:root {
  --sidebar-width: 292px;
  --sidebar-bg: #0f172a;
  --sidebar-fg: #dbe4f0;
  --sidebar-muted: #93a4b8;
  --content-bg: #f6f8fb;
  --soft-line: rgba(148, 163, 184, .16);
}
html, body { height: 100%; }
body { background: var(--content-bg); color: #1f2937; font-size: .92rem; }
a { text-decoration: none; }
.login-page-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, .14), transparent 32%),
    #f7f9fc;
}
.login-card {
  width: min(100%, 372px);
  max-width: 372px;
  overflow: hidden;
  border-radius: 24px;
}
.login-card .card-body { padding: 30px 28px !important; }
.login-card .form-control-lg {
  font-size: 1rem;
  min-height: 46px;
  border-radius: 13px;
}
.login-card .btn-lg {
  font-size: 1rem;
  min-height: 46px;
  border-radius: 13px;
}
.login-author { background: #fff; font-size: 11px; }
.app-shell { min-height: 100vh; display: flex; overflow: hidden; }
.app-sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width); max-width: var(--sidebar-width);
  background: linear-gradient(180deg, #111c32 0%, #0f172a 100%);
  color: var(--sidebar-fg); height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 18px 15px 10px; }
.sidebar-author { padding: 8px 14px; font-size: 10px; line-height: 1.2; color: var(--sidebar-muted); border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.app-content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; padding: 26px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: .2px; color: #fff; margin-bottom: 14px; padding: 8px 8px; }
.sidebar-group { margin-bottom: 7px; }
.sidebar-group-toggle {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: #edf4ff; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: 10px 13px; font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .045em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(2,6,23,.08);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.sidebar-group-toggle:hover { background: rgba(255,255,255,.115); border-color: rgba(255,255,255,.16); transform: translateY(-1px); }
.sidebar-group-toggle.collapsed { color: var(--sidebar-muted); background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.055); box-shadow: none; }
.sidebar-group-toggle .bi-chevron-down { transition: transform .18s ease; }
.sidebar-group-toggle:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }
.sidebar-subnav { padding: 7px 0 9px 8px; }
.nav-link { color: var(--sidebar-fg); border-radius: 14px; padding: 8px 12px; margin: 2px 0; font-size: 14px; display: flex; align-items: center; min-height: 38px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(91,141,239,.22); }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid rgba(15,23,42,.06); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 22px rgba(17,24,39,.05); }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.card-kpi { border: 0; border-radius: 16px; box-shadow: 0 12px 30px rgba(17,24,39,.08); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: .84rem; }
/* Data tables yang dibungkus `.table-responsive` selalu dipaksa selebar
   konten naturalnya (max-content) DAN punya fallback explicit min-width
   sehingga horizontal scroll konsisten trigger di viewport sempit
   (mobile/tablet/sidebar narrow), bukan mengkompresi kolom dan membuat
   header/teks wrap. Summary tables (di luar `.table-responsive`) tidak
   terkena rule ini sehingga tetap bisa wrap di card sempit. */
.table-responsive > .table,
.card-body.table-responsive .table {
    min-width: max-content;
}
@supports not (min-width: max-content) {
    .table-responsive > .table,
    .card-body.table-responsive .table {
        min-width: 720px;
    }
}
.table.table-sm { font-size: .82rem; }
.table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
.table td.text-wrap, .table th.text-wrap, .table .text-wrap { white-space: normal; }
/* Summary tables (not wrapped in `.table-responsive`) wrap long values such as
   project names instead of overflowing the card. */
.card-body > .table:not(.table-data) td,
.card-body > .table:not(.table-data) th { word-break: break-word; }
.form-control, .form-select, .btn { font-size: .9rem; }
.form-control-sm, .form-select-sm, .btn-sm { font-size: .78rem; }
.footer-note { color: #94a3b8; font-size: 12px; }
.searchable-select { min-height: 38px; }
.btn-toolbar-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.table-export-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; justify-content: flex-end; }
@media (max-width: 991px) {
  .app-shell { display: block; overflow: visible; }
  .app-sidebar { position: relative; width: 100%; min-width: 100%; max-width: 100%; height: auto; }
  .sidebar-scroll { max-height: 45vh; }
  .sidebar-group-toggle { border-radius: 16px; }
  .app-content { height: auto; overflow: visible; padding: 14px; }
  .topbar { align-items: flex-start !important; }
  .page-header .btn, .page-header form { width: 100%; }
  .page-header { align-items: stretch; }
  .card-body { padding: 1rem; }
  .row.g-4 { --bs-gutter-y: 1rem; }
}
@media (max-width: 480px) {
  .login-card { width: 100%; max-width: 100%; border-radius: 18px; }
  .login-card .card-body { padding: 24px 20px !important; }
}
@media print {
  .app-sidebar, .topbar, .table-export-toolbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .app-content { height: auto; overflow: visible; padding: 0; }
  .card-kpi { box-shadow: none; border: 1px solid #ddd; }
}
