/* ===== CSS Variables ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0284c7;
    --info-light: #e0f2fe;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ===== Landing Page ===== */
.landing-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.landing-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.landing-header {
    margin-bottom: 40px;
}

.logo-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(37,99,235,0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 10px 30px rgba(37,99,235,0.4); }
    50% { box-shadow: 0 10px 50px rgba(37,99,235,0.7); }
}

.logo-icon i { font-size: 42px; color: white; }

.landing-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.tagline {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 40px;
}

.btn-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-landing i { font-size: 28px; margin-bottom: 6px; }
.btn-landing span { font-size: 1.05rem; margin-bottom: 2px; }
.btn-landing small { font-size: 0.8rem; font-weight: 400; opacity: 0.8; }

.btn-scan {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    box-shadow: 0 8px 25px rgba(5,150,105,0.4);
}
.btn-scan:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(5,150,105,0.5); color: white; }

.btn-login {
    background: white;
    color: var(--gray-800);
    box-shadow: var(--shadow-md);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-admin {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.btn-admin:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); color: white; }

.landing-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 40px;
}

.feature-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.feature-item i { font-size: 1rem; color: #34d399; }

.landing-footer {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.footer-links { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }
.footer-links a { color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: white; }

/* ===== Auth Pages ===== */
.auth-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    max-width: 420px;
    width: 100%;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 36px 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header .logo-small {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.auth-header .logo-small i { font-size: 26px; color: white; }
.auth-header h2 { font-size: 1.4rem; color: var(--gray-900); }
.auth-header p { color: var(--gray-500); font-size: 0.9rem; }

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

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

.form-group .input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--gray-50);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    background: white;
}

.form-control.error { border-color: var(--danger); }
.form-control.success { border-color: var(--success); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control { padding-top: 12px; resize: vertical; min-height: 100px; }

.form-text {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-check label {
    font-size: 0.88rem;
    color: var(--gray-600);
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.4); color: white; }

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    box-shadow: 0 4px 15px rgba(5,150,105,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(5,150,105,0.4); color: white; }

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 4px 15px rgba(220,38,38,0.3);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,0.4); color: white; }

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}
.btn-warning:hover { transform: translateY(-1px); color: white; }

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

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

.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ===== Alert ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}

.alert i { font-size: 1.1rem; margin-top: 1px; }

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #075985;
    border: 1px solid #bae6fd;
}

/* ===== App Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--secondary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-brand h2 { font-size: 1.2rem; font-weight: 700; }

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

.sidebar-user .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section { padding: 8px 20px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.4); font-weight: 600; }

.nav-item { display: block; }
.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    font-size: 0.88rem;
    text-decoration: none;
    position: relative;
}

.nav-item a:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item a.active { background: rgba(37,99,235,0.2); color: white; }
.nav-item a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item a i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px;
}

.page-title { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-wrapper {
    padding: 24px 28px;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--gray-200); }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }

.stat-info { flex: 1; min-width: 0; }
.stat-info .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; }
.stat-info .stat-label { font-size: 0.82rem; color: var(--gray-500); }

/* ===== Table ===== */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

table tr:hover td { background: var(--gray-50); }

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #075985; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }

/* ===== Scan Page ===== */
.scan-page {
    background: var(--gray-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.scan-header {
    background: var(--gray-900);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.scan-header h2 { font-size: 1.1rem; font-weight: 600; }

.scan-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scan-frame {
    width: 280px;
    height: 280px;
    border: 3px dashed rgba(255,255,255,0.3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 24px;
    overflow: hidden;
    background: #000;
}

.scan-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame .scan-overlay {
    position: absolute;
    inset: 0;
    border: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    animation: scan-pulse 1.5s infinite;
}

@keyframes scan-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.scan-frame .scan-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.5);
}

.scan-frame .scan-placeholder i { font-size: 64px; margin-bottom: 12px; display: block; }
.scan-frame .scan-placeholder p { font-size: 0.9rem; }

.scan-instruction {
    color: rgba(255,255,255,0.7);
    text-align: center;
    font-size: 0.9rem;
    max-width: 300px;
}

/* ===== Scan Result ===== */
.result-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.result-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.result-card.authentic { border: 3px solid var(--success); }
.result-card.warning { border: 3px solid var(--danger); }
.result-card.recalled { border: 3px solid var(--danger); }

.result-header {
    padding: 28px 24px;
    text-align: center;
}

.result-header.authentic { background: linear-gradient(135deg, #059669, #10b981); }
.result-header.warning { background: linear-gradient(135deg, #dc2626, #ef4444); }
.result-header.recalled { background: linear-gradient(135deg, #92400e, #d97706); }

.result-header i { font-size: 48px; color: white; margin-bottom: 12px; }
.result-header h2 { color: white; font-size: 1.4rem; font-weight: 700; }
.result-header p { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin-top: 4px; }

.result-body {
    padding: 24px;
    background: white;
}

.result-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.result-detail:last-child { border-bottom: none; }
.result-detail .label { color: var(--gray-500); font-size: 0.85rem; }
.result-detail .value { color: var(--gray-800); font-weight: 600; font-size: 0.9rem; text-align: right; }

.result-actions {
    padding: 20px 24px;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Consumer Home ===== */
.consumer-home {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.consumer-home .hero-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 40px rgba(37,99,235,0.3);
}

.consumer-home .hero-icon i { font-size: 48px; color: white; }

.consumer-home h1 { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; }
.consumer-home p { color: var(--gray-500); margin-bottom: 32px; }

.scan-big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    margin: 0 auto 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(37,99,235,0.4);
    transition: all 0.3s;
}

.scan-big-btn:hover { transform: scale(1.05); box-shadow: 0 15px 50px rgba(37,99,235,0.5); }
.scan-big-btn i { font-size: 56px; margin-bottom: 8px; }
.scan-big-btn span { font-size: 1rem; font-weight: 600; }

.quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-link {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.2s;
    color: var(--gray-700);
}

.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--primary); }
.quick-link i { font-size: 28px; margin-bottom: 8px; display: block; }
.quick-link span { font-size: 0.88rem; font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.05rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
}

.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state i { font-size: 48px; color: var(--gray-300); margin-bottom: 16px; display: block; }
.empty-state h4 { font-size: 1.1rem; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .timeline-title { font-size: 0.9rem; font-weight: 600; color: var(--gray-800); }
.timeline-item .timeline-text { font-size: 0.82rem; color: var(--gray-500); }
.timeline-item .timeline-time { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }

/* ===== Tabs ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-item {
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== QR Code Display ===== */
.qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.qr-display img {
    width: 200px;
    height: 200px;
    margin-bottom: 16px;
}

.qr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== Progress ===== */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 4px;
    transition: width 0.3s;
}

/* ===== Loading ===== */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle { display: block; }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 14px;
    }

    .stat-info .stat-value {
        font-size: 1.2rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .scan-frame {
        width: 220px;
        height: 220px;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .landing-features {
        grid-template-columns: 1fr 1fr;
    }

    .result-header {
        padding: 20px 16px;
    }

    .result-header i { font-size: 36px; }
    .result-header h2 { font-size: 1.2rem; }

    table { font-size: 0.85rem; }
    table th, table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }

    .stat-info .stat-value {
        font-size: 1.1rem;
    }

    .landing-header h1 {
        font-size: 1.8rem;
    }

    .scan-big-btn {
        width: 150px;
        height: 150px;
    }

    .scan-big-btn i { font-size: 40px; }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Print styles */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
}
