:root {
    --bg-black: #000000;
    --bg-dark: #0a0a0a;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-success: #00ff88;
    --terminal-green: #00ff00;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-display);
    background: var(--bg-black);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   HERO - Full Screen Landing
   ============================================ */

.hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-black);
    z-index: 1000;
}

.spotlight {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.hero-content {
    text-align: center;
    z-index: 10;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.hero-title {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.typewriter {
    display: inline-block;
    border-right: 4px solid var(--accent-primary);
    padding-right: 8px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.hero-subtitle {
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.hero-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.5);
}

/* ============================================
   MAIN APP - Two Screen Layout
   ============================================ */

.app {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.app.active {
    display: flex;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 70px;
    flex-shrink: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 0.625rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--gradient-primary);
}

/* Views */
.view {
    display: none;
    flex: 1;
    overflow: hidden;
}

.view.active {
    display: block;
}

/* ============================================
   DASHBOARD VIEW - Single Screen Grid
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 70px);
    padding: 1.5rem;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    height: 100%;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-trend.positive {
    color: var(--accent-success);
}

/* Terminal Section */
.terminal-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.2);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 255, 0, 0.05);
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.terminal-title {
    color: var(--terminal-green);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.terminal-clear {
    padding: 0.375rem 0.875rem;
    background: transparent;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    color: var(--terminal-green);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.terminal-clear:hover {
    background: rgba(0, 255, 0, 0.1);
}

.terminal-body {
    flex: 1;
    padding: 1rem 1.5rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 0.5rem;
    color: var(--terminal-green);
}

.terminal-line.welcome {
    color: #00ffff;
    font-weight: 600;
}

.terminal-line.muted {
    color: var(--text-muted);
}

.terminal-line.success {
    color: var(--accent-success);
}

.terminal-line.error {
    color: #ff4444;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 255, 0, 0.02);
    border-top: 1px solid rgba(0, 255, 0, 0.2);
}

.prompt {
    color: var(--terminal-green);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.terminal-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   ACTIVITY LOG - OpenRouter-Inspired
   ============================================ */

.activity-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.activity-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.activity-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: grid;
    grid-template-columns: 140px 1fr 80px 40px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    align-items: center;
    transition: all 0.2s;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.activity-time {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.activity-model {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.activity-tokens {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: right;
}

.activity-status {
    display: flex;
    justify-content: center;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.status-icon.success {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-success);
}

.status-icon.error {
    background: rgba(255, 82, 82, 0.2);
    color: var(--accent-error);
}

/* ============================================
   CONFIG VIEW - Single Screen Grid
   ============================================ */

/* API Settings Section */
.api-settings {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header {
    margin-bottom: 1.5rem;
}

.settings-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-card label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.settings-card input,
.settings-card select {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.settings-card input:focus,
.settings-card select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.api-key-input {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-input input {
    flex: 1;
    padding-right: 3rem;
}

.toggle-visibility {
    position: absolute;
    right: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

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

.settings-actions {
    display: flex;
    gap: 0.75rem;
}

.quota-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
}

.quota-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quota-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.quota-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Providers Section */
.providers-section {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.providers-header {
    margin-bottom: 1rem;
}

.providers-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.providers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.provider-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.provider-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.provider-item-icon {
    font-size: 1.5rem;
}

.provider-item-info {
    flex: 1;
}

.provider-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.provider-item-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-success);
}

.provider-item-status.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.provider-item-actions {
    display: flex;
    gap: 0.5rem;
}

.provider-item-btn {
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.provider-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.providers-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    height: calc(100vh - 140px);
    overflow-y: auto;
}

.config-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    height: fit-content;
}

.config-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.config-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.config-card-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.config-card-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.config-models {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.model-select label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.model-select select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.config-command {
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--terminal-green);
    margin-bottom: 1rem;
    word-break: break-all;
}

.config-card-actions {
    display: flex;
    gap: 0.75rem;
}

.config-footer {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    flex: 1;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    flex: 1;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   INTEGRATION MODAL
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Dialog */
.modal-dialog {
    position: relative;
    width: 90%;
    max-width: 560px;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

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

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

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Modal Views */
.modal-view {
    display: none;
}

.modal-view.active {
    display: block;
}

/* Modal Header */
.modal-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.models-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.models-link:hover {
    color: var(--accent-secondary);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Provider Grid */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.provider-card {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.provider-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.provider-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.provider-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.provider-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.info-icon {
    color: var(--text-muted);
    cursor: help;
}

/* Key Input Group */
.key-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.key-input-group input {
    flex: 1;
    padding: 0.875rem 3rem 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.key-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.key-input-group input::placeholder {
    color: var(--text-muted);
    letter-spacing: normal;
}

.key-toggle {
    position: absolute;
    right: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Toggle Group */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.toggle-group label {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: all 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--gradient-primary);
    border-color: transparent;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-test,
.btn-save {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-test {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-test:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.btn-save {
    background: var(--gradient-primary);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

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

/* Loading State */
.btn-test.loading,
.btn-save.loading {
    position: relative;
    color: transparent;
}

.btn-test.loading::after,
.btn-save.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

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

    .stats-section {
        grid-template-columns: repeat(4, 1fr);
        height: auto;
    }
}

@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        gap: 1rem;
        height: auto;
        padding: 1rem;
    }

    .nav-tabs {
        width: 100%;
    }

    .nav-tab {
        flex: 1;
        text-align: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

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

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-actions {
        flex-direction: column;
    }

    .quota-display {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}