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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f8f9fa;
            color: #1a1a2e;
            min-height: 100vh;
        }

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

        .layout.full-height {
            height: 100vh;
            overflow: hidden;
        }

        .sidebar {
            width: 240px;
            background: white;
            border-right: 1px solid #e5e7eb;
            padding: 20px 0;
            flex-shrink: 0;
            position: fixed;
            height: 100vh;
            overflow-y: auto;
        }

        .main {
            flex: 1;
            padding: 24px 32px;
            margin-left: 240px;
            /* Offset for fixed sidebar */
        }

        .main.full-height {
            padding: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Simple Layout (without sidebar) */
        .layout-simple {
            display: flex;
            min-height: 100vh;
        }

        .layout-simple.full-height {
            height: 100vh;
            overflow: hidden;
        }

        .main-simple {
            flex: 1;
            padding: 24px 32px;
            margin-left: 0;
        }

        .main-simple.full-height {
            padding: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Sidebar */
        .sidebar-logo {
            font-size: 22px;
            font-weight: 700;
            padding: 0 20px 20px;
            border-bottom: 1px solid #e5e7eb;
            margin-bottom: 16px;
        }

        .sidebar-logo span {
            color: #3b82f6;
        }

        .sidebar-user {
            padding: 0 20px 16px;
            font-size: 13px;
            color: #6b7280;
        }

        .sidebar-nav a {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            color: #4b5563;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            border-left: 3px solid transparent;
        }

        .sidebar-nav a:hover {
            background: #f3f4f6;
        }

        .sidebar-nav a.active {
            background: #eff6ff;
            color: #3b82f6;
            border-left-color: #3b82f6;
        }

        .sidebar-nav .count {
            margin-left: auto;
            background: #e5e7eb;
            color: #374151;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 12px;
        }

        /* Common Elements */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 700;
        }

        .page-subtitle {
            font-size: 14px;
            color: #6b7280;
            margin-top: 4px;
        }

        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: background 0.2s;
        }

        .btn-primary {
            background: #3b82f6;
            color: white;
        }

        .btn-primary:hover {
            background: #2563eb;
        }

        .btn-secondary {
            background: #e5e7eb;
            color: #374151;
        }

        .btn-secondary:hover {
            background: #d1d5db;
        }

        .btn-danger {
            background: #fee2e2;
            color: #991b1b;
        }

        .btn-danger:hover {
            background: #fecaca;
        }

        .badge {
            display: inline-block;
            padding: 3px 10px;
            background: #dbeafe;
            color: #1d4ed8;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
        }

        .badge.unknown, .badge.gray {
            background: #f3f4f6;
            color: #6b7280;
        }
        .badge.green { background: #dcfce7; color: #15803d; }
        .badge.red { background: #fee2e2; color: #b91c1c; }
        .badge.blue { background: #e0f2fe; color: #0369a1; }

        /* Component Styles */
        .section {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            margin-bottom: 24px;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #e5e7eb;
            font-weight: 600;
        }

        .section-content {
            padding: 20px;
        }

        /* Modal Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            /* Darker backdrop for focus */
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(2px);
        }

        .modal-overlay.active {
            display: flex;
            animation: fadeIn 0.2s;
        }

        .modal-content {
            background: white;
            border-radius: 12px;
            width: 100%;
            max-width: 500px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            transform: scale(0.95);
            transition: transform 0.2s;
            display: flex;
            flex-direction: column;
            max-height: 90vh;
        }

        .modal-content.modal-wide {
            max-width: 960px;
            width: 95%;
        }

        .modal-overlay.active .modal-content {
            transform: scale(1);
        }

        .modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
            font-size: 16px;
        }

        .modal-body {
            padding: 24px;
        }

        .modal-footer {
            padding: 16px 20px;
            border-top: 1px solid #e5e7eb;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .modal-close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #9ca3af;
        }

        .modal-close-btn:hover {
            color: #4b5563;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* Helper Utilities */
        .hold-delete-container {
            display: flex;
            align-items: center;
            gap: 8px;
        }

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

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 6px;
        }

        .form-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
        }

        .form-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        /* Grids */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }

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

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

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

        .tests-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 24px;
        }

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

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

        /* Stat Card */
        .stat-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            position: relative;
            min-height: 140px;
        }

        .stat-card.clickable {
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .stat-card.clickable:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .stat-label {
            font-size: 11px;
            font-weight: 600;
            color: #9ca3af;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

        .stat-sublabel {
            font-size: 12px;
            color: #9ca3af;
            margin-bottom: 12px;
        }

        .stat-value {
            font-size: 32px;
            font-weight: 700;
            color: #1f2937;
            margin-bottom: 4px;
            line-height: 1.2;
        }

        .stat-value.green {
            color: #059669;
        }

        .stat-value.blue {
            color: #2563eb;
        }

        .stat-value.small {
            font-size: 18px;
            font-weight: 600;
        }

        .stat-sub {
            font-size: 13px;
            color: #6b7280;
            margin-top: 2px;
        }

        .stat-link {
            margin-top: auto;
            padding-top: 12px;
            font-size: 13px;
            color: #3b82f6;
            text-decoration: none;
            font-weight: 500;
        }

        /* Stripe Card Specifics */
        .status-dot {
            width: 8px;
            height: 8px;
            background: #10b981;
            border-radius: 50%;
            position: absolute;
            top: 20px;
            right: 20px;
        }

        .stripe-rates {
            margin-top: 8px;
        }

        .rate {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: #4b5563;
            margin-bottom: 4px;
        }

        .rate span:last-child {
            font-family: monospace;
            font-weight: 600;
            color: #111827;
        }

        .trend {
            font-size: 10px;
            padding: 1px 4px;
            border-radius: 4px;
            margin-left: 6px;
        }

        .trend.up {
            background: #d1fae5;
            color: #059669;
        }

        .updated {
            font-size: 10px;
            color: #9ca3af;
            margin-top: 12px;
        }

        /* Test Rows */
        .test-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f3f4f6;
        }

        .test-row:last-child {
            border-bottom: none;
        }

        .test-name {
            font-size: 14px;
            font-weight: 500;
        }

        .test-status {
            font-size: 11px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            margin-right: 8px;
        }

        .test-status.wait {
            background: #f3f4f6;
            color: #6b7280;
        }

        .test-status.pass {
            background: #d1fae5;
            color: #059669;
        }

        .test-btn {
            padding: 4px 10px;
            border: 1px solid #d1d5db;
            background: white;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
        }

        .test-btn:hover {
            background: #f9fafb;
            border-color: #9ca3af;
        }

        /* Client Status */
        .client-status-ok {
            background: #ecfdf5;
            border-radius: 8px;
            padding: 32px;
            text-align: center;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .client-status-ok .icon {
            width: 48px;
            height: 48px;
            background: #10b981;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin-bottom: 16px;
        }

        .client-status-ok .text {
            font-size: 16px;
            font-weight: 600;
            color: #065f46;
            margin-bottom: 4px;
        }

        .client-status-ok .subtext {
            font-size: 13px;
            color: #6b7280;
        }

        /* Generic Settings Card */
        .setting-card {
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .setting-card:hover {
            background: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .setting-card.readonly {
            cursor: default;
            opacity: 0.8;
        }

        .setting-title {
            font-size: 14px;
            font-weight: 600;
            color: #1a1a2e;
            margin-bottom: 4px;
        }

        .setting-desc {
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 8px;
        }

        .setting-value {
            font-size: 13px;
            color: #374151;
        }

        .readonly-badge {
            position: absolute;
            top: 12px;
            right: 12px;
            font-size: 10px;
            background: #e5e7eb;
            color: #6b7280;
            padding: 2px 6px;
            border-radius: 4px;
        }

        /* Media Queries for Grid */
        @media (min-width: 640px) {
            .sm\:grid-cols-2 {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (min-width: 1024px) {
            .lg\:grid-cols-4 {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }