/* ============================================================
   Portal Atzy — Tema Gelap (default) & Terang (data-theme="light")
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700&family=JetBrains+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #0E1217; --card: #161C23; --card2: #1C232C; --border: #242C36;
    --text: #E8ECF1; --muted: #93A0AE; --accent: #7C9CFF; --accent-text: #0A1230;
    --green: #46D69A; --green-bg: rgba(70,214,154,0.13);
    --red: #FF8585; --red-bg: rgba(255,133,133,0.13);
    --amber: #F2B84B; --amber-bg: rgba(242,184,75,0.14);
    --accent-bg: rgba(124,156,255,0.14);
    --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,0.2);
}
html[data-theme="light"] {
    --bg: #F4F5F7; --card: #FFFFFF; --card2: #F0F2F5; --border: #E2E5EA;
    --text: #12161C; --muted: #566170; --accent: #3B5BDB; --accent-text: #FFFFFF;
    --green: #0A7A52; --green-bg: #E2F5EC;
    --red: #B3261E; --red-bg: #FCE8E6;
    --amber: #855400; --amber-bg: #FFF1D0;
    --accent-bg: #E8EDFD;
    --shadow: 0 1px 2px rgba(16,24,40,0.05);
}
* { box-sizing: border-box; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
.mono { font-family: 'JetBrains Mono', monospace; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px; flex-shrink: 0; background: var(--card);
    border-right: 1px solid var(--border); padding: 22px 14px;
    display: flex; flex-direction: column; gap: 24px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
    color: var(--accent-text); display: flex; align-items: center; justify-content: center;
    font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 18px;
}
.sidebar-brand span { font-weight: 700; font-size: 19px; }
.nav-group-label { padding: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: var(--muted); }
.nav-link {
    display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
    border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 500;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--text); font-weight: 600; }
.nav-link.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.sidebar-footer {
    margin-top: auto; display: flex; align-items: center; gap: 12px;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--card2);
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.sidebar-footer .who { font-size: 13.5px; font-weight: 600; }
.sidebar-footer .sub { font-size: 12px; color: var(--muted); }
.main-content { flex: 1; min-width: 0; }
.mobile-topbar { display: none; }

.container { max-width: 1300px; margin: 0 auto; padding: 28px 32px; }
.page-title { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 6px; }
.page-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); font-size: 13px; }

.card {
    background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
    border-radius: var(--radius); padding: 20px;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-box {
    background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
    border-radius: var(--radius); padding: 16px 20px;
}
.stat-box .label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stat-box .value { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 30px; letter-spacing: -0.02em; }
.stat-box .value.green { color: var(--green); }
.stat-box .value.red { color: var(--red); }
.stat-box .value.amber { color: var(--amber); }

button, .btn {
    height: 40px; padding: 0 18px; border-radius: 10px; font-family: inherit;
    font-size: 13.5px; font-weight: 700; cursor: pointer; border: 0;
    background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); font-weight: 600; }
input[type=text], input[type=password], input[type=search], select, textarea {
    height: 42px; padding: 0 14px; background: var(--card2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-family: inherit; font-size: 14px;
}
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

.topbar { height: 64px; padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; gap: 16px; }
.icon-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; color: var(--text); font-size: 16px;
}

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; }
.badge.alive { background: var(--green-bg); color: var(--green); }
.badge.dead { background: var(--red-bg); color: var(--red); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.plain { background: var(--card2); color: var(--muted); }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--bg); }
.login-box {
    width: 100%; max-width: 340px; background: var(--card); border: 1px solid var(--border);
    padding: 36px 32px; border-radius: 20px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.login-logo {
    width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-text);
    display: flex; align-items: center; justify-content: center; font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700; font-size: 22px; margin-bottom: 4px;
}
.login-box h2 { margin: 0 0 8px; text-align: center; }
.login-box label { align-self: flex-start; }
.login-box input { width: 100%; }
.login-box button { width: 100%; margin-top: 8px; justify-content: center; }
.error { color: var(--red); font-size: 13px; background: var(--red-bg); padding: 10px 14px; border-radius: 10px; width: 100%; text-align: center; }
.alert { background: var(--green-bg); color: var(--green); padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; width: 260px; z-index: 50;
        transform: translateX(-100%); transition: transform 0.2s ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,0.3); }
    .mobile-topbar {
        display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px;
        background: var(--card); border-bottom: 1px solid var(--border);
    }
    .hamburger { width: 44px; height: 44px; background: transparent; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
    .mobile-title { font-weight: 700; font-size: 17px; }
    .container { padding: 16px; }
    .page-title { font-size: 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-box { padding: 12px 14px; }
    .stat-box .value { font-size: 22px; }
}
