* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #f8f9ff; color: #0b1c30; overflow: hidden; font-family: 'Inter', sans-serif; }

/* ==== Login Page ==== */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; margin: 0; padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #3498db 100%);
}
.login-wrapper { width: 100%; max-width: 400px; }
.login-box {
    background: #fff; padding: 36px 32px 24px;
    border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
    animation: fadeInUp .4s ease;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.login-header { text-align: center; margin-bottom: 24px; }
.login-logo {
    width: 60px; height: 60px; margin: 0 auto 12px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: #fff; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px; letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(52,152,219,.35);
}
.login-header h2 { margin: 0; font-size: 19px; color: #2c3e50; font-weight: 700; }
.login-sub { margin: 4px 0 0; font-size: 13px; color: #7f8c8d; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #34495e; margin-bottom: 6px; }
.form-group input[type=text], .form-group input[type=password] {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid #dfe6ec; border-radius: 8px;
    font-size: 14px; color: #2c3e50; transition: all .15s;
    background: #fbfcfd;
}
.form-group input:focus {
    outline: none; border-color: #3498db; background: #fff;
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}
.input-password { position: relative; }
.input-password input { padding-right: 42px !important; }
.btn-toggle-pass {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; font-size: 16px; cursor: pointer;
    padding: 6px 10px; border-radius: 6px; color: #7f8c8d;
}
.btn-toggle-pass:hover { background: #f0f3f6; }
.form-check { margin-top: -4px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #34495e; cursor: pointer; }
.checkbox-label input { width: 15px; height: 15px; accent-color: #3498db; }

.btn-login {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 0; color: #fff; border-radius: 8px; cursor: pointer;
    font-weight: 700; font-size: 14px; letter-spacing: .3px;
    box-shadow: 0 6px 16px rgba(52,152,219,.35);
    transition: transform .1s, box-shadow .15s;
}
.btn-login:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(52,152,219,.45); }
.btn-login:disabled { opacity: .7; cursor: wait; }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; line-height: 1.4; }
.alert-error { background: #fdecea; color: #b71c1c; border-left: 3px solid #e74c3c; }
.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 3px solid #27ae60; }

.login-footer { text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid #eef2f5; color: #95a5a6; font-size: 12px; }

/* ==== Topbar ==== */
.topbar { background: #131b2e; color: #fff; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #0051d5; }
.topbar h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 17px; letter-spacing: -.01em; margin: 0; }
.topbar h1::before { content: 'AM'; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 7px; background: #316bf3; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 10px; vertical-align: middle; }
.btn-logout { color: #dbe1ff; background: transparent; border: 1px solid #3f4d6c; padding: 7px 12px; border-radius: 4px; text-decoration: none; margin-left: 12px; font-size: 12px; font-weight: 600; }
.btn-logout:hover { color: #fff; border-color: #8ca9ff; background: rgba(255,255,255,.06); }

/* ==== Layout ==== */
.container { padding: 22px 28px 16px; max-width: 1680px; margin: 0 auto; height: calc(100vh - 61px); display: flex; flex-direction: column; overflow: hidden; }
.card { background: #fff; padding: 20px; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 1px 3px rgba(15,23,42,.05); margin-bottom: 14px; }
.identity { padding: 18px 22px; position: relative; overflow: hidden; }
.identity::after { content: ''; position: absolute; right: -55px; top: -80px; width: 210px; height: 210px; border-radius: 50%; background: #eff4ff; }
.identity h2 { position: relative; z-index: 1; margin: 0 0 8px; color: #0b1c30; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; }
.identity p { position: relative; z-index: 1; display: inline-block; margin: 4px 18px 0 0; font-size: 12px; color: #64748b; }
.identity strong { color: #0b1c30; }
.admin-filter-card { padding: 14px 20px; }
.admin-filter-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-filter-form { display: flex; align-items: center; gap: 10px; }
.admin-filter-form label { font-weight: 600; color: #45464d; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.admin-filter-form select {
    padding: 9px 12px; border: 1px solid #dfe6ec; border-radius: 8px;
    background: #eff4ff; color: #0b1c30; font-size: 12px; min-width: 180px; outline: none;
}
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }
.chart-card { text-align: center; padding: 16px 18px; }
.chart-card h3 { margin: 0 0 10px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; color: #0b1c30; }
.gauge-wrap { position: relative; height: 64px; width: 100%; max-width: 210px; margin: 0 auto; }
.chart-label { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #0b1c30; margin-top: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ==== Tabs ==== */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; border-bottom: 1px solid #dce9ff; }
.tab { padding: 10px 16px; background: transparent; color: #64748b; border-radius: 4px 4px 0 0; text-decoration: none; font-weight: 600; font-size: 12px; transition: .15s; }
.tab:hover { color: #0051d5; background: #eff4ff; }
.tab.active { background: #316bf3; color: #fff; }

/* ==== Table ==== */
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid #eff4ff; text-align: left; white-space: nowrap; }
.data-table .numeric-cell { text-align: right; }
.data-table th { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.data-table thead th { background: #000; color: #fff; font-weight: 700; position: sticky; top: 0; z-index: 1; pointer-events: none; }
.data-table tbody tr:nth-child(even) { background: #fbfcff; }
.data-table tbody tr:hover { background: #eff6ff; }

/* ==== Buttons ==== */
.btn-edit { background: #eff4ff; color: #0051d5; border: 1px solid #dbe1ff; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; }
.btn-edit:hover { background: #316bf3; color: #fff; }

/* ==== Modal ==== */
.modal { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(4px); align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #fff; padding: 24px; border: 1px solid #e2e8f0; border-radius: 12px; width: 420px; max-width: 90%; box-shadow: 0 20px 25px -5px rgba(15,23,42,.15); }
.modal-content h3 { margin: 0 0 12px; }
.modal-content textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.modal-actions button { padding: 8px 16px; border: 0; border-radius: 6px; cursor: pointer; font-weight: 600; }
.modal-actions button[type=button] { background: #ecf0f1; }
.modal-actions button[type=submit] { background: #27ae60; color: #fff; }

.tab-content { flex: 1; overflow: auto; max-height: none; padding: 14px; min-height: 0; background: #fff; }

.tab-screen-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 4px 2px 16px; border-bottom: 1px solid #eff4ff; margin-bottom: 12px; }
.tab-breadcrumb { color: #64748b; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tab-breadcrumb span { color: #b4c5ff; padding: 0 5px; }
.tab-screen-header h2 { margin: 5px 0 3px; color: #0b1c30; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; line-height: 1.3; }
.tab-screen-header p { margin: 0; color: #64748b; font-size: 12px; }
.tab-status-badge { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 6px 9px; border-radius: 999px; background: #ecfdf5; color: #065f46; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tab-status-badge > span { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.tab-status-muted { background: #eff4ff; color: #45464d; }
.tab-status-muted > span { background: #64748b; }

@media (max-width: 700px) {
    .topbar { padding: 12px 16px; }
    .topbar h1 { font-size: 14px; }
    .container { padding: 14px 12px 10px; }
    .identity p { display: block; }
    .charts-row { gap: 10px; }
    .tab { padding: 9px 10px; font-size: 11px; }
    .tab-screen-header { flex-direction: column; gap: 10px; }
    .tab-screen-header h2 { font-size: 18px; }
}