:root {
            --bg-base: #f8fafc;
            --bg-surface: #ffffff;
            --bg-card: #ffffff;
            --bg-card-hover: #f1f5f9;
            --bg-input: #ffffff;
            --border-glass: #e2e8f0;
            --border-accent: rgba(79, 70, 229, 0.3);
            --text-main: #0f172a;
            --text-muted: #64748b;
            --text-dim: #94a3b8;
            --primary: #4f46e5;
            --primary-hover: #4338ca;
            --primary-glow: rgba(79, 70, 229, 0.15);
            --cyan: #0284c7;
            --cyan-glow: rgba(2, 132, 199, 0.15);
            --emerald: #059669;
            --emerald-glow: rgba(5, 150, 105, 0.15);
            --amber: #d97706;
            --rose: #e11d48;
            --purple: #7c3aed;
            --radius-lg: 14px;
            --radius-md: 10px;
            --radius-sm: 6px;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
            --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
        }

        body {
            background-color: var(--bg-base);
            color: var(--text-main);
            min-height: 100vh;
            overflow-x: hidden;
            display: flex;
            flex-direction: column;
        }

        /* Glassmorphism / Crisp Card Classes */
        .glass-panel {
            background: var(--bg-card);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
        }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: #f1f5f9; }
        ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

        /* Typography & Code */
        code, pre, .font-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }

        /* Animations */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
        .fade-in { animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

        /* App Layout */
        .app-container {
            display: flex;
            min-height: 100vh;
            width: 100%;
        }

        /* Sidebar Navigation */
        .sidebar {
            width: 260px;
            background: #ffffff;
            border-right: 1px solid var(--border-glass);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            padding: 24px 16px;
            position: sticky;
            top: 0;
            height: 100vh;
            z-index: 100;
        }

        .brand-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0 8px 24px 8px;
            border-bottom: 1px solid var(--border-glass);
            margin-bottom: 20px;
        }

        .brand-icon {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-md);
            background: linear-gradient(135deg, var(--primary), var(--cyan));
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
        }

        .brand-icon svg { width: 22px; height: 22px; color: white; }
        .brand-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; }
        .brand-subtitle { font-size: 0.72rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

        .nav-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 11px 14px;
            border-radius: var(--radius-md);
            color: var(--text-muted);
            font-weight: 500;
            font-size: 0.88rem;
            cursor: pointer;
            transition: var(--transition);
            border: 1px solid transparent;
            text-decoration: none;
        }
        .nav-item:hover { color: var(--text-main); background: #f1f5f9; }
        .nav-item.active {
            color: var(--primary);
            background: #eff6ff;
            border-color: #dbeafe;
            font-weight: 600;
        }
        .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

        .user-footer {
            padding-top: 16px;
            border-top: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .user-badge { display: flex; align-items: center; gap: 10px; }
        .user-avatar {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: var(--primary);
            font-size: 0.85rem;
        }
        .user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
        .user-role { font-size: 0.72rem; color: var(--emerald); font-weight: 600; }

        /* Main Content Area */
        .main-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow-y: auto;
        }

        /* Top Header */
        .top-navbar {
            padding: 16px 32px;
            border-bottom: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #ffffff;
            position: sticky;
            top: 0;
            z-index: 90;
        }

        .header-title-wrap h1 { font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
        .header-title-wrap p { font-size: 0.82rem; color: var(--text-muted); }

        .top-actions { display: flex; align-items: center; gap: 12px; }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 9px 16px;
            border-radius: var(--radius-md);
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            border: 1px solid transparent;
            outline: none;
            text-decoration: none;
        }
        .btn-primary {
            background: var(--primary);
            color: #ffffff;
            box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
        }
        .btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
        .btn-secondary {
            background: #ffffff;
            color: #334155;
            border-color: #cbd5e1;
        }
        .btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }
        .btn-cyan {
            background: var(--cyan);
            color: #ffffff;
            box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
        }
        .btn-cyan:hover { background: #0369a1; transform: translateY(-1px); }
        .btn-danger {
            background: #fff1f2;
            color: var(--rose);
            border-color: #fecdd3;
        }
        .btn-danger:hover { background: var(--rose); color: #ffffff; }
        .btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: var(--radius-sm); }
        .btn svg { width: 16px; height: 16px; }

        /* Content Sections */
        .content-body { padding: 32px; flex: 1; }
        .tab-section { display: none; }
        .tab-section.active { display: block; }

        /* Stat Cards Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 20px;
            margin-bottom: 28px;
        }

        .stat-card {
            padding: 22px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-glass);
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            transition: var(--transition);
        }
        .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), var(--cyan));
        }
        .stat-card.emerald::before { background: linear-gradient(90deg, var(--emerald), #10b981); }
        .stat-card.amber::before { background: linear-gradient(90deg, var(--amber), #f59e0b); }
        .stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #a855f7); }

        .stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
        .stat-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
        .stat-icon {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            background: #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
        }
        .stat-value { font-size: 1.85rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.03em; margin-bottom: 4px; }
        .stat-desc { font-size: 0.75rem; color: var(--text-muted); }

        /* Tables & Lists */
        .table-container {
            width: 100%;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-glass);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            margin-top: 16px;
        }

        .table-header-bar {
            padding: 18px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-glass);
            background: #ffffff;
            gap: 16px;
            flex-wrap: wrap;
        }

        .search-box {
            display: flex;
            align-items: center;
            gap: 10px;
            background: #ffffff;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 8px 14px;
            width: 280px;
        }
        .search-box input {
            background: transparent;
            border: none;
            color: var(--text-main);
            font-size: 0.85rem;
            outline: none;
            width: 100%;
        }
        .search-box input::placeholder { color: var(--text-dim); }
        .search-box svg { width: 16px; height: 16px; color: var(--text-dim); }

        table { width: 100%; border-collapse: collapse; text-align: left; }
        th {
            background: #f8fafc;
            padding: 14px 20px;
            font-size: 0.75rem;
            font-weight: 700;
            color: #475569;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            border-bottom: 1px solid var(--border-glass);
        }
        td {
            padding: 16px 20px;
            font-size: 0.85rem;
            color: var(--text-main);
            border-bottom: 1px solid #f1f5f9;
            vertical-align: middle;
        }
        tr:hover td { background: #f8fafc; }

        /* Pagination Bar */
        .pagination-bar {
            padding: 16px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-top: 1px solid var(--border-glass);
            background: #ffffff;
            border-bottom-left-radius: var(--radius-md);
            border-bottom-right-radius: var(--radius-md);
        }
        .pagination-info {
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--text-muted);
        }
        .pagination-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* Badges */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .badge-success { background: #ecfdf5; color: var(--emerald); border: 1px solid #a7f3d0; }
        .badge-cyan { background: #ecfeff; color: var(--cyan); border: 1px solid #a5f3fc; }
        .badge-warning { background: #fffbeb; color: var(--amber); border: 1px solid #fde68a; }
        .badge-danger { background: #fff1f2; color: var(--rose); border: 1px solid #fecdd3; }
        .badge-gray { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

        /* Form Controls */
        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
        }
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 16px;
        }
        .form-label {
            font-size: 0.8rem;
            font-weight: 600;
            color: #334155;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .form-input, .form-select, .form-textarea {
            width: 100%;
            box-sizing: border-box;
            background: #ffffff;
            border: 1px solid #cbd5e1;
            border-radius: var(--radius-md);
            padding: 10px 14px;
            color: var(--text-main);
            font-size: 0.875rem;
            outline: none;
            transition: var(--transition);
        }
        .form-input:focus, .form-select:focus, .form-textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
        }
        .form-help { font-size: 0.72rem; color: var(--text-muted); }

        /* Modals */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(15, 23, 42, 0.45);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-overlay.active { display: flex; }
        .modal-box {
            width: 100%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
            background: #ffffff;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            animation: fadeIn 0.2s ease-out;
        }
        .modal-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .modal-body { padding: 24px; }
        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            background: #f8fafc;
        }

        /* Toast Alerts */
        #toast-container {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .toast {
            padding: 12px 18px;
            border-radius: var(--radius-md);
            background: #ffffff;
            color: var(--text-main);
            border: 1px solid var(--border-glass);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: var(--shadow-lg);
            animation: fadeIn 0.2s ease-out;
            min-width: 280px;
        }
        .toast.success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
        .toast.error { border-color: #fecdd3; background: #fff1f2; color: #9f1239; }

        /* Login Container */
        .login-wrapper {
            width: 100%;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        }
        .login-card {
            width: 100%;
            max-width: 420px;
            padding: 36px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-glass);
            box-shadow: var(--shadow-lg);
        }

        /* API Tester Styles */
        .tester-grid {
            display: grid;
            grid-template-columns: 1fr 1.15fr;
            gap: 24px;
            align-items: start;
        }
        @media (max-width: 1024px) {
            .tester-grid { grid-template-columns: 1fr; }
        }
        .sample-chips-wrap {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
            margin-bottom: 16px;
        }
        .sample-chip {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 5px 11px;
            border-radius: 20px;
            background: #f1f5f9;
            color: var(--text-main);
            border: 1px solid var(--border-glass);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .sample-chip:hover {
            background: #eff6ff;
            color: var(--primary);
            border-color: #bfdbfe;
        }
        .country-period-btn {
            border: none;
            background: transparent;
            padding: 6px 14px;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: var(--transition);
        }
        .country-period-btn:hover {
            color: var(--text-main);
        }
        .country-period-btn.active {
            background: #ffffff;
            color: var(--primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            font-weight: 700;
        }
        .country-item-card {
            background: #ffffff;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            cursor: pointer;
            user-select: none;
            transition: var(--transition);
        }
        .country-item-card:hover {
            border-color: #818cf8;
            background: #fafcff;
            box-shadow: 0 6px 16px rgba(79, 70, 229, 0.09);
            transform: translateY(-2px);
        }
        .sortable-th {
            cursor: pointer;
            user-select: none;
            transition: var(--transition);
        }
        .sortable-th:hover {
            background: #f1f5f9;
            color: var(--primary);
        }
        .sort-icon {
            font-size: 0.72rem;
            opacity: 0.75;
            transition: var(--transition);
        }
        .timeline-step-card {
            background: #ffffff;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-sm);
            padding: 14px 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            position: relative;
            transition: var(--transition);
        }
        .timeline-step-card.pass { border-left: 4px solid var(--emerald); }
        .timeline-step-card.fail { border-left: 4px solid var(--rose); background: #fffbfb; }
        .timeline-step-card.warn { border-left: 4px solid var(--amber); background: #fffdf5; }
        .timeline-badge {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 700;
            flex-shrink: 0;
        }
        .timeline-badge.pass { background: #dcfce7; color: #15803d; }
        .timeline-badge.fail { background: #fee2e2; color: #b91c1c; }
        .timeline-badge.warn { background: #fef3c7; color: #b45309; }
        .timeline-badge.pending { background: #f1f5f9; color: #64748b; }
        .input-wrap-with-btn {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
            box-sizing: border-box;
        }
        .input-wrap-with-btn input {
            width: 100%;
            box-sizing: border-box;
            padding-right: 44px;
        }
        .input-wrap-with-btn .btn-input-icon {
            position: absolute;
            right: 8px;
            background: transparent;
            border: none;
            cursor: pointer;
            color: var(--text-muted);
            padding: 6px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .input-wrap-with-btn .btn-input-icon:hover {
            color: var(--primary);
            background: #f1f5f9;
        }
        .tester-empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 60px 24px;
            color: var(--text-muted);
        }
        .tester-play-circle {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: #eff6ff;
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 16px;
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
        }
        .tester-result-box {
            background: #ffffff;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 20px;
            box-shadow: var(--shadow-sm);
        }
        .tester-meta-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px;
            margin: 16px 0;
            background: #f8fafc;
            border: 1px solid var(--border-glass);
            padding: 14px;
            border-radius: var(--radius-sm);
        }
        .meta-stat-item .meta-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 2px;
        }
        .meta-stat-item .meta-val {
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--text-main);
        }

        /* Modals & Dialogs */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 23, 42, 0.65);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 99999;
            display: flex;
            pointer-events: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
            opacity: 0;
            visibility: hidden;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        .modal-box,
        .modal-card {
            background: #ffffff !important;
            border-radius: 20px;
            width: 100%;
            max-width: 520px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
            border: 1px solid #e2e8f0;
            transform: scale(0.95) translateY(10px);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            box-sizing: border-box;
            position: relative;
        }
        .modal-overlay.active .modal-box,
        .modal-overlay.active .modal-card {
            transform: scale(1) translateY(0);
        }
        .modal-header {
            padding: 18px 24px;
            border-bottom: 1px solid #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #ffffff;
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .modal-body {
            padding: 24px;
            background: #ffffff;
        }
        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            background: #fafafa;
        }
        .modal-close {
            background: #f1f5f9;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #64748b;
            font-size: 1.1rem;
            font-weight: bold;
            transition: all 0.2s ease;
        }
        .modal-close:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        /* Responsive */
        @media (max-width: 900px) {
            .sidebar { display: none; }
            .content-body { padding: 20px; }
            .top-navbar { padding: 16px 20px; }
        }