:root {
  --bg: #f6f1e6;
  --bg-deep: #efe7d7;
  --paper: #fffdf8;
  --paper-2: #fbf7ee;
  --ink: #1f2e2a;
  --ink-soft: #354842;
  --muted: #6f7d76;
  --muted-2: #93a09a;
  --line: #e6ddca;
  --line-strong: #d8cdb7;
  --brand: #0f3d3e;
  --brand-ink: var(--brand);
  --brand-link: var(--brand-3);
  --brand-2: #195451;
  --brand-3: #2e716a;
  --gold: #c8963e;
  --gold-deep: #a87a2a;
  --gold-soft: #f2e5c9;
  --terra: #bd6047;
  --terra-soft: #f7e3db;
  --green: #377a58;
  --green-soft: #e3efe6;
  --blue: #466b8a;
  --blue-soft: #e5edf3;
  --red: #b0453a;
  --red-soft: #f8e3df;
  --shadow-sm: 0 1px 2px rgba(31, 46, 42, 0.04), 0 2px 8px rgba(31, 46, 42, 0.04);
  --shadow-md: 0 8px 28px rgba(31, 46, 42, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 61, 62, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sidebar-w: 252px;
  --topbar-h: 64px;
  --max: 1260px;
  --tap: 44px;
  --sidebar-1: #0f3d3e;
  --sidebar-2: #0c3334;
  --sidebar-3: #0a2d2e;
  --sidebar-ink: #f4eee1;
  --sidebar-accent: #c8963e;
  --scheme-name: "Galas";
  --scroll-thumb: color-mix(in srgb, var(--ink) 22%, transparent);
  --scroll-thumb-hover: color-mix(in srgb, var(--ink) 36%, transparent);
  --sidebar-scroll-thumb: rgba(244, 238, 225, 0.2);
  --sidebar-scroll-thumb-hover: rgba(244, 238, 225, 0.34);
}

/* Skema warna global (diatur admin). */
:root[data-scheme="forest"] {
  --brand: #173f2c;
  --brand-2: #1f5339;
  --brand-3: #3f7657;
  --gold: #c9a24a;
  --gold-deep: #a9822f;
  --gold-soft: #efe4c7;
  --sidebar-1: #143826;
  --sidebar-2: #102e1f;
  --sidebar-3: #0b2418;
  --sidebar-accent: #c9a24a;
}

:root[data-scheme="ocean"] {
  --brand: #123b52;
  --brand-2: #19506a;
  --brand-3: #347795;
  --gold: #d0a24f;
  --gold-deep: #aa7f31;
  --gold-soft: #f0e4c9;
  --sidebar-1: #103448;
  --sidebar-2: #0c2a3b;
  --sidebar-3: #081f2d;
  --sidebar-accent: #d0a24f;
}

:root[data-scheme="plum"] {
  --brand: #3c2949;
  --brand-2: #4f3860;
  --brand-3: #765a89;
  --gold: #c79a58;
  --gold-deep: #a67c3c;
  --gold-soft: #f1e5d2;
  --sidebar-1: #352340;
  --sidebar-2: #2a1b33;
  --sidebar-3: #201428;
  --sidebar-accent: #c79a58;
}

:root[data-scheme="terracotta"] {
  --brand: #5a2f26;
  --brand-2: #743e32;
  --brand-3: #9c5d4b;
  --gold: #d3a355;
  --gold-deep: #ad7f35;
  --gold-soft: #f3e5cd;
  --sidebar-1: #4e2a23;
  --sidebar-2: #40221c;
  --sidebar-3: #321a15;
  --sidebar-accent: #d3a355;
}

:root[data-scheme="slate"] {
  --brand: #26343b;
  --brand-2: #33454e;
  --brand-3: #59727e;
  --gold: #c3a46a;
  --gold-deep: #9e8149;
  --gold-soft: #eee6d5;
  --sidebar-1: #223037;
  --sidebar-2: #1b262c;
  --sidebar-3: #141d21;
  --sidebar-accent: #c3a46a;
}

/* Mono: hitam-putih netral, tetap terbaca di mode terang maupun gelap. */
:root[data-scheme="mono"] {
  --bg: #f5f5f4;
  --bg-deep: #ececeb;
  --paper: #ffffff;
  --paper-2: #f8f8f7;
  --ink: #151617;
  --ink-soft: #303236;
  --muted: #6a6d72;
  --muted-2: #96999e;
  --line: #e3e4e6;
  --line-strong: #d1d3d6;
  --brand: #17181b;
  --brand-2: #2b2d31;
  --brand-3: #5f6368;
  --gold: #9aa0a6;
  --gold-deep: #6d7278;
  --gold-soft: #ecedef;
  --sidebar-1: #17181b;
  --sidebar-2: #101113;
  --sidebar-3: #09090a;
  --sidebar-accent: #c9ccd0;
}

/* Preset tema mengubah bentuk, bayangan, dan kepadatan. */
:root[data-preset="minimal"] {
  --radius: 12px;
  --radius-sm: 9px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 1px rgba(31, 46, 42, 0.03);
  --shadow-md: 0 6px 18px rgba(31, 46, 42, 0.06);
}

:root[data-preset="soft"] {
  --radius: 24px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --shadow-sm: 0 4px 18px rgba(31, 46, 42, 0.06);
  --shadow-md: 0 14px 38px rgba(31, 46, 42, 0.1);
}

/* Mode gelap per pengguna. */
:root[data-mode="dark"] {
  --bg: #0d1413;
  --bg-deep: #080d0c;
  --paper: #141d1b;
  --paper-2: #101816;
  --ink: #e9efea;
  --ink-soft: #c8d5ce;
  --muted: #94a69e;
  --muted-2: #6f827a;
  --line: #24332f;
  --line-strong: #30443e;
  --brand-ink: #9fe3da;
  --brand-link: #8fd7ce;
  --gold-soft: #3b3018;
  --terra-soft: #3a231d;
  --green-soft: #152b21;
  --blue-soft: #14242f;
  --red-soft: #341b18;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 10px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* Mono gelap: permukaan hitam netral dengan aksen putih. */
:root[data-scheme="mono"][data-mode="dark"] {
  --bg: #0b0c0d;
  --bg-deep: #050506;
  --paper: #141517;
  --paper-2: #0f1011;
  --ink: #f1f2f3;
  --ink-soft: #d2d5d8;
  --muted: #9a9ea3;
  --muted-2: #6f7378;
  --line: #24262a;
  --line-strong: #34373b;
  --brand: #f2f3f4;
  --brand-2: #dcdde0;
  --brand-3: #9ba0a6;
  --brand-ink: #f2f3f4;
  --brand-link: #c9cdd2;
  --gold: #a4a9af;
  --gold-deep: #c3c7cb;
  --gold-soft: #2a2c2f;
  --sidebar-1: #141517;
  --sidebar-2: #0e0f10;
  --sidebar-3: #08090a;
  --sidebar-accent: #d5d8db;
  --terra-soft: #2c2322;
  --green-soft: #1c2823;
  --blue-soft: #1d242a;
  --red-soft: #2e1e1d;
}

:root[data-scheme="mono"] .btn-gold {
  color: #191a1c;
}

:root[data-scheme="mono"][data-mode="dark"] .btn {
  --btn-fg: #101113;
}

:root[data-scheme="mono"][data-mode="dark"] .btn-primary,
:root[data-scheme="mono"][data-mode="dark"] .chip.active {
  color: #101113;
}

:root[data-scheme="mono"][data-mode="dark"] .toast {
  background: #202225;
  color: #f1f2f3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

:root[data-scheme="mono"][data-mode="dark"] .toast .toast-icon {
  color: #d6d9dd;
}

:root[data-scheme="mono"][data-mode="dark"] .toast-success .toast-icon {
  color: #9ad3ae;
}

:root[data-scheme="mono"][data-mode="dark"] .toast-error {
  background: #8f352c;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(200, 150, 62, 0.1), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(15, 61, 62, 0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Scrollbars ---------- */
html {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

html::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

html::-webkit-scrollbar-track,
html::-webkit-scrollbar-corner {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  border-width: 2px;
  background-clip: padding-box;
}

.nav-scroll {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-scroll-thumb) transparent;
}

.nav-scroll::-webkit-scrollbar {
  width: 6px;
}

.nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.nav-scroll::-webkit-scrollbar-thumb {
  background: var(--sidebar-scroll-thumb);
  border-radius: 999px;
}

.nav-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-scroll-thumb-hover);
}

.modal-body,
.table-wrap,
.settle-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.settle-list::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.modal-body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.settle-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner,
.settle-list::-webkit-scrollbar-corner {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.settle-list::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.settle-list::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}


h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

::selection {
  background: var(--gold-soft);
  color: var(--brand-ink);
}

.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;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.mono-num {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

/* ---------- Boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  color: var(--brand-ink);
  z-index: 60;
}

.boot-mark {
  color: var(--brand-ink);
  animation: breathe 2.2s ease-in-out infinite;
}

.boot p {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* ---------- Shell ---------- */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background:
    radial-gradient(380px 280px at 10% 0%, color-mix(in srgb, var(--sidebar-accent) 22%, transparent), transparent 65%),
    linear-gradient(170deg, var(--sidebar-1) 0%, var(--sidebar-2) 60%, var(--sidebar-3) 100%);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 30;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 20px;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: rgba(247, 241, 228, 0.08);
  border: 1px solid rgba(247, 241, 228, 0.14);
  display: grid;
  place-items: center;
  color: var(--gold);
}

.brand-text {
  min-width: 0;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #fbf7ee;
}

.brand-text span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.55);
  margin-top: 3px;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}

.nav-group {
  margin-top: 18px;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-label {
  font-size: 9.5px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.42);
  padding: 0 12px 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 11px;
  color: rgba(247, 241, 228, 0.7);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(247, 241, 228, 0.07);
  color: #fbf7ee;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(247, 241, 228, 0.1);
  color: #fffdf8;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  flex: 0 0 20px;
  opacity: 0.9;
}

.nav-item.active .nav-icon {
  color: var(--gold);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(200, 150, 62, 0.18);
  color: #efd7a4;
}

.sidebar-foot {
  border-top: 1px solid rgba(247, 241, 228, 0.1);
  padding-top: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}

.user-card:hover {
  background: rgba(247, 241, 228, 0.06);
}

.user-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-avatar-photo {
  overflow: hidden;
  padding: 0;
  background: var(--paper-2);
}

.user-avatar-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.user-card .user-meta {
  min-width: 0;
  flex: 1;
}

.user-card .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fbf7ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card .user-role {
  font-size: 10.5px;
  color: rgba(247, 241, 228, 0.5);
  display: flex;
  align-items: center;
  gap: 5px;
}

.role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

.sidebar-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.sidebar-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 9px;
  font-size: 11.5px;
  color: rgba(247, 241, 228, 0.55);
  background: transparent;
  border: 1px solid rgba(247, 241, 228, 0.1);
  transition: 0.16s ease;
}

.sidebar-link:hover {
  color: #fbf7ee;
  border-color: rgba(247, 241, 228, 0.25);
  background: rgba(247, 241, 228, 0.05);
  text-decoration: none;
}

.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none;
}

.view {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 34px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.6vw, 32px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
}

.page-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 5px;
  max-width: 620px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  background: none;
  border: none;
  padding: 0;
}

.back-link:hover {
  color: var(--brand-ink);
  text-decoration: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}

/* ---------- Mobile nav ---------- */
.mobile-nav {
  display: none;
}

.drawer-backdrop {
  display: none;
}

/* ---------- Grid & layout helpers ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wrap {
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid > * {
  min-width: 0;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fffdf8;
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn.is-loading {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--brand);
  color: #fffdf8;
}

.btn-primary:hover {
  background: var(--brand-2);
}

.btn-gold {
  background: var(--gold);
  color: #241c0a;
}

.btn-gold:hover {
  background: #d3a44f;
}

.btn-soft {
  background: var(--paper-2);
  color: var(--brand-ink);
  border-color: var(--line);
}

.btn-soft:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(15, 61, 62, 0.06);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger-soft {
  background: var(--red-soft);
  color: var(--red);
  border-color: #ecc6bf;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 9px;
  gap: 5px;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: var(--tap);
  padding: 0;
  flex: 0 0 var(--tap);
}

.btn-icon.btn-sm {
  width: 34px;
  flex-basis: 34px;
  min-height: 34px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: 0.15s ease;
}

.icon-btn:hover {
  color: var(--brand-ink);
  background: rgba(15, 61, 62, 0.06);
}

.icon-btn.danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.btn .spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Chips & badges ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: 0.15s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fffdf8;
}

.chip.gold.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #251d0b;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--bg-deep);
  color: var(--muted);
}

.badge-green {
  background: var(--green-soft);
  color: var(--green);
}

.badge-gold {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.badge-red {
  background: var(--red-soft);
  color: var(--red);
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-terra {
  background: var(--terra-soft);
  color: var(--terra);
}

.badge-brand {
  background: rgba(15, 61, 62, 0.09);
  color: var(--brand-ink);
}

.badge-neutral {
  background: #eee8db;
  color: #7b7568;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.card-body {
  padding: 16px 20px 20px;
}

.card.flush .card-body {
  padding: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--brand-ink);
  letter-spacing: -0.005em;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--brand-ink);
}

.section-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vh, 52px) clamp(32px, 5vw, 78px);
  background:
    radial-gradient(600px 400px at 15% 8%, color-mix(in srgb, var(--sidebar-accent) 24%, transparent), transparent 60%),
    linear-gradient(160deg, var(--sidebar-1) 0%, var(--sidebar-2) 50%, var(--sidebar-3) 100%);
  color: #f8f3e8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.login-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #f8f3e8;
  opacity: 0.42;
  pointer-events: none;
}

.login-brand > :not(.login-art) {
  position: relative;
  z-index: 1;
}

.login-brand-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-logo {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  border: 1px solid rgba(248, 243, 232, 0.18);
  background: rgba(248, 243, 232, 0.07);
  display: grid;
  place-items: center;
  color: var(--gold);
}

.login-brand-top strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.login-brand-top span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(248, 243, 232, 0.5);
  margin-top: 3px;
}

.login-quote {
  max-width: 480px;
  margin: clamp(22px, 5vh, 44px) 0;
}

.login-quote .eyebrow {
  color: var(--sidebar-accent);
}

.login-quote h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.7vw, 52px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 14px 0 18px;
}

.login-quote h1 em {
  color: var(--sidebar-accent);
  font-style: italic;
}

.login-quote p {
  color: rgba(248, 243, 232, 0.66);
  font-size: 14px;
  line-height: 1.7;
  max-width: 420px;
}

.login-brand-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: rgba(248, 243, 232, 0.45);
}

.login-brand-foot .line {
  width: 34px;
  height: 1px;
  background: color-mix(in srgb, var(--sidebar-accent) 55%, transparent);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vh, 48px) clamp(20px, 5vw, 64px);
}

.login-card {
  width: 100%;
  max-width: 410px;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--brand-ink);
  letter-spacing: -0.01em;
}

.login-card > p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
  margin-bottom: 22px;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.password-toggle:hover {
  color: var(--brand-ink);
  background: rgba(15, 61, 62, 0.05);
}

.demo-accounts {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.demo-accounts summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-accounts summary::-webkit-details-marker {
  display: none;
}

.demo-accounts summary:hover {
  color: var(--brand-ink);
}

.demo-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.demo-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  text-align: left;
  transition: 0.15s ease;
}

.demo-chip:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
}

.demo-chip code {
  font-family: var(--font);
  color: var(--muted);
  font-size: 11px;
}

.login-legal {
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-mobile-brand {
  display: none;
}

/* Layar desktop pendek: rapatkan panel agar formulir tetap terlihat penuh. */
@media (min-width: 821px) and (max-height: 820px) {
  .login-brand {
    padding-block: 28px;
  }
  .login-quote {
    margin: 18px 0;
  }
  .login-quote .eyebrow {
    font-size: 10px;
  }
  .login-quote h1 {
    font-size: clamp(28px, 2.9vw, 40px);
    margin: 10px 0 12px;
  }
  .login-quote p {
    font-size: 12.5px;
    line-height: 1.6;
  }
  .login-card h2 {
    font-size: 25px;
  }
  .login-card > p {
    margin-bottom: 18px;
  }
  .demo-accounts {
    margin-top: 16px;
    padding-top: 12px;
  }
  .login-legal {
    margin-top: 14px;
  }
}

/* ---------- Hero & dashboard ---------- */
.greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.greeting-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.greeting-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 620px;
}

.greeting-date {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 26px 30px;
  background:
    radial-gradient(500px 260px at 88% 10%, color-mix(in srgb, var(--sidebar-accent) 26%, transparent), transparent 65%),
    linear-gradient(120deg, var(--sidebar-1) 0%, var(--sidebar-2) 55%, var(--sidebar-3) 100%);
  color: #f9f4e9;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--sidebar-1) 22%, transparent);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 28px;
  align-items: center;
}

.hero-art {
  position: absolute;
  right: -34px;
  bottom: -58px;
  width: 560px;
  height: 340px;
  color: #f8f3e8;
  opacity: 0.5;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero > .hero-art {
  position: absolute;
  z-index: 0;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249, 244, 233, 0.58);
}

.hero-label .dot {
  background: var(--sidebar-accent);
}

.hero-balance {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
}

.hero-balance .currency {
  font-size: 0.45em;
  color: rgba(249, 244, 233, 0.55);
  margin-right: 8px;
  font-family: var(--font);
  letter-spacing: 0.04em;
  vertical-align: 0.35em;
}

.hero-caption {
  font-size: 12.5px;
  color: rgba(249, 244, 233, 0.62);
  max-width: 390px;
}

.hero-split {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 22px;
}

.hero-stat {
  min-width: 110px;
}

.hero-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(249, 244, 233, 0.46);
  margin-bottom: 3px;
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: #f9f4e9;
  font-variant-numeric: tabular-nums;
}

.hero-side {
  background: rgba(255, 253, 248, 0.07);
  border: 1px solid rgba(249, 244, 233, 0.11);
  border-radius: 15px;
  padding: 16px 17px;
  backdrop-filter: blur(4px);
}

.hero-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: rgba(249, 244, 233, 0.58);
}

.hero-side strong {
  font-size: 12.5px;
  color: #f9f4e9;
}

.hero-progress {
  margin-top: 12px;
}

.hero-progress .progress {
  background: rgba(255, 255, 255, 0.13);
  height: 8px;
}

.hero-progress .progress-bar {
  background: linear-gradient(
    90deg,
    var(--sidebar-accent),
    color-mix(in srgb, var(--sidebar-accent) 55%, #ffffff)
  );
}

.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: rgba(249, 244, 233, 0.55);
  margin-top: 7px;
}

.hero-side-foot {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(249, 244, 233, 0.12);
  font-size: 11.5px;
  color: rgba(249, 244, 233, 0.65);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.hero-side-line {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
  line-height: 1.5;
}

.hero-side-line svg {
  margin-top: 1px;
}

.hero-side-line span {
  min-width: 0;
}

.hero-side-foot a,
.hero-side-foot button {
  color: color-mix(in srgb, var(--sidebar-accent) 78%, #ffffff);
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
}

.progress {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-deep);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-3);
  transition: width 0.5s ease;
}

.progress-bar.gold {
  background: var(--gold);
}

.progress-bar.green {
  background: var(--green);
}

.progress-bar.red {
  background: var(--terra);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.stat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.red {
  background: var(--terra-soft);
  color: var(--terra);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-label {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.dash-grid > * {
  min-width: 0;
}

.chart-card {
  min-height: 300px;
}

.bars {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 210px;
  padding: 12px 4px 0;
  overflow-x: auto;
}

.bar-col {
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.bar-track {
  position: relative;
  width: 100%;
  max-width: 42px;
  flex: 1;
  border-radius: 9px 9px 4px 4px;
  background: #f0e9db;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.bar-target {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(15, 61, 62, 0.28);
  top: 0;
}

.bar-fill {
  width: 100%;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #2e716a, #0f3d3e);
  transition: height 0.5s ease;
  min-height: 3px;
}

.bar-fill.low {
  background: linear-gradient(180deg, #d98065, #b45b43);
}

.bar-fill.mid {
  background: linear-gradient(180deg, #d2a556, #b8822b);
}

.bar-label {
  font-size: 9.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.bar-value {
  font-size: 9.5px;
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 5px;
}

.legend-dot.green { background: var(--brand-3); }
.legend-dot.red { background: var(--terra); }
.legend-dot.gold { background: var(--gold); }

.week-card {
  background: linear-gradient(150deg, #fffdf8, #f8f1e1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
}

.week-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.week-date {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--brand-ink);
  font-weight: 600;
  line-height: 1.25;
}

.week-day {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 4px;
  font-weight: 600;
}

.week-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.week-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.week-progress {
  margin-top: auto;
}

.week-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 6px;
  color: var(--muted);
}

.week-progress-head strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.week-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  justify-content: center;
  height: 100%;
  min-height: 230px;
}

.week-empty h4 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--brand-ink);
}

.week-empty p {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 290px;
}

.cohort-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cohort-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  text-align: left;
  transition: 0.16s ease;
}

button.cohort-card {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.cohort-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.cohort-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.cohort-year {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--brand-ink);
}

.cohort-percent {
  font-size: 11px;
  color: var(--gold-deep);
  font-weight: 700;
  background: var(--gold-soft);
  padding: 2px 7px;
  border-radius: 6px;
}

.cohort-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 8px;
}

.cohort-meta strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.section-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.section-pill strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-item:first-child {
  padding-top: 2px;
}

.activity-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 700;
}

.activity-icon.gold {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.activity-main {
  flex: 1;
  min-width: 0;
}

.activity-main strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-main span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-amount {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.015em;
}

.label .req {
  color: var(--terra);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fffefa;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #aaa99f;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c9bfa9;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(46, 113, 106, 0.12);
  background-color: #fff;
}

.input.error,
.select.error,
.textarea.error {
  border-color: var(--red);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f7d76' 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 12px center;
  padding-right: 34px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input {
  flex: 1;
}

.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.error-text {
  font-size: 11.5px;
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.form-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 11px;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-line input[type="checkbox"],
.checkbox-line input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  flex: 0 0 17px;
}

.checkbox-line small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12.5px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #d8d0c1;
  position: relative;
  transition: 0.18s ease;
  flex: 0 0 38px;
}

.switch-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .switch-track {
  background: var(--brand-3);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.search-box {
  position: relative;
}

.search-box .input {
  padding-left: 36px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.filter-bar .field {
  min-width: 130px;
  flex: 1;
}

.filter-bar .field.search-field {
  min-width: 200px;
  flex: 1.5;
}

.filter-bar .filter-action {
  flex: 0 0 auto;
}

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-soft);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
}

:root[data-mode="dark"] .data-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-3) 18%, var(--paper));
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .strong {
  color: var(--ink);
  font-weight: 600;
}

.data-table .clickable {
  cursor: pointer;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cell-user .user-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 10.5px;
}

.cell-user .cell-main {
  min-width: 0;
}

.cell-user strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.cell-user small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.arrears-text {
  color: var(--terra);
  font-weight: 600;
}

.paid-text {
  color: var(--green);
  font-weight: 600;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 105px;
}

.mini-progress .progress {
  flex: 1;
  height: 5px;
}

.mini-progress span {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 10px 13px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--brand-ink);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.tab .count {
  display: inline-block;
  font-size: 9.5px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--muted);
  margin-left: 4px;
}

.tab.active .count {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.callout .callout-icon {
  flex: 0 0 20px;
  color: var(--muted);
  margin-top: 1px;
}

.callout strong {
  color: var(--ink-soft);
}

.callout-info {
  background: var(--blue-soft);
  border-color: #d3e1ec;
  color: #4b6578;
}

.callout-info .callout-icon {
  color: var(--blue);
}

.callout-warn {
  background: #fbf3df;
  border-color: #ecdcb4;
  color: #7c6225;
}

.callout-warn .callout-icon {
  color: var(--gold-deep);
}

.callout-danger {
  background: var(--red-soft);
  border-color: #ecc6bf;
  color: #8a3a30;
}

.callout-danger .callout-icon {
  color: var(--red);
}

.callout-success {
  background: var(--green-soft);
  border-color: #cfe4d6;
  color: #2f6449;
}

.callout-success .callout-icon {
  color: var(--green);
}

/* ---------- Meeting detail / payment rows ---------- */
.meeting-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meeting-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.15;
  margin-top: 3px;
}

.meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.meeting-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.summary-tile span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 600;
}

.summary-tile strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.summary-tile .sub {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.list-toolbar .search-box {
  min-width: 180px;
  flex: 1;
}

.list-toolbar .chip-row {
  gap: 5px;
}

.list-toolbar .chip {
  min-height: 31px;
  padding: 4px 10px;
  font-size: 11px;
}

.toolbar-count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.pay-list {
  display: flex;
  flex-direction: column;
}

.pay-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1.6fr) minmax(120px, 0.7fr) minmax(150px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}

.pay-row:last-child {
  border-bottom: 0;
}

.pay-row:hover {
  background: #fcf9f2;
}

.pay-row.is-paid {
  background: #fbfdf9;
}

.pay-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-select input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.pay-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.pay-person .user-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 10.5px;
}

.pay-person .pay-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-person .pay-meta {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pay-amount strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
}

.pay-amount small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.pay-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.pay-flags .badge {
  font-size: 8.5px;
  padding: 2px 6px;
  line-height: 1.3;
}

/* ---------- Konteks pembayaran & saldo lebih ---------- */
.pay-context {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 12px 13px;
  font-size: 11.5px;
  color: var(--muted);
}

.pay-context-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  margin-bottom: 6px;
}

.pay-context ul {
  margin: 0;
  padding-left: 17px;
  display: grid;
  gap: 4px;
  line-height: 1.5;
}

.pay-context strong {
  color: var(--ink-soft);
}

.pay-context-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
  font-size: 10.5px;
}

.pay-context-figures span {
  color: var(--muted);
}

.quick-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quick-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.quick-options .chip {
  height: auto;
  padding: 6px 9px;
  font-size: 10.5px;
}

.pay-preview {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  padding: 9px 11px;
}

.pay-preview-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.pay-preview-row strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

:root[data-mode="dark"] .pay-row:hover {
  background: var(--paper-2);
}

:root[data-mode="dark"] .pay-row.is-paid {
  background: color-mix(in srgb, var(--green) 10%, var(--paper));
}

:root[data-mode="dark"] .pay-context,
:root[data-mode="dark"] .pay-preview {
  background: var(--paper-2);
}

.pay-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.pay-actions .btn {
  min-height: 34px;
  font-size: 11.5px;
  padding: 5px 10px;
}

.pay-actions .status-label {
  font-size: 10.5px;
  color: var(--green);
  font-weight: 600;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: var(--gold-soft);
  border-bottom: 1px solid #e6d3a8;
  font-size: 11.5px;
  color: #6d541c;
  flex-wrap: wrap;
}

.selection-bar .row {
  gap: 7px;
}

/* ---------- Student profile ---------- */
.profile-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  background: var(--gold-soft);
  color: var(--brand-ink);
}

.profile-main {
  flex: 1;
  min-width: 220px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.2;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.profile-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.profile-contact span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.profile-stat {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
}

.profile-stat span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.profile-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Reports ---------- */
.report-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.report-stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
}

.report-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.report-stat strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.report-stat small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

.report-stat.accent {
  background: linear-gradient(140deg, #0f3d3e, #195451);
  border-color: transparent;
  color: #f9f4e9;
}

.report-stat.accent span,
.report-stat.accent small {
  color: rgba(249, 244, 233, 0.58);
}

.report-stat.accent strong {
  color: #f9f4e9;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.8fr) 88px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.bar-row .bar-name {
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row .progress {
  height: 9px;
}

.bar-row .bar-num {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gender-split {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.gender-chip {
  font-size: 10px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ---------- Funds ---------- */
.fund-list {
  display: flex;
  flex-direction: column;
}

.fund-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.fund-item:last-child {
  border-bottom: 0;
}

.fund-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.fund-main {
  min-width: 0;
}

.fund-main strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fund-main span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fund-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fund-actions {
  display: flex;
  gap: 1px;
}

.category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.category-pill strong {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- Import ---------- */
.dropzone {
  display: block;
  width: 100%;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper-2);
  padding: 24px 20px;
  text-align: center;
  transition: 0.16s ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--gold);
  background: #fdf7ea;
}

.dropzone.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 9px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
}

.dropzone strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.dropzone span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.dropzone input {
  display: none;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-item {
  display: flex;
  gap: 11px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.step-num {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.step-item strong {
  color: var(--ink-soft);
}

.mapping-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mapping-pill {
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.mapping-pill strong {
  color: var(--ink-soft);
}

.preview-table td,
.preview-table th {
  font-size: 11.5px;
}

.row-error {
  background: #fdf1ee !important;
}

.row-warn {
  background: #fdfaf0 !important;
}

.code-block {
  background: #0c292a;
  color: #e8dfc9;
  border-radius: 11px;
  padding: 14px;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.6;
  max-height: 320px;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}

.sync-status.ok {
  color: var(--green);
}

.sync-status.off {
  color: var(--muted);
}

/* ---------- Settings ---------- */
.settings-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.settings-block-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-ink);
}

.settings-block-head p {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.cash-highlight {
  background:
    radial-gradient(400px 200px at 90% 0%, rgba(200, 150, 62, 0.16), transparent 70%),
    var(--paper);
  border-color: #e5d3ae;
}

.cash-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}

.cash-value span {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.cash-input-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cash-input-row .field {
  flex: 1;
  min-width: 170px;
}

.lookup-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.lookup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.lookup-item:last-child {
  border-bottom: 0;
}

.lookup-item .lookup-name {
  flex: 1;
  font-weight: 500;
  color: var(--ink-soft);
}

.lookup-item .lookup-count {
  font-size: 10px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.lookup-item.inactive .lookup-name {
  color: var(--muted);
  text-decoration: line-through;
}

.lookup-add {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.lookup-add .input {
  flex: 1;
}

.danger-zone {
  border: 1px solid #ecc6bf;
  background: #fffaf8;
  border-radius: var(--radius);
  padding: 20px;
}

.danger-zone h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--red);
}

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 11.5px;
}

.info-list dt {
  color: var(--muted);
}

.info-list dd {
  margin: 0;
  color: var(--ink-soft);
  word-break: break-word;
}

/* ---------- Users & roles ---------- */
.role-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.role-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 15px;
}

.role-card .role-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.role-card h4 {
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 3px;
}

.role-card p {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Activity timeline ---------- */
.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  padding: 0 0 18px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-strong);
}

.timeline-item.pay .timeline-dot { border-color: var(--green); }
.timeline-item.create .timeline-dot { border-color: var(--blue); }
.timeline-item.delete .timeline-dot { border-color: var(--red); }
.timeline-item.update .timeline-dot { border-color: var(--gold); }
.timeline-item.login .timeline-dot { border-color: var(--muted-2); }
.timeline-item.import .timeline-dot { border-color: var(--terra); }

.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-head strong {
  font-size: 12.5px;
  color: var(--ink);
}

.timeline-head time {
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.timeline-body {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.55;
}

.timeline-user {
  font-size: 10.5px;
  color: var(--brand-link);
  font-weight: 600;
}

/* ---------- Modal / toast / empty ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 35, 34, 0.48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade-in 0.18s ease;
}

.modal {
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal.modal-sm {
  max-width: 410px;
}

.modal.modal-lg {
  max-width: 760px;
}

.modal.modal-xl {
  max-width: 960px;
}

.modal-head {
  padding: 20px 22px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.25;
}

.modal-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  margin-top: -3px;
}

.modal-close:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
}

.modal-foot {
  padding: 0 22px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-foot .left {
  margin-right: auto;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--brand);
  color: #fbf7ee;
  padding: 11px 14px;
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(15, 61, 62, 0.25);
  font-size: 12.5px;
  line-height: 1.45;
  animation: toast-in 0.25s ease;
  pointer-events: auto;
}

.toast .toast-icon {
  flex: 0 0 18px;
  margin-top: 1px;
  color: #e6c987;
}

.toast-success .toast-icon {
  color: #a9d7b9;
}

.toast-error {
  background: #8f352c;
}

.toast-error .toast-icon {
  color: #f3c4bb;
}

.toast-info {
  background: #3d586b;
}

.toast.leaving {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 42px 20px;
  gap: 5px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
  margin-bottom: 7px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--brand-ink);
  font-weight: 600;
}

.empty-text {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
}

.empty .btn {
  margin-top: 10px;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f1ebde 25%, #f8f4eb 50%, #f1ebde 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #efe8da 25%, #f8f4eb 50%, #efe8da 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.loading-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 0;
}

.loading-card {
  height: 120px;
}

/* ---------- Guard / hold button ---------- */
.guard-box {
  background: #fdf7e9;
  border: 1px solid #e9d6ab;
  border-radius: 13px;
  padding: 14px;
  margin-top: 6px;
}

.guard-box-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.guard-box-head .guard-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2e2bd;
  color: var(--gold-deep);
}

.guard-box-head strong {
  display: block;
  font-size: 12px;
  color: #6d541c;
}

.guard-box-head span {
  display: block;
  font-size: 10.5px;
  color: #8d7640;
  line-height: 1.5;
}

.duplicate-warn {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #efccc5;
  border-radius: 7px;
  padding: 6px 8px;
}

.hold-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  touch-action: none;
}

.hold-btn .hold-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.24);
  z-index: -1;
  transition: none;
}

.hold-btn.holding .hold-fill {
  width: 100%;
  transition: width 1.5s linear;
}

.hold-btn.hold-ready {
  background: var(--green) !important;
  color: #fff !important;
}

/* ---------- Presentation mode ---------- */
body.presentation {
  background: #0b2f30;
}

body.presentation .sidebar,
body.presentation .mobile-nav,
body.presentation .topbar,
body.presentation .page-head,
body.presentation .present-hide,
body.presentation .drawer-backdrop {
  display: none !important;
}

body.presentation .app-main {
  margin-left: 0;
}

body.presentation .view {
  max-width: 1440px;
  padding: 22px clamp(16px, 4vw, 48px) 40px;
}

body.presentation .hero {
  padding: clamp(26px, 4vw, 46px);
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

body.presentation .hero-balance {
  font-size: clamp(54px, 7vw, 92px);
}

body.presentation .greeting {
  margin-bottom: 18px;
}

body.presentation .greeting-title {
  font-size: clamp(32px, 4vw, 46px);
}

body.presentation .kpi-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

body.presentation .stat-value {
  font-size: 26px;
}

body.presentation .dash-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

body.presentation .card,
body.presentation .stat-card,
body.presentation .cohort-card,
body.presentation .week-card {
  background: #fffdf8;
}

body.presentation .present-toolbar {
  display: flex !important;
}

.present-toolbar {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 80;
  display: none;
  align-items: center;
  gap: 8px;
}

.present-toolbar .present-hint {
  font-size: 10px;
  color: rgba(249, 244, 233, 0.55);
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 7px;
}

.present-toolbar .btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f9f4e9;
}

body.presentation .hero-art {
  opacity: 0.34;
}

@media (max-width: 760px) {
  body.presentation .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  body.presentation .dash-grid {
    grid-template-columns: 1fr;
  }
  body.presentation .hero {
    grid-template-columns: 1fr;
  }
  body.presentation .view {
    padding: 14px 12px 30px;
  }
  body.presentation .hero-balance {
    font-size: clamp(40px, 12vw, 60px);
  }
}

/* ---------- Print ---------- */
@media print {
  .sidebar,
  .mobile-nav,
  .topbar,
  .page-actions,
  .page-head .back-link,
  .toast-root,
  .present-toolbar {
    display: none !important;
  }
  .app-main {
    margin-left: 0;
  }
  .view {
    max-width: none;
    padding: 0;
  }
  body {
    background: #fff;
  }
  .card,
  .profile-card,
  .summary-tile {
    box-shadow: none;
    break-inside: avoid;
  }
  .print-area {
    display: block;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-4,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-side {
    max-width: 460px;
  }
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cohort-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .role-cards {
    grid-template-columns: 1fr;
  }
  .role-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }
  .role-card .role-icon {
    margin-bottom: 0;
    flex: 0 0 31px;
  }
}

@media (max-width: 1099px) {
  .sidebar {
    transform: translateX(-104%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
    width: min(300px, 84vw);
    padding-bottom: 76px;
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
  }
  body.drawer-open .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(12, 35, 34, 0.42);
    backdrop-filter: blur(2px);
    z-index: 29;
    animation: fade-in 0.18s ease;
  }
  .app-main {
    margin-left: 0;
  }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.88);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }
  .topbar-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--brand-ink);
    display: grid;
    place-items: center;
  }
  .topbar-org {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .topbar-org .brand-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
    background: var(--brand);
    border: none;
    color: var(--gold);
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 5px max(6px, env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom));
    justify-content: space-around;
    box-shadow: 0 -4px 18px rgba(31, 46, 42, 0.05);
  }
  .mobile-nav-item {
    flex: 1;
    max-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 46px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 600;
    border-radius: 9px;
    text-decoration: none;
    padding: 4px 2px;
  }
  .mobile-nav-item:hover {
    text-decoration: none;
  }
  .mobile-nav-item.active {
    color: var(--brand-ink);
    background: rgba(15, 61, 62, 0.055);
  }
  .mobile-nav-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
  }
  .mobile-nav-item.active .mobile-nav-icon {
    color: var(--gold-deep);
  }
  .view {
    padding: 24px 20px calc(88px + env(safe-area-inset-bottom));
  }
  .toast-root {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 820px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
  .login-panel {
    min-height: 100vh;
    padding: 30px 20px;
    background:
      radial-gradient(500px 300px at 100% 0%, rgba(200, 150, 62, 0.16), transparent 65%),
      var(--bg);
  }
  .login-card {
    max-width: 430px;
    margin: auto;
  }
  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 32px;
  }
  .login-mobile-brand .login-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--brand);
    color: var(--gold);
    border: none;
  }
  .login-mobile-brand strong {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--brand-ink);
    font-weight: 600;
  }
  .login-mobile-brand span {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
  }
  .login-card h2 {
    font-size: 27px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 > .span-2,
  .grid-3 > .span-2 {
    grid-column: 1 / -1;
  }
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fund-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .fund-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
    margin-top: -4px;
  }
  .bar-row {
    grid-template-columns: 90px minmax(0, 1fr) 76px;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }
  .view {
    padding: 18px 14px calc(84px + env(safe-area-inset-bottom));
  }
  .topbar {
    height: 58px;
    padding: 0 13px;
  }
  .page-head {
    margin-bottom: 16px;
    gap: 12px;
  }
  .page-title {
    font-size: 24px;
  }
  .page-sub {
    font-size: 12px;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn:not(.btn-icon) {
    flex: 1;
  }
  .hero {
    padding: 22px 20px;
    border-radius: 18px;
    gap: 20px;
  }
  .hero-balance {
    font-size: clamp(34px, 10vw, 44px);
  }
  .hero-split {
    gap: 15px;
    margin-top: 18px;
  }
  .hero-stat strong {
    font-size: 16px;
  }
  .hero-side {
    padding: 14px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat-card {
    padding: 12px;
    gap: 9px;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-label {
    font-size: 9px;
  }
  .stat-meta {
    font-size: 9.5px;
  }
  .card-pad {
    padding: 16px;
  }
  .card-head {
    padding: 15px 16px 0;
  }
  .card-body {
    padding: 13px 16px 16px;
  }
  .cohort-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cohort-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 10px;
    padding: 12px 14px;
  }
  .cohort-head {
    margin-bottom: 0;
    gap: 8px;
    justify-content: flex-start;
  }
  .cohort-card .progress {
    grid-column: 1 / -1;
    margin-top: 7px;
  }
  .cohort-meta {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
  .cohort-percent {
    margin-left: auto;
  }
  .report-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .report-stat {
    padding: 11px 12px;
  }
  .report-stat strong {
    font-size: 17px;
  }
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .summary-tile {
    padding: 10px 12px;
  }
  .summary-tile strong {
    font-size: 17px;
  }
  .filter-bar {
    padding: 10px;
    gap: 8px;
  }
  .filter-bar .field {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
  }
  .filter-bar .field.search-field {
    min-width: 100%;
    flex-basis: 100%;
  }
  .filter-bar .filter-action {
    flex: 1 1 100%;
  }
  .filter-bar .filter-action .btn {
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
  .pay-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .pay-amount {
    text-align: left;
    grid-column: 2;
    padding-left: 43px;
    margin-top: -4px;
  }
  .pay-amount strong,
  .pay-amount small {
    display: inline;
    font-size: 10.5px;
    margin: 0 4px 0 0;
    color: var(--muted);
  }
  .pay-amount strong {
    color: var(--ink-soft);
  }
  .pay-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
  .pay-actions .status-label {
    display: none;
  }
  .pay-actions .btn {
    min-width: 74px;
  }
  .list-toolbar {
    padding: 10px 12px;
    gap: 7px;
  }
  .list-toolbar .search-box {
    min-width: 100%;
  }
  .list-toolbar .toolbar-count {
    margin-left: auto;
  }
  .selection-bar {
    padding: 8px 12px;
  }
  .profile-card {
    padding: 16px;
    gap: 13px;
  }
  .profile-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 17px;
  }
  .profile-name {
    font-size: 21px;
  }
  .profile-stats {
    gap: 7px;
    width: 100%;
  }
  .profile-stat {
    padding: 8px 10px;
  }
  .profile-stat strong {
    font-size: 16px;
  }
  .role-cards {
    gap: 8px;
  }
  .settings-block {
    padding: 16px;
  }
  .cash-value {
    font-size: 28px;
  }
  .bar-row {
    grid-template-columns: minmax(0, 1fr) 70px;
    gap: 4px 8px;
  }
  .bar-row .progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .bar-row .bar-num {
    grid-column: 2;
    grid-row: 1;
  }
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: none;
    max-height: 93vh;
    border-radius: 18px 18px 0 0;
    animation: sheet-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .modal-head {
    padding: 18px 16px 0;
  }
  .modal-body {
    padding: 14px 16px;
  }
  .modal-foot {
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-foot .btn {
    flex: 1;
  }
  .modal-foot .left {
    flex-basis: 100%;
    margin-bottom: 2px;
  }
  @keyframes sheet-in {
    from { transform: translateY(40px); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
  }
  .toast-root {
    left: 12px;
    right: 12px;
    max-width: none;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .toast {
    width: 100%;
  }
  .data-table th,
  .data-table td {
    padding: 9px 10px;
  }
  .hide-sm {
    display: none !important;
  }
  .summary-strip.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hide-xs {
    display: none !important;
  }
  .mobile-nav-item {
    font-size: 9px;
  }
  .login-panel {
    padding: 26px 18px;
  }
  .login-mobile-brand {
    margin-bottom: 24px;
  }
  .cash-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cash-input-row .btn {
    width: 100%;
  }
  .tabs {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 8px;
  }
  .tab {
    padding: 10px 10px 12px;
    font-size: 11.5px;
  }
  .tabs.with-border {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
  }
}

@media (min-width: 1100px) {
  .show-mobile {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .report-cards {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 11px 12px;
  }
  .hero-balance {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Logo unggahan ---------- */
.brand-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.brand-mark:has(.brand-logo-img),
.login-logo:has(.brand-logo-img) {
  background: transparent;
  border-color: transparent;
  overflow: hidden;
}

/* ---------- Menu akun (hover di kiri bawah) ---------- */
.user-menu-wrap {
  position: relative;
}

.user-card {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.user-menu-caret {
  margin-left: auto;
  opacity: 0.5;
  display: grid;
  place-items: center;
  transition: transform 0.16s ease;
}

.user-menu-wrap.open .user-menu-caret,
.user-menu-wrap:hover .user-menu-caret,
.user-menu-wrap:focus-within .user-menu-caret {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  padding: 6px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.user-menu-wrap:hover .account-menu,
.user-menu-wrap:focus-within .account-menu,
.user-menu-wrap.open .account-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-menu-head {
  padding: 9px 10px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.account-menu-head strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-head span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  transition: 0.14s ease;
}

.account-menu-item:hover {
  background: var(--paper-2);
  color: var(--brand-ink);
}

.account-menu-item.danger {
  color: var(--red);
}

.account-menu-item.danger:hover {
  background: var(--red-soft);
}

/* ---------- Preferensi akun ---------- */
.account-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.account-mini strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
}

.account-mini span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.account-photo {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.account-photo-figure {
  flex: 0 0 auto;
  line-height: 0;
}

.account-photo-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-photo-copy strong {
  font-size: 14px;
  color: var(--ink);
}

.account-photo-copy > span {
  font-size: 11px;
  color: var(--muted);
}

.account-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 3px;
}

.account-photo-copy .hint {
  margin-top: 2px;
}

.avatar-crop-stage {
  display: flex;
  justify-content: center;
}

.avatar-crop-frame {
  position: relative;
  width: min(300px, 66vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #0f1a18;
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.avatar-crop-frame.dragging {
  cursor: grabbing;
}

.avatar-crop-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-crop-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.avatar-crop-zoom-icon {
  display: inline-flex;
}

.avatar-crop-zoom input[type='range'] {
  flex: 1;
  accent-color: var(--brand-3);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
}

.segment {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  transition: 0.15s ease;
}

.segment:not(.active):not(:disabled):hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--brand-3) 8%, transparent);
}

.segment input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segment.active,
.segment:has(input:checked) {
  background: var(--paper);
  color: var(--brand-ink);
  box-shadow: var(--shadow-sm);
}

.segment:focus-within {
  outline: 2px solid color-mix(in srgb, var(--brand-3) 45%, transparent);
  outline-offset: 1px;
}

/* Ringkasan cepat saat menandai lunas */
.quick-pay-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}

.quick-pay-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.quick-pay-summary strong {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.quick-pay-summary .quick-pay-total {
  border-top: 1px dashed var(--line-strong);
  padding-top: 7px;
  margin-top: 1px;
}

.quick-pay-summary .quick-pay-total strong {
  font-size: 15px;
  color: var(--brand-ink);
}

/* Tombol lunasi tunggakan di daftar anggota */
.pay-arrears-btn {
  flex: 0 0 auto;
  min-height: 38px;
  height: 38px;
  padding: 0 10px;
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand-3) 12%, var(--paper));
  border-color: color-mix(in srgb, var(--brand-3) 32%, var(--line));
}

.pay-arrears-btn:hover {
  background: color-mix(in srgb, var(--brand-3) 20%, var(--paper));
}

/* Modal lunasi tunggakan per anggota */
.settle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settle-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.settle-all input,
.settle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-3);
  flex: 0 0 auto;
}

.settle-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.settle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.settle-row:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand-3) 45%, var(--line));
  background: var(--paper-2);
}

.settle-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settle-main strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.settle-main small {
  font-size: 10.5px;
  color: var(--muted);
}

.settle-amount {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.settle-row:has(input:checked) .settle-amount {
  color: var(--brand-ink);
}

.settle-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.settle-total strong {
  font-size: 16px;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}

/* Gambar QRIS di jendela pembayaran */
.qris-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--brand-3) 40%, var(--line));
  border-radius: 14px;
  background: var(--paper-2);
}

.qris-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.qris-panel-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand-3) 14%, var(--paper));
  color: var(--brand-ink);
}

.qris-panel-head strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.qris-panel-head small {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.qris-panel-image {
  display: flex;
  justify-content: center;
}

.qris-panel-image img {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.qris-panel-foot {
  font-size: 10.5px;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}

/* Pratinjau QRIS di Pengaturan */
.qris-settings {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.qris-settings-preview {
  width: 158px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.qris-settings-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 640px) {
  .settle-list {
    max-height: 38vh;
  }
  .qris-settings {
    flex-direction: column;
  }
  .qris-settings-preview {
    width: 132px;
  }
  .qris-panel-image img {
    max-width: 215px;
  }
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.theme-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.theme-chip[data-swatch="forest"] i { background: #173f2c; box-shadow: inset 0 0 0 2px #c9a24a; }
.theme-chip[data-swatch="ocean"] i { background: #123b52; box-shadow: inset 0 0 0 2px #d0a24f; }
.theme-chip[data-swatch="plum"] i { background: #3c2949; box-shadow: inset 0 0 0 2px #c79a58; }
.theme-chip[data-swatch="terracotta"] i { background: #5a2f26; box-shadow: inset 0 0 0 2px #d3a355; }
.theme-chip[data-swatch="slate"] i { background: #26343b; box-shadow: inset 0 0 0 2px #c3a46a; }
.theme-chip[data-swatch="mono"] i { background: #17181b; box-shadow: inset 0 0 0 2px #9aa0a6; }
.theme-chip.active {
  border-color: var(--gold);
  color: var(--ink-soft);
}

.theme-preview {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.theme-preview-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-preview-swatch {
  height: 18px;
  flex: 1;
  border-radius: 5px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-preview-box {
  width: 82px;
  height: 82px;
  border-radius: 16px;
  border: 1px dashed var(--line-strong);
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  overflow: hidden;
}

.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-preview-box .brand-fallback {
  width: 52px;
  height: 52px;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.fine-switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
}

.fine-note-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.fine-note-card svg {
  flex: none;
  margin-top: 1px;
  color: var(--brand-3);
}

.attendance-pills {
  display: inline-flex;
  gap: 4px;
}

.att-pill {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  background: var(--paper-2);
  color: var(--muted);
}

.att-pill.present {
  background: color-mix(in srgb, var(--green) 12%, var(--paper));
  color: var(--green);
}

.att-pill.late {
  background: color-mix(in srgb, var(--gold) 16%, var(--paper));
  color: color-mix(in srgb, var(--gold) 82%, var(--ink));
}

.att-pill.absent {
  background: color-mix(in srgb, var(--red) 11%, var(--paper));
  color: var(--red);
}

/* ---------- Kehadiran ---------- */
.meeting-tabs {
  margin-top: -2px;
}

.meeting-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.att-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.att-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--paper);
}

.att-stat span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.att-stat strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
}

.att-stat small {
  font-size: 10.5px;
  color: var(--muted);
}

.att-stat.is-present strong {
  color: var(--green);
}

.att-stat.is-late strong {
  color: var(--gold);
}

.att-stat.is-absent strong {
  color: var(--red);
}

.att-bulk-bar:empty {
  display: none;
}

.att-bulk-bar .selection-bar {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.att-complete {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--green) 6%, var(--paper));
}

.att-list {
  display: flex;
  flex-direction: column;
}

.att-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(122px, 0.65fr) minmax(250px, 0.95fr);
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}

.att-row:last-child {
  border-bottom: 0;
}

.att-row:hover {
  background: color-mix(in srgb, var(--gold) 6%, var(--paper));
}

.att-row.is-late {
  background: color-mix(in srgb, var(--gold) 7%, var(--paper));
}

.att-row.is-absent {
  background: color-mix(in srgb, var(--red) 5%, var(--paper));
}

.att-row.is-present {
  background: color-mix(in srgb, var(--green) 4%, var(--paper));
}

.att-current {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.att-current small {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.att-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.att-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 1;
  min-width: 0;
}

.att-segmented .segment {
  padding: 7px 5px;
  font-size: 11px;
  white-space: nowrap;
}

.att-segmented .segment:disabled {
  cursor: default;
  opacity: 0.72;
}

.att-segmented .segment.active[data-att-status='present'] {
  background: color-mix(in srgb, var(--green) 15%, var(--paper));
  color: var(--green);
  box-shadow: none;
}

.att-segmented .segment.active[data-att-status='late'] {
  background: color-mix(in srgb, var(--gold) 18%, var(--paper));
  color: color-mix(in srgb, var(--gold) 82%, var(--ink));
  box-shadow: none;
}

.att-segmented .segment.active[data-att-status='absent'] {
  background: color-mix(in srgb, var(--red) 13%, var(--paper));
  color: var(--red);
  box-shadow: none;
}

@media (max-width: 900px) {
  .att-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .att-current {
    display: none;
  }

  .att-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .att-segmented {
    max-width: 360px;
  }
}

@media (max-width: 640px) {
  .att-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .att-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .att-controls {
    grid-column: 1;
  }

  .att-segmented {
    max-width: none;
  }
}

/* ---------- Penyesuaian mode gelap ---------- */
:root[data-mode="dark"] body {
  background:
    radial-gradient(1200px 600px at 90% -10%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
    var(--bg);
}

:root[data-mode="dark"] .topbar {
  background: rgba(20, 29, 27, 0.9);
}

:root[data-mode="dark"] .mobile-nav {
  background: rgba(20, 29, 27, 0.95);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.3);
}

:root[data-mode="dark"] .input,
:root[data-mode="dark"] .select,
:root[data-mode="dark"] .textarea {
  background-color: var(--paper-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

:root[data-mode="dark"] .input::placeholder,
:root[data-mode="dark"] .textarea::placeholder {
  color: var(--muted-2);
}

:root[data-mode="dark"] .input:hover,
:root[data-mode="dark"] .select:hover,
:root[data-mode="dark"] .textarea:hover {
  border-color: var(--muted-2);
}

:root[data-mode="dark"] .input:focus,
:root[data-mode="dark"] .select:focus,
:root[data-mode="dark"] .textarea:focus {
  background-color: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-3) 28%, transparent);
}

:root[data-mode="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a69e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-mode="dark"] .badge-neutral {
  background: var(--bg-deep);
  color: var(--muted);
}

:root[data-mode="dark"] .badge-brand {
  background: rgba(127, 209, 200, 0.14);
  color: var(--brand-ink);
}

:root[data-mode="dark"] .badge-green {
  color: #8fd8b0;
}

:root[data-mode="dark"] .badge-blue {
  color: #93bedd;
}

:root[data-mode="dark"] .badge-gold {
  color: #e2bd76;
}

:root[data-mode="dark"] .badge-terra {
  color: #e8a28d;
}

:root[data-mode="dark"] .badge-red {
  color: #e79b91;
}

:root[data-mode="dark"] .paid-text {
  color: #8fd8b0;
}

:root[data-mode="dark"] .arrears-text {
  color: #e8a28d;
}

:root[data-mode="dark"] .bar-track {
  background: var(--bg-deep);
}

:root[data-mode="dark"] .week-card {
  background: linear-gradient(150deg, var(--paper), var(--paper-2));
}

:root[data-mode="dark"] .callout-warn {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 28%, var(--line));
  color: #e4c98d;
}

:root[data-mode="dark"] .callout-info {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  color: #a9c6da;
}

:root[data-mode="dark"] .callout-danger {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  color: #e3aaa2;
}

:root[data-mode="dark"] .callout-success {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  color: #a9d7b9;
}

:root[data-mode="dark"] .switch-track {
  background: var(--line-strong);
}

:root[data-mode="dark"] .switch-track::after {
  background: var(--paper);
}

:root[data-mode="dark"] .demo-chip:hover,
:root[data-mode="dark"] .dropzone:hover,
:root[data-mode="dark"] .dropzone.dragover {
  background: var(--gold-soft);
}

:root[data-mode="dark"] .row-error {
  background: var(--red-soft) !important;
}

:root[data-mode="dark"] .row-warn {
  background: var(--gold-soft) !important;
}

:root[data-mode="dark"] .danger-zone {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
}

:root[data-mode="dark"] .guard-box {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
}

:root[data-mode="dark"] .guard-box-head .guard-icon {
  background: color-mix(in srgb, var(--gold) 28%, var(--paper));
}

:root[data-mode="dark"] .guard-box-head strong,
:root[data-mode="dark"] .guard-box-head span {
  color: #e4c98d;
}

:root[data-mode="dark"] body.presentation {
  background: var(--bg-deep);
}

:root[data-mode="dark"] body.presentation .card,
:root[data-mode="dark"] body.presentation .stat-card,
:root[data-mode="dark"] body.presentation .cohort-card,
:root[data-mode="dark"] body.presentation .week-card {
  background: var(--paper);
}

:root[data-mode="dark"] .skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
}

:root[data-mode="dark"] .login-brand {
  color: #f8f3e8;
}

:root[data-mode="dark"] .login-panel {
  background: var(--bg);
}

:root[data-mode="dark"] .demo-accounts {
  border-color: var(--line);
}

:root[data-mode="dark"] .progress {
  background: var(--bg-deep);
}

:root[data-mode="dark"] .data-table thead th {
  background: var(--paper-2);
}

@media (max-width: 1099px) {
  .sidebar-foot {
    padding-bottom: 4px;
  }
}

/* ---------- Penyesuaian skema mono ---------- */
:root[data-scheme="mono"] body {
  background:
    radial-gradient(1100px 560px at 90% -10%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 62%),
    radial-gradient(900px 480px at -10% 100%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 62%),
    var(--bg);
}

:root[data-scheme="mono"][data-mode="dark"] body {
  background:
    radial-gradient(1100px 560px at 90% -10%, rgba(255, 255, 255, 0.045), transparent 62%),
    radial-gradient(900px 480px at -10% 100%, rgba(255, 255, 255, 0.025), transparent 62%),
    var(--bg);
}

:root[data-scheme="mono"][data-mode="dark"] .topbar {
  background: rgba(11, 12, 13, 0.9);
}

:root[data-scheme="mono"][data-mode="dark"] .mobile-nav {
  background: rgba(11, 12, 13, 0.95);
}

:root[data-scheme="mono"] .btn-ghost:hover,
:root[data-scheme="mono"] .icon-btn:hover,
:root[data-scheme="mono"] .mobile-nav-item.active,
:root[data-scheme="mono"] .password-toggle:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

:root[data-scheme="mono"] .badge-brand {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}

:root[data-scheme="mono"] .btn-gold:hover {
  background: var(--gold-deep);
}

:root[data-scheme="mono"] .badge-neutral {
  background: #ecedef;
  color: #5f6368;
}

:root[data-scheme="mono"][data-mode="dark"] .badge-neutral {
  background: #232529;
  color: #aeb2b7;
}

/* ---------- Kehadiran & inventaris ---------- */
.stat-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.inventory-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.inventory-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.inventory-card.archived {
  opacity: 0.72;
}

.inventory-card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(240px 120px at 80% 0%, rgba(200, 150, 62, 0.14), transparent 70%),
    var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.inventory-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.inventory-photo.placeholder {
  color: var(--muted-2);
}

.inventory-status {
  position: absolute;
  top: 8px;
  left: 8px;
}

.archive-flag {
  left: auto;
  right: 8px;
}

.inventory-card-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.inventory-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.inventory-card-head strong {
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink);
}

.inventory-qty {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}

.inventory-card-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.01em;
}

.inventory-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10.5px;
  color: var(--muted);
}

.inventory-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.inventory-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.inventory-value {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
}

.inventory-detail {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.inventory-media {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
}

.inventory-media-photo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-media-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-stamp {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(15, 61, 62, 0.82);
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.photo-empty span {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.photo-empty small {
  font-size: 10.5px;
  line-height: 1.5;
}

.inventory-facts dd {
  text-align: right;
}

.inventory-timestamps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--muted);
}

.inventory-timestamps span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.inventory-doc-list,
.inventory-service-list,
.inventory-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inventory-doc {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
}

.inventory-doc-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--brand);
  flex: none;
}

.inventory-doc-main {
  flex: 1;
  min-width: 0;
}

.inventory-doc-main strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-doc-main small {
  font-size: 10.5px;
  color: var(--muted);
}

.inventory-service {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: var(--paper-2);
}

.inventory-service-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.inventory-service-head strong {
  font-size: 12.5px;
}

.inventory-service-head span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.inventory-service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}

.inventory-service-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inventory-service p {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.55;
}

.inventory-log-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.inventory-log-item:last-child {
  border-bottom: none;
}

.inventory-log-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--brand);
  flex: none;
}

.inventory-log-main strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.5;
}

.inventory-log-main small {
  font-size: 10px;
  color: var(--muted);
}

.inventory-upload {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.category-color-input {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  cursor: pointer;
  flex: none;
}

.btn-icon {
  padding: 0;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
}

.scanner-view {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0a2426;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scanner-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 13% 10%;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(6, 26, 28, 0.35);
  pointer-events: none;
}

.scanner-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 36, 38, 0.78);
  color: #fff;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .inventory-detail {
    grid-template-columns: 1fr;
  }
  .inventory-media {
    position: static;
  }
  .inventory-media > .settings-block:first-child {
    display: grid;
    grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .inventory-media > .settings-block:first-child .inventory-media-photo {
    grid-row: span 3;
  }
}

@media (max-width: 720px) {
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .inventory-media > .settings-block:first-child {
    grid-template-columns: 1fr;
  }
  .inventory-media > .settings-block:first-child .inventory-media-photo {
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
  .inventory-doc {
    flex-wrap: wrap;
  }
  .inventory-doc-main {
    flex-basis: calc(100% - 44px);
  }
}

@media (max-width: 520px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
  .inventory-card-photo {
    aspect-ratio: 16 / 10;
  }
  .report-cards {
    grid-template-columns: 1fr;
  }
}
