/* Antigravity Manager - Styles
 * Premium dark theme with minimal design
 */

:root {
    /* Border Radius System */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    color-scheme: dark;

    /* Colors */
    --bg-primary: #09090b; 
    --bg-secondary: #0f0f12; 
    --bg-tertiary: #18181b;
    --bg-card: #131316; 
    --bg-hover: #1e1e23; 
    --bg-elevated: #1a1a1f;
    
    --text-primary: #e4e4e7; 
    --text-secondary: #a1a1aa; 
    --text-tertiary: #71717a; 
    --text-muted: #52525b;
    
    --accent-primary: #5b5bd6; 
    --accent-secondary: #818cf8;
    --accent-success: #6ee7b7; 
    --accent-danger: #fb7185; 
    --accent-warning: #fbbf24;
    --accent-success-muted: rgba(110, 231, 183, 0.12);
    --accent-danger-muted: rgba(251, 113, 133, 0.15);
    --accent-warning-muted: rgba(251, 191, 36, 0.12);
    
    --border-color: rgba(255,255,255,0.06); 
    --border-subtle: rgba(255,255,255,0.04);
    /* Typography */
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizes */
    --sidebar-width: 240px;
}

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

html,
body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    -webkit-app-region: drag;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-app-region: no-drag;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

.version {
    font-size: 11px;
    color: var(--text-tertiary);
    background: transparent;
    padding: 0;
    border-radius: var(--radius-md);
    width: fit-content;
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    position: relative;
    border-radius: var(--radius-md);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: 3px;
    background: rgba(91, 91, 214, 0.7);
    border-radius: 2px;
}

.nav-icon {
    font-size: 18px;
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--border-color) !important;
    margin-top: 16px;
    margin-left: 16px;
    margin-right: 16px;
    -webkit-app-region: no-drag;
}

/* Main Content */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-primary);
}

.page {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.btn--primary {
    background: #4f4fbc;
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn--primary:hover {
    background: #5a5ac7;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 2px 8px rgba(79, 79, 188, 0.3);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.btn--secondary:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn--danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.btn--ghost:hover {
    background: var(--bg-hover);
}

.btn--icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stats-card__value {
    font-size: 28px;
    font-weight: 600;
}

.stats-card__title {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Tables */
.accounts-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.accounts-table th,
.accounts-table td {
    padding:   12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.accounts-table td:last-child {
    white-space: nowrap;
}

.accounts-table th {
    background: var(--bg-tertiary);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.account-row:hover {
    background: var(--bg-hover);
}

.account-row.is-current {
    background: rgba(99, 102, 241, 0.1);
}

.account-row.is-selected {
    background: rgba(99, 102, 241, 0.15);
}

/* Status dots */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot--active,
.status-dot--running {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-dot--idle {
    background: var(--text-tertiary);
}

.status-dot--disabled,
.status-dot--stopped {
    background: var(--accent-danger);
}

.status-dot--banned {
    background: #dc2626;
    box-shadow: 0 0 8px #dc2626, 0 0 16px rgba(220, 38, 38, 0.4);
    animation: pulse 1.5s infinite;
}

.status-dot--locked {
    background: var(--accent-warning);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.banned-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-md);
    font-size: 10px;
    font-weight: 700;
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.locked-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-md);
    font-size: 10px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.disabled-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-md);
    font-size: 10px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

/* Quota bars */
.quota-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: inline-block;
    margin-right: var(--space-2);
}

.quota-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.quota-fill--good {
    background: var(--accent-success);
}

.quota-fill--warning {
    background: var(--accent-warning);
}

.quota-fill--critical {
    background: var(--accent-danger);
}

.quota-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
}

.search-box::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    pointer-events: none;
}

.search-box input {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 10px 16px 10px 38px;
    color: var(--text-primary);
    width: 280px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input::placeholder,
.search-box input::placeholder,
.accounts-search input::placeholder,
.search-input::placeholder,
textarea::placeholder {
    color: #71717a !important;
    opacity: 1 !important;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.selection-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Code blocks */
pre {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
}

code {
    font-family: var(--font-mono);
}

/* Sections */
section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Status card */
.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.status-indicator p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Config grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.config-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.config-item input[type="number"],
.config-item input[type="text"] {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Settings */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 16px;
}

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

.setting-info label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Monitor */
.monitor-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.recording-btn, .btn-recording {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(251, 113, 133, 0.12);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
    cursor: pointer;
}

.recording-btn.recording {
    background: rgba(251, 113, 133, 0.12);
    color: var(--accent-danger);
}

.recording-btn.paused {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.recording-btn .dot, .recording-btn .recording-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-danger);
}

.recording-btn.recording .dot, .recording-btn .recording-dot {
    animation: pulse-recording 2s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.quick-filters {
    display: flex;
    gap: 8px;
}

.quick-filters button,
.monitor-filters .filter-btn,
.monitor-filters button {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all 0.15s;
}

.quick-filters button.active,
.monitor-filters .filter-btn.active,
.monitor-filters button.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
    border-color: rgba(99, 102, 241, 0.3);
}

.header-stats, .monitor-stats {
    display: flex;
    gap: 16px;
}

.stat {
    font-size: var(--text-sm);
    font-weight: 500;
}

.stat--success, .monitor-stats .stat-ok {
    color: var(--accent-success);
    opacity: 0.8;
}

.stat--error, .monitor-stats .stat-err {
    color: var(--accent-danger);
    opacity: 0.8;
}

.stat--total {
    color: var(--text-secondary);
}

.monitor-stats .stat-value {
    font-weight: 600;
}

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

.logs-table th,
.logs-table td {
    padding:   12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.logs-table th {
    background: var(--bg-tertiary);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.status-badge--success {
    background: var(--accent-success-muted);
    color: var(--accent-success);
}

.status-badge--error {
    background: var(--accent-danger-muted);
    color: var(--accent-danger);
}

.status-badge.status-200,
.status-200 {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    font-size: var(--text-xs);
}

.proxy-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
}

.proxy-badge.on {
    background: var(--accent-success-muted);
    color: var(--accent-success);
}

.proxy-badge.off {
    background: var(--border-color);
    color: var(--text-tertiary);
}

.back-link, a[href="/proxy"].back-link {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    transition: color 0.15s;
}
.back-link:hover {
    color: var(--text-primary);
}

.monitor-controls button:not([class]):empty,
.monitor-controls button:empty,
.quick-filters + div button:empty,
.monitor-toolbar button:empty {
    display: none !important;
    width: 0;
    height: 0;
    overflow: hidden;
}

.tokens-in {
    color: var(--accent-primary);
    opacity: 0.7;
}
.tokens-out {
    color: var(--accent-success);
    opacity: 0.7;
}
.tokens-cached {
    color: var(--text-muted);
}

/* Tier cards */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tier-card:hover {
    transform: translateY(-2px);
}

.tier-card--ultra {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.tier-card--pro {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.tier-card--free {
    background: var(--bg-card);
}

.tier-card--warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.tier-count {
    display: block;
    display: flex; justify-content: center; align-items: center; color: var(--accent-primary);
    font-weight: 600;
}

.tier-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.tier-card--ultra .tier-count {
    color: #fbbf24;
    text-shadow: none;
}

.tier-card--pro .tier-count {
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.tier-card--free .tier-count {
    color: var(--text-secondary);
}

.tier-card--warning .tier-count {
    color: var(--accent-warning);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

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

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.action-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.action-icon {
    display: flex; justify-content: center; align-items: center; color: var(--accent-primary);
}

.action-label {
    font-size: 14px;
    font-weight: 500;
}

/* API Key section */
.api-key-row {
    display: flex;
    gap: 12px;
}

.api-key-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Code example */
.code-example {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.code-header {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Current account */
.current-account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.no-account {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
}

/* Back button */
.back-button {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-right: 16px;
}

.back-button:hover {
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Alert banners */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert--success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--accent-success);
}

.alert--error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.alert--warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-warning);
}

.alert-icon {
    font-size: 18px;
}

/* Current badge */
.current-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-left: 8px;
}

/* Token stats */
.token-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.token-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.token-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.token-value {
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.tokens-in {
    color: var(--accent-primary);
    opacity: 0.7;
}

.tokens-cached {
    color: var(--text-muted);
    font-size: 0.9em;
}

.tokens-out {
    color: var(--accent-success);
    opacity: 0.7;
}

/* Model styling in logs */
.model-name {
    font-family: var(--font-mono);
    font-size: 12px;
}

.model-mapped {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Time column */
.col-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Error row */
.log-row.has-error {
    background: rgba(239, 68, 68, 0.05);
}

/* Toolbar right */
.toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.controls-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* Update section */
.update-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.update-available {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.update-badge {
    background: var(--accent-success);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: 10px;
    font-weight: 600;
}

/* Version text */
.version-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Empty actions */
.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

/* Email styling */
.email-text {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* Small button variant */
.btn--sm,
.account-actions button,
.actions-cell button {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.account-actions button:hover,
.actions-cell button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.account-actions button.btn-danger,
.account-actions .del-btn,
.actions-cell .btn--danger {
    color: var(--accent-danger);
    border-color: rgba(251, 113, 133, 0.2);
}

/* Dim non-essential buttons for unhealthy accounts (only USE is dimmed) */
.actions-dimmed .btn--sm {
    opacity: 0.35;
    pointer-events: none;
}
/* Admin/diagnostic buttons stay active: DEL, INF, REF, WRM, VRF */
.actions-dimmed .btn--danger,
.actions-dimmed .btn--action {
    opacity: 1;
    pointer-events: auto;
}

/* Warning status badge */
.status-badge--warning {
    background: var(--accent-warning-muted);
    color: var(--accent-warning);
}

/* Hint text */
.hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Toggle switch enhancement */
.toggle {
    width:  36px;
    height:  20px;
    appearance: none;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.10);
    border-radius:  999px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle::before {
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    content: '';
    position: absolute;
    width:  14px;
    height:  14px;
    border-radius: 50%;
    background: #d4d4d8;
    top:  3px;
    left:  3px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle:checked {
    background: var(--accent-primary);
}

.toggle:checked::before {
    transform: translateX(16px);
    background: #fff;
}

/* Logs table container */
.logs-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Select styling */
select {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 8px 32px 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1a6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Global input dark backgrounds — prevents white inputs */
input[type="number"],
input[type="text"],
input:not([type]):not(.toggle),
textarea {
    background: var(--bg-tertiary) !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    color-scheme: dark !important;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
}

/* ========================================
   Modal Dialog
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    animation: modalEnter 0.25s ease;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-lg);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalEnter {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-total {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-size {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 100px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pagination-ellipsis {
    color: var(--text-tertiary);
    padding: 0 8px;
}

/* ========================================
   Account Card (Grid View)
   ======================================== */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.account-card:hover {
    border-color: var(--border-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.account-card.is-current {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.account-card.is-selected {
    background: rgba(99, 102, 241, 0.1);
}

.account-card.is-disabled {
    opacity: 0.5;
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.account-card-email {
    margin-bottom: 12px;
}

.email-name {
    font-weight: 500;
    font-size: 15px;
}

.email-domain {
    color: var(--text-tertiary);
    font-size: 14px;
}

.account-card-quotas {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.account-card-quotas.model-quota-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.account-card-quotas.model-quota-grid .quota-item {
    padding: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.account-card-quotas.model-quota-grid .quota-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: inline-block;
    margin-right: var(--space-2);
}

.account-card-quotas.model-quota-grid .quota-value {
    font-size: 11px;
    font-weight: 600;
}

.quota-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quota-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.quota-reset {
    font-size: 10px;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 2px;
}

.quota-reset.reset-time--success {
    color: var(--accent-success);
}

.quota-reset.reset-time--warning {
    color: var(--accent-warning);
}

.quota-reset.reset-time--neutral {
    color: var(--text-muted);
    opacity: 0.7;
}

.account-card-proxy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.proxy-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.proxy-toggle {
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.proxy-toggle.on {
    background: var(--accent-success-muted);
    color: var(--accent-success);
}

.proxy-toggle.off {
    background: var(--accent-danger-muted);
    color: var(--accent-danger);
}

.account-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ========================================
   View Toggle
   ======================================== */
.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
}

.view-toggle button {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle button:hover {
    color: var(--text-primary);
}

.view-toggle button.active {
    background: var(--bg-card);
    color: var(--accent-primary);
}

/* ========================================
   Filter Tabs
   ======================================== */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
}

.filter-tabs button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tabs button:hover {
    color: var(--text-primary);
}

.filter-tabs button.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
}

.filter-count {
    font-size: 11px;
    padding: 2px 6px;
    margin-left: 4px;
    background: var(--border-color);
    border-radius: var(--radius-md);
}

.filter-tabs button.active .filter-count {
    background: rgba(99, 102, 241, 0.2);
}

/* ========================================
   Selection Actions
   ======================================== */
.selection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selection-count {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 500;
}

/* ========================================
   Proxy Config Page
   ======================================== */
.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.config-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.config-header.clickable {
    cursor: pointer;
    user-select: none;
}

.config-header.clickable:hover {
    background: var(--bg-hover);
}

.expand-icon {
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.config-content {
    padding: 20px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.config-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.config-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

.form-group input[type="password"] {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group small {
    font-size: 11px;
    color: var(--text-tertiary);
}

.form-group small.warning {
    color: var(--accent-warning);
}

.form-group--toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* API Key Row */
.api-key-row {
    display: flex;
    gap: 8px;
}

.api-key-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px !important;
}

.api-key-actions button,
.api-key-row button {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.api-key-actions button:hover,
.api-key-row button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.proxy-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.proxy-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.section-toggle .toggle-arrow,
.collapsible-header .arrow {
    font-size: var(--text-base);
    color: var(--text-secondary);
    transition: transform 0.2s;
}

/* Model Mapping */
.mapping-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

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

.mapping-form input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.mapping-form .arrow {
    color: var(--text-tertiary);
}

.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.mapping-from, .mapping-source, .route-from {
    flex: 1;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.mapping-arrow, .route-arrow {
    color: var(--text-muted);
}

.mapping-to, .mapping-target, .route-to {
    flex: 1;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.empty-text {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Protocol Tabs */
.protocol-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 16px;
}

.protocol-tabs button {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.protocol-tabs button:hover {
    color: var(--text-primary);
}

.protocol-tabs button.active {
    background: var(--bg-card);
    color: var(--accent-primary);
}

/* Model Selector */
.model-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.model-selector label {
    font-size: 13px;
    color: var(--text-secondary);
}

.model-selector select {
    flex: 1;
}

/* Quick Start */
.quick-start {
    padding: 20px;
}

.base-url {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.base-url label {
    font-size: 13px;
    color: var(--text-secondary);
}

.base-url code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-primary);
}

/* ========================================
   Dashboard Improvements
   ======================================== */
.stats-grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

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

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

.stats-card__subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

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

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dashboard-card h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Current Account Detail */
.current-account-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-email {
    font-size: 15px;
    font-weight: 500;
}

.quota-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quota-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quota-row>span:first-child {
    width: 60px;
    font-size: 12px;
    color: var(--text-secondary);
}

.quota-row>span:last-child {
    width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
}

.quota-fill--claude {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(99, 102, 241, 0.35) 100%);
}

.btn--block {
    width: 100%;
    text-align: center;
}

/* Best Accounts List */
.best-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.best-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.best-account-item:hover {
    background: var(--bg-hover);
}

.best-account-item.is-current {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.best-account-item .account-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-account-item .email {
    font-size: 13px;
    font-weight: 500;
}

.best-account-item .quota-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-account-item .quota-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-success);
}

/* Tier badges */
.tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.tier-badge--sm {
    font-size: 10px;
    padding: 2px 6px;
}

.tier-ultra,
.tier-badge.tier-ultra {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.tier-pro,
.tier-badge.tier-pro {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.tier-banned,
.tier-badge.tier-banned {
    background: var(--accent-danger-muted);
    color: var(--accent-danger);
    border: 1px solid rgba(251, 113, 133, 0.2);
}

.tier-verify,
.tier-badge.tier-verify {
    background: var(--accent-warning-muted);
    color: var(--accent-warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.tier-disabled,
.tier-badge.tier-disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.tier-locked,
.tier-badge.tier-locked {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.tier-free,
.tier-badge.tier-free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Proxy badge */
.proxy-badge {
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.proxy-badge.on {
    background: var(--accent-success-muted);
    color: var(--accent-success);
}

.proxy-badge.off {
    background: var(--accent-danger-muted);
    color: var(--accent-danger);
}

/* Verification panel (inline, below account row) */
.vrf-panel-row {
    background: var(--bg-secondary);
}

.vrf-panel-cell {
    padding: 0 !important;
    overflow: hidden;
}

.vrf-panel {
    padding: 10px 16px 12px 48px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.vrf-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vrf-panel__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vrf-panel__close {
    padding: 2px 6px !important;
    font-size: 14px !important;
    line-height: 1;
    color: var(--text-muted) !important;
}

.vrf-panel__url-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.vrf-panel__url {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    word-break: break-all;
    overflow-wrap: break-word;
    user-select: all;
    -webkit-user-select: all;
    cursor: text;
}

.vrf-panel__copy {
    flex-shrink: 0;
    min-width: 56px;
    text-align: center;
}

.vrf-panel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vrf-panel__probe {
    flex-shrink: 0;
}

.vrf-panel__status {
    font-size: 12px;
    color: var(--text-tertiary);
    min-height: 1em;
}

.vrf-panel__status--success {
    color: var(--accent-success);
}

.vrf-panel__status--blocked {
    color: var(--accent-warning);
}

.vrf-panel__status--error {
    color: var(--accent-danger);
}

/* Header status */
.header-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.running {
    color: rgba(52, 211, 153, 0.85);
}

.status-indicator.running .status-dot {
    background: var(--accent-success);
    animation: pulse 2s infinite;
}

.status-indicator.stopped {
    color: var(--text-tertiary);
}

.status-indicator.stopped .status-dot {
    background: var(--text-tertiary);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Log Details */
.log-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.log-row:hover {
    background: var(--bg-hover);
}

.log-row.expanded {
    background: var(--bg-hover);
}

.expand-icon {
    display: inline-block;
    width: 16px;
    margin-right: 4px;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
    font-size: 10px;
}

.expand-icon.open {
    transform: rotate(90deg);
}

.log-details-row td {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.log-details {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
}

.detail-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
}

.detail-item.highlight .detail-value {
    color: var(--accent-primary);
}

.detail-item.error .detail-value {
    color: var(--accent-danger);
}

.code-block {
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Add Account Modal */
.add-account-modal {
    max-width: 480px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tab-content {
    min-height: 250px;
}

/* OAuth Tab */
.oauth-tab {
    text-align: center;
}

.oauth-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.oauth-tab h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.oauth-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.oauth-url-section {
    margin-top: 20px;
    text-align: left;
}

.oauth-url-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.oauth-url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.oauth-url-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Token Tab */
.token-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.token-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.token-input {
    width: 100%;
    height: 120px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    resize: vertical;
}

.token-input::placeholder {
    color: var(--text-tertiary);
}

.token-hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Import Tab */
.import-tab {
    text-align: center;
    padding: 20px 0;
}

.import-tab h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.import-tab p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Button modifiers for modal */
.btn--full {
    width: 100%;
}

.btn--small {
    padding: 6px 10px;
    font-size: 12px;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert--info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.alert--success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert--error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   Log Detail Modal
   ============================================ */

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

/* Log Detail Modal */
.log-detail-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.log-detail-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.log-detail-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.log-detail-modal .modal-title .method {
    font-weight: 600;
    font-size: 14px;
}

.log-detail-modal .modal-title .path {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-detail-modal .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-detail-modal .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.log-detail-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.detail-item .value {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

.detail-item code.value {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Code Blocks */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Error Block */
.error-section h3 {
    color: var(--accent-danger);
}

.error-block {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

/* Empty Detail */
.empty-detail {
    text-align: center;
    padding: 32px;
    color: var(--text-tertiary);
}

/* Clickable Log Rows */
.log-row.clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.log-row.clickable:hover {
    background: var(--bg-hover);
}

.log-row.clickable:hover td {
    color: var(--text-primary);
}

/* Hint text */
.empty-state .hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ============================================
   Account Details Modal
   ============================================ */

.account-details-modal {
    max-width: 600px;
}

.account-details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-top: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.account-details-modal .modal-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-details-modal .modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.model-quota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.model-quota-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.15s ease;
}

.model-quota-card:hover {
    border-color: var(--accent-primary);
}

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

.model-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.model-percentage {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-md);
}

.model-percentage.quota-fill--good {
    background: var(--accent-success-muted) !important;
    color: var(--text-primary);
}

.model-percentage.quota-fill--warning {
    background: var(--accent-warning-muted);
    color: var(--text-primary);
}

.model-percentage.quota-fill--critical {
    background: var(--accent-danger-muted);
    color: var(--text-primary);
}

.model-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.model-progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.model-progress-bar.quota-fill--good {
    background: var(--accent-success);
}

.model-progress-bar.quota-fill--warning {
    background: var(--accent-warning);
}

.model-progress-bar.quota-fill--critical {
    background: var(--accent-danger);
}

.model-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.reset-icon {
    font-size: 12px;
}

.reset-text {
    font-family: monospace;
}

.reset-text.reset-time--success {
    color: var(--accent-success);
}

.reset-text.reset-time--warning {
    color: var(--accent-warning);
}

.reset-text.reset-time--neutral {
    color: var(--text-tertiary);
}

.empty-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ========================================
   Skeleton Loading
   ======================================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 180px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text--lg {
    height: 24px;
    width: 60%;
}

/* ========================================
   Rank Indicators (Best Accounts)
   ======================================== */
.rank-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-indicator--1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.rank-indicator--2 {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff;
}

.rank-indicator--3 {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
}

.rank-indicator--default {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 30%),
        radial-gradient(circle at 50% 120%, rgba(99, 102, 241, 0.14), transparent 36%),
        var(--bg-primary);
    padding: 48px 24px;
}

.login-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(15, 23, 42, 0.92));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 48px;
    box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.72);
}

.login-container::before {
    content: "";
    position: absolute;
    inset: -20% 12% auto;
    height: 140px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 72%);
    pointer-events: none;
}

.login-header {
    position: relative;
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 17px;
    color: rgba(226, 232, 240, 0.88);
    max-width: 24ch;
    margin: 0 auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    gap: 8px;
}

.login-form .form-group label {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.86);
}

.login-form .form-input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-mono);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-form .form-input::placeholder {
    color: rgba(148, 163, 184, 0.85);
}

.login-form .form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-hint {
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(203, 213, 225, 0.84);
    margin-top: 24px;
}

.btn--full-width {
    width: 100%;
}

.login-form .btn--primary {
    min-height: 48px;
    background: var(--bg-card);
    border-color: rgba(165, 180, 252, 0.68);
    color: #f8fafc;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(15, 23, 42, 0.35);
    box-shadow: 0 24px 40px -28px rgba(79, 70, 229, 0.95);
}

.login-form .btn--primary:hover {
    background: var(--bg-card);
    box-shadow: 0 28px 48px -28px rgba(79, 70, 229, 1);
}


/* --- Dashboard Redesign --- */

.hero-metrics {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.hero-metrics .stats-card {
    flex: 1;
    min-width: 0;
}

/* Ultra Accounts Section — compact reset table */
.ultra-accounts-section {
    margin-bottom: 24px;
}

.ultra-accounts-section h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
}

.ultra-reset-table {
    display: flex;
    flex-direction: column;
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ultra-reset-header {
    display: grid;
    grid-template-columns: 1fr 100px 100px;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ultra-reset-row {
    display: grid;
    grid-template-columns: 1fr 100px 100px;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

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

.ultra-reset-row:hover {
    background: var(--surface-secondary);
}

.ultra-reset-cell {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.ultra-reset-cell--email {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ultra-reset-cell--time {
    font-family: var(--font-mono);
    color: var(--accent-success);
    font-weight: 500;
    justify-content: flex-end;
    text-align: right;
}
.secondary-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.info-strip {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.info-strip__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-card--hero {
    padding: 28px 24px;
    gap: 8px;
    position: relative;
    min-height: 140px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.stats-card--hero .stats-card__value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
}

.stats-card--hero .stats-card__title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.stats-card__subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: auto;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Accent Cards — uniform border, no glow */
.stats-card--purple,
.stats-card--indigo,
.stats-card--blue,
.stats-card--hero {
    border: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
    background: var(--bg-card);
}

/* Value Colors */
.stats-card--success {
    color: var(--text-primary);
}

.stats-card--warning {
    color: var(--text-primary);
}

.stats-card--danger {
    color: var(--text-primary);
    opacity: 0.85;
}

/* Muted percentage value colors — high specificity override */
.stats-card__value.stats-card--danger { color: rgba(251, 113, 133, 0.75) !important; }
.stats-card__value.stats-card--warning { color: rgba(251, 191, 36, 0.7) !important; }
.stats-card__value.stats-card--success { color: rgba(52, 211, 153, 0.75) !important; }

/* Info Strip Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
    min-width: 20px;
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.badge--danger {
    color: var(--accent-danger);
    background: var(--accent-danger-muted);
}


.btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn--primary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.btn--danger {
    color: var(--accent-danger);
    border-color: rgba(248, 113, 113, 0.2);
}
.btn--danger:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
}



.btn--sm:hover, .btn--action:hover, .col-actions .btn:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-default) !important;
}


.col-actions .btn--danger:hover {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

/* Custom checkbox styling — excludes .toggle which draws its own pill */
input[type="checkbox"]:not(.toggle) {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}
input[type="checkbox"]:not(.toggle):checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
input[type="checkbox"]:not(.toggle):checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

table th {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quota-history-table {
    width: 100%;
    border-collapse: collapse;
}

.quota-history-table td,
.quota-history-row td {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
}

.stats-card .sigma,
.stats-card-label {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

/* ====== 8 FIXES APPENDED ====== */

/* Issue 2: SETTINGS — White number inputs */
.setting-row input[type="number"],
.settings input[type="number"],
.setting-row input[type="text"],
.settings input[type="text"],
.path-input input[type="text"],
input[type="number"],
input[type="text"] {
  background: var(--bg-tertiary) !important;
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  color-scheme: dark !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: var(--radius-md);
}

/* Issue 3: PROXY — Model routing colors still neon */
.mapping-from, .mapping-source, .route-from, .model-from {
    color: var(--text-secondary) !important;
}
.mapping-arrow, .route-arrow {
    color: var(--text-muted) !important;
}
.mapping-to, .mapping-target, .route-to, .model-to {
    color: var(--text-primary) !important;
}

/* Issue 8: GENERAL — Quota bar fill color still neon green */
.quota-bar-fill,
.model-progress-fill,
.progress-fill {
    background-color: var(--accent-success) !important;
}

/* FINAL: Hero cards — kill ALL colored border-top regardless of source */
.stats-card.stats-card--hero.stats-card--purple,
.stats-card.stats-card--hero.stats-card--indigo,
.stats-card.stats-card--hero.stats-card--blue,
.stats-card.stats-card--hero,
.stats-card.stats-card--purple,
.stats-card.stats-card--indigo,
.stats-card.stats-card--blue {
    border: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
}


/* ========================================
   QA DEFECT FIXES
   ======================================== */

/* DASHBOARD PAGE */
/* 5. Hero card colored borders - reduce opacity or soften */
.stats-card--hero::before, .stats-card--purple::before, .stats-card--indigo::before, .stats-card--blue::before {
    display: none !important;
}
.stats-card--hero, .stats-card--purple, .stats-card--indigo, .stats-card--blue {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* 6. Version badge padding - text cramped -> more horizontal padding */
.version {
    padding: 2px 8px !important;
}

/* 7. Inconsistent text wrapping in card subtitles -> fix */
.stats-card__subtitle {
    white-space: nowrap !important;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* ACCOUNTS PAGE */
/* 1. Heading overlaps Sync button -> fix flexbox for header area */
.page-header {
    gap: 16px;
    flex-wrap: wrap;
}

/* 2. Table header misalignment (EMAIL vs data) -> fix alignment */
.accounts-table th:first-child,
.accounts-table td:first-child {
    text-align: center !important;
    width: 48px;
    padding-right: 0 !important;
}
.accounts-table th {
    vertical-align: middle;
}

/* 3. UNKNOWN badge clipped by container -> fix overflow */
.tier-badge {
    white-space: nowrap !important;
    max-width: 100%;
}
.col-tier {
    overflow: visible !important;
}

/* 4. Massive gap between table header and first row -> reduce */
.accounts-table th {
    padding-bottom: 8px !important;
}
.accounts-table td {
    padding: 12px 16px !important;
}

/* 5. Button text wrapping ("Refresh All" on two lines) -> white-space: nowrap */
.btn {
    white-space: nowrap !important;
}

/* 6. Invisible checkboxes - dark border on dark bg -> border rgba(255,255,255,0.25) + styled check */
input[type="checkbox"]:not(.toggle) {
    border: 1.5px solid rgba(255,255,255,0.25) !important;
    background: transparent !important;
}
input[type="checkbox"]:not(.toggle):checked {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}

/* 7. Neon blue count badge ("29") -> mute with --accent-primary at low opacity */
.selection-count, .filter-count, .tier-count {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent-secondary) !important;
}

/* 8. Status indicator dot too dim -> use semantic color at higher opacity */
.status-dot, .status-indicator {
    opacity: 0.9 !important;
}

/* PROXY PAGE */
/* 1. Toggle thumbs stark white -> mute to #d4d4d8 */
/* GLOBAL 5. All toggle thumbs too white -> #d4d4d8 or var(--text-primary) */

/* 2. Active toggle track neon purple -> --accent-primary at 60-70% opacity */
/* GLOBAL 4. All toggle tracks too bright purple -> background: rgba(99,102,241,0.6) */

/* 3. Active sidebar border harsh neon -> --accent-primary at 50% opacity */
/* GLOBAL 1. Sidebar active left border too harsh */

/* 4. Status dot not vertically centered with text -> fix alignment */
.proxy-status, .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 5. Input text contrast mismatch (dim vs bright) -> both use --text-primary */
input[type="text"], input[type="number"], .token-input {
    color: var(--text-primary) !important;
}

/* 6. Version pill text too dark -> use --text-muted minimum */
/* GLOBAL 3. Version pill in sidebar illegible -> color: var(--text-tertiary) minimum */
.version, .sidebar-version, .version-text {
    color: var(--text-tertiary) !important;
}

/* 7. Status text "Running" too neon green -> --accent-success at 80% or muted */
.status-text--running, .status-active {
    color: rgba(52, 211, 153, 0.85) !important;
    opacity: 0.85;
}

/* 8. Stop button muddy red -> clean contrast */
.btn--danger {
    background: var(--accent-danger-muted) !important;
    color: var(--accent-danger) !important;
    border: 1px solid rgba(251, 113, 133, 0.2) !important;
}
.btn--danger:hover {
    background: rgba(251, 113, 133, 0.25) !important;
}

/* 9. Section subheadings weak -> more weight/spacing */
.section-title, h3 {
    font-weight: 600 !important;
    font-size: 11px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 16px !important;
}

/* SETTINGS PAGE */
/* 1. Toggle thumb clips outside track -> fix sizing/overflow */

/* 2. Select dropdown harsh borders -> style with --border-color + proper padding */
select {
    border: 1px solid rgba(255,255,255,0.10);
    padding: 8px 12px !important;
    border-radius: var(--radius-md) !important;
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
}

/* 3. Save button faint border -> --accent-primary solid bg */
.btn--primary {
    background: #4f4fbc !important;
    color: #fff !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* 4. Active toggle track neon purple -> handled globally */
/* 5. Severe low contrast subtext -> use --text-secondary */
.setting-description, .help-text, .section-desc {
    color: var(--text-secondary) !important;
}

/* 6. Sidebar active state blocky -> improve border-radius + subtler bg */

/* MONITOR PAGE */
/* 1. MODEL column too narrow (wraps to 4 lines) -> min-width: 180px or white-space: nowrap with ellipsis */
.logs-table td:nth-child(4) {
    white-space: nowrap !important;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2. PATH column truncation abrupt -> proper text-overflow: ellipsis */
.path-cell, .logs-table td:nth-child(6) {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. Neon filter pills -> muted rgba(99,102,241,0.15) bg with --accent-secondary text */
.filter-pill, .btn-filter, .filter-tabs button.active {
    background: rgba(99,102,241,0.15) !important;
    color: var(--accent-secondary) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

/* 4. Muddy brown labels/headers -> use --text-secondary/--text-tertiary */
/* Already handled by global table th fix */

/* 5. Recording button muddy red -> --accent-danger-muted bg with muted text */
.recording-btn, .btn-recording, .recording-indicator {
    background: var(--accent-danger-muted) !important;
    color: var(--accent-danger) !important;
    border: 1px solid rgba(251, 113, 133, 0.2) !important;
}

/* 6. Filter pills overflow cut off -> overflow-x: auto on container */
.filters-container, .filter-group, .filter-tabs {
    overflow-x: auto !important;
    white-space: nowrap;
    padding-bottom: 4px;
}

/* 7. Search bar icon misalignment -> align-items: center */
.search-bar, .search-container, .search-box {
    display: flex;
    align-items: center !important;
}

/* 8. Squished header stats -> gap 16px minimum */
.header-stats, .monitor-stats, .monitor-controls {
    display: flex;
    gap: 16px !important;
}

/* 9. Token counter labels too dim, values too stark -> balance both */
.token-label, .log-meta span {
    color: var(--text-secondary) !important;
}
.token-value {
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* GLOBAL (ALL PAGES) */
/* 2. Sidebar Monitor separator awkward -> add margin/padding */
.sidebar-footer {
    margin: 16px !important;
     border-top: 1px solid var(--border-color) !important;
}

/* 3, 4, 5 are handled in Proxy section */

/* ========================================
   BATCH 1 QA DEFECT FIXES (OVERRIDE)
   ======================================== */

/* GLOBAL 2. Sidebar Monitor separator */
.sidebar-footer {
    margin: 16px !important;
     border-top: 1px solid var(--border-color) !important;
}

/* GLOBAL 3. Version pill in sidebar */
.version, .sidebar-version, .version-text, .sidebar .version {
    color: #71717a !important;
    opacity: 1 !important;
}

/* DASHBOARD 8. Hero card colored top borders */
.stats-card--purple { border-top: 2px solid rgba(168, 85, 247, 0.4) !important; }
.stats-card--indigo { border-top: 2px solid rgba(99, 102, 241, 0.4) !important; }
.stats-card--blue { border-top: 2px solid rgba(59, 130, 246, 0.4) !important; }
.stats-card--hero { border-top: 2px solid rgba(99, 102, 241, 0.5) !important; }

/* DASHBOARD 9. Neon percentage values */
.quota-fill--good, .model-progress-bar.quota-fill--good, .quota-bar-fill {
    background-color: rgba(52, 211, 153, 0.85) !important;
}
.quota-fill--warning, .model-progress-bar.quota-fill--warning {
    background-color: rgba(251, 191, 36, 0.85) !important;
}
.quota-fill--critical, .model-progress-bar.quota-fill--critical {
    background-color: rgba(251, 113, 133, 0.85) !important;
}
.model-percentage, .quota-text, .quota-value {
    color: var(--text-primary) !important;
}

/* DASHBOARD 10 & 14. Card subtitles / wrapping */
.stats-card__subtitle, .stats-card__title {
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* DASHBOARD 11. Version badge/pill on cards */
.version {
    padding: 2px 10px !important;
}

/* DASHBOARD 12 & 13. Table headers and cell padding */
table th, .accounts-table th, .logs-table th, .ultra-reset-header {
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
}
table td, .accounts-table td, .logs-table td {
    padding: 12px 16px !important;
}

/* ========================================
   BATCH 2: QA DEFECT FIXES (OVERRIDE)
   ======================================== */

/* --- ACCOUNTS PAGE --- */

/* 1. Heading overlaps Sync button */
.page-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

/* 2. Button text wrapping */
.header-actions .btn, .btn {
    white-space: nowrap !important;
}

/* 3. Table header EMAIL misalignment with data */
.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) {
    text-align: left !important;
}

/* 4. Massive gap between table header and first row */
.accounts-table th, table th {
    padding-bottom: 8px !important;
}
.accounts-table td, table td {
    padding-top: 8px !important;
}

/* 5. Invisible checkboxes */
input[type="checkbox"]:not(.toggle) {
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    background: transparent !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    position: relative !important;
    display: inline-block !important;
    vertical-align: middle !important;
}
input[type="checkbox"]:not(.toggle):checked {
    background-color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}
input[type="checkbox"]:not(.toggle):checked::after {
    content: '' !important;
    position: absolute !important;
    left: 4px !important;
    top: 1px !important;
    width: 4px !important;
    height: 8px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

/* 6. Neon blue count badge */
.selection-count, .filter-count, .tier-count, .badge {
    background: rgba(99, 102, 241, 0.12) !important;
    color: var(--accent-secondary) !important;
}

/* 7. UNKNOWN badge clipped by container */
.col-tier, .tier-badge-container, .badge-container {
    overflow: visible !important;
}
.tier-badge, .badge {
    white-space: nowrap !important;
}

/* 8. Status indicator dot too dim */
.status-dot--active, .status-dot--running, .status-active .status-dot, .proxy-status-dot {
    opacity: 0.9 !important;
    box-shadow: 0 0 4px var(--accent-success) !important;
}

/* --- PROXY PAGE --- */

/* 9. Status dot not vertically centered with "Running" text */
.status-indicator, .proxy-status, .server-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 10. Status text "Running" too neon green */
.status-text--running, .status-active, .proxy-status-text {
    color: rgba(52, 211, 153, 0.85) !important;
}

/* 11. Input text contrast mismatch */
input[type="number"], input[type="text"], .proxy-input {
    color: var(--text-primary) !important;
}

/* 12. Stop button muddy dark red */
.btn--danger, .stop-btn {
    background: var(--accent-danger-muted) !important;
    color: var(--accent-danger) !important;
    border: 1px solid rgba(251, 113, 133, 0.2) !important;
}
.btn--danger:hover, .stop-btn:hover {
    background: rgba(251, 113, 133, 0.25) !important;
}

/* 13. Section subheadings visually weak */
.section-title, h3, .subheading, .settings-group h3 {
    font-weight: 600 !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
    margin-top: 24px !important;
    margin-bottom: 16px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

.config-header h2, .proxy h2 {
    font-weight: 600 !important;
    font-size: 11px !important;
    color: var(--text-tertiary) !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

/* --- SETTINGS PAGE --- */

/* 14. Select dropdown harsh default borders */
select, .setting-select, .setting-row select {
    border: 1px solid rgba(255,255,255,0.10) !important;
    background-color: var(--bg-tertiary) !important;
    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='%2371717a' d='M2.5 4.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    color: var(--text-primary) !important;
    padding: 8px 32px 8px 12px !important;
    border-radius: var(--radius-md) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* 15. Save button faint murky border */
.btn--primary, .save-btn {
    background: #4f4fbc !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    padding: 8px 20px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* 16. Low contrast subtext */
.setting-description, .setting-subtitle, .help-text, .section-desc, .setting-row p {
    color: var(--text-secondary) !important;
}

/* --- MONITOR PAGE --- */

/* 17. Model column */
.logs-table td:nth-child(4), .model-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 220px !important;
    min-width: 180px !important;
}

/* 18. Path column */
.logs-table td:nth-child(6), .path-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 300px !important;
}

/* 19. Active filter pill uses jarring neon purple */
.filter-pill.active, .btn-filter.active, .filter-tabs button.active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent-secondary) !important;
    border: 1px solid transparent !important;
}

/* 20. Filter pills overflow */
.filters-container, .filter-group, .filter-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    display: flex !important;
}

/* 21. Squished header stats */
.header-stats, .monitor-stats, .stat-group, .monitor-controls {
    display: flex !important;
    gap: 16px !important;
}

/* 22. Muddy brown/orange labels for back link, token counter, table headers */
.back-link, .token-label, .log-meta span {
    color: var(--text-secondary) !important;
}
.logs-table th {
    color: var(--text-tertiary) !important;
}

/* 23. Search bar icon misalignment */
.search-box, .search-container, .search-bar {
    display: flex !important;
    align-items: center !important;
}

/* 24. Recording button muddy red */
.recording-btn, .btn-recording, .recording-indicator {
    background: var(--accent-danger-muted) !important;
    color: #fb7185 !important;
    border: 1px solid rgba(251, 113, 133, 0.2) !important;
}

/* 25. Token counter labels too dim, values too stark */
.token-counter .label {
    color: var(--text-secondary) !important;
}
.token-counter .value, .token-value {
    color: var(--text-primary) !important;
}



input:focus, select:focus, textarea:focus, .form-input:focus, .search-box input:focus {
    border-color: rgba(255,255,255,0.20) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.10) !important;
    outline: none !important;
}

.search-box input::placeholder, input::placeholder {
    color: #71717a !important;
    opacity: 1 !important;
}

.btn--primary {
    background: #4f4fbc !important;
    color: white !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    padding: 8px 20px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08) !important;
}
.btn--primary:hover {
    background: #5a5ac7 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 2px 8px rgba(79, 79, 188, 0.3) !important;
}

.nav-item.active {
    background: rgba(255,255,255,0.05) !important;
    color: var(--text-primary) !important;
    position: relative;
    border-radius: var(--radius-md) !important;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: 3px;
    background: rgba(91, 91, 214, 0.7);
    border-radius: 2px;
}

.status-badge, .badge, .banned-badge, .locked-badge, .disabled-badge, .tier-badge, .update-badge, .proxy-badge, .current-badge {
    border-radius: var(--radius-sm) !important;
    padding: 2px 8px !important;
}

/* Task 7: Table row borders too bright */
table tr, .accounts-table tr, .log-row {
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}
table th, .accounts-table th {
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* Task 8: Card/section borders */
.account-card, .model-quota-card, .stats-card, .info-strip, . ultra-reset-table {
    border-color: var(--border-color) !important;
}
.card, .section, .panel, .container, .box, .action-card {
    border-color: var(--border-color) !important;
}

/* Task 9: Input/select borders Default */
input, select, textarea, .form-input, .search-box input {
    border-color: rgba(255,255,255,0.12) !important;
}

/* Task 9: Input/select borders Focus */
input:focus, select:focus, textarea:focus, .form-input:focus, .search-box input:focus {
    border-color: rgba(255,255,255,0.20) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.10) !important;
    outline: none !important;
}

/* Task 12: Recording badge padding */
.recording-btn, .btn-recording, .recording-indicator {
    padding: 4px 12px !important;
    gap: 6px !important; /* proper dot spacing */
}

/* Task 4: Sidebar divider fix */
.sidebar-footer {
    margin-left: 16px !important;
    margin-right: 16px !important;
}

/* Task 5: Toggle switch redesign */
.toggle, input[type="checkbox"].toggle {
    width: 36px !important;
    height: 20px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.10) !important;
    border: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}
.toggle::before, .toggle::after, input[type="checkbox"].toggle::before, input[type="checkbox"].toggle::after {
    content: '' !important;
    width: 14px !important;
    height: 14px !important;
    top: 3px !important;
    left: 3px !important;
    background: #d4d4d8 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    position: absolute !important;
    border-radius: 50% !important;
    transform: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.toggle:checked, input[type="checkbox"].toggle:checked {
    background: var(--accent-primary) !important;
}
.toggle:checked::before, .toggle:checked::after, input[type="checkbox"].toggle:checked::before, input[type="checkbox"].toggle:checked::after {
    transform: translateX(16px) !important;
    background: #fff !important;
}

/* ========================================
   PAGE-SPECIFIC LAYOUT FIXES (16 issues)
   ======================================== */

.secondary-metrics {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
}

.stats-card__subtitle {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ultra-accounts-section {
    margin-top: 16px !important;
}
.ultra-reset-header {
    grid-template-columns: 1fr 120px 120px !important;
}
.ultra-reset-header > *:nth-child(2),
.ultra-reset-header > *:nth-child(3) {
    text-align: right !important;
}
.ultra-reset-row {
    grid-template-columns: 1fr 120px 120px !important;
}
.ultra-reset-cell--time {
    justify-content: flex-end !important;
    text-align: right !important;
}

.accounts-table th:first-child,
.accounts-table td:first-child {
    width: 48px !important;
    text-align: center !important;
    padding-left: 12px !important;
    padding-right: 4px !important;
}
input[type="checkbox"]:not(.toggle) {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}
input[type="checkbox"]:not(.toggle):checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
input[type="checkbox"]:not(.toggle):checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.status-dot {
    width: 8px !important;
    height: 8px !important;
    vertical-align: middle;
    flex-shrink: 0;
}

.tier-unknown,
.tier-badge.tier-unknown {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.view-toggle {
    display: inline-flex !important;
    background: var(--bg-tertiary) !important;
    border-radius: var(--radius-md) !important;
    padding: 2px !important;
    border: 1px solid var(--border-color) !important;
}
.view-toggle button {
    padding: 4px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    color: var(--text-tertiary) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
.view-toggle button:hover {
    color: var(--text-primary) !important;
}
.view-toggle button.active {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.setting-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

input[type="number"],
input[type="text"] {
    color: var(--text-primary) !important;
}

.proxy-status,
.status-indicator,
.server-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

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

.settings-section .setting-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}
.settings-section .setting-row:last-child {
    border-bottom: none !important;
}

.logs-table {
    table-layout: fixed !important;
}
.logs-table th:nth-child(1),
.logs-table td:nth-child(1) {
    width: 80px !important;
    padding-left: 16px !important;
}
.logs-table th:nth-child(2),
.logs-table td:nth-child(2) {
    width: 80px !important;
}
.logs-table th:nth-child(3),
.logs-table td:nth-child(3) {
    width: 70px !important;
}
.logs-table th:nth-child(4),
.logs-table td:nth-child(4) {
    width: 220px !important;
    min-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.logs-table th:nth-child(5),
.logs-table td:nth-child(5) {
    width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.logs-table th:nth-child(6),
.logs-table td:nth-child(6) {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.monitor-stats .stat-value,
.header-stats .stat-value {
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}
.monitor-stats .stat-label,
.header-stats .stat-label {
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

.filter-tabs button {
    padding-bottom: 8px !important;
}
.filter-tabs button.active {
    border-bottom: 2px solid var(--accent-primary) !important;
}

.token-counter .value,
.token-value {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}
.token-counter .label,
.token-label {
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

/* ========================================
   PAGE-SPECIFIC FIXES — BATCH 3
   ======================================== */

/* DASHBOARD 1: Card timing values wrapping ("4h 55m" breaking to next line) */
.stats-card__value,
.stats-card__subtitle {
    white-space: nowrap !important;
}

/* DASHBOARD 2: Quota table headers/cells alignment */
.table th, .table td {
    text-align: left !important;
}

/* DASHBOARD 3: Neon percentage colors too saturated — desaturate success */
.stats-card__value.stats-card--success { color: rgba(110, 231, 183, 0.85) !important; }

/* DASHBOARD 4: Table header background too harsh — transparent + crisp border */
table th, .table th {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ACCOUNTS 5: Action buttons inline with H1 */
.page-header {
    flex-wrap: nowrap !important;
    align-items: center !important;
}
.page-header .header-actions {
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
}

/* ACCOUNTS 6: LIST/GRID toggle needs visible active pill */
.view-toggle button.active {
    background: rgba(255, 255, 255, 0.10) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ACCOUNTS 7: Empty table gap too large */
.accounts-table-container .empty-state,
.empty-state {
    padding: 32px !important;
}

/* PROXY 9: Status dot vertically centered with text baseline */
.proxy-status, .server-status, .status-indicator {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}
.proxy-status .status-dot {
    flex-shrink: 0 !important;
    align-self: center !important;
}

/* SETTINGS 11: Save button sticky at bottom of viewport */
.page:has(.settings-section) .page-header .btn--primary {
    position: fixed !important;
    bottom: 24px !important;
    right: 32px !important;
    z-index: 100 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

/* SETTINGS 12: Breathing room before first settings card */
.settings .settings-section:first-of-type {
    margin-top: 8px !important;
}

/* MONITOR 13: Stats unified row — header-stats inline with h1 */
.monitor .page-header {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
}
.monitor .page-header .header-stats {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 13px !important;
}

/* MONITOR 14: Table row density — reduce padding for log viewer */
.logs-table td {
    padding: 6px 12px !important;
}
.logs-table th {
    padding: 8px 12px !important;
}

/* MONITOR 15: Filter tab truncation — prevent text cutoff */
.monitor .quick-filters button,
.monitor .filter-tabs button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.monitor .quick-filters,
.monitor .filter-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 4px !important;
}

/* MONITOR 16: "← Back" link — reduce prominence */
.back-button,
.back-link {
    display: none !important;
}

/* MONITOR 17: Recording badge — crisp contrast + glow dot */
.monitor .recording-btn,
.monitor .recording-btn.recording {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}
.monitor .recording-btn .dot,
.monitor .recording-btn .recording-dot {
    background: #f87171 !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6) !important;
}
