:root {
  --ink: #14231f;
  --muted: #65756f;
  --green-950: #08251d;
  --green-900: #0b3328;
  --green-800: #0f4c3a;
  --green-700: #146c52;
  --green-100: #e4f2ec;
  --gold: #d9a441;
  --gold-soft: #fbf3e2;
  --bg: #f4f6f2;
  --card: #ffffff;
  --line: #e4e8e1;
  --line-strong: #d3d9d0;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #b54708;
  --warning-soft: #fef3e6;
  --info: #175cd3;
  --info-soft: #eaf1fd;
  --success: #067647;
  --success-soft: #e7f6ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 10px 28px rgba(16, 24, 20, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-800); }
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; color: var(--ink); margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.app-shell { min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 262px;
  background:
    radial-gradient(circle at 15% 12%, rgba(217, 164, 65, .16), transparent 32%),
    linear-gradient(165deg, var(--green-950), var(--green-800) 70%, #0d4233);
  color: #e9f3ee;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .22s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold), #b9832a);
  color: var(--green-950);
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 21px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: Georgia, serif; font-size: 17px; color: #fff; letter-spacing: .01em; }
.brand-text span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: rgba(233, 243, 238, .58); margin-top: 3px; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 10px; }

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: rgba(233, 243, 238, .4);
  padding: 20px 12px 8px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(233, 243, 238, .82);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: background .15s ease, color .15s ease;
}

.nav-link svg { width: 17px; height: 17px; opacity: .75; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active {
  background: rgba(217, 164, 65, .15);
  border-left-color: var(--gold);
  color: #fff;
}
.nav-link.active svg { color: var(--gold); opacity: 1; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 16px;
}

.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(217, 164, 65, .2);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  flex: none;
  border: 1px solid rgba(217, 164, 65, .32);
}
.avatar.light { background: var(--green-100); color: var(--green-800); border: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 21px; }
.user-info { min-width: 0; flex: 1; }
.user-info strong { display: block; font-size: 12.8px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { display: block; font-size: 10.8px; color: rgba(233, 243, 238, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logout-btn {
  background: none;
  border: 0;
  color: rgba(233, 243, 238, .6);
  padding: 6px;
  cursor: pointer;
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.logout-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.logout-btn svg { width: 17px; height: 17px; }

/* Main */
.main { margin-left: 262px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 68px;
  background: rgba(244, 246, 242, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { font-weight: 600; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); }
.branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-800);
}
.branch-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.menu-btn {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}
.menu-btn svg { width: 19px; height: 19px; display: block; }

.content { padding: 28px 30px 50px; max-width: 1500px; width: 100%; }

/* Page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; color: var(--green-700); margin-bottom: 6px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 17px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.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)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* KPI */
.kpi { position: relative; padding: 20px; overflow: hidden; }
.kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--green-100);
  opacity: .55;
}
.kpi.gold::after { background: var(--gold-soft); }
.kpi.red::after { background: var(--danger-soft); }
.kpi.blue::after { background: var(--info-soft); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; }
.kpi-value { font-size: 25px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.kpi-foot { margin-top: 7px; font-size: 12px; color: var(--muted); position: relative; z-index: 1; }
.icon-tile {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--green-100); color: var(--green-800); flex: none;
}
.icon-tile.gold { background: var(--gold-soft); color: #92660e; }
.icon-tile.red { background: var(--danger-soft); color: var(--danger); }
.icon-tile.blue { background: var(--info-soft); color: var(--info); }
.icon-tile svg { width: 18px; height: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 16px;
  background: #fafbf8;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #edf0ea; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcf9; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .strong { font-weight: 600; }
.table .small { font-size: 11.8px; color: var(--muted); }
.table tfoot td { background: #fafbf8; font-weight: 700; border-top: 1.5px solid var(--line-strong); }
.table.compact td, .table.compact th { padding: 9px 12px; }

.primary-cell { display: flex; align-items: center; gap: 10px; }
.primary-cell .meta { display: flex; flex-direction: column; line-height: 1.35; }
.primary-cell .meta span { font-size: 11.6px; color: var(--muted); }

/* Chips & badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  background: #f0f2ee;
  color: #4b5a54;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.neutral { background: #f0f2ee; color: #53625c; }
.chip.gold { background: var(--gold-soft); color: #92660e; }
.chip.plain::before { display: none; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--green-100); color: var(--green-800); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--green-800); color: #fff; box-shadow: 0 6px 14px rgba(15, 76, 58, .18); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-secondary { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--green-700); color: var(--green-800); background: #fdfefc; }
.btn-gold { background: var(--gold); color: #3a2a08; }
.btn-gold:hover { background: #e5b155; color: #3a2a08; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f6d5d1; }
.btn-danger:hover { background: #fbdcd8; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef1eb; color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: #3c4a45; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.req { color: var(--danger); }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 39px;
}
textarea { resize: vertical; min-height: 78px; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(20, 108, 82, .11); }
input:disabled, select:disabled { background: #f4f6f2; color: var(--muted); }
input[type="file"] { padding: 7px; background: #fafbf8; }
.field-validation-error, .text-danger { color: var(--danger); font-size: 11.8px; }
.validation-summary-errors { background: var(--danger-soft); border: 1px solid #f5d2ce; color: #7a1c13; border-radius: 9px; padding: 12px 14px; margin-bottom: 16px; font-size: 12.8px; }
.validation-summary-errors ul { margin: 0; padding-left: 17px; }
.journal-lines-wrap { overflow: visible; }
.account-picker { position: relative; }
.account-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(16, 40, 30, .16);
  padding: 4px;
}
.account-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.8px;
  color: var(--ink);
  cursor: pointer;
}
.account-option:hover, .account-option.active { background: #eef4ee; color: var(--green-800); }
.account-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.validation-summary-valid { display: none; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.form-section { margin-bottom: 26px; }
.form-section h3 { font-size: 15px; margin-bottom: 4px; }
.form-section .desc { font-size: 12.2px; color: var(--muted); margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--green-800); min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 11px; padding: 18px; margin: 0 0 18px; }
legend { font-size: 13px; font-weight: 700; color: var(--green-800); padding: 0 7px; }

/* Filters */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fcfdfb;
}
.filter-bar .field { min-width: 145px; }
.filter-bar .field.grow { flex: 1; min-width: 220px; }
.filter-bar .field > label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.filter-bar input, .filter-bar select { min-height: 36px; padding: 7px 10px; font-size: 12.8px; }

/* Flash */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  border: 1px solid;
  animation: fadeIn .25s ease;
}
.flash.success { background: var(--success-soft); border-color: #c8e9d7; color: #05603a; }
.flash.error { background: var(--danger-soft); border-color: #f5d2ce; color: #7a1c13; }
.flash.info { background: var(--info-soft); border-color: #d3e2fb; color: #124b9f; }
.flash svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Dashboard */
.chart { display: flex; align-items: flex-end; gap: 22px; height: 190px; padding: 10px 6px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar-track { width: 100%; max-width: 52px; flex: 1; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--green-700), var(--green-800));
  min-height: 4px;
  position: relative;
  transition: opacity .15s;
}
.chart-bar.gold { background: linear-gradient(180deg, #e2b45e, var(--gold)); }
.chart-col:hover .chart-bar { opacity: .82; }
.chart-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.chart-value { font-size: 10.8px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid #edf0ea; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item strong { font-size: 13px; display: block; }
.list-item .sub { font-size: 11.5px; color: var(--muted); }
.list-item .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-item .date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { width: 46px; height: 46px; border-radius: 50%; background: #f0f3ee; display: grid; place-items: center; margin: 0 auto 10px; color: #92a19a; }
.empty-icon svg { width: 21px; height: 21px; }

/* Detail */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; }
.detail-item { min-width: 0; }
.detail-item .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.detail-item .val { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.hero-card {
  background: linear-gradient(135deg, var(--green-900), var(--green-800) 55%, #17624b);
  color: #fff;
  border: 0;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  border: 34px solid rgba(217, 164, 65, .14);
  right: -80px; top: -100px;
}
.hero-card h1, .hero-card h2 { color: #fff; }
.hero-card .muted { color: rgba(255, 255, 255, .62); }
.hero-card .detail-item .lbl { color: rgba(255, 255, 255, .5); }
.hero-card .detail-item .val { color: #fff; }
.hero-money { display: flex; gap: 38px; flex-wrap: wrap; margin-top: 20px; position: relative; z-index: 1; }
.hero-money .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .52); }
.hero-money .val { font-family: Georgia, serif; font-size: 27px; font-weight: 700; margin-top: 2px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }

.money-pos { color: var(--success); font-weight: 700; }
.money-neg { color: var(--danger); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.progress { height: 7px; border-radius: 99px; background: #edf0ea; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-700), #28a37b); }
.progress.gold > span { background: linear-gradient(90deg, var(--gold), #e7bd6d); }

.note {
  background: var(--gold-soft);
  border: 1px solid #f1e2c2;
  color: #6e4d0d;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 12.6px;
}
.note strong { color: #5b3f08; }

.quote-box {
  border: 1px dashed var(--line-strong);
  background: #fbfcf8;
  border-radius: 11px;
  padding: 16px;
}
.quote-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.quote-row.total { border-top: 1px solid var(--line-strong); margin-top: 7px; padding-top: 10px; font-weight: 700; font-size: 15px; }

/* Login */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-brand {
  background:
    radial-gradient(circle at 80% 15%, rgba(217, 164, 65, .22), transparent 38%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .06), transparent 40%),
    linear-gradient(160deg, var(--green-950), var(--green-800));
  color: #fff;
  padding: 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border: 55px solid rgba(217, 164, 65, .1);
  border-radius: 50%;
  bottom: -190px; right: -130px;
}
.auth-brand .brand { border: 0; padding: 0; position: relative; z-index: 1; }
.auth-copy { position: relative; z-index: 1; max-width: 480px; }
.auth-copy h1 { color: #fff; font-size: 42px; line-height: 1.16; margin-bottom: 16px; }
.auth-copy p { color: rgba(255, 255, 255, .65); font-size: 14.5px; max-width: 400px; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.auth-point { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .8); }
.auth-point span.dot { width: 22px; height: 22px; border-radius: 50%; background: rgba(217, 164, 65, .16); color: var(--gold); display: grid; place-items: center; font-size: 11px; flex: none; }
.auth-foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255, 255, 255, .4); }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h2 { font-size: 29px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.auth-box .field { margin-bottom: 15px; }
.auth-submit { width: 100%; padding: 11px; margin-top: 6px; }
.demo-box { margin-top: 24px; border: 1px solid var(--line); background: #fff; border-radius: 11px; overflow: hidden; }
.demo-box .demo-head { padding: 10px 14px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: #fafbf8; border-bottom: 1px solid var(--line); }
.demo-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; font-size: 12px; border-bottom: 1px solid #f0f3ee; }
.demo-row:last-child { border-bottom: 0; }
.demo-row code { font-family: Consolas, monospace; font-size: 11.5px; color: var(--green-800); background: var(--green-100); padding: 1px 5px; border-radius: 4px; }
.demo-row .role { color: var(--muted); }

/* Misc */
.pagination { display: flex; gap: 6px; padding: 14px 18px; align-items: center; justify-content: flex-end; }
.page-num { padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12px; color: var(--muted); background: #fff; }
.page-num.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.statement-section { margin-bottom: 22px; }
.statement-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.statement-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: 13px; }
.statement-line:last-child { border-bottom: 0; }
.statement-total { display: flex; justify-content: space-between; padding: 11px 0 0; border-top: 1.5px solid var(--ink); font-weight: 700; font-size: 14px; }
.statement-total.grand { font-size: 16px; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.report-tabs a { padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.report-tabs a:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.report-tabs a.active { background: var(--green-800); color: #fff; }
.report-tabs a.active:hover { color: #fff; }
.avatar-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.avatar-photo.sm { width: 34px; height: 34px; }
.photo-frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f5f7f2; width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame .ph { font-size: 12px; color: var(--muted); text-align: center; padding: 10px; }
.code { font-family: Consolas, monospace; font-size: 12px; background: #f2f4f0; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }


/* Responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.sidebar-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; place-items: center; }
  .content { padding: 22px 18px 40px; }
  .topbar { padding: 0 18px; }
  .topbar-right .date { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 24px; }
  .kpi-value { font-size: 22px; }
  .chart { gap: 10px; }
  .chart-value { display: none; }
  .filter-bar .field { flex: 1 1 45%; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .topbar-right { gap: 8px; }
  .branch-pill { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}

/* Reports */
.section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  color: var(--muted);
  margin: 4px 0 12px;
}
.report-card {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.report-card:hover {
  border-color: var(--green-700);
  box-shadow: 0 12px 30px rgba(16, 24, 20, .08);
  transform: translateY(-1px);
  color: inherit;
}
.report-card h3 { font-size: 16px; margin-bottom: 4px; }
.report-card p { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.report-link { font-size: 12px; font-weight: 700; color: var(--green-700); }
.report-group td {
  background: #f7f9f5;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--muted);
  padding-top: 15px;
}

/* Loan statement */
.statement-doc { display: flex; flex-direction: column; gap: 18px; }
.statement-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 26px 30px 28px;
  color: #f2f8f5;
  background:
    radial-gradient(circle at 88% -10%, rgba(217, 164, 65, .22), transparent 42%),
    linear-gradient(135deg, var(--green-950), var(--green-800) 62%, #115441);
  box-shadow: var(--shadow);
}
.statement-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 40px solid rgba(217, 164, 65, .10);
}
.statement-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.statement-brand { display: flex; align-items: center; gap: 12px; }
.statement-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.statement-brand-name { font-family: Georgia, serif; font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .01em; }
.statement-brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: rgba(242, 248, 245, .55); margin-top: 2px; }
.statement-hero-meta { text-align: right; }
.statement-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; font-weight: 700; color: rgba(242, 248, 245, .55); }
.statement-hero-meta .statement-kicker { color: var(--gold); }
.statement-number { font-family: Georgia, serif; font-size: 19px; font-weight: 700; margin-top: 3px; }
.statement-generated { font-size: 11.5px; color: rgba(242, 248, 245, .62); margin-top: 3px; }
.statement-hero-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.statement-customer { font-size: 26px; color: #fff; margin: 6px 0 6px; }
.statement-meta-line { font-size: 12.5px; color: rgba(242, 248, 245, .72); }
.statement-meta-line .code { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }
.statement-hero-amount { text-align: right; }
.statement-hero-amount .statement-kicker { color: var(--gold); }
.statement-amount { font-family: Georgia, serif; font-size: 30px; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.statement-hero .chip { background: rgba(255, 255, 255, .12); color: #f2f8f5; }
.statement-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.statement-summary .cell { padding: 18px 22px; border-right: 1px solid var(--line); min-width: 0; }
.statement-summary .cell:last-child { border-right: 0; }
.statement-summary .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.statement-summary .val { font-family: Georgia, serif; font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.statement-summary .chip { font-family: "Segoe UI", system-ui, sans-serif; font-size: 11px; }
.statement-summary .foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.statement-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.statement-section-title h2 { font-size: 16px; }
.statement-section-title .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.statement-party { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.statement-party h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--green-700); margin-bottom: 8px; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 700; }
.statement-party p { font-size: 12.5px; margin: 0 0 3px; color: var(--ink); }
.statement-party .muted { color: var(--muted); }
.statement-party .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.statement-table .receipt { font-family: Consolas, monospace; font-size: 11.5px; }
.statement-table th { background: #f7f9f5; }
.statement-table .chip { padding: 2px 7px; font-size: 10px; }
.statement-footer { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; flex-wrap: wrap; }
.statement-sign { min-width: 200px; text-align: center; }
.statement-sign .line { height: 1px; background: var(--line-strong); margin-bottom: 6px; }
.statement-sign .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.summary-block { break-inside: avoid; page-break-inside: avoid; }
.summary-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: #eef2ec; }
.summary-bar span { display: block; height: 100%; }
.summary-bar .male { background: var(--green-700); }
.summary-bar .female { background: var(--gold); }
.statement-doc .statement-section-title h2 { font-family: Georgia, serif; letter-spacing: 0; }

.mcag-anchor-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mcag-anchor-nav a { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: #fff; }
.mcag-anchor-nav a:hover { color: var(--green-800); border-color: var(--green-700); }
.mcag-doc { gap: 20px; }
.mcag-section { break-inside: auto; }
.mcag-table td, .mcag-table th { font-size: 12.5px; padding: 6px 10px; vertical-align: top; }
.mcag-table .mcag-code { width: 60px; font-family: Consolas, monospace; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mcag-table .mcag-label { font-weight: 600; }
.mcag-table .mcag-def { font-size: 11px; color: var(--muted); line-height: 1.35; }
.mcag-table tr.group td { background: #f2f6ef; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--green-800); padding: 7px 10px; }
.mcag-table tr.total td { border-top: 1.5px solid var(--ink); font-weight: 700; background: #fbfcf9; }
.mcag-table tr.grand td { font-weight: 700; background: #f4f8f1; border-top: 2px solid var(--green-800); }
.mcag-table tr.grand td.num { color: var(--green-800); font-size: 13px; }
.mcag-region-table td, .mcag-region-table th { font-size: 11px; padding: 5px 7px; }
.mcag-region-table th.num { white-space: nowrap; }
.mcag-check-summary { padding: 12px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.mcag-check-summary.ok { background: var(--success-soft); color: var(--success); }
.mcag-check-summary.bad { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1080px) {
  .statement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statement-summary .cell:nth-child(2) { border-right: 0; }
  .statement-summary .cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .statement-hero { padding: 22px; }
  .statement-hero-top { flex-wrap: wrap; }
  .statement-hero-meta { text-align: left; }
  .statement-hero-body { align-items: flex-start; gap: 18px; }
  .statement-hero-amount { text-align: left; }
  .statement-customer { font-size: 22px; }
  .statement-amount { font-size: 25px; }
  .statement-summary { grid-template-columns: 1fr; }
  .statement-summary .cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .statement-summary .cell:last-child { border-bottom: 0; }
  .statement-party { grid-template-columns: 1fr; gap: 16px; }
  .statement-footer { flex-direction: column; align-items: stretch; }
  .statement-sign { width: 100%; }
}

@page { size: A4; margin: 12mm; }

@media print {
  html, body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .statement-page-head, .page-actions, .filter-bar, .form-actions, .btn, .flash { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11px; }
  .card { border: 1px solid #d8ddd6; box-shadow: none; border-radius: 8px; }
  .table th { background: #f1f4ef !important; }
  .table-wrap { overflow: visible !important; }
  .statement-doc { gap: 12px; }
  .statement-hero { box-shadow: none; border-radius: 8px; padding: 18px 20px 20px; }
  .statement-hero-body { margin-top: 16px; padding-top: 14px; }
  .statement-customer { font-size: 20px; }
  .statement-amount { font-size: 24px; }
  .statement-number { font-size: 16px; }
  .statement-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .statement-summary .cell { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 0; }
  .statement-summary .cell:last-child { border-right: 0; }
  .statement-summary .val { font-size: 16px; }
  .statement-summary .foot { font-size: 9.5px; }
  .statement-section-title { padding: 11px 14px; }
  .statement-party { gap: 16px; }
  .statement-table { font-size: 10px; }
  .statement-table th, .statement-table td { padding: 6px 8px; }
  .statement-table thead { display: table-header-group; }
  .statement-table tr { break-inside: avoid; page-break-inside: avoid; }
  .statement-hero, .statement-summary, .statement-section-title, .statement-footer { break-inside: avoid; page-break-inside: avoid; }
  .statement-section { break-inside: auto; }
  .report-tabs, .note, .mcag-anchor-nav { display: none !important; }
  .mcag-table td, .mcag-table th { padding: 4px 6px; font-size: 9px; }
  .mcag-table .mcag-def { font-size: 8.5px; }
  .mcag-table .mcag-code { width: 42px; font-size: 8.5px; }
  .mcag-region-table td, .mcag-region-table th { font-size: 8.5px; padding: 3px 4px; }
  .mcag-section { break-inside: auto; }
}
