/* ================= ADMIN LAYOUT ================= */

.admin-shell { display: flex; min-height: calc(100vh - 57px); }

/* sidebar */
.admin-sidebar {
  width: 224px; flex-shrink: 0; display: flex; flex-direction: column;
  padding: 20px 16px; background: var(--sidebar); min-height: calc(100vh - 57px);
}
.admin-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; margin-bottom: 28px; }
.admin-brand .box { width: 32px; height: 32px; border-radius: 8px; background: #2A3557; display: flex; align-items: center; justify-content: center; }
.admin-brand .box svg { color: white; }
.admin-brand .sub { font-size: 9px; color: #94A3C7; font-weight: 500; margin: 0; }
.admin-brand .main { font-size: 12px; color: white; font-weight: 700; margin: 0; }

.admin-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-radius: 12px; padding: 10px 12px; font-size: 12px; font-weight: 500; color: #9AA3BD;
}
.admin-nav a .left { display: flex; align-items: center; gap: 10px; }
.admin-nav a.active { background: var(--primary); color: white; }
.admin-nav a:hover:not(.active) { background: #1D2846; color: #ffffff; }
.admin-nav .count { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 2px 6px; background: var(--primary); color: white; }
.admin-nav a.active .count { background: white; color: var(--primary); }

.admin-logout { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 12px; font-size: 12px; font-weight: 500; color: #9AA3BD; background: none; border: none; width: 100%; text-align: left; box-sizing: border-box; }
.admin-logout:hover { color: white; background: #1D2846; }

/* main content */
.admin-main { flex: 1; display: flex; overflow: hidden; }
.admin-content { flex: 1; overflow-y: auto; padding: 24px 28px; }

.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.admin-header-row h1 { font-size: 18px; font-weight: 800; margin: 0; }
.date-pill { display: flex; align-items: center; gap: 6px; border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); color: var(--muted); }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { border-radius: 16px; padding: 16px; background: var(--card); border: 1px solid var(--border); }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-card .lbl { font-size: 12px; color: var(--muted); margin: 0; }
.stat-card .val { font-size: 24px; font-weight: 800; margin: 2px 0; }
.stat-card .sub { font-size: 10px; color: var(--muted); margin: 0; }

/* charts row */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card { border-radius: 16px; padding: 20px; background: var(--card); border: 1px solid var(--border); }
.chart-card .chart-title { font-size: 14px; font-weight: 700; margin: 0; }
.chart-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.chart-select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--ink); background: white; outline: none; }
.chart-select:hover { border-color: var(--primary); }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; flex-shrink: 0; width: 132px; height: 132px; border-radius: 999px; }
.donut .hole { position: absolute; inset: 24px; border-radius: 999px; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .hole .n { font-size: 18px; font-weight: 800; }
.donut .hole .l { font-size: 10px; color: var(--muted); }
.legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.legend-row .name { font-size: 11px; flex: 1; }
.legend-row .val { font-size: 11px; font-weight: 600; color: var(--muted); }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .name { font-size: 11px; width: 100px; flex-shrink: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; border-radius: 999px; background: var(--primary-light); }
.bar-fill { height: 10px; border-radius: 999px; background: var(--primary); }
.bar-row .val { font-size: 11px; font-weight: 600; width: 18px; text-align: right; }

/* table */
.table-card { border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.table-card .head { padding: 16px 20px; }
.table-card .head p { font-size: 14px; font-weight: 700; margin: 0; }
table.laporan-table { width: 100%; border-collapse: collapse; }
table.laporan-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table.laporan-table td { padding: 12px 20px; font-size: 12px; border-bottom: 1px solid var(--border); }
table.laporan-table tr.row-link { cursor: pointer; }
table.laporan-table tr.row-link:hover { background: #F8FAFF; }
td.nomor-cell { font-family: monospace; font-weight: 700; color: var(--primary); }
td.trunc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.table-footer-link { display: block; width: 100%; text-align: center; padding: 12px; font-size: 12px; font-weight: 600; color: var(--primary); border-top: 1px solid var(--border); background: none; border-left: none; border-right: none; border-bottom: none; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text], .toolbar select {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 12px; outline: none;
}
.toolbar .spacer { flex: 1; }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; font-size: 12px; font-weight: 600; background: white; color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-export { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 10px; padding: 9px 14px; font-size: 12px; font-weight: 600; background: var(--selesai); color: white; }

/* placeholder page */
.placeholder-card { border-radius: 16px; padding: 60px 20px; text-align: center; background: var(--card); border: 1px solid var(--border); }
.placeholder-card p.t { font-size: 14px; font-weight: 700; margin: 0; }
.placeholder-card p.d { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* detail slide panel */
.detail-panel { width: 400px; flex-shrink: 0; overflow-y: auto; padding: 24px; background: var(--card); border-left: 1px solid var(--border); }
.detail-panel .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.detail-panel .head p { font-size: 14px; font-weight: 700; margin: 0; }
.detail-panel .close-btn { background: none; border: none; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.detail-actions a, .detail-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px;
  padding: 8px; font-size: 11px; font-weight: 500; border: 1px solid var(--border); color: var(--ink); background: white;
}
.detail-section-title { font-size: 11px; font-weight: 700; margin: 0 0 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 16px; font-size: 11px; }
.detail-grid .lbl { color: var(--muted); margin: 0; }
.detail-grid .val { font-weight: 500; margin: 2px 0 0; }
.detail-block { padding-top: 16px; border-top: 1px solid var(--border); margin-bottom: 16px; }
.detail-block p.desc { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 0; }

.status-btn-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.status-btn { border: none; border-radius: 999px; padding: 6px 12px; font-size: 10px; font-weight: 700; }
.handled-by { font-size: 11px; color: var(--muted); }
.handled-by b { color: var(--ink); font-weight: 500; }

.riwayat-item { display: flex; gap: 8px; margin-bottom: 10px; }
.riwayat-dot-col { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.riwayat-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--primary); }
.riwayat-line { width: 1px; flex: 1; margin-top: 4px; background: var(--border); }
.riwayat-time { font-size: 10px; color: var(--muted); margin: 0; }
.riwayat-text { font-size: 11px; margin: 0; }

.note-form { display: flex; gap: 8px; margin-top: 8px; }
.note-form input { flex: 1; border-radius: 10px; padding: 9px 12px; font-size: 11px; border: 1px solid var(--border); outline: none; }
.note-form button { border-radius: 10px; padding: 0 14px; font-size: 11px; font-weight: 700; color: white; background: var(--primary); border: none; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 32px; }
.login-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-icon svg { color: var(--primary); }
.alert-error { background: var(--baru-bg); color: #B94A0B; border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 16px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .detail-panel { position: fixed; inset: 57px 0 0 0; width: auto; z-index: 50; }
}
