/* ==========================================================================
   SIGAP — fondasi tampilan, autentikasi, kerangka aplikasi
   ========================================================================== */

:root {
  --navy-950: #061426;
  --navy-900: #0a203d;
  --navy-800: #10325a;
  --navy-700: #17416f;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --gold-600: #b8860b;
  --gold-500: #d9a521;
  --gold-300: #f3d48a;
  --gold-100: #fdf4da;
  --bg: #f1f4f9;
  --bg-deep: #e8edf5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --text: #0f1f33;
  --text-soft: #33445c;
  --muted: #697a91;
  --muted-2: #8b9ab0;
  --line: #e1e7f0;
  --line-strong: #cfd8e6;
  --danger: #c62f3a;
  --danger-2: #a7212c;
  --danger-bg: #fdf0f1;
  --success: #157347;
  --success-bg: #eaf7ef;
  --warning: #a16207;
  --warning-bg: #fdf6e3;
  --info: #1d4ed8;
  --info-bg: #eef4ff;
  --purple: #6d28d9;
  --purple-bg: #f3efff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(15, 31, 51, .05);
  --shadow-sm: 0 2px 8px rgba(15, 31, 51, .05);
  --shadow: 0 10px 30px rgba(15, 31, 51, .08);
  --shadow-lg: 0 24px 70px rgba(7, 20, 38, .22);
  --sidebar-w: 272px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal-700); }
img, svg { vertical-align: middle; }
::selection { background: var(--teal-100); color: var(--navy-900); }

:focus-visible {
  outline: 3px solid rgba(13, 148, 136, .35);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--text-soft);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--btn-border); border-radius: 11px;
  background: var(--btn-bg); color: var(--btn-color);
  font-weight: 600; font-size: 13.5px; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  --btn-color: #fff;
  --btn-border: transparent;
  box-shadow: 0 8px 20px rgba(10, 32, 61, .18);
}
.btn-primary:hover {
  --btn-bg: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  box-shadow: 0 12px 26px rgba(10, 32, 61, .24);
}
.btn-teal {
  --btn-bg: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  --btn-color: #fff; --btn-border: transparent;
}
.btn-gold {
  --btn-bg: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  --btn-color: #2b1d00; --btn-border: transparent;
}
.btn-outline { --btn-bg: transparent; --btn-color: var(--navy-800); }
.btn-outline:hover { --btn-bg: var(--surface); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-color: var(--text-soft); }
.btn-ghost:hover { --btn-bg: var(--surface-3); box-shadow: none; }
.btn-danger { --btn-bg: var(--danger); --btn-color: #fff; --btn-border: transparent; }
.btn-danger:hover { --btn-bg: var(--danger-2); }
.btn-danger-soft { --btn-bg: var(--danger-bg); --btn-color: var(--danger); --btn-border: #f5cdd1; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 13px 22px; font-size: 14.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  color: var(--muted); transition: .18s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn-dark { color: #9fb1cb; }
.icon-btn-dark:hover { background: rgba(255,255,255,.08); color: #fff; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--teal-700); font-weight: 600; font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Formulir
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .field-label {
  font-size: 12.5px; font-weight: 700; color: var(--text-soft); letter-spacing: .01em;
}
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-hint { font-size: 11.5px; color: var(--muted-2); font-weight: 500; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute; left: 14px; width: 18px; height: 18px;
  color: var(--muted-2); pointer-events: none;
}
.input-action {
  position: absolute; right: 8px; display: inline-flex; align-items: center;
  justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted-2);
}
.input-action:hover { background: var(--surface-3); color: var(--text); }
.input-action .icon { width: 18px; height: 18px; }

input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input-wrap input { padding-left: 42px; }
.input-wrap input[type="password"], .input-wrap input[type="text"] { padding-right: 46px; }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #a4b0c1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}
select {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697a91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
input[type="date"], input[type="time"] { min-height: 44px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-soft); }
.checkbox-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--teal-600); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.form-error { margin-bottom: 14px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid transparent;
  font-size: 12.8px; line-height: 1.5;
}
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert-error { background: var(--danger-bg); border-color: #f2cdd0; color: #9f1d27; }
.alert-success { background: var(--success-bg); border-color: #c8e8d3; color: #11603b; }
.alert-warning { background: var(--warning-bg); border-color: #f0dfb0; color: #825506; }
.alert-info { background: var(--info-bg); border-color: #d5e2fb; color: #1c3f96; }

/* --------------------------------------------------------------------------
   Autentikasi
   -------------------------------------------------------------------------- */

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr);
  background: var(--bg);
}
.auth-visual {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 54px 34px;
  color: #fff;
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(20, 184, 166, .32), transparent 55%),
    radial-gradient(900px 600px at 100% 110%, rgba(217, 165, 33, .18), transparent 55%),
    linear-gradient(145deg, var(--navy-950) 0%, var(--navy-900) 48%, #0a2a49 100%);
}
.auth-grid {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 40% 40%, black 20%, transparent 78%);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.auth-orb-1 {
  width: 420px; height: 420px; right: -150px; top: -160px;
  border: 1px solid rgba(243, 212, 138, .22);
  box-shadow: inset 0 0 100px rgba(20, 184, 166, .12);
}
.auth-orb-2 {
  width: 260px; height: 260px; left: -90px; bottom: 8%;
  border: 1px solid rgba(255, 255, 255, .09);
}
.auth-brand, .mobile-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; color: var(--gold-300);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(243, 212, 138, .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 15px; }
.brand-mark-lg svg { width: 34px; height: 34px; }
.brand-mark-sm { width: 38px; height: 38px; border-radius: 11px; }
.brand-mark-sm svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: .12em; color: #fff; }
.brand-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-top: 4px; }
.auth-copy { position: relative; z-index: 1; max-width: 600px; padding: 60px 0 40px; }
.eyebrow-light {
  display: inline-block; margin-bottom: 18px; padding: 5px 11px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-300); background: rgba(217, 165, 33, .1);
  border: 1px solid rgba(243, 212, 138, .28); border-radius: 999px;
}
.auth-copy h1 {
  font-size: clamp(34px, 3.4vw, 50px); line-height: 1.1; letter-spacing: -.035em;
  font-weight: 760; max-width: 560px;
}
.auth-copy h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold-300), #fff3cf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-copy > p {
  margin-top: 20px; max-width: 490px;
  color: rgba(226, 235, 247, .72); font-size: 15px; line-height: 1.7;
}
.security-list {
  list-style: none; padding: 0; margin: 34px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 13px 22px;
  max-width: 560px;
}
.security-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.6px; line-height: 1.45; color: rgba(232, 240, 250, .82);
}
.security-list .tick {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(20, 184, 166, .16);
  border: 1px solid rgba(20, 184, 166, .35); color: #5eead4;
}
.security-list .tick .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.auth-visual-foot {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  font-size: 11.5px; color: rgba(226, 235, 247, .45);
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.35); }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 42px 40px; position: relative;
  background:
    radial-gradient(800px 500px at 100% 0%, rgba(20, 184, 166, .08), transparent 55%),
    radial-gradient(700px 500px at 0% 100%, rgba(217, 165, 33, .06), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 436px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  padding: 34px 34px 26px;
  box-shadow: 0 24px 60px rgba(15, 31, 51, .10), 0 2px 6px rgba(15,31,51,.04);
  animation: riseIn .55s cubic-bezier(.22,.8,.3,1) both;
}
.mobile-brand { display: none; margin-bottom: 26px; }
.mobile-brand .brand-name { color: var(--navy-900); }
.mobile-brand .brand-sub { color: var(--muted); }
.eyebrow {
  display: inline-block; margin-bottom: 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase;
  color: var(--teal-700);
}
.auth-card-head h2 { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; color: var(--navy-900); }
.auth-card-head p { margin-top: 8px; margin-bottom: 25px; font-size: 13px; color: var(--muted); line-height: 1.6; }
#login-form .btn-lg { margin-top: 2px; }
.demo-box {
  margin-top: 22px; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px;
}
.demo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; font-weight: 700; color: var(--text-soft);
  margin-bottom: 10px;
}
.demo-head > span:first-child { display: flex; align-items: center; gap: 6px; }
.demo-head .icon { width: 14px; height: 14px; color: var(--gold-600); }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-account {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 9px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; text-align: left; color: var(--text-soft);
  transition: .16s ease;
}
.demo-account:hover { background: #fff; border-color: var(--line); box-shadow: var(--shadow-xs); }
.demo-account > .icon { width: 15px; height: 15px; color: var(--muted-2); margin-left: auto; }
.demo-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.demo-info strong { font-size: 12.5px; color: var(--text); }
.demo-info small { font-size: 10.8px; color: var(--muted); }
.demo-note { margin-top: 10px; font-size: 10.8px; color: var(--muted-2); line-height: 1.45; }
.login-note {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 18px;
  font-size: 10.9px; line-height: 1.5; color: var(--muted-2);
}
.login-note .icon { width: 14px; height: 14px; margin-top: 1px; color: var(--teal-600); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: var(--surface-3); color: var(--muted);
}
.pill-gold { background: var(--gold-100); color: #7a5800; border: 1px solid #f1dfae; }
.pill-teal { background: var(--teal-100); color: var(--teal-700); }
.pill-red { background: var(--danger-bg); color: var(--danger); }

/* --------------------------------------------------------------------------
   Kerangka aplikasi
   -------------------------------------------------------------------------- */

.app-shell { min-height: 100vh; display: flex; background: var(--bg); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w); height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  color: #fff;
  background:
    radial-gradient(600px 400px at -10% 0%, rgba(20,184,166,.20), transparent 55%),
    radial-gradient(500px 400px at 110% 100%, rgba(217,165,33,.10), transparent 55%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900) 60%, #091d36);
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform .26s cubic-bezier(.22,.8,.3,1);
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 24px; }
.sidebar .brand-name { font-size: 19px; }
.sidebar .brand-sub { font-size: 9.5px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding-top: 2px; }
.nav-label {
  margin: 17px 12px 7px; font-size: 9.5px; font-weight: 800;
  letter-spacing: .17em; text-transform: uppercase; color: rgba(198, 214, 234, .42);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 13px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: #b8c7dc; text-align: left;
  font-size: 13px; font-weight: 550; transition: .16s ease;
}
.nav-item .icon { width: 19px; height: 19px; color: #8fa4c0; transition: .16s ease; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item:hover .icon { color: #cfe1f5; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(20,184,166,.20), rgba(20,184,166,.045));
  border-color: rgba(20,184,166,.16);
  color: #fff; font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.nav-item.active .icon { color: #5eead4; }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--gold-300);
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px 8px; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user-text strong { font-size: 12.4px; color: #eef4fb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text span { font-size: 10.5px; color: #8fa4c0; }
.sidebar-note {
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  font-size: 10px; color: rgba(198,214,234,.45);
}
.sidebar-note .icon { width: 12px; height: 12px; }
.sidebar-scrim {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(6, 20, 38, .5); backdrop-filter: blur(2px);
}

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  min-height: 76px; padding: 12px 30px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(225, 231, 240, .9);
}
.mobile-menu { display: none; }
.page-heading { min-width: 0; }
.page-heading h1 { font-size: 19px; font-weight: 750; letter-spacing: -.02em; color: var(--navy-900); }
.page-heading p { margin-top: 2px; font-size: 11.8px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.date-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); color: var(--muted);
}
.date-chip .icon { width: 17px; height: 17px; color: var(--teal-700); }
.date-chip div { display: flex; flex-direction: column; line-height: 1.2; }
.date-chip span { font-size: 10px; color: var(--muted); }
.date-chip strong { font-size: 11.5px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px;
  display: grid; place-items: center; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 800; border: 2px solid #fff;
}
.user-menu-wrap { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; transition: .16s ease;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--line); }
.user-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-chip-text strong { font-size: 12px; color: var(--text); max-width: 145px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 10px; color: var(--muted); }
.user-chip .chev { width: 14px; height: 14px; color: var(--muted-2); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 70;
  width: 224px; padding: 6px; border-radius: 13px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: popIn .16s ease both;
}
.user-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-soft); text-align: left; font-size: 12.5px;
}
.user-menu button:hover { background: var(--surface-2); }
.user-menu button .icon { width: 16px; height: 16px; color: var(--muted); }
.user-menu button.danger { color: var(--danger); }
.user-menu button.danger .icon { color: var(--danger); }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }

.view-root { flex: 1; width: 100%; max-width: 1540px; margin: 0 auto; padding: 26px 30px 44px; outline: none; }
.view-root > * { animation: fadeUp .32s ease backwards; }
.app-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 30px 20px; border-top: 1px solid var(--line);
  font-size: 10.8px; color: var(--muted-2);
}
.app-footer strong { color: var(--text-soft); letter-spacing: .08em; }
#banner-root { max-width: 1540px; width: 100%; margin: 0 auto; padding: 16px 30px 0; }
#banner-root:empty { padding: 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--teal-700));
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  border: 2px solid rgba(255,255,255,.18);
}
.avatar-sm { width: 32px; height: 32px; font-size: 10px; }
.avatar-md { width: 38px; height: 38px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 14px; }
.avatar-xl { width: 72px; height: 72px; font-size: 20px; border: 4px solid #fff; box-shadow: var(--shadow-sm); }
.avatar-admin { background: linear-gradient(135deg, #1e3a8a, #0f766e); }
.avatar-pimpinan { background: linear-gradient(135deg, #7c5806, #b8860b); }
.avatar-staf { background: linear-gradient(135deg, #475569, #64748b); }

/* --------------------------------------------------------------------------
   Modal, toast, skeleton
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(6, 20, 38, .55);
  backdrop-filter: blur(5px);
  animation: fadeIn .18s ease both;
}
.modal {
  width: 100%; max-width: 580px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.6);
  animation: modalIn .24s cubic-bezier(.22,.8,.3,1) both;
  overflow: hidden;
}
.modal-sm { max-width: 430px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 920px; }
.modal-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line);
}
.modal-head-text { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 18px; font-weight: 750; letter-spacing: -.02em; color: var(--navy-900); }
.modal-head p { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-close { margin: -4px -6px 0 0; flex: none; }
.modal-body { padding: 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.modal-foot .left { margin-right: auto; }

.toast-root {
  position: fixed; top: 18px; right: 18px; z-index: 1200;
  display: flex; flex-direction: column; gap: 9px; width: min(370px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal-600);
  box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; color: var(--text-soft);
  pointer-events: auto; animation: toastIn .28s cubic-bezier(.22,.8,.3,1) both;
}
.toast.leaving { animation: toastOut .2s ease both; }
.toast .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--teal-700); }
.toast-success { border-left-color: var(--success); }
.toast-success .icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .icon { color: var(--danger); }
.toast-warning { border-left-color: var(--gold-500); }
.toast-warning .icon { color: var(--gold-600); }
.toast-info { border-left-color: var(--info); }
.toast-info .icon { color: var(--info); }

.skeleton { position: relative; overflow: hidden; background: #e9eef6; border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.5s infinite;
}
.skeleton-card { height: 112px; border-radius: var(--radius); }
.skeleton-row { height: 54px; border-radius: 10px; margin-bottom: 8px; }
.skeleton-title { width: 30%; height: 18px; margin-bottom: 16px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 42px 22px; text-align: center; color: var(--muted);
}
.empty-icon {
  display: grid; place-items: center; width: 58px; height: 58px;
  margin-bottom: 13px; border-radius: 17px;
  background: var(--surface-3); color: var(--muted-2);
}
.empty-icon .icon { width: 27px; height: 27px; }
.empty-state h4 { font-size: 14px; color: var(--text-soft); margin-bottom: 4px; }
.empty-state p { font-size: 12px; max-width: 330px; line-height: 1.55; }
.empty-state .btn { margin-top: 15px; }

/* --------------------------------------------------------------------------
   Animasi
   -------------------------------------------------------------------------- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spin { animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   Responsif kerangka
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  :root { --sidebar-w: 250px; }
  .view-root { padding: 22px 22px 40px; }
  #banner-root { padding: 14px 22px 0; }
  .topbar { padding: 12px 22px; }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-shell.nav-open .sidebar { transform: none; }
  .app-shell.nav-open .sidebar-scrim { display: block; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .auth-screen { grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr); }
  .auth-visual { padding: 38px 36px 28px; }
}

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px; }
  .mobile-brand { display: flex; }
  .auth-card { max-width: 470px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: 10px 16px; gap: 10px; }
  .page-heading h1 { font-size: 17px; }
  .page-heading p { display: none; }
  .date-chip { display: none; }
  .user-chip-text { display: none; }
  .user-chip .chev { display: none; }
  .view-root { padding: 18px 15px 34px; }
  #banner-root { padding: 12px 15px 0; }
  .app-footer { padding: 14px 16px 18px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-body { padding: 18px; }
  .modal-head { padding: 18px 18px 14px; }
  .modal-foot { padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toast-root { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 520px) {
  .auth-panel { padding: 18px 14px; align-items: flex-start; }
  .auth-card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth-card-head h2 { font-size: 23px; }
  .security-list { grid-template-columns: 1fr; }
  .modal-foot .btn { flex: 1; }
}
