@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --navy: #0f1f3d;
    --navy-dark: #080f1e;
    --navy-mid: #162847;
    --navy-light: #1e3a5f;
    --blue: #1a56db;
    --blue-light: #3b82f6;
    --accent: #06b6d4;
    --accent2: #10b981;
    --gold: #f59e0b;
    --red: #ef4444;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --sidebar-w: 260px;
    --topbar-h: 65px;
    --radius: 14px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-100);
    color: #1e293b;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--navy-dark);
    display: flex; flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute; top: -100px; right: -80px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(26,86,219,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex; align-items: center; gap: 12px;
}

.sidebar-logo img {
    width: 44px; height: 44px; border-radius: 10px;
    object-fit: contain;
}

.logo-text { flex: 1; }
.logo-text h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px; font-weight: 700;
    color: var(--white); line-height: 1.2;
}
.logo-text p {
    font-size: 10px; color: var(--accent);
    font-weight: 500; letter-spacing: 0.5px;
    text-transform: uppercase; margin-top: 2px;
}

.sidebar-menu {
    flex: 1; padding: 20px 12px;
    overflow-y: auto;
}

.menu-label {
    font-size: 10px; font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase; letter-spacing: 1px;
    padding: 0 10px; margin: 16px 0 8px;
}

.menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.2s; margin-bottom: 3px;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.07);
    color: var(--white);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(26,86,219,0.4);
}

.menu-item i { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.05);
}

.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: white; font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.user-info { flex: 1; }
.user-info p { font-size: 12px; font-weight: 600; color: white; }
.user-info span { font-size: 10px; color: var(--accent); font-weight: 500; }

.logout-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(239,68,68,0.15); color: #ef4444;
    text-decoration: none; font-size: 14px;
    transition: all 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.3); }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center;
    padding: 0 28px; gap: 16px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.topbar-title { flex: 1; }
.topbar-title h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px; font-weight: 700; color: var(--navy);
}
.topbar-title p { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

.topbar-date {
    background: var(--navy);
    color: white; font-size: 12px; font-weight: 500;
    padding: 7px 14px; border-radius: 8px;
    display: flex; align-items: center; gap: 6px;
}

.page-body { padding: 28px; flex: 1; }

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px; margin-bottom: 28px;
}

.stat-card {
    background: white; border-radius: var(--radius);
    padding: 22px; position: relative; overflow: hidden;
    box-shadow: var(--shadow); transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-card::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.blue::after { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.stat-card.cyan::after { background: linear-gradient(90deg, var(--accent), #22d3ee); }
.stat-card.green::after { background: linear-gradient(90deg, var(--accent2), #34d399); }
.stat-card.gold::after { background: linear-gradient(90deg, var(--gold), #fbbf24); }

.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 14px;
}
.stat-card.blue .stat-icon { background: rgba(26,86,219,0.1); color: var(--blue); }
.stat-card.cyan .stat-icon { background: rgba(6,182,212,0.1); color: var(--accent); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.1); color: var(--accent2); }
.stat-card.gold .stat-icon { background: rgba(245,158,11,0.1); color: var(--gold); }

.stat-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 30px; font-weight: 800; color: var(--navy);
    line-height: 1;
}
.stat-label { font-size: 12.5px; color: var(--gray-400); margin-top: 4px; font-weight: 500; }

/* ===== CARDS ===== */
.card {
    background: white; border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
}

.card-header h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px; font-weight: 700; color: var(--navy);
    display: flex; align-items: center; gap: 8px;
}

.card-header h3 i { color: var(--blue); }

.card-body { padding: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%; border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: var(--navy);
    color: white; font-weight: 600;
    padding: 12px 16px; text-align: left;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px; letter-spacing: 0.3px;
}

thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child { border-radius: 0 8px 0 0; }

tbody tr { border-bottom: 1px solid var(--gray-200); transition: background 0.15s; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 16px; color: #334155; }

/* ===== BADGE ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600;
}
.badge-blue { background: rgba(26,86,219,0.1); color: var(--blue); }
.badge-green { background: rgba(16,185,129,0.1); color: var(--accent2); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--red); }
.badge-gold { background: rgba(245,158,11,0.1); color: var(--gold); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 9px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; text-decoration: none; transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
}
.btn-primary {
    background: var(--blue); color: white;
}
.btn-primary:hover { background: #1648c0; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,86,219,0.4); }
.btn-success { background: var(--accent2); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline {
    background: transparent; border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--navy); margin-bottom: 6px;
}
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--gray-200); border-radius: 9px;
    font-size: 13.5px; font-family: 'DM Sans', sans-serif;
    color: #334155; transition: border 0.2s;
    background: white;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }

/* ===== ALERT ===== */
.alert {
    padding: 12px 16px; border-radius: 9px;
    font-size: 13.5px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; border-left: 3px solid var(--accent2); }
.alert-danger { background: rgba(239,68,68,0.1); color: #991b1b; border-left: 3px solid var(--red); }

/* ===== SMA TABLE HIGHLIGHT ===== */
.sma-up { color: var(--red); font-weight: 700; }
.sma-down { color: var(--accent2); font-weight: 700; }
.sma-stable { color: var(--gold); font-weight: 700; }

/* ===== MODAL ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 200;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: white; border-radius: 16px;
    padding: 28px; width: 480px; max-width: 95vw;
    box-shadow: var(--shadow-lg);
}
.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px; font-weight: 700; color: var(--navy);
    margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.modal-title i { color: var(--blue); }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy-dark);
    position: relative; overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute; top: -200px; left: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(26,86,219,0.2) 0%, transparent 60%);
}

.login-page::after {
    content: '';
    position: absolute; bottom: -200px; right: -100px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 60%);
}

.login-card {
    background: white; border-radius: 20px;
    padding: 44px 40px; width: 420px; max-width: 95vw;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
    position: relative; z-index: 1;
}

.login-logo {
    text-align: center; margin-bottom: 32px;
}

.login-logo img {
    width: 70px; height: 70px; margin-bottom: 12px;
}

.login-logo h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px; font-weight: 800; color: var(--navy);
}

.login-logo p { font-size: 12.5px; color: var(--gray-400); margin-top: 4px; }

.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0;
}
.login-divider span { font-size: 12px; color: var(--gray-400); white-space: nowrap; }
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

.btn-login {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    color: white; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s; letter-spacing: 0.3px;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,86,219,0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.badge-green {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    display: inline-block;
}
.badge-red {
    background: rgba(239,68,68,0.12);
    color: #dc2626;
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    display: inline-block;
}
