/* ===== Monitoring Legalitas — UI ===== */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6eaf0;
  --grid: #eceff3;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-l: #eff5ff;
  --sidebar: #0b1220;
  --sidebar-2: #1e293b;
  --sidebar-tx: #cbd5e1;
  --thead-bg: #f8fafc;
  --zebra: #fafbfc;
  --hover: #f1f6ff;
  --ring: rgba(37, 99, 235, .35);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 4px 8px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
h1, h3 { margin: 0; }
code { background: rgba(37,99,235,.08); color: var(--primary-d); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; background: linear-gradient(180deg, #0b1220 0%, #111a2e 100%); color: var(--sidebar-tx);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  border-right: 1px solid rgba(148, 163, 184, .1);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(148, 163, 184, .12); }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; display: block; object-fit: cover; box-shadow: 0 4px 12px rgba(11, 46, 99, .35); flex-shrink: 0; }
.brand-logo.big { font-size: 40px; width: auto; height: auto; background: none; box-shadow: none; }
.login-mark-logo img, .login-mobile-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-title { font-weight: 700; color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.nav { padding: 14px 12px; flex: 1; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px;
  color: var(--sidebar-tx); font-weight: 500; margin-bottom: 3px; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(148, 163, 184, .1); color: #fff; }
.nav-item.active { background: #2563eb; color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 99, 235, .35); }
.nav-ico { font-size: 17px; width: 22px; text-align: center; }
.nav-badge { margin-left: auto; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; text-align: center; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(148, 163, 184, .12); }
.user-box { margin-bottom: 10px; }
.user-name { color: #fff; font-weight: 600; }
.user-role { font-size: 12px; color: #94a3b8; }
.btn-logout { display: block; text-align: center; padding: 9px; border: 1px solid rgba(148, 163, 184, .2); border-radius: 9px; color: var(--sidebar-tx); font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.btn-logout:hover { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--card); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -.2px; margin: 0; }
.topbar-date { color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
/* Lonceng notifikasi kini memakai utility Tailwind (lihat views/layout/header.php). */
.page { padding: 22px 26px; flex: 1; }
.foot { padding: 14px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* ===== Cards / KPI ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card h3 { font-size: 15px; font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .16s ease, box-shadow .16s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.kpi-ico { font-size: 22px; }
.kpi-label { color: var(--muted); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }
.kpi-value { font-size: 27px; font-weight: 800; margin-top: 2px; letter-spacing: -.5px; }
.kpi-value span { font-size: 13px; font-weight: 600; color: var(--muted); }
.accent-blue::before { background: #2563eb; } .accent-green::before { background: #16a34a; }
.accent-orange::before { background: #f59e0b; } .accent-purple::before { background: #7c3aed; }
.accent-teal::before { background: #0d9488; } .accent-red::before { background: #dc2626; }

/* ===== Charts ===== */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.chart-card canvas { width: 100%; height: 170px; display: block; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }

/* ===== Dashboard profesional ===== */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head .dh-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.dash-head .dh-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.dash-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.dash-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 24px 0 12px; display: flex; align-items: center; gap: 9px; }
.dash-section-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; text-decoration: none; color: inherit; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: var(--zebra); color: var(--c, var(--primary)); }
.stat-meta { min-width: 0; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.panel-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel-head h3 { font-size: 14px; font-weight: 700; }

.status-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--zebra); margin: 14px 0 16px; }
.status-bar span { display: block; height: 100%; }
.status-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.status-legend .li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-legend .sq { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.status-legend .li b { font-weight: 800; font-variant-numeric: tabular-nums; }
.status-legend .li .lbl { color: var(--muted); }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; }
#gaugeKepatuhan { width: 124px; height: 124px; display: block; }
.gauge-cap { color: var(--muted); font-size: 12.5px; text-align: center; }

/* Sorotan (jatuh tempo terdekat, kelengkapan data, notifikasi WA) */
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .insight-grid { grid-template-columns: 1fr; } }
.mini-list { list-style: none; margin: 8px 0 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.mini-list li:last-child { border-bottom: none; }
.mini-list .ml-main { flex: 1; min-width: 0; }
.mini-list .ml-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .ml-sub { color: var(--muted); font-size: 12px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.wa-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ===== Filter bar ===== */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.filterbar label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; font-weight: 600; }
.filterbar input, .filterbar select, .grid-form input, .upload-form input[type=file] {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; background: var(--card); color: var(--text); font-family: inherit;
}
.filterbar input:focus, .filterbar select:focus, .grid-form input:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--primary); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; font-size: 14px; font-family: inherit; transition: background .15s, box-shadow .15s, transform .1s, border-color .15s, color .15s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .28); } .btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); box-shadow: 0 4px 14px rgba(37, 99, 235, .38); color: #fff; }
.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; box-shadow: 0 2px 8px rgba(22, 163, 74, .26); } .btn-success:hover { background: linear-gradient(135deg, #15803d, #166534); color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--hover); border-color: #c7d2fe; }
.btn-block { width: 100%; }
.btn-sm { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; font-size: 12px; font-weight: 600; border-radius: 8px; border: 1px solid var(--border); color: var(--text); background: var(--card); cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-sm:hover { background: var(--hover); border-color: #c7d2fe; color: var(--primary-d); }
.btn-sm:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-sm-danger { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.btn-sm-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.btn-danger { color: #dc2626; border-color: #fca5a5; background: var(--card); }
.btn-danger:hover { background: #fef2f2; }
/* Beri jarak antar tombol aksi kecil di dalam sel tabel */
.table td .btn-sm, .table td form { margin: 2px 3px 2px 0; }
.table td form { display: inline-block; }

/* ===== Tables ===== */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.card > .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table thead th { position: sticky; top: 0; z-index: 1; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; background: var(--hover); border-bottom: 1px solid var(--border); }
.table tbody tr, .table tbody td { transition: background .12s; }
/* Zebra selang-seling agar baris mudah dipindai (opt-out: <table class="table no-zebra">). */
.table tbody tr:nth-child(even) > td { background: var(--zebra); }
.table.no-zebra tbody tr > td { background: transparent; }
.table tbody tr:hover > td { background: var(--hover); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: none; }
.table td b { font-weight: 700; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* Form Pengaturan */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-form > label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.settings-form input[type=url], .settings-form input[type=password], .settings-form input[type=text] {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 14px; background: var(--card); color: var(--text); font-family: inherit; width: 100%;
}
.switch-row { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }
.input-key { display: flex; gap: 8px; align-items: center; }
.input-key input { flex: 1; }
.prompt-box { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.5; background: var(--bg); color: var(--text); resize: vertical; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.muted { color: var(--muted); font-weight: 400; }
.link { font-size: 13px; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.5; background: #eef2ff; color: #3730a3; text-transform: capitalize; white-space: nowrap; }
.badge-import { background: #dcfce7; color: #166534; }
.badge-manual { background: #fef3c7; color: #92400e; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-open { background: #fee2e2; color: #b91c1c; }
.status-proses { background: #ffedd5; color: #c2410c; }
.status-closed { background: #dcfce7; color: #166534; }

/* ===== Temuan panel ===== */
.temuan-counts { display: flex; gap: 10px; margin-bottom: 12px; }
.tc { flex: 1; text-align: center; border-radius: 9px; padding: 10px; font-size: 12px; font-weight: 600; }
.tc span { display: block; font-size: 22px; font-weight: 800; }
.tc-open { background: #fee2e2; color: #b91c1c; }
.tc-proses { background: #ffedd5; color: #c2410c; }
.tc-closed { background: #dcfce7; color: #166534; }
.temuan-list { list-style: none; margin: 0; padding: 0; }
.temuan-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.temuan-list li:last-child { border-bottom: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dot-open { background: #dc2626; } .dot-proses { background: #f97316; } .dot-closed { background: #16a34a; }
.t-judul { font-weight: 600; font-size: 13px; }
.t-meta { font-size: 12px; color: var(--muted); }
.muted-note { font-size: 12px; color: var(--muted); margin-top: 10px; font-style: italic; }

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border-radius: 11px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ===== Forms / modal ===== */
.upload-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.grid-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 5px; font-weight: 600; }
.grid-form input, .grid-form select, .grid-form textarea { border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font-size: 14px; background: var(--card); color: var(--text); font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.grid-form input:focus, .grid-form select:focus, .grid-form textarea:focus,
.filterbar input:focus, .filterbar select:focus, .settings-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 6px; }
@media (max-width: 640px) { .grid-form { grid-template-columns: 1fr; } }

.modal { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); z-index: 50; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal.open { display: flex; animation: modalFade .18s ease; }
.modal-card { background: var(--card); border-radius: 16px; padding: 24px; width: 640px; max-width: 100%; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: modalPop .2s cubic-bezier(.16,1,.3,1); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1; border-radius: 8px; width: 34px; height: 34px; transition: background .15s, color .15s; }
.modal-close:hover { background: var(--hover); color: var(--text); }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ===== Toast (feedback aksi + notif expired) ===== */
.toast-item { animation: slideInToast .28s cubic-bezier(.16,1,.3,1); }
.toast-item.toast-out { animation: slideOutToast .25s ease forwards; }
@keyframes slideInToast { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOutToast { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Login (senada dengan versi Next.js — split panel) ===== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--bg); }

/* Panel kiri — identitas produk, senada dengan sidebar aplikasi. */
.login-aside {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 46px 50px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: linear-gradient(155deg, var(--sidebar) 0%, var(--sidebar-2) 55%, #1e3a8a 130%);
  color: #e2e8f0;
}
.login-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(680px 420px at 88% 8%, rgba(59, 130, 246, .28), transparent 70%),
    radial-gradient(520px 380px at 5% 95%, rgba(13, 148, 136, .20), transparent 72%);
}
.login-aside::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
  mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
}
.login-mark { display: flex; align-items: center; gap: 12px; }
.login-mark-logo {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 23px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.login-mark-name { font-weight: 800; font-size: 15px; color: #f8fafc; letter-spacing: -.01em; }
.login-mark-sub { font-size: 12px; color: #94a3b8; margin-top: 1px; }
.login-headline { font-size: clamp(24px, 2.3vw, 33px); font-weight: 800; line-height: 1.28; letter-spacing: -.02em; margin: 0; color: #f8fafc; }
.login-lead { margin: 14px 0 0; max-width: 44ch; font-size: 14px; line-height: 1.7; color: #a8b6c9; }
.login-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 15px; max-width: 46ch; }
.login-point { display: flex; gap: 13px; align-items: flex-start; }
.login-point-ic {
  width: 35px; height: 35px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-size: 16px;
  background: rgba(59, 130, 246, .16); border: 1px solid rgba(96, 165, 250, .26);
}
.login-point-t { font-size: 13.5px; font-weight: 700; color: #f1f5f9; }
.login-point-d { font-size: 12.5px; line-height: 1.6; color: #94a3b8; margin-top: 2px; }
.login-foot { font-size: 12px; color: #7c8da5; }

/* Panel kanan — formulir. */
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--card); }
.login-card { width: 100%; max-width: 396px; }
.login-card-head { margin-bottom: 24px; }
.login-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--primary); }
.login-h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 9px 0 6px; }
.login-h1-sub { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.login-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 26px; }
.login-mobile-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: var(--primary-l); border: 1px solid var(--border);
}
.login-mobile-brand .login-mark-name { color: var(--text); }
.login-mobile-brand .login-mark-sub { color: var(--muted); }

.login-wrap .form-row { margin-bottom: 15px; }
.login-wrap .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.login-wrap .input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px;
  font-size: 14px; background: var(--card); color: var(--text); font-family: inherit;
}
.login-wrap .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.login-input-wrap { position: relative; }
.login-input-wrap .input { padding-right: 44px; }
.login-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; padding: 6px 8px; border-radius: 8px;
  font-size: 15px; line-height: 1; color: var(--muted);
}
.login-eye:hover { background: var(--hover); }
.login-hint { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; font-weight: 600; color: #b45309; }
.login-hint[hidden] { display: none; }
.login-submit { width: 100%; margin-top: 10px; padding: 12px 16px; font-size: 14.5px; border-radius: 11px; }
.login-err {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px;
  padding: 11px 13px; border-radius: 11px; font-size: 13px; line-height: 1.55;
  border: 1px solid #fca5a5; background: #fef2f2; color: #991b1b;
}
.login-note { margin: 20px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

:root[data-theme="dark"] .login-err { background: #2d0f10; border-color: #b91c1c; color: #fecaca; }
:root[data-theme="dark"] .login-hint { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-err { background: #2d0f10; border-color: #b91c1c; color: #fecaca; }
  :root:not([data-theme="light"]) .login-hint { color: #fbbf24; }
}

/* Layar sempit: panel kiri diganti kepala ringkas di atas formulir. */
@media (max-width: 940px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-mobile-brand { display: flex; }
  .login-panel { align-items: start; padding-top: 56px; }
}

/* ===== Dashboard FMS ===== */
.fms-banner { background: linear-gradient(120deg,#1e3a8a,#2563eb); color:#fff; border-radius:14px; padding:18px 22px; margin-bottom:18px; text-align:center; box-shadow:0 6px 18px rgba(37,99,235,.25); }
.fms-title { font-size:22px; font-weight:800; letter-spacing:.5px; }
.fms-sub { font-size:13px; opacity:.9; margin-top:3px; }
.section-title { font-size:14px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); margin:0 0 12px; }

/* Tabel YoY harian */
.yoy-table th, .yoy-table td { padding:4px 6px; font-size:11px; white-space:nowrap; }
.yoy-table .yoy-lbl { font-weight:700; position:sticky; left:0; background:var(--card); }
.yoy-table .yoy-pct td { color:var(--muted); }

/* Peta SPPBE */
.sppbe-map { position:relative; width:100%; aspect-ratio:16/9; background:url('../img/sulawesi.svg') center/contain no-repeat; margin:6px 0 4px; }
.map-marker { position:absolute; transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center; z-index:2; }
.map-dot { width:12px; height:12px; border-radius:50%; background:#2563eb; border:2px solid #fff; box-shadow:0 0 0 2px rgba(37,99,235,.35); }
.map-label { margin-top:2px; text-align:center; line-height:1.1; background:rgba(255,255,255,.9); border-radius:5px; padding:2px 5px; box-shadow:0 1px 3px rgba(0,0,0,.15); }
.map-label b { display:block; font-size:12px; color:#1d4ed8; }
.map-label small { font-size:8.5px; color:var(--muted); max-width:110px; display:block; }
.map-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; font-size:13px; color:var(--muted); padding:20px; }
.map-attr { text-align:right; font-size:9px; color:var(--muted); margin-top:-2px; }

/* Peta interaktif Leaflet */
#sppbeLeaflet { position:relative; height:460px; width:100%; border-radius:8px; z-index:0; margin:6px 0 4px; }
/* Label peta tanpa kotak (transparan) — teks putih dgn bayangan agar terbaca di citra satelit. */
.leaflet-tooltip.sppbe-tip { background:transparent; border:0; box-shadow:none; padding:0; font-size:11px; line-height:1.25; text-align:center; color:#fff; font-weight:600; text-shadow:0 0 3px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.9); white-space:nowrap; }
.leaflet-tooltip.sppbe-tip b { color:#fff; font-size:13px; }
/* Hilangkan panah/segitiga tooltip */
.leaflet-tooltip.sppbe-tip::before { display:none !important; }

/* Tombol mode peta (Satelit/Jalan/Hibrid) */
.map-mode-ctl { display:flex; background:#fff; border-radius:6px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.3); }
.map-mode-ctl button { border:0; background:#fff; color:#334155; font:600 12px system-ui,sans-serif; padding:5px 10px; cursor:pointer; border-left:1px solid #e5e7eb; }
.map-mode-ctl button:first-child { border-left:0; }
.map-mode-ctl button.active { background:#2563eb; color:#fff; }

/* Label saat ekspor: teks putih + garis penunjuk, tanpa kotak */
.sppbe-print-label { position:absolute; color:#fff; font:600 11px/1.2 system-ui,sans-serif; text-align:center; white-space:nowrap; text-shadow:0 0 3px #000,0 1px 2px #000,0 0 6px #000; }
.sppbe-print-label b { display:block; font-size:13px; color:#fff; }
.sppbe-print-line { stroke:#fff; stroke-width:1.4; opacity:.9; }

.export-bar { display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.export-lbl { font-size:13px; font-weight:600; color:var(--muted); }
.export-status { font-size:12px; color:var(--primary); font-style:italic; }

.ops-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; margin-bottom:20px; }
.ops-card { border-radius:14px; padding:18px 20px; color:#fff; box-shadow:0 4px 14px rgba(0,0,0,.10); }
.ops-blue { background:linear-gradient(135deg,#2563eb,#1d4ed8); }
.ops-green { background:linear-gradient(135deg,#16a34a,#15803d); }
.ops-orange { background:linear-gradient(135deg,#f59e0b,#d97706); }
.ops-teal { background:linear-gradient(135deg,#0d9488,#0f766e); }
.ops-label { font-size:12px; font-weight:700; letter-spacing:.6px; opacity:.92; }
.ops-value { font-size:30px; font-weight:800; margin:6px 0 2px; line-height:1; }
.ops-value span { font-size:14px; font-weight:600; opacity:.85; }
.ops-rerata { font-size:12px; opacity:.9; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px; }
@media (max-width:900px){ .grid-2 { grid-template-columns:1fr; } }

.prop-list { margin-top:12px; border-top:1px solid var(--border); }
.prop-row { display:flex; justify-content:space-between; padding:6px 2px; font-size:13px; border-bottom:1px solid var(--border); }
.prop-row b { color:var(--primary); }

.table.compact th, .table.compact td { padding:6px 8px; font-size:12px; }
.badge-go { background:#dcfce7; color:#166534; }
.badge-danger { background:#fee2e2; color:#991b1b; }
.pill { display:inline-block; padding:2px 9px; border-radius:20px; font-size:11px; font-weight:600; }
.pill-open { background:#fee2e2; color:#991b1b; }
.pill-proses { background:#ffedd5; color:#9a3412; }
.pill-closed { background:#dcfce7; color:#166534; }
.table tfoot td { font-weight:700; border-top:2px solid var(--border); background:rgba(37,99,235,.04); }

/* ===== Parity Next.js: panel title, legend, pill/tag, bar kepatuhan, baris SPPBE ===== */
.input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 14px; background: var(--card); color: var(--text); font-family: inherit; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.panel-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.status-legend .leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.status-legend .leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.status-legend .leg b { color: var(--text); font-variant-numeric: tabular-nums; }

.gauge-panel { display: flex; flex-direction: column; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; background: var(--border); color: var(--muted); }

.pctbar { width: 64px; height: 7px; border-radius: 999px; background: var(--border); overflow: hidden; display: inline-block; }
.pctbar-fill { display: block; height: 100%; border-radius: 999px; }

.caret { display: inline-block; transition: transform .15s; color: var(--muted); font-size: 11px; }
.caret.open { transform: rotate(90deg); }
.sppbe-head { cursor: pointer; }
.sppbe-head:hover { background: var(--hover); }
.sppbe-child { background: var(--hover); font-size: 12.5px; }
.sppbe-child td { border-bottom: 1px solid var(--border); }

/* Form pengajuan publik — tiap jenis dokumen jadi accordion agar ringkas */
.ajukan-doc { margin-bottom: 10px; padding: 13px 16px; transition: border-color .15s, box-shadow .15s; }
.ajukan-doc.filled { border-color: rgba(22, 163, 74, .55); box-shadow: 0 0 0 1px rgba(22, 163, 74, .18); }
.ajukan-head { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.ajukan-head:hover .caret { color: var(--primary); }
.ajukan-head:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 6px; }
.ajukan-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; min-width: 0; }
.ajukan-filled { color: #16a34a; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ajukan-doc.open .caret { transform: rotate(90deg); }
.ajukan-doc .ajukan-body { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.ajukan-doc.open .ajukan-body { display: grid; }

/* ===== Dark mode (ikut sistem, atau dipaksa lewat data-theme) ===== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --card: #111827; --text: #e5e7eb; --muted: #94a3b8;
    --border: #24303f; --grid: #1f2937;
    --primary-l: #16233c; --thead-bg: #0f1a2b; --zebra: #0f1826; --hover: #17243a;
    --ring: rgba(59, 130, 246, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 4px 14px rgba(0, 0, 0, .5); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --card: #111827; --text: #e5e7eb; --muted: #94a3b8;
  --border: #24303f; --grid: #1f2937;
  --primary-l: #16233c; --thead-bg: #0f1a2b; --zebra: #0f1826; --hover: #17243a;
  --ring: rgba(59, 130, 246, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-md: 0 4px 14px rgba(0, 0, 0, .5); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
}
/* Penyesuaian komponen mode gelap — berlaku baik ikut-sistem maupun paksa toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) code { background: rgba(37,99,235,.18); color: #93c5fd; }
  :root:not([data-theme="light"]) .badge { background: #1e293b; color: #c7d2fe; }
  :root:not([data-theme="light"]) .btn-ghost:hover, :root:not([data-theme="light"]) .btn-sm:hover { border-color: #334155; }
  :root:not([data-theme="light"]) .btn-danger:hover { background: #3f1d1d; }
  :root:not([data-theme="light"]) .alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
  :root:not([data-theme="light"]) .alert-danger { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.3); color: #fda4af; }
  :root:not([data-theme="light"]) .alert-info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #93c5fd; }
  :root:not([data-theme="light"]) .alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fcd34d; }
}
:root[data-theme="dark"] code { background: rgba(37,99,235,.18); color: #93c5fd; }
:root[data-theme="dark"] .badge { background: #1e293b; color: #c7d2fe; }
:root[data-theme="dark"] .btn-ghost:hover, :root[data-theme="dark"] .btn-sm:hover { border-color: #334155; }
:root[data-theme="dark"] .btn-danger:hover { background: #3f1d1d; }
:root[data-theme="dark"] .alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
:root[data-theme="dark"] .alert-danger { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.3); color: #fda4af; }
:root[data-theme="dark"] .alert-info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #93c5fd; }
:root[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fcd34d; }

/* ===== Topbar tools (cari, tema) + responsif HP ===== */
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hamburger { display: none; border: 1px solid var(--border); background: var(--card); color: var(--text); width: 38px; height: 38px; border-radius: 9px; font-size: 18px; cursor: pointer; }
.topsearch { position: relative; }
.topsearch input { border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 13px; background: var(--card); color: var(--text); font-family: inherit; width: 190px; transition: box-shadow .15s, border-color .15s; }
.topsearch input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.themebtn { border: 1px solid var(--border); background: var(--card); color: var(--text); width: 38px; height: 38px; border-radius: 9px; font-size: 17px; cursor: pointer; }
.themebtn:hover, .hamburger:hover { border-color: var(--primary); }
.themebtn:focus-visible, .hamburger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-overlay { display: none; }
@media (max-width: 860px) {
  .hamburger { display: inline-grid; place-items: center; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 50px rgba(0,0,0,.45); }
  .sidebar-overlay.open { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 55; }
  .topbar { padding: 16px 16px 8px; }
  .topbar h1 { font-size: 18px; }
  .topsearch input { width: 130px; }
  .page { padding: 12px 16px 24px; }
}
@media (max-width: 560px) {
  .topbar-date { display: none; }
  .topsearch { display: none; }
}

/* ===== Loading: progress bar atas, tombol, overlay ===== */
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar tipis di atas (muncul saat pindah halaman / submit). */
#nprogress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
#nprogress.active { opacity: 1; }
#nprogress .bar { height: 100%; width: 0; border-radius: 0 4px 4px 0; background: linear-gradient(90deg, var(--primary), #38bdf8); box-shadow: 0 0 10px rgba(56, 189, 248, .55), 0 0 4px rgba(37, 99, 235, .6); transition: width .25s ease; }

/* Tombol dalam keadaan memproses: spinner kecil sebelum label. */
.btn.is-loading, .btn-sm.is-loading { pointer-events: none; opacity: .9; }
.btn.is-loading::before, .btn-sm.is-loading::before {
  content: ""; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .6s linear infinite;
}
.btn-sm.is-loading::before { width: 12px; height: 12px; }

/* Overlay layar penuh (dipakai ekspor PNG/PDF). */
#loadOverlay { position: fixed; inset: 0; z-index: 250; display: none; place-items: center; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
#loadOverlay.show { display: grid; animation: modalFade .18s ease; }
#loadOverlay .lo-card { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 24px 32px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 190px; }
#loadOverlay .lo-spin { width: 42px; height: 42px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
#loadOverlay .lo-text { font-size: 13.5px; font-weight: 700; color: var(--text); }
#loadOverlay .lo-sub { font-size: 12px; color: var(--muted); margin-top: -6px; }

@media (prefers-reduced-motion: reduce) {
  #nprogress .bar { transition: width .4s linear; }
  .btn.is-loading::before, .btn-sm.is-loading::before, #loadOverlay .lo-spin { animation-duration: 1.4s; }
}

/* ===== Ikon SVG (menu, topbar, tombol) — pengganti emoji ===== */
.ic { flex-shrink: 0; }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 20px; }
.nav-ico svg { width: 19px; height: 19px; }
.themebtn, .hamburger { display: inline-grid; place-items: center; }
.themebtn svg { width: 18px; height: 18px; }
.hamburger svg { width: 22px; height: 22px; }
.btn-logout { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-logout svg { width: 15px; height: 15px; }
.bell-ic { display: inline-flex; align-items: center; line-height: 0; }
.topsearch-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: inline-flex; line-height: 0; }
.topsearch input { padding-left: 33px; }

/* ===== Modal konfirmasi (pengganti confirm() bawaan browser) ===== */
#confirmModal { align-items: center; }
#confirmModal .modal-card { width: 424px; max-width: 100%; text-align: center; padding: 26px 24px 22px; }
.confirm-ico { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; color: #d97706; background: rgba(217, 119, 6, .13); }
.confirm-ico svg { width: 30px; height: 30px; }
#confirmModal.is-danger .confirm-ico { color: #e11d48; background: rgba(225, 29, 72, .12); }
.confirm-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.confirm-msg { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; }
.confirm-ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.confirm-ok:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
#confirmModal.is-danger .confirm-ok { background: #e11d48; border-color: #e11d48; }
#confirmModal.is-danger .confirm-ok:hover { background: #be123c; border-color: #be123c; }

/* ===== Aksesibilitas: skip-link + fokus keyboard terlihat ===== */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 300; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); transform: translateY(-160%); transition: transform .15s ease; }
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; color: #fff; }
.content a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.nav-item:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
#mainContent:focus { outline: none; }
