/* =====================================================================
   GBCOPTRST Business Financial Management — UI stylesheet
   Navy / white / gold brand. No external fonts or frameworks.
   ===================================================================== */
:root {
  --navy-950: #071427;
  --navy-900: #0a1a33;
  --navy-800: #0f2547;
  --navy-700: #163463;
  --navy-600: #1f467f;
  --navy-100: #e6ecf5;
  --navy-50: #f3f6fb;
  --gold-600: #a9831f;
  --gold-500: #c9a227;
  --gold-400: #ddbc55;
  --gold-100: #f8f0d6;
  --ink: #1f2933;
  --ink-2: #3e4c59;
  --muted: #6b7785;
  --line: #e2e7ef;
  --line-2: #edf1f6;
  --bg: #f4f6fa;
  --white: #ffffff;
  --success: #17804d;
  --success-bg: #e7f5ee;
  --warning: #9a6700;
  --warning-bg: #fff6dd;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info: #1f5fae;
  --info-bg: #eaf2fd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(10, 26, 51, .06), 0 1px 3px rgba(10, 26, 51, .05);
  --shadow-lg: 0 12px 32px rgba(10, 26, 51, .16);
  --sidebar: 262px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy-800); text-decoration: underline; }
h1, h2, h3 { color: var(--navy-900); margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.icon-xl { width: 72px; height: 72px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.gold { color: var(--gold-500); }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; display: block; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.num-strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.print-only { display: none; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #c9d3e3; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; overflow-y: auto;
  border-right: 1px solid rgba(201, 162, 39, .18);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark { border-radius: 9px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .08em; }
.brand-text small { font-size: 11px; color: var(--gold-400); letter-spacing: .02em; }
.nav { padding: 10px 12px 20px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7f8ea8; padding: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: #c9d3e3; font-weight: 500; margin: 1px 0; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(201,162,39,.14); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-500); }
.nav-link.active .icon { color: var(--gold-400); }
.nav-count { margin-left: auto; background: var(--gold-500); color: var(--navy-950); font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; }
.sidebar-foot { padding: 14px 20px 18px; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #7f8ea8; }
.tag-internal { display: inline-flex; gap: 6px; align-items: center; }
.tag-internal .icon { width: 14px; height: 14px; color: var(--gold-400); }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.icon-btn.menu-btn { display: none; }
.table td.mono, .table td a { white-space: nowrap; }
.search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); }
.search input { width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--navy-50); font: inherit; }
.search input:focus { outline: none; border-color: var(--navy-600); background: #fff; box-shadow: 0 0 0 3px rgba(31,70,127,.12); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.company-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; }
.company-chip .icon { width: 15px; height: 15px; color: var(--gold-600); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; list-style: none; }
.icon-btn:hover { background: var(--navy-50); border-color: var(--line); }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 50; }
.dropdown-wide { width: 340px; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 7px; color: var(--ink); font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--navy-50); text-decoration: none; }
.dropdown-menu form { margin: 0; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.dropdown-head a { display: inline; width: auto; padding: 0; color: var(--navy-600); }
.dropdown-empty { padding: 18px 10px; text-align: center; color: var(--muted); }
.notif { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.notif.unread .notif-title { font-weight: 600; }
.notif.unread::before { content: ""; position: absolute; }
.notif-meta { font-size: 11.5px; color: var(--muted); }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; }
.profile-btn:hover { background: var(--navy-50); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: var(--gold-400); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 1.5px solid var(--gold-500); }
.profile-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: 13px; }
.profile-name small { font-weight: 400; color: var(--muted); font-size: 11.5px; }

.content { padding: 26px 28px 40px; flex: 1; width: 100%; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; }
.crumbs a { color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: #fff; }

/* ---------- Progress / loading ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); z-index: 100; transition: width .4s ease; }
.progress.active { width: 70%; transition: width 4s cubic-bezier(.1,.7,.2,1); }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & grids ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 15.5px; font-weight: 650; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 0; }
.card-title a { color: inherit; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; font-weight: 600; }
.link { font-size: 13px; font-weight: 500; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.grid-main > .card { margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.narrow { max-width: 860px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy-700); }
.stat:nth-child(3n+1)::after { background: var(--gold-500); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--navy-50); color: var(--navy-700); display: inline-flex; align-items: center; justify-content: center; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--navy-900); margin: 8px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; word-break: break-all; }
.stat-value .cur { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat-sub { font-size: 12px; color: var(--muted); }
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy-900); color: #c9d3e3; border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.kpi-strip > div { padding: 14px 20px; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.07); }
.kpi-strip > div:last-child { border-right: 0; }
.kpi-strip strong { color: #fff; font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi-strip span { font-size: 12px; color: var(--gold-400); }
.welcome { display: flex; justify-content: space-between; gap: 24px; align-items: center; background: linear-gradient(120deg, #fff 60%, var(--gold-100)); border-left: 4px solid var(--gold-500); }
.welcome h2 { font-size: 18px; margin-bottom: 6px; }
.welcome p { margin: 0 0 8px; color: var(--ink-2); max-width: 720px; }
.welcome-art { color: var(--navy-700); opacity: .85; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 18px; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 140px; }
.field-inline.grow { flex: 1; min-width: 200px; }
.field-inline select, .field-inline input { min-width: 0; }
.quick-ranges { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); background: #fff; }
.chip:hover { border-color: var(--navy-600); text-decoration: none; }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ---------- Forms ---------- */
.form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd7e3; border-radius: var(--radius-sm); padding: 8px 11px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy-700); padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(31,70,127,.13); }
input[readonly], input:disabled, select:disabled { background: var(--navy-50); color: var(--muted); }
textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; font-size: 13.5px; color: var(--ink-2); }
.check input { margin-top: 2px; flex: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.inline-form { margin-top: 14px; }
.inline-form > summary { list-style: none; display: inline-flex; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > summary { margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font: 600 13.5px/1.2 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.btn-primary { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.btn-primary:hover { background: var(--navy-700); color: #fff; box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.btn-secondary { background: #fff; color: var(--navy-800); border-color: #cfd7e3; }
.btn-secondary:hover { border-color: var(--navy-600); color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--navy-50); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--navy-50); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #fafbfd; }
.table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; background: #fbfcfe; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table .row-muted td { color: var(--muted); font-style: italic; }
.table .section-row td { background: var(--navy-50); font-weight: 700; color: var(--navy-800); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.table .subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
.empty-row { color: var(--muted); text-align: center; padding: 20px !important; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.lines-table select { min-width: 240px; }
.lines-table .amt { width: 140px; }
.col-x { width: 44px; }

/* ---------- Badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; vertical-align: 0; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: #eef1f5; color: var(--ink-2); }
.badge-type { background: var(--navy-50); color: var(--navy-700); }
.badge-role { background: var(--gold-100); color: #7a5d10; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; border: 1px solid transparent; font-size: 13.5px; }
.alert span { flex: 1; }
.alert-success { background: var(--success-bg); color: #0f5a36; border-color: #c4e6d4; }
.alert-error { background: var(--danger-bg); color: #8a1c13; border-color: #f6c9c3; }
.alert-warning { background: var(--warning-bg); color: #6e4a00; border-color: #f0dfa6; }
.alert-info { background: var(--info-bg); color: #174a87; border-color: #c9dcf5; }
.alert-close { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert-close:hover { opacity: 1; }
.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-100); border: 1px solid #ecdca7; color: #5e4708; padding: 11px 14px; border-radius: 9px; font-size: 13px; margin: 14px 0; }
.balance-status { padding: 8px 12px; border-radius: 8px; background: var(--navy-50); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.balance-status.ok { background: var(--success-bg); color: var(--success); }
.balance-status.bad { background: var(--danger-bg); color: var(--danger); }

/* ---------- Lists, timelines, definition lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.list li:last-child { border-bottom: 0; }
.list-meta { font-size: 12px; color: var(--muted); display: block; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { display: flex; gap: 12px; padding: 7px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -6px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-500); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--gold-100); }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dl dd { margin: 0; }
.notes { background: var(--navy-50); padding: 12px 14px; border-radius: 8px; margin: 0; white-space: normal; }
.steps { padding-left: 20px; margin: 8px 0 14px; }
.steps li { margin: 5px 0; }
.det summary { cursor: pointer; color: var(--navy-600); }
.det pre { white-space: pre-wrap; word-break: break-word; background: var(--navy-50); padding: 8px; border-radius: 6px; font-size: 11.5px; max-width: 420px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-state h2, .empty-state h3 { font-size: 15.5px; color: var(--navy-900); margin: 10px 0 4px; }
.empty-state p { margin: 0 auto 14px; max-width: 420px; font-size: 13.5px; }
.empty-icon { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto; background: var(--navy-50); color: var(--navy-600); display: flex; align-items: center; justify-content: center; border: 1px dashed #c7d2e2; }
.empty-icon .icon { width: 24px; height: 24px; vertical-align: 0; }

/* ---------- Tabs, pager ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--navy-800); text-decoration: none; }
.tab.active { color: var(--navy-900); border-bottom-color: var(--gold-500); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
.pager span { margin-right: auto; font-size: 12.5px; }
.pager-info { margin-top: 12px; font-size: 12.5px; }

/* ---------- Notifications page ---------- */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.notif-list li a:hover { background: var(--navy-50); text-decoration: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: transparent; }
.notif-list li.unread .notif-dot { background: var(--gold-500); }
.notif-body { flex: 1; display: flex; flex-direction: column; }
.notif-list li:not(.unread) strong { font-weight: 500; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 260px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .axis { stroke: var(--line); }
.chart .grid { stroke: var(--line-2); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-income { fill: var(--navy-700); }
.chart .bar-expense { fill: var(--gold-500); }
.chart .line-net { fill: none; stroke: var(--success); stroke-width: 2; }
.chart .dot-net { fill: #fff; stroke: var(--success); stroke-width: 2; }
.chart-tip { position: fixed; pointer-events: none; background: var(--navy-900); color: #fff; padding: 8px 10px; border-radius: 7px; font-size: 12px; z-index: 90; box-shadow: var(--shadow-lg); }
.legend { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.lg-income { background: var(--navy-700); }
.lg-expense { background: var(--gold-500); }
.lg-net { background: var(--success); height: 3px; }

/* ---------- Reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.report-card:hover { border-color: var(--gold-500); text-decoration: none; transform: translateY(-1px); }
.report-card strong { color: var(--navy-900); font-size: 15px; }
.report-card span:last-child { color: var(--muted); font-size: 13px; }
.report-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--navy-900); color: var(--gold-400); display: inline-flex; align-items: center; justify-content: center; }
.report-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 14px; border-bottom: 2px solid var(--navy-900); flex-wrap: wrap; }
.report-brand { display: flex; gap: 12px; align-items: center; }
.report-brand div { display: flex; flex-direction: column; }
.report-brand strong { font-size: 16px; color: var(--navy-900); }
.report-brand span { font-size: 12px; color: var(--gold-600); }
.report-title { text-align: right; display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.report-title h2 { font-size: 19px; }
.report-banner { margin: 12px 0 16px; padding: 8px 12px; background: var(--gold-100); border: 1px solid #ecdca7; color: #5e4708; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; border-radius: 6px; text-align: center; }
.report-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.report-section { font-size: 14px; margin: 18px 0 8px; }
.report-section small { color: var(--muted); font-weight: 500; }
.report-table { margin-bottom: 10px; }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.je-block { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.je-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 9px 12px; background: var(--navy-50); font-size: 13px; }
.je-foot { font-size: 11.5px; color: var(--muted); padding: 6px 12px; }
.je-block .table { margin: 0; }

/* ---------- Confirm modal ---------- */
.modal { border: 0; border-radius: 14px; padding: 26px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); text-align: center; }
.modal::backdrop { background: rgba(7, 20, 39, .55); }
.modal h3 { font-size: 17px; margin: 10px 0 6px; }
.modal p { color: var(--ink-2); margin: 0 0 18px; }
.modal-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--gold-100); color: var(--gold-600); display: inline-flex; align-items: center; justify-content: center; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- Auth pages ---------- */
.auth-body { margin: 0; background: var(--bg); min-height: 100vh; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: radial-gradient(circle at 20% 15%, rgba(201,162,39,.18), transparent 40%), linear-gradient(160deg, var(--navy-800), var(--navy-950)); color: #c9d3e3; display: flex; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border: 1px solid rgba(201,162,39,.25); border-radius: 50%; }
.auth-brand-inner { max-width: 460px; position: relative; z-index: 1; }
.brand-lg { padding: 0; border: 0; margin-bottom: 40px; }
.brand-lg .brand-text strong { font-size: 20px; }
.auth-brand h2 { color: #fff; font-size: 34px; line-height: 1.15; margin-bottom: 26px; font-weight: 700; }
.auth-points { list-style: none; padding: 0; margin: 0 0 32px; }
.auth-points li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.auth-points .icon { color: var(--gold-400); width: 20px; height: 20px; }
.auth-disclaimer { font-size: 12px; color: #8b9ab3; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-body > .auth-card { margin: 10vh auto; }
.auth-title { font-size: 22px; margin-bottom: 6px; }
.auth-card .muted { margin: 0 0 20px; }
.auth-links { text-align: center; margin: 18px 0 0; font-size: 13px; }
.auth-foot { font-size: 12px; color: var(--muted); margin-top: 20px; text-align: center; }
.debug { white-space: pre-wrap; background: var(--navy-50); padding: 10px; border-radius: 8px; font-size: 12px; }

/* ---------- Installer ---------- */
.install-body { background: var(--bg); }
.install-wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 60px; }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; padding: 20px 24px; background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); border-radius: 14px; color: #c9d3e3; border-bottom: 3px solid var(--gold-500); }
.install-head h1 { color: #fff; font-size: 20px; }
.install-head p { margin: 2px 0 0; font-size: 13px; color: var(--gold-400); }
.install-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
.success-title { color: var(--success); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(7,20,39,.45); z-index: 35; }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-flex; }
  .company-chip, .profile-name { display: none; }
  .topbar { padding: 0 14px; gap: 8px; }
  .content { padding: 18px 14px 32px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand h2 { font-size: 24px; margin-bottom: 12px; }
  .auth-points, .auth-disclaimer { display: none; }
  .brand-lg { margin-bottom: 16px; }
  .bs-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip > div:nth-child(2) { border-right: 0; }
}
@media (max-width: 640px) {
  .stat-grid, .stat-grid-3, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head h1 { font-size: 20px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .filters { flex-direction: column; align-items: stretch; }
  .quick-ranges { margin-left: 0; }
  .dropdown-wide { width: calc(100vw - 28px); right: -60px; }
  .welcome { flex-direction: column; align-items: flex-start; }
  .welcome-art { display: none; }
  .footer { padding: 14px; }
  .report-title { text-align: left; }
  .card { padding: 16px; }
}

/* ---------- Print / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11.5px; }
  .sidebar, .topbar, .footer, .page-actions, .filters, .no-print, .tabs, .alert-close, .crumbs, .pager, .btn, .sidebar-backdrop, .progress { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .print-only { display: block; }
  .table th { background: #eef1f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-banner, .section-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
  tr { page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .chart { height: 200px; }
}
