/**
 * SiGaji UI — payroll-grade design system (load after styles.css)
 * Font: dimuat via <link> di index; --font di sigaji-tokens.css
 */
:root {
  --ink-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --content-bg: var(--color-bg-content, #eef1f6);
}

body {
  font-family: var(--font);
  background: var(--content-bg);
  color: var(--tx);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Login (premium) ── */
#login {
  position: relative;
  overflow: hidden;
  background: #0c1929;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59, 130, 246, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(26, 86, 160, 0.4) 0%, transparent 50%),
    linear-gradient(155deg, #071525 0%, var(--color-primary-dark) 38%, var(--color-primary) 72%, var(--indigo) 100%);
}
.login-bg-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
}
.lbox-premium {
  position: relative;
  z-index: 1;
  width: min(420px, 94vw);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.15rem 2.15rem;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}
.llogo {
  margin-bottom: 2rem;
}
.llogo h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-tagline {
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 0.65rem;
}
#login .btn-p.btn-full {
  padding: 12px 18px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  margin-top: 0.25rem;
}
.fg input,
.fg select,
.fg textarea {
  border-radius: var(--radius-md);
  border-color: var(--color-slate-200);
  padding: 11px 14px;
  font-size: 0.9rem;
}
.fg input:focus,
.fg select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* ── App shell ── */
#app.sigaji-app-active,
#app {
  background: var(--content-bg);
}
.topbar {
  height: var(--sigaji-topbar-h, 58px);
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.alogo {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--blue);
}
.periode-pill {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.72rem;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.periode-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}
.av {
  width: 34px;
  height: 34px;
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(26, 86, 160, 0.25);
}
.rbadge {
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.save-ind {
  font-size: 0.68rem;
  padding: 3px 8px;
  background: #ecfdf5;
  border-radius: 6px;
  color: #047857;
}

/* Bar periode antara topbar & layout: jangan ikut menyusut di shell terkunci */
#period-timeline-bar,
#period-sticky-bar { flex-shrink: 0; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sigaji-sidebar-w, 228px);
  background: var(--sidebar-bg);
  padding: 0.85rem 0.55rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
  /* Sidebar sendiri TIDAK scroll; hanya daftar menu (#nav-dynamic) yang scroll. */
  overflow: hidden;
  justify-content: flex-start;
}
/* Daftar menu mengambil sisa ruang & scroll halus bila menu lebih panjang dari layar */
#nav-dynamic {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
#nav-dynamic::-webkit-scrollbar { width: 6px; }
#nav-dynamic::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 6px;
}
#nav-dynamic::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }
/* Tombol bawah (mis. logout/pengaturan) selalu menempel, tidak ikut ter-scroll */
#nav-bottom {
  flex-shrink: 0;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar {
  color: var(--sidebar-fg-muted);
}
.nsec {
  color: var(--sidebar-fg-muted);
  padding: 1rem 0.85rem 0.4rem;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
}
.sidebar .ni {
  color: var(--sidebar-fg-muted);
}
.ni {
  margin: 3px 0.35rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border-left: none;
  font-weight: 500;
  font-size: 0.8rem;
  gap: 10px;
  transition: background 0.15s var(--ease), color 0.15s, transform 0.12s;
}
.sidebar .ni:hover,
.ni:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--sidebar-fg-hover);
}
.sidebar .ni.active,
.ni.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.08));
  color: var(--sidebar-fg-active);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.2);
  font-weight: 700;
}
.ni.active .nic {
  transform: scale(1.05);
}
.nic {
  font-size: 1rem;
  opacity: 0.95;
}

/* ── Main content ── */
.content {
  padding: var(--content-pad-y, 1.5rem) var(--content-pad-x, 1.65rem) 2.5rem;
  background: var(--content-bg);
  -webkit-overflow-scrolling: touch;
}

.ph {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.pt {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.pst {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Cards ── */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.2rem 1.35rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  transition: box-shadow 0.2s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.ct {
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.02em;
  padding-bottom: 0.65rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--table-head-bg);
}

/* ── KPI cards (dashboard) ── */
.sg4-kpi {
  gap: 14px;
  margin-bottom: 1.15rem;
}
.sc-kpi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  position: relative;
  overflow: visible;
}
.sc-kpi::before {
  display: none;
}
.sc-kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.sc-kpi-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border-radius: var(--radius-md);
  line-height: 1;
}
.sc-kpi-kar .sc-kpi-icon {
  background: linear-gradient(135deg, var(--color-blue-100), var(--color-blue-50));
}
.sc-kpi-bruto .sc-kpi-icon {
  background: linear-gradient(135deg, #e0e7ff, #eef2ff);
}
.sc-kpi-pph .sc-kpi-icon {
  background: linear-gradient(135deg, #fef3c7, var(--row-pending-bg));
}
.sc-kpi-neto .sc-kpi-icon {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
}
.sc-kpi-kar::after,
.sc-kpi-bruto::after,
.sc-kpi-pph::after,
.sc-kpi-neto::after {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
}
.sc-kpi-kar::after { background: var(--color-primary-light); }
.sc-kpi-bruto::after { background: #6366f1; }
.sc-kpi-pph::after { background: #f59e0b; }
.sc-kpi-neto::after { background: #10b981; }
.sc-kpi-body {
  flex: 1;
  min-width: 0;
}
.sc-kpi .sl {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.sc-kpi .sv {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.sv-money {
  font-size: 1.05rem !important;
  font-variant-numeric: tabular-nums;
}
.sv-warn { color: #b45309 !important; }
.sv-ok { color: #047857 !important; }

/* Legacy .sc without .sc-kpi */
.sc:not(.sc-kpi) {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.sc:not(.sc-kpi)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--blue-light));
  border-radius: 4px 0 0 4px;
}

/* Dashboard hero */
.pb,
.dash-hero {
  background: linear-gradient(120deg, #071525 0%, #0c2340 28%, #0d3d7a 52%, #1a56a0 78%, #2563eb 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 10px 32px rgba(26, 86, 160, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.88;
}
.dash-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
}
.dash-hero-meta {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 6px;
  line-height: 1.45;
}
.dash-hero-count {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.dash-hero-count-lbl {
  font-size: 0.68rem;
  opacity: 0.85;
  margin-top: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Tables (payroll grid) — detail di sigaji-table.css ── */
.card > div[style*='overflow'] {
  border-radius: var(--radius-md);
  border: 1px solid var(--table-cell-border);
}
.card table {
  border-collapse: separate;
  border-spacing: 0;
}
.content .table-wrap thead,
.sigaji-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.content .table-wrap th,
.sigaji-table th,
th {
  background: var(--table-head-bg);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--table-head-border);
  color: var(--table-head-color);
  font-weight: 700;
  text-transform: uppercase;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--table-cell-border);
  font-size: 0.82rem;
}
tbody tr {
  transition: background 0.12s;
}
tr:hover td {
  background: var(--table-row-hover);
}
tbody tr:last-child td {
  border-bottom: none;
}
.ka {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(145deg, var(--color-blue-100), var(--color-blue-50));
  color: var(--blue);
  border: 1px solid var(--color-blue-200);
}
.knl {
  font-weight: 700;
  color: var(--blue);
}

/* ── Tabs (segmented) ── */
.tabs {
  gap: 4px;
  border-bottom: none;
  margin-bottom: 1.1rem;
  padding: 5px;
  background: #e2e8f0;
  border-radius: var(--radius-md);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.tab {
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  border-bottom: none;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.8rem;
  color: #64748b;
  transition: all 0.15s var(--ease);
}
.tab:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.55);
}
.tab.active {
  color: var(--blue);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* ── Buttons ── */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn-p {
  background: linear-gradient(180deg, #1d5bb8 0%, var(--blue) 100%);
  box-shadow: 0 2px 10px rgba(26, 86, 160, 0.3);
}
.btn-p:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 86, 160, 0.38);
}
.btn-g {
  background: linear-gradient(180deg, #3d8c1a 0%, var(--color-success) 100%);
  box-shadow: 0 2px 8px rgba(45, 106, 10, 0.25);
}
.btn-out {
  border-color: var(--color-slate-300);
  color: var(--table-head-color);
  background: var(--wh);
}
.btn-out:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--color-surface-elevated);
}
.btn-sm {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

/* Search */
.inp-search {
  max-width: 280px;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--wh) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  transition: border 0.15s, box-shadow 0.15s;
}
.inp-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Info & badges */
.info-box {
  border-radius: var(--radius-md);
  border-left-width: 4px;
  font-size: 0.82rem;
  line-height: 1.5;
}
.bdg {
  padding: 4px 10px;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
}

/* Forms in slide panel */
.spt-body .fg input,
.spt-body .fg select,
.spt-body .fg textarea,
.sp-body .fg input,
.sp-body .fg select {
  border-radius: var(--radius-md);
  border-color: var(--color-slate-200);
}
.stit {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--blue);
  border-bottom-color: var(--color-slate-200);
  margin-top: 1.1rem;
}

/* Slide panel & modal */
.sph {
  background: linear-gradient(120deg, #0c2340, var(--color-primary) 55%, var(--indigo));
  padding: 1.35rem 1.5rem;
}
.sp {
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.18);
  border-left: 1px solid var(--border);
}
.spt-wrap {
  background: var(--surface-2);
  border-bottom: 1px solid var(--color-slate-200);
  padding: 0 1.25rem;
}
.spt {
  font-size: 0.78rem;
  font-weight: 600;
}
.spt.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}
.modal {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal-h {
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Toast */
.toast9 {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* PPh box */
.pph-box {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-blue-200);
}

/* Scrollbar (webkit) */
.content::-webkit-scrollbar,
.sp::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.content::-webkit-scrollbar-thumb,
.sp::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-slate-300);
  border-radius: 8px;
}

/* Focus visible */
button:focus-visible,
.ni:focus-visible,
.tab:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 900px) {
  .tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .sc-kpi:hover,
  .card:hover {
    transform: none;
  }
  .sg4-kpi {
    grid-template-columns: 1fr 1fr;
  }
  .sc-kpi {
    flex-direction: column;
    gap: 8px;
  }
  .sc-kpi-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}
@media (max-width: 520px) {
  .sg4-kpi {
    grid-template-columns: 1fr;
  }
}

/* Modal konfirmasi */
#m-confirm.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-confirm {
  border-top: 4px solid var(--blue);
  max-width: 420px;
}
.modal-confirm .mtit {
  font-size: 1.05rem;
  padding-bottom: 0.35rem;
}
.confirm-body {
  margin: 0 0 1rem;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}

/* Zona berbahaya — Backup & Sistem */
.card-danger-zone {
  border: 1px solid rgba(155, 33, 33, 0.25);
  border-left: 4px solid var(--color-danger);
  background: linear-gradient(135deg, var(--wh)5f5 0%, var(--wh) 55%);
  margin-bottom: 1rem;
}
.danger-zone-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 0.85rem;
}
.reset-admin-hint {
  padding: 0.5rem 0.65rem;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
#pg-backup .backup-tabs-bar .tab[data-bktab="bk-ringkas"].active {
  color: #7f1d1d;
  border-color: #fecaca;
  background: var(--row-neto-neg-bg);
}

/* ═══════════════════════════════════════════════════════════
   SiGaji UI v11.5 — flow, motion, komponen halaman
   ═══════════════════════════════════════════════════════════ */

/* Transisi halaman */
.pg.active {
  animation: sigajiPgIn 0.38s var(--ease) both;
}
@keyframes sigajiPgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pg.active,
  .sc-kpi:hover,
  .card:hover,
  .btn-p:hover,
  .periode-pill:hover {
    animation: none;
    transform: none;
    transition: none;
  }
}

@media (min-width: 1200px) {
  .content > .pg {
    max-width: 1280px;
  }
}

/* Header halaman (judul + aksi) */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.page-actions {
  flex-shrink: 0;
}

/* Login — form & footer */
.login-remember {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.65rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--table-head-color);
  user-select: none;
}
.login-remember input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  cursor: pointer;
}
.login-config-hint {
  font-size: 0.78rem;
  color: #5b4d3a;
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.75rem;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-slate-200);
  line-height: 1.5;
}
.login-config-hint strong {
  color: var(--ink);
}
.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--table-head-bg);
}
.login-footer-sep {
  color: var(--color-slate-300);
  font-size: 0.75rem;
  user-select: none;
}
.login-link {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.login-link:hover {
  background: var(--color-blue-50);
  text-decoration: underline;
}
.login-link-accent {
  color: #15803d;
}
.login-link-accent:hover {
  background: #ecfdf5;
}
.login-file-hint {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(135deg, var(--row-pending-bg), var(--wh));
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #92400e;
}
.login-file-hint code {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #fde68a;
}

/* Login — tombol loading */
#btn-login.is-busy {
  pointer-events: none;
  opacity: 0.88;
  position: relative;
}
#btn-login.is-busy .btn-login-label::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--wh);
  border-radius: 50%;
  animation: sigajiSpin 0.65s linear infinite;
}
@keyframes sigajiSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Logo login — entrance */
.lbox-premium {
  animation: sigajiLoginIn 0.55s var(--ease) both;
}
@keyframes sigajiLoginIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Topbar — notifikasi & keluar */
.notif-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.12s;
}
.notif-btn:hover {
  background: var(--color-blue-50);
  transform: scale(1.04);
}
.ndot.on {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 2px var(--wh);
}
.topbar .btn-out,
.topbar-logout {
  border-radius: var(--radius-md);
  font-weight: 600;
}
.topbar-logout {
  margin-left: 4px;
}

/* Drawer mobile — glass & depth */
html.sigaji-mobile-nav #sidebar-wrap.sigaji-nav-drawer-open {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 12px 0 40px rgba(15, 23, 42, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
html.sigaji-mobile-nav .nav-backdrop.sigaji-nav-drawer-open {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
html.sigaji-mobile-nav .nav-drawer-btn {
  background: linear-gradient(135deg, var(--color-blue-50), var(--color-blue-100));
  border: 1px solid var(--color-blue-200);
}

/* Dashboard — hero & alert */
.dash-hero-side {
  text-align: right;
}
.dash-thr-badge {
  margin-left: 8px;
  vertical-align: middle;
}
#d-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-item {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.5;
  border-left: 4px solid transparent;
  background: var(--surface-2);
}
.alert-item strong {
  font-weight: 700;
}
.alert-purple {
  background: linear-gradient(90deg, #f5f3ff, #faf5ff);
  border-left-color: #7c3aed;
  color: #4c1d95;
}
.alert-amber {
  background: linear-gradient(90deg, #fffbeb, var(--wh));
  border-left-color: #d97706;
  color: #1c1917;
}
.alert-green {
  background: linear-gradient(90deg, #ecfdf5, var(--wh));
  border-left-color: #059669;
  color: #065f46;
}
.alert-blue {
  background: linear-gradient(90deg, var(--color-blue-50), var(--wh));
  border-left-color: var(--indigo);
  color: #1e3a8a;
}
.alert-empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 1.25rem;
  border: 1px dashed var(--color-slate-200);
  border-radius: var(--radius-md);
  background: #fafbfc;
  font-size: 0.85rem;
}

/* Notifikasi */
.notif-feed {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--table-head-bg);
  transition: background 0.12s;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: var(--color-surface-elevated);
}
.notif-unread {
  background: linear-gradient(90deg, var(--color-blue-50) 0%, var(--wh) 55%);
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--color-slate-300);
}
.notif-unread .notif-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.notif-text {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 3px;
  line-height: 1.45;
}
.notif-empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 2.5rem 1.5rem;
  font-size: 0.9rem;
}
.notif-item .btn-r {
  flex-shrink: 0;
  align-self: center;
}

/* Tabel — wrapper di dalam card */
.card .table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--table-head-bg);
  margin-top: 0.25rem;
}
tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.65);
}
tbody tr:hover td {
  background: var(--table-head-bg) !important;
}

/* Toast — slide up */
.toast9 {
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}
.toast9.show {
  transform: translateY(0);
}

/* Modal backdrop */
.mbd.show {
  backdrop-filter: blur(3px);
}
.po.show {
  backdrop-filter: blur(2px);
}

/* Slide panel footer */
.spf {
  background: linear-gradient(180deg, var(--wh), var(--color-surface-elevated));
}

/* Chip / quota di toolbar */
#kar-quota-badge {
  font-size: 0.72rem;
}

/* ── Toolbar halaman (filter & slip) ── */
.page-toolbar-filters,
.page-toolbar-slip {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.toolbar-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.toolbar-select {
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 500;
  background: var(--wh);
  color: var(--ink);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
.toolbar-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
#ab-periode-sel.toolbar-select {
  min-width: min(260px, 72vw);
}
.toolbar-select-wide {
  min-width: min(200px, 55vw);
}
.btn-thr-pdf {
  background: linear-gradient(180deg, #f5f3ff, var(--color-purple-muted)) !important;
  color: var(--color-purple) !important;
  border: 1.5px solid var(--color-purple-border) !important;
  font-weight: 700 !important;
}
.btn-wa {
  background: linear-gradient(180deg, #22c55e, #16a34a) !important;
  color: var(--wh) !important;
  border: none !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}
.btn-email {
  background: linear-gradient(180deg, #1d5bb8, var(--blue)) !important;
  color: var(--wh) !important;
  border: none !important;
  font-weight: 700 !important;
}
.meta-muted {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}
#kar-count.meta-muted {
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--ink-muted);
  padding: 2.5rem 1.5rem;
  background: linear-gradient(180deg, var(--color-surface-elevated), var(--wh));
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-slate-200);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Absensi — legenda & grid */
.ab-status-legend {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.ab-legend-hint {
  color: var(--ink-muted);
  font-weight: 600;
  margin-right: 0.25rem;
}
.ab-chip {
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.ab-h { background: var(--color-success-bg); color: var(--color-success); }
.ab-c { background: var(--color-purple-muted); color: var(--color-purple); }
.ab-i { background: var(--color-primary-subtle); color: var(--color-primary); }
.ab-s { background: var(--color-warning-bg); color: var(--color-warning); }
.ab-hs { background: var(--wh)0e0; color: #b45309; }
.ab-hi { background: #e0f0ff; color: #0369a1; }
.ab-a { background: var(--color-danger-bg); color: var(--color-danger); }
.ab-ln { background: #fef9c3; color: #713f12; }
.ab-grid-host {
  overflow-x: auto;
  overflow-y: visible;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

/* Master TER — grid 3 kolom */
.ter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .ter-grid {
    grid-template-columns: 1fr;
  }
  .page-toolbar-filters,
  .page-toolbar-slip {
    width: 100%;
    justify-content: flex-start;
  }
  .toolbar-select,
  .toolbar-select-wide {
    width: 100%;
    max-width: 100%;
  }
}

/* Tabs di bawah header — jarak konsisten */
.pg > .tabs {
  margin-top: 0.15rem;
}
