/* ================================================
   PROXY ENDPOINT POOL — FROST TECH RETRO THEME
   Researched from: Dribbble, CodePen, ColorHunt, 
   HappyHues, Animista, Uiverse
   ================================================ */

/* === CSS VARIABLES === */
:root {
    /* BACKGROUNDS — Cold Charcoal */
    --bg-deepest:    #0B0D10;
    --bg-primary:    #0F1318;
    --bg-card:       #141920;
    --bg-elevated:   #1A2028;
    --bg-hover:      #252D38;
    --bg-input:      #111820;

    /* ACCENT — Frost Tech Cyan + Retro Amber */
    --accent-primary:    #14FFEC;
    --accent-secondary:  #3B82F6;
    --accent-amber:      #FFD369;
    --accent-glow:       #00FFD1;

    /* STATUS */
    --status-success:    #2BEDB3;
    --status-warning:    #F5A623;
    --status-danger:     #FF5C5C;
    --status-info:       #4A9EFF;

    /* TEXT */
    --text-primary:      #E1E5EA;
    --text-secondary:    #8892A6;
    --text-muted:        #4A5568;
    --text-accent:       #14FFEC;

    /* BORDERS */
    --border-default:    #1C2433;
    --border-active:     #2A3548;
    --border-glow:       rgba(20, 255, 236, 0.12);

    /* GRADIENTS */
    --gradient-bg:       linear-gradient(135deg, #0B0D10 0%, #0F1318 50%, #0D1F2D 100%);
    --gradient-card:     linear-gradient(145deg, #141920 0%, #1A2028 100%);
    --gradient-accent:   linear-gradient(135deg, #14FFEC 0%, #4A9EFF 100%);

    /* SIZING */
    --sidebar-width:     240px;
    --topbar-height:     56px;
    --mobile-nav-height: 64px;
    --radius:            10px;
    --radius-lg:         14px;

    /* TRANSITIONS */
    --transition:        all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:   all 0.15s ease;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* === GRAIN OVERLAY === */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.035;
    pointer-events: none;
    z-index: 10000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === CRT OVERLAY === */
.crt-overlay::after {
    content: '';
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.15) 50%
    );
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.2;
}

/* === GLASS PANEL === */
.glass-panel {
    background: rgba(20, 25, 32, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deepest);
}
::-webkit-scrollbar-thumb {
    background: var(--border-active);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================================
   LOGIN SCREEN
   ================================================ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 48px 36px;
    text-align: center;
}

.login-logo {
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(20, 255, 236, 0.5);
    display: block;
    margin-bottom: 12px;
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 4px;
}

.login-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-top: 4px;
}

.login-form {
    text-align: left;
}

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

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="url"],
.input-group input[type="number"],
.input-group input[type="date"],
.input-group textarea,
.select-retro {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus,
.select-retro:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(20, 255, 236, 0.08),
                0 0 12px rgba(20, 255, 236, 0.1);
}

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

.error-text {
    color: var(--status-danger);
    font-size: 0.8rem;
    margin-top: 12px;
    text-align: center;
}

/* === BUTTONS === */
.btn-neon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(20, 255, 236, 0.15);
    white-space: nowrap;
}

.btn-neon:hover {
    background: var(--accent-primary);
    color: var(--bg-deepest);
    box-shadow: 0 0 24px rgba(20, 255, 236, 0.35),
                0 0 60px rgba(20, 255, 236, 0.1);
    transform: translateY(-1px);
}

.btn-neon:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: var(--bg-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-danger {
    color: var(--status-danger);
    border-color: rgba(255, 92, 92, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 92, 92, 0.1);
    border-color: var(--status-danger);
}

.btn-success {
    color: var(--status-success);
    border-color: rgba(43, 237, 179, 0.3);
}

/* ================================================
   DASHBOARD LAYOUT
   ================================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 0;
    border-right: 1px solid var(--border-default);
    border-left: none;
    border-top: none;
    border-bottom: none;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-default);
}

.sidebar-header .logo-icon {
    font-size: 1.3rem;
    margin-bottom: 0;
}

.sidebar-header .logo-text {
    font-size: 0.85rem;
    letter-spacing: 3px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

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

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(20, 255, 236, 0.06);
    border: 1px solid rgba(20, 255, 236, 0.1);
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

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

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0 28px 40px;
    min-height: 100vh;
}

/* TOP BAR */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0;
    position: sticky;
    top: 0;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(12px);
    z-index: 50;
    border-bottom: 1px solid var(--border-default);
    margin: 0 -28px;
    padding: 0 28px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.mobile-menu-btn {
    display: none;
}

/* ================================================
   PAGES
   ================================================ */
.page {
    display: none;
    padding-top: 24px;
}

.page.active {
    display: block;
}

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

.page-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ================================================
   KPI CARDS
   ================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.kpi-info {
    flex: 1;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.kpi-sub {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ================================================
   CHARTS
   ================================================ */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    padding: 20px;
}

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

.chart-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ================================================
   PANELS
   ================================================ */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.panel {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

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

.panel-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* CSS Pure Charts */
.css-chart-container {
    height: 180px;
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 24px;
    position: relative;
    border-bottom: 1px solid var(--border-default);
}

.css-bar-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.css-bar {
    width: 100%;
    background: var(--accent-primary);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.5s ease-out;
    position: relative;
    cursor: pointer;
}

.css-bar:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px rgba(20, 255, 236, 0.4);
}

.css-bar.danger {
    background: var(--status-danger);
}
.css-bar.danger:hover {
    box-shadow: 0 0 10px rgba(255, 94, 94, 0.4);
}

.css-bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.css-bar-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-deepest);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    z-index: 10;
}

.css-bar:hover .css-bar-tooltip {
    opacity: 1;
    border-color: inherit;
}

/* Endpoint status item */
.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.status-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.status-item-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-item-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 8px;
    background: var(--bg-deepest);
    border-radius: 4px;
}

.status-item-ms {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Log item */
.log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.log-model {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-size: 0.75rem;
    min-width: 100px;
}

.log-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.log-status.ok {
    color: var(--status-success);
    background: rgba(43, 237, 179, 0.08);
}

.log-status.error {
    color: var(--status-danger);
    background: rgba(255, 92, 92, 0.08);
}

.log-ms {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-left: auto;
}

.log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ================================================
   TABLES
   ================================================ */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(28, 36, 51, 0.5);
    color: var(--text-primary);
}

tbody tr {
    transition: var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-hover);
}

/* ================================================
   STATUS DOT
   ================================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.healthy {
    background: var(--status-success);
    box-shadow: 0 0 6px var(--status-success);
    animation: pulse 2s infinite;
}

.status-dot.degraded {
    background: var(--status-warning);
    box-shadow: 0 0 6px var(--status-warning);
}

.status-dot.down {
    background: var(--status-danger);
    box-shadow: 0 0 6px var(--status-danger);
}

.status-dot.unknown {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px var(--status-success); }
    50% { box-shadow: 0 0 12px var(--status-success), 0 0 20px rgba(43, 237, 179, 0.25); }
}

/* ================================================
   MODALS
   ================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}

/* Fetched models info */
.fetched-models-info {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--bg-deepest);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.fetched-models-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.fetched-model-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(20, 255, 236, 0.06);
    border: 1px solid rgba(20, 255, 236, 0.15);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.fetched-model-tag:hover {
    background: rgba(20, 255, 236, 0.12);
    border-color: var(--accent-primary);
}

/* Checkbox lists for Key Modal */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--bg-deepest);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: var(--bg-deepest);
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

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

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
}

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

/* Form section titles */
.form-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-default);
    font-family: 'JetBrains Mono', monospace;
}

.form-section-title:first-of-type {
    margin-top: 0;
}

/* Key display & copy */
.key-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--accent-primary);
    padding: 4px 10px;
    background: var(--bg-deepest);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-block;
}

.key-display:hover {
    background: rgba(20, 255, 236, 0.06);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(20, 255, 236, 0.15);
}

/* Key created dialog */
.key-created-display {
    background: var(--bg-deepest);
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.key-created-display:hover {
    box-shadow: 0 0 24px rgba(20, 255, 236, 0.2);
    transform: scale(1.01);
}

.key-created-display code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-primary);
    word-break: break-all;
    display: block;
    line-height: 1.6;
}

.key-created-display .copy-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 2px;
    color: var(--text-muted);
    animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
    max-width: 360px;
    border: 1px solid;
}

.toast.success {
    background: rgba(43, 237, 179, 0.1);
    border-color: rgba(43, 237, 179, 0.25);
    color: var(--status-success);
}

.toast.error {
    background: rgba(255, 92, 92, 0.1);
    border-color: rgba(255, 92, 92, 0.25);
    color: var(--status-danger);
}

.toast.info {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.25);
    color: var(--status-info);
}

/* ================================================
   ANIMATIONS
   ================================================ */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.39, 0.575, 0.565, 1.0) both;
}

@keyframes fadeInUp {
    0% { transform: translateY(24px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideInRight {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* SKELETON LOADING */
.skeleton {
    background-color: var(--bg-card);
    background-image: linear-gradient(90deg,
        var(--bg-card) 0px,
        var(--bg-hover) 40px,
        var(--bg-card) 80px
    );
    background-size: 600px;
    animation: shimmer 1.6s infinite linear;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200px; }
    100% { background-position: 400px; }
}

/* ================================================
   MOBILE NAVIGATION
   ================================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(11, 13, 16, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-default);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    transition: var(--transition-fast);
    min-width: 56px;
}

.mobile-nav-item span:first-child {
    font-size: 1.2rem;
}

.mobile-nav-item.active {
    color: var(--accent-primary);
}

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

.select-retro option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ================================================
   TEXT UTILITIES
   ================================================ */
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge-success { background: rgba(43, 237, 179, 0.1); color: var(--status-success); }
.badge-danger { background: rgba(255, 92, 92, 0.1); color: var(--status-danger); }
.badge-warning { background: rgba(245, 166, 35, 0.1); color: var(--status-warning); }
.badge-info { background: rgba(74, 158, 255, 0.1); color: var(--status-info); }
.badge-muted { background: var(--bg-hover); color: var(--text-muted); }

/* API Key display */
.key-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: var(--bg-deepest);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-default);
    color: var(--accent-amber);
    cursor: pointer;
    user-select: all;
}

.key-display:hover {
    border-color: var(--accent-amber);
    box-shadow: 0 0 8px rgba(255, 211, 105, 0.1);
}

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

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ================================================
   RESPONSIVE — TABLET
   ================================================ */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-grid {
        grid-template-columns: 1fr;
    }
    .panel-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   RESPONSIVE — MOBILE
   ================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }

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

    .main-content {
        margin-left: 0;
        padding: 0 16px 100px;
    }

    .top-bar {
        margin: 0 -16px;
        padding: 0 16px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 1.3rem;
    }

    .kpi-icon {
        font-size: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        max-height: 90vh;
        max-width: 100%;
    }

    table {
        font-size: 0.78rem;
    }

    thead th, tbody td {
        padding: 8px 10px;
    }
}

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

    .kpi-card {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .kpi-sub {
        position: relative;
        bottom: auto;
        right: auto;
    }
}
