/* ═══════════════════════════════════════════════════
   KuCoin Trading Bot — Premium Business Dashboard
   Institutional-grade dark/light trading UI
   ═══════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────── */
:root {
    /* Premium Dark Theme */
    --bg-0: #06080f;
    --bg-1: #0c1017;
    --bg-2: #111620;
    --bg-3: #171d2a;
    --bg-4: #1c2333;
    --bg-hover: #1a2135;
    --bg-input: #0e1219;
    --bg-glass: rgba(12, 16, 23, 0.85);
    --bg-overlay: rgba(3, 5, 10, 0.8);

    --border-0: rgba(255,255,255,0.03);
    --border-1: rgba(255,255,255,0.06);
    --border-2: rgba(255,255,255,0.09);
    --border-3: rgba(255,255,255,0.14);

    --text-0: #eef1f8;
    --text-1: #b8bdd0;
    --text-2: #7d849c;
    --text-3: #4d5470;
    --text-4: #353b50;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: #60a5fa;
    --accent-bg: rgba(59,130,246,0.08);
    --accent-bg-hover: rgba(59,130,246,0.14);
    --accent-border: rgba(59,130,246,0.2);
    --accent-glow: rgba(59,130,246,0.15);

    --green: #22c55e;
    --green-light: #4ade80;
    --green-bg: rgba(34,197,94,0.07);
    --green-border: rgba(34,197,94,0.16);
    --green-glow: 0 0 20px rgba(34,197,94,0.1);

    --red: #ef4444;
    --red-light: #f87171;
    --red-bg: rgba(239,68,68,0.07);
    --red-border: rgba(239,68,68,0.16);

    --amber: #eab308;
    --amber-bg: rgba(234,179,8,0.07);
    --amber-border: rgba(234,179,8,0.16);

    --purple: #a78bfa;
    --purple-bg: rgba(167,139,250,0.07);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 30px rgba(59,130,246,0.06);

    --sidebar-w: 256px;
    --topbar-h: 56px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    --radius-full: 9999px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --transition: 0.15s ease;
    --transition-slow: 0.25s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
    --bg-0: #f0f2f5;
    --bg-1: #ffffff;
    --bg-2: #ffffff;
    --bg-3: #f7f8fa;
    --bg-4: #eef0f4;
    --bg-hover: #f3f4f7;
    --bg-input: #f5f6f8;
    --bg-glass: rgba(255,255,255,0.9);
    --bg-overlay: rgba(0,0,0,0.5);
    --border-0: rgba(0,0,0,0.03);
    --border-1: rgba(0,0,0,0.06);
    --border-2: rgba(0,0,0,0.1);
    --border-3: rgba(0,0,0,0.14);
    --text-0: #0f1729;
    --text-1: #334155;
    --text-2: #64748b;
    --text-3: #94a3b8;
    --text-4: #cbd5e1;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --shadow-glow: none;
    --accent-bg: rgba(59,130,246,0.06);
    --accent-bg-hover: rgba(59,130,246,0.1);
    --green-bg: rgba(34,197,94,0.06);
    --red-bg: rgba(239,68,68,0.06);
    --amber-bg: rgba(234,179,8,0.06);
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-0);
    font-size: 13px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100%;
}

a { color: var(--accent-soft); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

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

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-1);
    border-right: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-1);
    height: var(--topbar-h);
}

.brand-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: white;
    flex-shrink: 0;
}
.brand-text h2 {
    font-size: 14px; font-weight: 700; color: var(--text-0);
    line-height: 1.2; letter-spacing: -0.2px;
}
.brand-sub {
    font-size: 10px; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500;
}

.nav-section { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-label {
    display: block;
    padding: 0 20px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-3);
    margin-top: 4px;
}

.nav-menu { list-style: none; }
.nav-menu li a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; margin: 1px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px; font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
}
.nav-menu li a svg { opacity: 0.5; transition: opacity var(--transition); flex-shrink: 0; }
.nav-menu li a:hover { color: var(--text-0); background: var(--bg-hover); }
.nav-menu li a:hover svg { opacity: 0.8; }
.nav-menu li.active a {
    color: var(--accent-soft);
    background: var(--accent-bg);
}
.nav-menu li.active a svg { opacity: 1; stroke: var(--accent-soft); }
.nav-menu li.active a::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-footer {
    border-top: 1px solid var(--border-1);
    padding: 12px 16px;
}
.sidebar-footer-inner {
    display: flex; align-items: center; justify-content: space-between;
}
.theme-toggle {
    background: var(--bg-3); border: 1px solid var(--border-1);
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); cursor: pointer; transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text-0); border-color: var(--border-2); background: var(--bg-4); }

/* ── Main Content ─────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--topbar-h);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-1);
    display: flex; align-items: center;
    padding: 0 24px; gap: 16px;
    position: sticky; top: 0; z-index: 50;
}
.top-bar h1 {
    font-size: 15px; font-weight: 600;
    letter-spacing: -0.2px;
}
.top-bar-left { flex: 1; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.top-bar-clock {
    font-size: 12px; font-weight: 500; color: var(--text-2);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    background: var(--bg-3); padding: 4px 10px;
    border-radius: var(--radius-xs); border: 1px solid var(--border-1);
}
.menu-toggle {
    display: none; background: none; border: none;
    color: var(--text-1); cursor: pointer; padding: 4px;
}

.content-area {
    padding: 20px 24px;
    flex: 1;
    max-width: 1440px;
}

/* ── Cards ────────────────────────────────────── */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-0);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-3);
}
.card-header h3 {
    font-size: 12px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.8px;
}
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 6px; }

/* ── Control Bar ──────────────────────────────── */
.control-bar {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap; gap: 12px;
}
.control-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.control-info {
    color: var(--text-3); font-size: 11px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ── Stats Grid ───────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.stat-label {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-3); margin-bottom: 8px;
}
.stat-value {
    font-size: 22px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    line-height: 1;
    font-family: var(--font);
}

/* ── Grid Layouts ─────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px; margin-bottom: 20px;
}
.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

/* ── Tables ────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 8px 14px; text-align: left;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-3);
    background: var(--bg-3);
    border-bottom: 1px solid var(--border-1);
    white-space: nowrap;
    position: sticky; top: 0;
}
.table td {
    padding: 10px 14px;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border-0);
    white-space: nowrap;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: var(--radius-xs);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.6;
}
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-gray { background: var(--bg-4); color: var(--text-2); border: 1px solid var(--border-2); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-accent { background: var(--accent-bg); color: var(--accent-soft); border: 1px solid var(--accent-border); }

.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: var(--radius-xs);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-badge.success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.status-badge.success::before { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
.status-badge.warning { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.status-badge.warning::before { background: var(--amber); }
.status-badge.danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.status-badge.danger::before { background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse-dot 1.5s infinite; }
.status-badge.info { background: var(--accent-bg); color: var(--accent-soft); border: 1px solid var(--accent-border); }
.status-badge.info::before { background: var(--accent-soft); }

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

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 14px; border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; white-space: nowrap;
    line-height: 1.4;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: var(--accent);
    color: white; border: none;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
    text-decoration: none;
}

.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.9; text-decoration: none; }
.btn-warning { background: var(--amber); color: #000; }
.btn-warning:hover { opacity: 0.9; text-decoration: none; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; text-decoration: none; }

.btn-outline {
    border: 1px solid var(--border-2); color: var(--text-1);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--accent); color: var(--accent-soft);
    background: var(--accent-bg); text-decoration: none;
}

.btn-ghost {
    background: transparent; border: none;
    color: var(--text-2); font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--radius-xs);
}
.btn-ghost:hover { color: var(--text-0); background: var(--bg-hover); text-decoration: none; }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* ── Forms ────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; margin-bottom: 5px;
    font-size: 11px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input {
    width: 100%; padding: 8px 12px;
    background: var(--bg-input); border: 1px solid var(--border-1);
    border-radius: var(--radius-sm); color: var(--text-0);
    font-family: var(--font); font-size: 13px;
    transition: all var(--transition);
}
.form-input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
    background: var(--bg-0);
}
.form-input::placeholder { color: var(--text-3); }
select.form-input { cursor: pointer; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Modal ────────────────────────────────────── */
.modal {
    position: fixed; inset: 0;
    background: var(--bg-overlay);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    width: 100%; max-width: 560px; max-height: 90vh;
    overflow-y: auto; box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border-1);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-3);
}
.modal-header h3 {
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-close {
    background: transparent; border: 1px solid var(--border-1);
    width: 28px; height: 28px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); font-size: 16px; cursor: pointer;
    transition: all var(--transition); line-height: 1;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px; border-top: 1px solid var(--border-1);
    display: flex; gap: 8px; justify-content: flex-end;
    background: var(--bg-3);
}

/* ── Alerts ───────────────────────────────────── */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
    border: 1px solid transparent;
}
.alert-error { background: var(--red-bg); color: var(--red-light); border-color: var(--red-border); }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.alert-success { background: var(--green-bg); color: var(--green-light); border-color: var(--green-border); }

/* ── Signals List ─────────────────────────────── */
.signals-list { display: flex; flex-direction: column; }
.signal-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border-0);
    font-size: 12px;
}
.signal-item:last-child { border-bottom: none; }
.signal-indicator {
    font-weight: 700; min-width: 60px;
    color: var(--accent-soft); font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-family: var(--font-mono);
}
.signal-pair { font-weight: 600; min-width: 85px; color: var(--text-0); font-size: 12px; }
.signal-time {
    color: var(--text-3); font-size: 10px; margin-left: auto;
    font-family: var(--font-mono);
}

/* ── Strategy Cards ───────────────────────────── */
.strategy-card { position: relative; }
.strategy-card .card-header { gap: 12px; }
.strategy-card .card-header h3 {
    font-size: 13px; text-transform: none; letter-spacing: 0;
    color: var(--text-0); font-weight: 600;
}
.strategy-info { display: flex; flex-direction: column; gap: 2px; }
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; padding: 5px 0;
    border-bottom: 1px solid var(--border-0);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-3); font-size: 11px; }
.info-value { font-weight: 500; color: var(--text-1); font-variant-numeric: tabular-nums; }
.info-list { display: flex; flex-direction: column; gap: 2px; }

/* ── Pagination ───────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border-0);
}
.pagination-info { color: var(--text-3); font-size: 12px; }

/* ── Utilities ────────────────────────────────── */
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

.code-block {
    display: block; background: var(--bg-0);
    padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-1);
    font-family: var(--font-mono);
    font-size: 11px; overflow-x: auto; word-break: break-all;
    margin-top: 8px; color: var(--text-1);
    line-height: 1.7;
}

canvas { width: 100% !important; border-radius: var(--radius-sm); }

/* ── Login Page ───────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: var(--bg-0);
    position: relative;
}
.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(59,130,246,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.login-container { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.login-box {
    background: var(--bg-2); border: 1px solid var(--border-1);
    border-radius: var(--radius); padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 {
    font-size: 20px; font-weight: 700;
    color: var(--text-0);
    letter-spacing: -0.3px;
    margin-top: 4px;
}
.login-header p {
    color: var(--text-3); font-size: 12px; margin-top: 4px;
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500;
}

/* ── Notification Toast ───────────────────────── */
.notification {
    position: fixed; top: 16px; right: 16px;
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 500; z-index: 300;
    max-width: 380px; color: white;
    box-shadow: var(--shadow-lg);
    animation: notifyIn 0.2s cubic-bezier(0.4,0,0.2,1);
    border: 1px solid rgba(255,255,255,0.1);
}
@keyframes notifyIn {
    from { transform: translateX(100%) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}
.notification-error { background: var(--red); }
.notification-success { background: var(--green); }
.notification-info { background: var(--accent); }

/* ── Section Dividers ─────────────────────────── */
.section-title {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-3);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-0);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

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

@media (max-width: 1024px) {
    :root { --sidebar-w: 240px; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }

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

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 14px; }
    .stat-value { font-size: 18px; }

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

    .control-bar { flex-direction: column; align-items: stretch; padding: 12px 14px; }
    .control-group { justify-content: center; }
    .control-info { text-align: center; }

    .table th, .table td { padding: 6px 10px; font-size: 11px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .modal-content { margin: 10px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-card { padding: 10px 12px; }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 9px; }

    .top-bar h1 { font-size: 14px; }
    .top-bar-clock { display: none; }

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

    .login-box { padding: 28px 22px; }
    .login-header h1 { font-size: 18px; }

    .card-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .card-actions { width: 100%; }
}

@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-area { padding: 10px; }
}
