@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.ttf') format('truetype');
}

/* Sistem tampilan Sakuci cPanel.
   Satu berkas untuk semua halaman -- sebelumnya tiap halaman membawa <style>
   sendiri, dan itulah sebab tampilannya tidak pernah terasa satu kesatuan. */

:root {
    /* Tema Elegan Clean & Latar Biru Modern */
    --bg:        #f8fafc;
    --surface:   #ffffff;
    --sidebar:   #0b1329;   /* Deep Midnight Blue */
    --sidebar-2: #162447;   /* Navy slate untuk hover & active */

    --line:      #e2e8f0;
    --line-soft: #f1f5f9;

    --ink:       #0f172a;
    --ink-2:     #475569;
    --ink-3:     #94a3b8;
    --ink-inv:   #f8fafc;

    --accent:    #2563eb;   /* Biru Elegan Royal Blue */
    --accent-2:  #1d4ed8;   /* Biru Hover */
    --accent-bg: #eff6ff;   /* Latar Biru Lembut */

    --danger:    #dc2626;
    --danger-bg: #fef2f2;
    --warn:      #d97706;
    --warn-bg:   #fffbeb;

    --r:   8px;
    --r-l: 12px;

    --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
    font-family: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", monospace;
    font-size: .86em;
}

/* ---------- Kerangka: sidebar tetap + area isi ---------- */

.shell { display: flex; min-height: 100vh; }

.side {
    width: 238px;
    flex: none;
    background: var(--sidebar);
    color: var(--ink-inv);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.side-brand {
    padding: 1.4rem 1.35rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand strong { display: block; font-size: .97rem; font-weight: 600; letter-spacing: -.01em; }
.side-brand span { display: block; font-size: .74rem; color: #7d8496; margin-top: .1rem; }

.side-nav { padding: .85rem .7rem; flex: 1; }
.side-nav a {
    display: flex; align-items: center; gap: .65rem;
    padding: .58rem .68rem;
    margin-bottom: .12rem;
    border-radius: var(--r);
    color: #aeb5c6;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 450;
    transition: background .12s, color .12s;
}
.side-nav a:hover { background: var(--sidebar-2); color: #e8eaf0; }
.side-nav a.on { background: var(--sidebar-2); color: #fff; font-weight: 550; }
.side-nav a.on svg { color: var(--accent); }
.side-nav svg { width: 16px; height: 16px; flex: none; color: #6f7789; }

.side-foot {
    padding: .9rem 1.05rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.side-user { min-width: 0; }
.side-user b { display: block; font-size: .82rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user span { font-size: .71rem; color: #7d8496; }
.side-foot a { color: #7d8496; display: flex; }
.side-foot a:hover { color: #d9534f; }
.side-foot svg { width: 16px; height: 16px; }

.main { flex: 1; min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 1.15rem 2rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}
.topbar h1 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.015em; }
.topbar p { font-size: .82rem; color: var(--ink-2); margin-top: .1rem; }

.wrap { padding: 1.6rem 2rem 3rem; max-width: 1180px; }

/* ---------- Kartu ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    box-shadow: var(--shadow);
    margin-bottom: 1.15rem;
}
.card-h {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-h h2 { font-size: .93rem; font-weight: 600; letter-spacing: -.01em; }
.card-h p { font-size: .8rem; color: var(--ink-2); margin-top: .08rem; }
.card-b { padding: 1.25rem; }
.card-b.flush { padding: 0; }

/* ---------- Ringkasan angka ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.15rem; }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    padding: 1.05rem 1.2rem;
    box-shadow: var(--shadow);
}
.stat-n { font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.stat-l { font-size: .78rem; color: var(--ink-2); margin-top: .2rem; text-transform: uppercase; letter-spacing: .045em; font-weight: 550; }

/* ---------- Tombol ---------- */

.btn {
    display: inline-flex; align-items: center; gap: .42rem;
    padding: .5rem .95rem;
    border: 1px solid transparent;
    border-radius: var(--r);
    background: var(--accent);
    color: #fff;
    font-family: inherit; font-size: .84rem; font-weight: 550;
    line-height: 1.4;
    cursor: pointer; text-decoration: none;
    transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }

.btn-2 { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-2:hover:not(:disabled) { background: var(--line-soft); border-color: #d3d8e0; }

.btn-danger { background: var(--surface); color: var(--danger); border-color: #e8cdca; }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }

.btn-sm { padding: .35rem .7rem; font-size: .79rem; }

/* ---------- Isian ---------- */

.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: .82rem; font-weight: 550; margin-bottom: .34rem; color: var(--ink); }
.hint { font-size: .78rem; color: var(--ink-3); margin-top: .3rem; }

input[type=text], input[type=url], input[type=password], input[type=email], select, textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    font-family: inherit; font-size: .875rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
input[type=file] { font-size: .8rem; }

.row { display: flex; gap: .85rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 12rem; }
.row > .row-fix { flex: 0 0 auto; }

/* ---------- Pesan ---------- */

.note {
    padding: .72rem .95rem;
    border-radius: var(--r);
    border: 1px solid;
    margin-bottom: 1.15rem;
    font-size: .86rem;
}
.note-ok   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.note-err  { background: var(--danger-bg); border-color: #eecac6; color: #7d281f; }
.note-warn { background: var(--warn-bg);   border-color: #ecd9b0; color: #6d4710; }
.note code { background: rgba(255,255,255,.65); padding: .1rem .35rem; border-radius: 3px; }

/* ---------- Tabel ---------- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .68rem 1.25rem; border-bottom: 1px solid var(--line-soft); font-size: .86rem; }
th {
    background: #fbfbfc; color: var(--ink-2);
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfcfd; }
td a { color: var(--ink); text-decoration: none; }
td a:hover { color: var(--accent); }
.num { text-align: right; white-space: nowrap; }
.dim { color: var(--ink-3); }

/* ---------- Label kecil ---------- */

.pill {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .71rem; font-weight: 600;
    letter-spacing: .015em;
}
.pill-accent { background: var(--accent-bg); color: var(--accent-2); }
.pill-warn   { background: var(--warn-bg);   color: var(--warn); }
.pill-ok     { background: #ecfdf5; color: #065f46; }
.pill-mute   { background: var(--line-soft); color: var(--ink-2); }

.dot-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
    flex-shrink: 0;
}
.dot-offline {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-3);
    opacity: 0.45;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}
.pulse-online {
    animation: pulse-dot 2.5s infinite ease-in-out;
}

/* ---------- Keadaan kosong ---------- */

.empty { padding: 2.6rem 1.25rem; text-align: center; }
.empty p { color: var(--ink-2); font-size: .88rem; }
.empty .btn { margin-top: .9rem; }

/* ---------- Kaki halaman ---------- */

.kaki {
    padding: 1.15rem 2rem 1.6rem;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: .78rem;
    letter-spacing: .01em;
}

/* ---------- Layar sempit ---------- */

@media (max-width: 820px) {
    .shell { flex-direction: column; }
    .side { width: 100%; height: auto; position: static; }
    .side-nav { display: flex; gap: .2rem; overflow-x: auto; padding: .5rem; }
    .side-nav a { white-space: nowrap; margin-bottom: 0; }
    .wrap, .topbar, .kaki { padding-left: 1.1rem; padding-right: 1.1rem; }
}
