:root {
  --ink: #14231f;
  --muted: #65756f;
  --green-950: #08251d;
  --green-900: #0b3328;
  --green-800: #0f4c3a;
  --green-700: #146c52;
  --green-100: #e4f2ec;
  --gold: #d9a441;
  --gold-light: #ecd08c;
  --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: Arial, Helvetica, 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: Arial, Helvetica, sans-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: Arial, Helvetica, sans-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: Arial, Helvetica, sans-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-group + .nav-group { margin-top: 12px; }

.nav-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold-light);
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.nav-group-head:hover { color: #f7e4b4; background: rgba(255, 255, 255, .06); }
.nav-group-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.nav-caret {
  font-size: 9px;
  line-height: 1;
  opacity: .85;
  transition: transform .18s ease;
}

.nav-group:not(.open) .nav-caret { transform: rotate(-90deg); }

.nav-group-body { padding-top: 2px; }
.nav-group:not(.open) .nav-group-body { display: none; }

.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;
  text-decoration: none;
}
.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); }
.topbar-alert { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #fdf3dd; border: 1px solid #efd9a4; color: #8a6414; font-weight: 700; font-size: 11.8px; text-decoration: none; white-space: nowrap; }
.topbar-alert:hover { background: #fbeac4; color: #6f4f0b; }
.topbar-alert svg { width: 15px; height: 15px; }
.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); }
.topbar-sms { display: inline-flex; align-items: center; gap: 5px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.topbar-sms strong { color: var(--green-800); font-weight: 700; font-variant-numeric: tabular-nums; }

.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-5 { grid-template-columns: repeat(5, 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; }

.sms-credit-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.sms-credit-item { min-width: 168px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.sms-credit-value { font-size: 20px; font-weight: 700; color: var(--green-800); margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.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-wrap.is-scrollable { overflow: auto; }
.table-wrap.is-scrollable thead th { position: sticky; top: 0; z-index: 2; }
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; }
/* Amount and numeric fields are typed, not stepped: hide native spinner arrows. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field-validation-error, .text-danger { color: var(--danger); font-size: 11.8px; }
/* Show / hide control shared by the login box and the site-wide script. */
.password-field, .password-wrap { position: relative; }
.password-field > input, .password-wrap > input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--green-700); background: rgba(20, 108, 82, .08); outline: none; }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .eye-slash { display: none; }
.password-toggle.is-visible .eye-slash { display: block; }
.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: Arial, Helvetica, sans-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; }

/* Premium sign in */
.login-body {
  background: #061c16;
  min-height: 100vh;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(217, 164, 65, .18), transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(20, 108, 82, .5), transparent 46%),
    linear-gradient(150deg, #051914 0%, #08251d 45%, #0c3a2d 100%);
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-orb-a {
  width: 520px; height: 520px;
  border: 1px solid rgba(217, 164, 65, .14);
  top: -240px; right: -150px;
  box-shadow: 0 0 0 70px rgba(217, 164, 65, .04), 0 0 0 150px rgba(217, 164, 65, .025);
}
.login-orb-b {
  width: 460px; height: 460px;
  border: 1px solid rgba(255, 255, 255, .06);
  bottom: -260px; left: -160px;
  box-shadow: 0 0 0 90px rgba(255, 255, 255, .02);
}
.login-shell {
  width: 100%;
  max-width: 1060px;
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(3, 16, 12, .55), 0 2px 0 rgba(255, 255, 255, .08) inset;
  position: relative;
  z-index: 1;
}
.login-brand {
  background:
    radial-gradient(circle at 82% 8%, rgba(217, 164, 65, .26), transparent 36%),
    radial-gradient(circle at 4% 96%, rgba(255, 255, 255, .07), transparent 42%),
    linear-gradient(158deg, #07241c, #0c3d2f 62%, #0f4c3a);
  color: #fff;
  padding: 46px 46px 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  border: 46px solid rgba(217, 164, 65, .09);
  border-radius: 50%;
  bottom: -170px; right: -120px;
}
.login-brand-head {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 1;
}
.login-brand .brand-mark {
  width: 46px; height: 46px;
  font-size: 23px;
  border-radius: 13px;
}
.login-wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.login-wordmark strong { font-size: 19px; color: #fff; letter-spacing: .01em; }
.login-wordmark span { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: rgba(233, 243, 238, .58); margin-top: 4px; }
.login-brand-copy { position: relative; z-index: 1; margin-top: 6px; }
.login-kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--gold);
  margin-bottom: 16px;
}
.login-brand-copy h1 {
  color: #fff;
  font-size: 33px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 14px;
}
.login-brand-copy p {
  color: rgba(255, 255, 255, .62);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 380px;
  margin: 0;
}
.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
}
.login-features li strong { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.login-features li small { display: block; font-size: 12px; color: rgba(255, 255, 255, .5); margin-top: 1px; }
.login-feature-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: rgba(217, 164, 65, .12);
  border: 1px solid rgba(217, 164, 65, .22);
  color: var(--gold);
}
.login-feature-icon svg { width: 17px; height: 17px; }
.login-brand-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .42);
  position: relative;
  z-index: 1;
}
.login-secure-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .12);
  flex: none;
}
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background:
    radial-gradient(circle at 100% 0%, #f2f7f3, transparent 52%),
    #fff;
}
.login-form-inner { width: 100%; max-width: 356px; }
.login-form-head .eyebrow { color: var(--green-700); }
.login-form-head h2 { font-size: 27px; margin: 8px 0 6px; letter-spacing: -.02em; }
.login-form-head .sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.login-field { margin-bottom: 16px; }
.login-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.login-label-row label { margin: 0; }
.login-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
  cursor: pointer;
}
.login-link:hover { color: var(--green-800); text-decoration: underline; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fbfcfa;
  padding: 0 46px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.login-input input::placeholder { color: #9aa8a2; }
.login-input input:focus {
  outline: none;
  border-color: var(--green-700);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20, 108, 82, .1);
}
.login-input-icon {
  position: absolute;
  left: 15px;
  width: 18px; height: 18px;
  color: #8d9c96;
  pointer-events: none;
}
.login-eye {
  position: absolute;
  right: 8px;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8d9c96;
  cursor: pointer;
}
.login-eye svg { width: 18px; height: 18px; }
.login-eye:hover, .login-eye.is-on { color: var(--green-700); background: var(--green-100); }
.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--danger-soft);
  border: 1px solid #f5c9c5;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.login-error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.login-submit {
  width: 100%;
  margin-top: 6px;
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14.5px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--green-700), var(--green-800));
  box-shadow: 0 10px 22px rgba(15, 76, 58, .22);
}
.login-submit:hover { background: linear-gradient(145deg, #17805f, var(--green-800)); }
.login-submit svg { width: 17px; height: 17px; }
.login-submit:disabled { opacity: .7; cursor: default; }
.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 28px;
  font-size: 11px;
  color: #9aa8a2;
}
.login-foot-dot { width: 3px; height: 3px; border-radius: 50%; background: #c2ccc7; }

/* Password recovery dialog */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 20, 15, .62);
  backdrop-filter: blur(3px);
}
.auth-modal[hidden] { display: none; }
.auth-modal-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 30px 30px 26px;
  position: relative;
  box-shadow: 0 30px 70px rgba(2, 14, 10, .45);
  animation: loginModalIn .18s ease-out;
}
@keyframes loginModalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.auth-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8d9c96;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.auth-modal-close:hover { background: #f1f4f1; color: var(--ink); }
.auth-modal-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: #92660e;
  margin-bottom: 16px;
}
.auth-modal-icon svg { width: 22px; height: 22px; }
.auth-modal-icon.ok { background: var(--success-soft); color: var(--success); }
.auth-modal-card h3 { font-size: 20px; margin-bottom: 7px; }
.auth-modal-card > div > p { color: var(--muted); font-size: 12.8px; line-height: 1.6; margin-bottom: 18px; }
.auth-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.modal-open { overflow: hidden; }

/* 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: Arial, Helvetica, sans-serif; font-size: 12px; background: #f2f4f0; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }


/* Responsive */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .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, .topbar-right .topbar-sms { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .login-page { padding: 22px 16px; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .login-brand { padding: 24px 24px 22px; gap: 14px; }
  .login-brand-copy { margin-top: 0; }
  .login-brand-copy h1 { font-size: 23px; margin-bottom: 0; }
  .login-brand-copy p, .login-features, .login-brand-foot { display: none; }
  .login-form-panel { padding: 32px 24px 30px; }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { 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: Arial, Helvetica, sans-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: Arial, Helvetica, sans-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: Arial, Helvetica, sans-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; }
.doc-letterhead {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green-800);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px 24px;
}
.doc-letterhead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.doc-letterhead-brand { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.doc-letterhead-logo { width: 78px; height: 78px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; flex: 0 0 auto; }
.doc-letterhead-monogram { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold), #b9832a); color: var(--green-950); font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 28px; flex: 0 0 auto; }
.doc-letterhead-org { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.doc-letterhead-name { font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: 700; color: var(--green-950); margin-top: 2px; letter-spacing: -.01em; }
.doc-letterhead-detail { font-size: 11.5px; color: #5b6b63; line-height: 1.55; margin-top: 2px; }
.doc-letterhead-meta { text-align: right; min-width: 230px; }
.doc-letterhead-kicker { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--green-700); }
.doc-letterhead-quarter { font-family: Arial, Helvetica, sans-serif; font-size: 30px; font-weight: 700; color: var(--green-950); line-height: 1.1; margin-top: 2px; }
.doc-letterhead-period { font-size: 13px; font-weight: 700; color: var(--green-950); margin-top: 4px; }
.doc-letterhead-title-block { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.doc-letterhead-title { font-family: Arial, Helvetica, sans-serif; font-size: 19px; font-weight: 700; letter-spacing: .08em; color: var(--green-950); }
.doc-letterhead-member { font-size: 12px; color: #5b6b63; margin-top: 6px; }
.doc-letterhead-member strong { color: var(--green-950); }

.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: Arial, Helvetica, sans-serif; font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.statement-summary .chip { font-family: Arial, Helvetica, 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: Arial, Helvetica, 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: Arial, Helvetica, sans-serif; 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: Arial, Helvetica, sans-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: Arial, Helvetica, sans-serif; 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%; }
  .doc-letterhead { padding: 20px; }
  .doc-letterhead-meta { text-align: left; }
  .doc-letterhead-title { font-size: 16px; }
}

@page { size: A4 portrait; margin: 10mm 9mm 12mm; }

.print-letterhead { display: none; }

@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; width: 100%; }
  body { background: #fff; font-size: 10.5px; }
  .print-letterhead {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    border-bottom: 2px solid #14231f; padding-bottom: 10px; margin-bottom: 14px;
    break-inside: avoid; page-break-inside: avoid;
  }
  .print-letterhead-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
  .print-letterhead-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; flex: none; }
  .print-letterhead-monogram {
    width: 42px; height: 42px; border-radius: 10px; flex: none;
    background: #0f4c3a; color: #d9a441; display: grid; place-items: center;
    font-family: Arial, Helvetica, sans-serif; font-size: 20px; font-weight: 700;
  }
  .print-letterhead-org { font-family: Arial, Helvetica, sans-serif; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #65756f; font-weight: 700; }
  .print-letterhead-name { font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 700; color: #14231f; line-height: 1.15; }
  .print-letterhead-detail { font-size: 9.5px; color: #4b5a53; line-height: 1.35; }
  .print-letterhead-meta { text-align: right; font-size: 9.5px; color: #4b5a53; line-height: 1.4; flex: none; }
  .print-letterhead-meta strong { display: block; font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #14231f; }
  .receipt-letterhead-brand { display: none !important; }
  .receipt-letterhead-meta { margin-left: auto; }
  .statement-brand { display: none !important; }
  .statement-hero-meta { margin-left: auto; }
  a { color: inherit; text-decoration: none; }
  .card { border: 1px solid #d8ddd6; box-shadow: none; border-radius: 8px; break-inside: auto; }
  .card.kpi, .kpi { break-inside: avoid; page-break-inside: avoid; }
  .card-head { padding: 12px 14px; }
  .card-head h2, .card-head h3 { font-size: 14px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 21px; }
  .page-head .sub { font-size: 10.5px; margin-top: 3px; }
  .grid { gap: 10px; }
  .kpi-value { font-size: 17px; }
  .table th { background: #f1f4ef !important; }
  .table-wrap { overflow: visible !important; }
  table.table, .table { width: 100%; font-size: 9.3px; }
  .table th, .table td { padding: 4px 6px; overflow-wrap: anywhere; word-break: break-word; }
  .table th { font-size: 8.6px; letter-spacing: .02em; }
  .table thead, .statement-table thead { display: table-header-group; }
  .table tr { break-inside: avoid; page-break-inside: avoid; }
  .chip { border: 1px solid #cfd6cd; }
  .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,
  .doc-letterhead { break-inside: avoid; page-break-inside: avoid; }
  .doc-letterhead { box-shadow: none; border-radius: 6px; padding: 16px 18px; }
  .doc-letterhead-name { font-size: 18px; }
  .doc-letterhead-quarter { font-size: 24px; }
  .doc-letterhead-title { font-size: 15px; }
  .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; }
}

.print-preview-note { font-size: 13px; color: #4b5a53; line-height: 1.55; margin-top: 4px; }
.print-preview-note strong { color: #123f32; }

/* Chat Jilsoft */
.chat-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-800); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 18px 11px 14px; font: inherit; font-weight: 600; font-size: 13px;
  box-shadow: 0 12px 30px rgba(8, 37, 29, .28); cursor: pointer;
}
.chat-launch:hover { background: var(--green-700); }
.chat-launch svg { width: 19px; height: 19px; }
.chat-launch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(217, 164, 65, .25); }

.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 901;
  width: 384px; max-width: calc(100vw - 28px);
  height: min(560px, calc(100vh - 44px));
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(8, 37, 29, .3);
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: var(--green-900); color: #fff; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(217, 164, 65, .2); border: 1px solid rgba(217, 164, 65, .45); color: var(--gold); font-weight: 700; font-family: Arial, Helvetica, sans-serif; }
.chat-head strong { display: block; font-size: 13.5px; }
.chat-head span { display: block; font-size: 11px; color: rgba(233, 243, 238, .7); }
.chat-head .grow { flex: 1; min-width: 0; }
.chat-close { background: none; border: 0; color: rgba(255, 255, 255, .75); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.chat-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f9f5; }
.chat-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 12.9px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.chat-msg.user { align-self: flex-end; background: var(--green-800); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.pending { color: var(--muted); font-style: italic; }
.chat-link { display: inline-block; margin-top: 6px; font-weight: 600; font-size: 12.3px; }
.chat-action { display: inline-block; margin-top: 8px; font: inherit; font-size: 12.3px; font-weight: 700; padding: 6px 12px; border-radius: 8px; border: 0; background: var(--green-800); color: #fff; cursor: pointer; }
.chat-action:hover { background: var(--green-700); }
.chat-action:disabled { opacity: .6; cursor: default; }

.chat-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-suggest button { font: inherit; font-size: 11.4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fafbf8; color: var(--green-800); cursor: pointer; }
.chat-suggest button:hover { border-color: var(--green-700); background: var(--green-100); }

.chat-input { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 13px; outline: none; }
.chat-input input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(20, 108, 82, .11); }
.chat-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: var(--green-800); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chat-send:hover { background: var(--green-700); }
.chat-send svg { width: 18px; height: 18px; }

@media (max-width: 520px) {
  .chat-launch { right: 14px; bottom: 14px; }
  .chat-panel { right: 14px; left: 14px; bottom: 14px; width: auto; height: calc(100vh - 28px); }
}
@media print {
  .chat-launch, .chat-panel { display: none !important; }
}
