/* ============================================================
   Mes Colis Dashboard — Professional Design System
   ============================================================ */

:root {
    /* Brand colors */
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-900: #134e4a;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-600: #16a34a;
    --green-700: #15803d;
    
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-600: #d97706;
    --amber-700: #b45309;
    
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    
    --pink-500: #ec4899;
    --pink-600: #db2777;
    
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    
    /* Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0d9488 0%, #115e59 100%);
    color: white;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    box-shadow: var(--shadow-xl);
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-600);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.sidebar-logo .logo-icon svg {
    width: 22px;
    height: 22px;
}

.sidebar-logo .logo-text h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-logo .subtitle {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.menu-section {
    padding: 16px 8px 8px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: all var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 2px;
    position: relative;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 0 3px 3px 0;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

.menu-item.logout {
    color: #fecaca;
}

.menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ============================================================
   MAIN
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 20px;
    flex-wrap: wrap;
}

.page-title-wrapper h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 500;
}

.breadcrumb svg {
    width: 12px;
    height: 12px;
    color: var(--gray-300);
}

.breadcrumb .current {
    color: var(--gray-700);
    font-weight: 600;
}

/* Connection status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: white;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    color: var(--gray-700);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
    position: relative;
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--green-600);
}

.status-dot.connected::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--green-600);
    opacity: 0.4;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.disconnected {
    background: var(--red-500);
}

.status-dot.error {
    background: var(--amber-600);
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   SEARCH CARD
   ============================================================ */
.search-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.search-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--gray-700);
    letter-spacing: -0.01em;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-input-wrapper .icon-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--gray-50);
    transition: all var(--transition);
    color: var(--gray-900);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-input:focus {
    outline: none;
    border-color: var(--teal-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.search-buttons {
    display: flex;
    gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--transition);
    letter-spacing: -0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.btn-primary {
    background: var(--teal-600);
    color: white;
    flex: 1;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
    background: var(--teal-700);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-danger {
    background: var(--pink-500);
    color: white;
    flex: 1;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-danger:hover {
    background: var(--pink-600);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-refresh {
    background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-600) 100%);
    color: white;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-refresh:hover {
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ============================================================
   STATS
   ============================================================ */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 16px;
}

.stats-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.stats-title h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.date-info {
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--gray-200));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--gray-300);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.blue { --stat-color: var(--blue-600); }
.stat-card.green { --stat-color: var(--green-600); }
.stat-card.amber { --stat-color: var(--amber-600); }
.stat-card.red { --stat-color: var(--red-600); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.stat-icon.blue { background: var(--blue-50); color: var(--blue-600); }
.stat-icon.green { background: var(--green-50); color: var(--green-600); }
.stat-icon.amber { background: var(--amber-50); color: var(--amber-600); }
.stat-icon.red { background: var(--red-50); color: var(--red-600); }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.colis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.colis-table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.colis-table th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-500);
    font-size: 10.5px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
}

.colis-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.colis-table tbody tr {
    transition: background var(--transition-fast);
}

.colis-table tbody tr:hover {
    background: var(--gray-50);
}

.colis-table tbody tr:last-child td {
    border-bottom: none;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes highlight {
    0% { background: var(--teal-50); }
    100% { background: transparent; }
}

.colis-table tbody tr.new-row {
    animation: slideIn 400ms cubic-bezier(0.4, 0, 0.2, 1), highlight 2s ease-out 400ms;
}

.barcode {
    font-family: var(--font-mono);
    color: var(--gray-700);
    font-weight: 500;
    font-size: 12.5px;
    letter-spacing: -0.01em;
}

.client-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 13.5px;
    margin-bottom: 2px;
}

.client-city {
    font-size: 11.5px;
    color: var(--gray-500);
    font-weight: 500;
}

.price {
    font-weight: 700;
    color: var(--teal-700);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 13.5px;
}

.price-unit {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    margin-left: 3px;
}

.designation {
    color: var(--gray-700);
    font-weight: 500;
}

.livreur-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 13px;
    margin-bottom: 2px;
}

.livreur-phone {
    font-size: 11.5px;
    color: var(--gray-500);
    font-family: var(--font-mono);
}

.date-cell {
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.date-cell .time {
    color: var(--gray-900);
    font-weight: 600;
}

.agency-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-700);
    font-weight: 500;
    white-space: nowrap;
}

.agency-cell svg {
    width: 13px;
    height: 13px;
    color: var(--teal-600);
    flex-shrink: 0;
}

/* Badges */
.badges-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-success {
    background: var(--green-50);
    color: var(--green-700);
    border: 1px solid var(--green-100);
}

.badge-warning {
    background: var(--amber-50);
    color: var(--amber-700);
    border: 1px solid var(--amber-100);
}

.badge-danger {
    background: var(--red-50);
    color: var(--red-700);
    border: 1px solid var(--red-100);
}

.badge-default {
    background: var(--blue-50);
    color: var(--blue-700);
    border: 1px solid var(--blue-100);
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* Empty */
.empty-row td {
    padding: 80px 20px;
    text-align: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.8;
}

.empty-state h3 {
    color: var(--gray-700);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 13px;
    max-width: 320px;
    line-height: 1.5;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-body {
    background: linear-gradient(135deg, #0d9488 0%, #134e4a 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body.login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 0 0 1px rgb(255 255 255 / 0.05);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: white;
}

.login-logo .logo-wrapper svg {
    width: 32px;
    height: 32px;
}

.login-logo h1 {
    color: var(--gray-900);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 13.5px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--gray-700);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.form-group .input-wrapper {
    position: relative;
}

.form-group .input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--gray-50);
    transition: all var(--transition);
    color: var(--gray-900);
}

.form-group input:focus {
    outline: none;
    border-color: var(--teal-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login svg {
    width: 16px;
    height: 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--red-50);
    color: var(--red-700);
    border: 1px solid var(--red-100);
}

.alert-warning {
    background: var(--amber-50);
    color: var(--amber-700);
    border: 1px solid var(--amber-100);
}

/* ============================================================
   SEARCH PAGE — Info banner
   ============================================================ */
.info-banner {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: var(--blue-700);
}

.info-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke-width: 2;
}

.info-banner strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.info-banner p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--blue-700);
    opacity: 0.85;
}

/* ============================================================
   LOOKUP CARD
   ============================================================ */
.lookup-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.lookup-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.lookup-input-group .search-input-wrapper {
    flex: 1;
    margin-bottom: 0;
}

.lookup-input-group .search-input {
    padding: 12px 14px 12px 42px;
    font-size: 15px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.lookup-btn {
    padding: 12px 28px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.lookup-hint {
    font-size: 12.5px;
    color: var(--gray-500);
    padding-top: 4px;
}

/* Stats actions buttons wrapper */
.stats-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-200);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-small {
    padding: 8px 14px;
    font-size: 12.5px;
}

/* ============================================================
   LOADING CARD
   ============================================================ */
.loading-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 40px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-card p {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 13.5px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--teal-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ERROR CARD
   ============================================================ */
.error-card {
    background: var(--red-50);
    border: 1px solid var(--red-100);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: var(--red-700);
}

.error-card svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke-width: 2;
}

.error-card strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.error-card p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--red-700);
    opacity: 0.85;
}

/* ============================================================
   RESULT CARD
   ============================================================ */
.result-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
    animation: slideIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.result-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.result-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.result-body {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.result-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-field label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.result-field .value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 500;
}

/* ============================================================
   HISTORY SECTION
   ============================================================ */
.history-section {
    margin-top: 32px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.history-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    color: var(--teal-700);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-ghost:hover {
    background: var(--teal-50);
    border-color: var(--teal-100);
}

.btn-ghost svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
    .main-content { padding: 28px 32px; }
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar-logo .logo-text,
    .menu-section,
    .menu-item .label,
    .sidebar-footer { display: none; }
    .sidebar-logo { justify-content: center; padding: 20px 12px; }
    .menu-item { justify-content: center; padding: 12px; }
    .main-content { margin-left: 64px; padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    
    .lookup-input-group {
        flex-direction: column;
    }
    
    .result-body {
        grid-template-columns: 1fr;
    }
    
    .stats-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-50);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
