/* Stylesheet aplikasi. Dipisah dari HTML agar CSP tanpa unsafe-inline. */
:root {
    --primary: #1e293b;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #b91c1c;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.topbar { background: var(--primary); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.75rem; padding-bottom: 0.25rem; }
.brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.topbar nav { order: 3; display: flex; gap: 0.25rem; width: 100%; overflow-x: auto; white-space: nowrap; border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 0.4rem 0 0.5rem; }
.topbar nav a { color: #cbd5e1; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.92rem; }
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.topbar nav a.active { color: #fff; background: rgba(255, 255, 255, 0.16); }
.userbox { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.userbox small { color: #94a3b8; }
.userlink { color: #fff; }
.userlink:hover { text-decoration: underline; }
.page { flex: 1; padding: 2rem 1.25rem; width: 100%; }
@media (max-width: 700px) { .hide-sm { display: none; } }
.page-title { margin: 0 0 0.25rem; font-size: 1.6rem; }
.muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.card-box { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.card-box h2 { margin: 0 0 1rem; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; }
.stat .num { font-size: 1.9rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 0.9rem; }
.form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.9rem; }
.form input[type="text"], .form input[type="password"], .form input[type="number"], .form select {
    display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.7rem;
    border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-weight: 400; background: #fff;
}
.form input:focus, .form select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.form .check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.form .check input { width: 1rem; height: 1rem; }
.form .hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }
.actions { display: flex; gap: 0.5rem; align-items: center; }
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 0.55rem 1rem; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: #eff6ff; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #991b1b; }
.inline { display: inline; margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #e2e8f0; color: #334155; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: var(--danger); }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.92rem; border: 1px solid; }
.alert ul { margin: 0.25rem 0 0 1.1rem; padding: 0; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; }
.login-box h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.login-box-wide { max-width: 760px; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 700px) { .login-grid { grid-template-columns: 1fr; } }
.demo-panel { border-left: 1px solid var(--border); padding-left: 2rem; }
@media (max-width: 700px) { .demo-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.5rem; } }
.demo-title { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.demo-item { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; width: 100%; margin-bottom: 0.5rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.demo-item:hover { border-color: var(--accent); background: #eff6ff; }
.demo-item strong { display: block; font-size: 0.92rem; }
.demo-item small { color: var(--muted); font-size: 0.8rem; }
.demo-item code { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.form textarea { display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-weight: 400; background: #fff; min-height: 90px; }
.form textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; justify-content: space-between; margin: 1.25rem 0; }
.toolbar form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.toolbar label { font-size: 0.85rem; font-weight: 600; display: block; }
.toolbar input, .toolbar select { display: block; margin-top: 0.25rem; padding: 0.5rem 0.65rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-weight: 400; min-width: 200px; background: #fff; }
.thumb { width: 48px; height: 66px; object-fit: cover; border-radius: 4px; background: #e2e8f0; display: block; }
.cover-lg { width: 160px; height: 226px; object-fit: cover; border-radius: 8px; background: #e2e8f0; border: 1px solid var(--border); }
.detail { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 700px) { .detail { grid-template-columns: 1fr; } }
.meta { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 0.35rem 0.75rem; font-size: 0.92rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.row-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.row-form select { padding: 0.3rem 0.4rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.footer { border-top: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 0.85rem; text-align: center; padding: 1rem 0; }

@media (max-width: 700px) {
    .menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
    .menu-toggle:focus-visible + .menu-btn { outline: 2px solid #fff; outline-offset: 2px; }
    .topbar .brand { flex: 1 1 auto; font-size: 1.05rem; }
    .menu-btn { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; }
    .menu-btn:hover { background: rgba(255, 255, 255, 0.1); }
    .topbar nav { display: none; flex-direction: column; gap: 0; width: 100%; order: 4; padding: 0.25rem 0 0.5rem; white-space: normal; }
    .menu-toggle:checked ~ nav { display: flex; }
    .topbar nav a { padding: 0.7rem 0.75rem; border-radius: 6px; }
    .topbar { position: sticky; top: 0; z-index: 50; }
    .topbar-inner { padding-top: 0.5rem; padding-bottom: 0.5rem; min-height: 0; gap: 0.5rem; }
    .topbar .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar .userbox { display: none; }
    .menu-toggle:checked ~ .userbox { display: flex; order: 5; width: 100%; justify-content: space-between; padding: 0.5rem 0 0.25rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
    .card-table table, .card-table thead, .card-table tbody, .card-table tr, .card-table td { display: block; width: 100%; }
    .card-table thead { display: none; }
    .card-table tr { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; background: #fff; }
    .card-table td { border: 0; padding: 0.3rem 0; }
    .card-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; margin-bottom: 0.1rem; }
    .card-table td:empty { display: none; }
    .card-table td[data-label=""]::before { content: none; }
}

.theme-biru_tua .topbar { background: #1e3a8a; }
.theme-navy_aksen .topbar nav a.active { color: #60a5fa; background: transparent; box-shadow: inset 0 -2px 0 #60a5fa; border-radius: 0; }
.theme-putih .topbar { background: #ffffff; color: #0f172a; border-bottom: 1px solid var(--border); }
.theme-putih .brand, .theme-putih .userlink, .theme-putih .userbox { color: #0f172a; }
.theme-putih .userbox small { color: #64748b; }
.theme-putih .topbar nav { border-top: 1px solid var(--border); }
.theme-putih .topbar nav a { color: #475569; }
.theme-putih .topbar nav a:hover { color: #0f172a; background: #f1f5f9; }
.theme-putih .topbar nav a.active { color: #2563eb; background: transparent; box-shadow: inset 0 -2px 0 #2563eb; border-radius: 0; }
.theme-putih .topbar .btn-ghost { color: #0f172a; border-color: #cbd5e1; }
.theme-putih .topbar .btn-ghost:hover { background: #f1f5f9; }

/* Gaya dari atribut style statis */
.u1{margin-top:1.25rem}
.u2{margin:0 0 1rem; justify-content:flex-start}
.u3{justify-content:flex-start; margin:1.25rem 0 0.75rem}
.u4{margin-top:0.75rem}
.u5{margin-top:1rem}
.u6{margin-top:2rem; font-size:1.15rem}
.u7{margin-top:0.5rem}
.u8{font-weight:500}
.u9{margin:1.5rem 0 0.75rem; font-size:1rem}
.u10{margin-top:1rem; max-width: 760px}
.u11{margin-top:1.5rem}
.u12{margin:0}
.u13{margin:1rem 0 0}
.u14{width:100%}
.u15{max-width:560px}
.u16{justify-content:flex-start; margin:1.5rem 0 0.75rem}
.u17{width:130px; padding:0.3rem 0.4rem; border:1px solid #cbd5e1; border-radius:6px}
.u18{margin-top:1.25rem; max-width: 720px}
.u19{margin-top:1.5rem; max-width: 720px}
.u20{margin-top:0}
.u21{align-items:flex-start; padding:0.6rem 0.75rem; border:1px solid var(--border); border-radius:8px; margin-bottom:0.5rem; cursor:pointer}
.u22{font-weight:400; font-size:0.85rem}
.u23{margin-top:1.5rem; max-width: 720px; border-color:#fecaca}
.u24{margin-top:1rem; max-width: 520px}

/* Kelas untuk kondisi dinamis dan atribut yang sebelumnya inline */
.u-max520 { max-width: 520px; }
.u-thumbm { margin: 0.4rem 0; }
.u-radio { margin-top: 0.25rem; }
.stat-alert { border-color: #fecaca; }
.num-alert { color: var(--danger); }
.span-full { grid-column: 1 / -1; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #cbd5e1; margin-top: 0.2rem; }
.swatch-navy { background: #1e293b; }
.swatch-biru_tua { background: #1e3a8a; }
.swatch-putih { background: #ffffff; }
.swatch-navy_aksen { background: #60a5fa; }

.u-toolbar-start { justify-content: flex-start; }
.u-toolbar-top { margin: 1rem 0; }
.u-toolbar-gap { margin-top: 1rem; }

/* Error per kolom */
.field-error { display: block; color: var(--danger); font-size: 0.85rem; font-weight: 500; margin-top: 0.3rem; }
.form input[aria-invalid="true"], .form select[aria-invalid="true"], .form textarea[aria-invalid="true"] { border-color: var(--danger); }
.alert-error:focus { outline: 2px solid var(--danger); outline-offset: 2px; }

/* Target sentuh minimal 44px di layar kecil */
@media (max-width: 700px) {
    .btn, .btn-sm { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Teks kartu mobile: label 13px, isi 15px agar mudah dibaca */
@media (max-width: 700px) {
    .card-table td { font-size: 0.9375rem; }
    .card-table td::before { font-size: 0.8125rem; }
    .card-table .muted { font-size: 0.875rem; }
}

/* Tombol menu: hanya tampil di mobile, dan disesuaikan untuk tema putih */
@media (min-width: 701px) { .menu-toggle, .menu-btn { display: none; } }
.theme-putih .menu-btn { color: #0f172a; border-color: #cbd5e1; }
.theme-putih .menu-btn:hover { background: #f1f5f9; }

/* Kartu statistik: dua kolom di layar kecil */
@media (max-width: 700px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .stat { padding: 0.85rem; }
    .stat .num { font-size: 1.5rem; }
}

/* Perkenalan aplikasi di halaman login */
.login-intro { border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; padding-bottom: 1.25rem; }
.login-kicker { margin: 0 0 0.25rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.login-title { margin: 0 0 0.5rem; font-size: 1.5rem; }
.login-lead { margin: 0 0 0.75rem; color: var(--muted); }
.login-points { margin: 0; padding-left: 1.1rem; color: var(--text); font-size: 0.95rem; }
.login-points li { margin-bottom: 0.3rem; }

/* Keterangan reset otomatis di halaman login */
.login-reset { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-left: 3px solid var(--accent); font-size: 0.9rem; color: var(--text); }
