:root {
  --bg: #f5f7f5;
  --surface: #fff;
  --surface-2: #f6f8f6;
  --ink: #243a32;
  --muted: #74817a;
  --line: #e4eae5;
  --accent: #27644e;
  --accent-ink: #fff;
  --accent-soft: #eaf3eb;
  --head: #f5f8f5;
  --pos: #26734e;
  --neg: #bb5549;
  --warn: #987120;
  --warn-soft: #fff7e4;
  --font-ui: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --font-num: "Roboto Mono", ui-monospace, monospace;
  --total-bg: #184c39;
  --total-ink: #fff;
  --r: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font-ui); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #91b5a2; outline-offset: 3px; }
svg.icon { width: 19px; height: 19px; flex: 0 0 auto; stroke-width: 1.7; vertical-align: middle; }
.num, td.n, th.n { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 60; padding: 10px 18px; background: var(--accent); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 30; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 30px 24px 25px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--accent); }
.brand-mark .icon { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.4px; }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.sidebar-label { margin: 0 25px 10px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1.3px; }
nav.tabs { padding: 0 14px; overflow-y: auto; flex: 1; }
.nav-group { margin: 23px 12px 8px; font-size: 10px; font-weight: 600; letter-spacing: 1.1px; color: var(--muted); }
nav.tabs button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; border-radius: 9px; text-align: left; color: #69776f; padding: 11px 13px; margin-bottom: 4px; font-size: 12px; font-weight: 500; }
nav.tabs button:hover { background: var(--surface-2); color: var(--accent); }
nav.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav.tabs .nav-arrow { margin-left: auto; font-size: 19px; opacity: 0; }
nav.tabs button[aria-selected="true"] .nav-arrow { opacity: 1; }
.sidebar-foot { margin: 18px; padding: 17px 14px; border-radius: 12px; background: #f6f8f3; border: 1px solid #ebeee5; }
.sidebar-foot b { font-size: 11px; display: block; margin-bottom: 3px; }
.sidebar-foot p { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 0 0 12px; }
.sidebar-foot button { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--accent); border: 0; background: none; padding: 0; font-weight: 600; }
.workspace { margin-left: 236px; }
.topbar { min-height: 88px; padding: 21px 34px; background: rgba(245,247,245,.97); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 20; }
.breadcrumb { color: var(--muted); font-size: 10px; letter-spacing: .5px; margin-bottom: 3px; }
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -.6px; margin: 0; line-height: 1.45; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.sync-status { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; max-width: 170px; }
.sync-dot { flex: 0 0 6px; width: 6px; height: 6px; background: #b4bdb6; border-radius: 50%; }
.sync-status[data-state="ok"] .sync-dot { background: #5d9970; }
.sync-status[data-state="error"] .sync-dot { background: var(--neg); }
.month { display: flex; align-items: center; gap: 1px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 4px; }
.month input { border: 0; width: 132px; min-width: 0; padding: 5px 4px; background: #fff; font-size: 11px; font-weight: 600; }
.iconbtn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.iconbtn:hover { background: var(--accent-soft); color: var(--accent); }
.refresh-btn .icon { width: 17px; height: 17px; }
.mobile-menu, .mobile-nav, .menu-overlay { display: none; }
main { max-width: 1500px; margin: 0 auto; padding: 28px 34px 48px; display: grid; gap: 22px; grid-template-columns: minmax(0,1fr); }
#data { min-width: 0; grid-template-columns: minmax(0,1fr); gap: 22px !important; }
h2 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.4px; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); font-size: 12px; margin: 5px 0 0; max-width: 85ch; line-height: 1.8; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.3px; margin-bottom: 7px; }
.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.section-intro h2 { font-size: 25px; letter-spacing: -.9px; }
.section-intro .sub { font-size: 12px; }
.period-badge { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 10px; color: var(--accent); border: 1px solid #dce7dd; border-radius: 30px; padding: 6px 12px; background: #edf4ec; }
.period-badge .icon { width: 14px; height: 14px; }
section.panel, .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 21px; display: grid; gap: 16px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.label { font-size: 11px; font-weight: 500; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.kpi { background: #f0f8f1; border: 1px solid #c2dac8; border-top: 4px solid #398359; border-radius: var(--r); padding: 21px; display: grid; gap: 14px; min-width: 0; position: relative; box-shadow: 0 6px 18px #234a3410; }
.kpi .label { color: #425a4c; font-weight: 700; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); background: #f0f6ef; }
.kpi.expense .kpi-icon { background: #fcf1ea; color: #b77854; }
.kpi.commission .kpi-icon { background: #f7f4e8; color: #9d8a43; }
.kpi .v { color: #174e39; font-family: var(--font-num); font-size: clamp(26px,2.35vw,38px); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -1px; overflow-wrap: anywhere; }
.kpi .f { color: var(--muted); font-size: 10px; line-height: 1.7; }
.kpi.expense { background: #fff5f0; border-color: #e8c8ba; border-top-color: #ad563d; }
.kpi.expense .v { color: #983f2d; }
.kpi.commission { background: #fff8e5; border-color: #e6d39d; border-top-color: #b58420; }
.kpi.commission .v { color: #785411; }
.kpi.main { color: #fff; background: #184c39; border-color: #184c39; border-top-color: #7bc293; box-shadow: 0 8px 22px #184c3924; }
.kpi.main .v { color: #fff; }
.kpi.main .label, .kpi.main .f { color: #d7e8d9; }
.kpi.main .kpi-icon { color: #d9e8d8; background: #386953; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 22px; }
.chart-legend { display: flex; gap: 14px; font-size: 10px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: #4c8065; }
.chart-legend .out { background: #d1ae70; }
.cash-chart { width: 100%; height: auto; display: block; min-height: 180px; }
.chart-note { font-size: 9px; color: var(--muted); margin: 0; }
.chart-empty { display: grid; gap: 8px; place-content: center; text-align: center; min-height: 205px; color: var(--muted); }
.chart-empty .icon { width: 34px; height: 34px; margin: 0 auto 4px; color: #afc5b6; }
.chart-empty b { color: var(--ink); font-size: 12px; font-weight: 500; }
.chart-empty p { margin: 0; font-size: 10px; }
.chart-empty .actions { justify-content: center; margin-top: 8px; }
.activity-list { display: grid; align-content: start; }
.activity-item { display: flex; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: center; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 33px; height: 33px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); border-radius: 10px; flex-shrink: 0; }
.activity-icon .icon { width: 16px; height: 16px; }
.activity-text { min-width: 0; flex: 1; }
.activity-text b { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-text small { font-size: 10px; color: var(--muted); }
.activity-value { font-size: 12px; font-family: var(--font-num); }
.cols { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(300px,100%),1fr)); gap: 22px; }
.report-details { padding: 0; }
.report-details > summary { display: flex; align-items: center; justify-content: space-between; padding: 20px 21px; font-size: 12px; font-weight: 600; list-style: none; }
.report-details > summary::after { content: '+'; font-size: 20px; color: var(--muted); }
.report-details[open] > summary::after { content: '−'; }
.report-details > .cols { padding: 0 20px 20px; }
.report-details .panel { background: var(--surface-2); border: 0; }
.entry-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; color: var(--accent); font-size: 12px; font-weight: 600; }
.entry-section > summary::-webkit-details-marker, .report-details > summary::-webkit-details-marker { display: none; }
.entry-section > summary span { display: flex; gap: 8px; align-items: center; }
.entry-section > summary::after { content: '+'; font-size: 19px; font-weight: 400; }
.entry-section[open] > summary::after { content: '−'; }
.entry-section form { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
form.entry { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 14px; align-items: end; }
.field { display: grid; gap: 7px; min-width: 0; }
.field.wide { grid-column: span 2; }
.field label { font-size: 11px; font-weight: 500; color: #66796c; }
.field-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 7px; }
.add-inline { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 7px; min-height: 28px; border: 1px solid #cfdfd0; border-radius: 6px; background: #edf5ec; color: var(--accent); font-size: 10px; font-weight: 600; white-space: nowrap; }
.add-inline:hover { background: #deeddd; border-color: #8db695; }
.add-inline .icon { width: 13px; height: 13px; }
body.quick-dialog-open { overflow: hidden; }
.quick-name-dialog { width: min(460px,calc(100% - 28px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 25px; border: 1px solid #c9d9cc; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #153a343d; overflow-y: auto; }
.quick-name-dialog::backdrop { background: #15342f80; backdrop-filter: blur(2px); }
.quick-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quick-dialog-head h2 { font-size: 20px; }
.quick-dialog-head .eyebrow { color: var(--accent); font-weight: 600; }
.quick-dialog-head .iconbtn { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface-2); }
.quick-name-dialog > .sub { margin: 10px 0 20px; }
.quick-name-dialog fieldset { display: grid; gap: 16px; min-width: 0; padding: 0; margin: 0; border: 0; }
.quick-name-dialog fieldset:disabled { opacity: .7; }
.quick-rate-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 14px; }
.quick-name-dialog .field label { font-weight: 600; }
.quick-name-dialog .field input, .quick-name-dialog .field select { min-height: 44px; }
.quick-name-dialog .msg { min-height: 20px; margin: 14px 0; overflow-wrap: anywhere; }
.quick-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--line); }
.field input, .field select, .inp { width: 100%; border: 1px solid var(--line); background: #fbfcfa; border-radius: 8px; padding: 10px 11px; min-width: 0; min-height: 40px; font-size: 13px; }
input:focus, select:focus { outline: 2px solid #87b29a; outline-offset: 1px; border-color: #87b29a; }
.field input.money { font-family: var(--font-num); text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 15px; min-height: 38px; font-size: 11px; font-weight: 500; border: 1px solid var(--accent); border-radius: 8px; color: #fff; background: var(--accent); text-decoration: none; }
.btn:hover { background: #1e523e; }
.btn.ghost { background: #fff; color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 6px 10px; min-height: 30px; font-size: 10px; }
.btn:disabled, .iconbtn:disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.linkbtn { border: 0; background: none; color: var(--accent); padding: 6px; font-size: 11px; }
.linkbtn.danger { color: var(--neg); }
.linkbtn[data-armed] { font-weight: 600; background: #fff1ee; border-radius: 5px; }
.msg { font-size: 12px; color: var(--muted); }
.msg.err { color: var(--neg); }
.msg.ok { color: var(--pos); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; border-top: 1px solid var(--line); padding-top: 17px; }
.filter-field { display: grid; gap: 5px; font-size: 10px; color: var(--muted); }
.filter-field input, .filter-field select { min-height: 37px; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 0; }
.filter-search { flex: 1; min-width: min(190px,100%); }
.search-control { position: relative; display: flex; align-items: center; }
.search-control > .icon { position: absolute; left: 11px; width: 14px; height: 14px; color: #9caaa1; }
.search-control input { width: 100%; padding-left: 33px; }
.ledger-summary { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; padding: 16px; background: #edf5ec; border: 1px solid #bfd6c4; border-radius: 12px; font-size: 11px; color: #425a4c; }
.ledger-summary > span:not(.count) { display: grid; gap: 7px; flex: 1 1 125px; min-width: 0; padding: 12px 14px; background: #fff; border: 1px solid #cddfce; border-radius: 9px; font-weight: 600; }
.ledger-summary strong { color: #174e39; font: 700 21px/1.25 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ledger-summary .count { flex-basis: 100%; color: var(--accent); font-weight: 600; }
.ledger-summary .count strong { color: var(--accent); font: 700 15px var(--font-ui); margin: 0 4px 0 0; }
.ledger-results { display: grid; gap: 14px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 11px; color: var(--muted); font-weight: 500; background: var(--head); position: sticky; top: 0; }
td.n, th.n { text-align: right; }
td.note { white-space: normal; min-width: 135px; color: var(--muted); }
tr.day td, tr.day:hover td { background: #e8f2e6; font-weight: 700; font-size: 12px; color: #31573c; border-top: 2px solid #c7dbc5; }
tr.day td.n { font-size: 13px; }
td.sum, th.sum { background: #edf6ec; color: #174e39; font-weight: 700; border-inline: 1px solid #d6e5d5; }
td.sum { font-size: 14px; }
tr.total td, tr.total:hover td { font-weight: 700; color: var(--total-ink); background: var(--total-bg); border-top: 3px solid #7ab48b; border-bottom-color: #ffffff24; padding-block: 17px; }
tr.total td.n { font-size: 16px; }
tr.total td.pos { color: #d0ffdb; }
tr.total td.neg { color: #ffccc2; }
tr.total td.z { color: #d4e6d9; }
tr.total td.sum { background: #123c2c; border-inline-color: #ffffff24; }
tr.day td.neg, td.sum.neg { color: #963f32; }
tr:last-child td { border-bottom: 0; }
tr.editing td { background: #edf6ee; outline: 1px solid #b9d5be; outline-offset: -1px; }
tbody tr:hover td { background: #fafcf8; }
tbody tr:hover td.sum { background: #e3f0e0; }
tbody tr.day:hover td.sum { background: #e8f2e6; }
tbody tr.total:hover td.sum { background: #123c2c; }
.z { color: #a7b0a9; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.pill { display: inline-block; font-size: 9px; font-weight: 500; padding: 3px 8px; border-radius: 20px; color: var(--accent); background: var(--accent-soft); }
.pill.dl { color: var(--warn); background: var(--warn-soft); }
.cellinp { width: 102px; font: 11px var(--font-num); text-align: right; padding: 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; }
.warnbox { border: 1px solid #ecddb8; background: var(--warn-soft); border-radius: 10px; padding: 15px 17px; font-size: 11px; display: grid; gap: 5px; }
.warnbox b { color: var(--warn); }
.okline { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #6d8e74; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; }
.chip button { border: 0; background: none; color: var(--muted); padding: 2px 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 8px 10px; font-size: 11px; }
.banner { border: 1px solid #eac4bc; background: #fff7f4; color: var(--neg); padding: 12px 16px; border-radius: 10px; font-size: 12px; }
.drop { display: grid; place-items: center; text-align: center; gap: 7px; padding: 35px 20px; border: 1.5px dashed #b5cdbb; border-radius: 12px; background: #f5f9f2; color: var(--muted); cursor: pointer; font-size: 11px; }
.drop b { font-size: 13px; font-weight: 500; color: var(--ink); }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { max-width: 100%; font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 25px 15px; white-space: normal; }
.scroll-hint { font-size: 9px; color: var(--muted); margin: 0; }
.menu-overlay { position: fixed; inset: 0; border: 0; background: #1c332e66; z-index: 25; }
.mobile-sync { display: none; margin: 3px 0 0; font-size: 10px; color: var(--neg); }
.import-receipt { display: flex; align-items: center; gap: 12px; padding: 14px 17px; background: #edf4eb; border: 1px solid #dce8d7; border-radius: 12px; }
.receipt-icon { color: var(--accent); }
.import-receipt > div { display: grid; gap: 3px; flex: 1; min-width: 0; }
.import-receipt b { font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.import-receipt span:not(.receipt-icon) { color: #6d806d; font-size: 10px; }
.commission-strip { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px; background: #edf5ec; border: 1px solid #bfd6c4; border-radius: 12px; }
.commission-strip > div { display: grid; gap: 8px; flex: 1; min-width: 160px; padding: 13px 15px; background: #fff; border: 1px solid #cddfce; border-radius: 9px; }
.commission-strip span { color: #52694e; font-size: 11px; font-weight: 600; }
.commission-strip b { color: #174e39; font: 700 23px/1.25 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.period-grid, .import-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.period-card { display: grid; gap: 12px; padding: 23px; background: #f0f8f1; border: 1px solid #c2dac8; border-top: 4px solid #398359; border-radius: 14px; min-width: 0; box-shadow: 0 5px 15px #234a340c; }
.period-card > span { font-size: 11px; color: #425a4c; font-weight: 700; }
.period-card b { color: #174e39; font: 700 32px/1.2 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.period-card small { font-size: 10px; color: var(--muted); }
.period-card.primary { background: var(--total-bg); border-color: var(--total-bg); border-top-color: #7bc293; color: #fff; }
.period-card.primary b { color: #fff; }
.period-card.primary span, .period-card.primary small { color: #d0e1d1; }
.settlement-note { display: flex; flex-wrap: wrap; gap: 12px 16px; font-size: 11px; padding: 14px; background: #edf5ec; border: 1px solid #bfd6c4; border-radius: 10px; }
.settlement-note > span { display: grid; gap: 8px; flex: 1 1 220px; min-width: 0; padding: 13px 15px; background: #fff; border-radius: 8px; color: #425a4c; font-weight: 600; }
.settlement-note b { font: 700 22px/1.25 var(--font-num); font-variant-numeric: tabular-nums; color: #174e39; overflow-wrap: anywhere; }
.settlement-note > span:last-child { background: var(--total-bg); color: #d7e8d9; }
.settlement-note > span:last-child b { color: #fff; }
.source-note { display: grid; gap: 4px; padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; }
.source-note span { color: var(--muted); }
.pending-panel { background: #fffcf2 !important; border-color: #ebdfbd !important; }
.issue-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 12px; }
.issue-card { display: flex; gap: 12px; align-items: center; padding: 17px; background: #fff8e5; color: var(--warn); border: 1px solid #ecdfbb; border-radius: 10px; text-align: left; }
.issue-card > span:first-of-type { display: grid; gap: 4px; flex: 1; }
.issue-card small { font-size: 11px; }
.import-overview > div { display: grid; gap: 8px; padding: 17px; background: #f3f7ef; border: 1px solid #e1eadd; border-radius: 11px; min-width: 0; }
.import-overview span, .import-overview small { color: var(--muted); font-size: 10px; }
.import-overview b { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.preview-checks summary { font-size: 12px; color: var(--accent); padding: 10px 0; }
.backup-option { display: flex; align-items: start; gap: 8px; font-size: 11px; color: var(--muted); }
.backup-option input { accent-color: var(--accent); }
.pct-input { width: 70px; }
.field input[readonly] { color: #698771; background: #edf3e8; }
@media (min-width: 1500px) { main { padding-top: 34px; } }
@media (max-width: 1199px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .brand { padding-inline: 18px; }
  .brand strong { font-size: 15px; }
  .topbar { padding: 18px 24px; }
  main { padding-inline: 24px; }
  .sync-status { display: none; }
  .kpis { gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi { padding: 16px; }
  .kpi .v { font-size: 32px; }
  .kpi .label { font-size: 10px; }
  .overview-grid { grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); }
}
@media (max-width: 899px) {
  .workspace { margin-left: 0; }
  .sidebar { transform: translateX(-100%); visibility: hidden; width: 254px; box-shadow: 8px 0 35px #17332617; }
  body.menu-open .sidebar { transform: translateX(0); visibility: visible; }
  body.menu-open .menu-overlay { display: block; }
  body.menu-open { overflow: hidden; }
  .mobile-menu { display: grid; flex-shrink: 0; }
  .topbar { min-height: 76px; gap: 10px; padding: 14px 20px; }
  .heading-group { flex: 1; }
  .mobile-sync:not([hidden]) { display: block; }
  .breadcrumb { font-size: 9px; }
  .page-title { font-size: 17px; }
  .top-actions { gap: 9px; }
  main { padding: 23px 20px 105px; }
  .kpi .v { font-size: 32px; }
  .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .mobile-nav { position: fixed; inset: auto 0 0; display: flex; align-items: center; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); z-index: 24; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .mobile-nav button { display: grid; gap: 3px; justify-items: center; padding: 5px 12px; color: var(--muted); font-size: 9px; background: none; border: 0; border-radius: 8px; }
  .mobile-nav button[aria-current="page"] { color: var(--accent); background: #f0f6ed; }
  .mobile-nav .icon { width: 20px; height: 20px; }
}
@media (max-width: 599px) {
  body { font-size: 13px; }
  .topbar { flex-wrap: wrap; padding: 13px 16px 12px; gap: 8px; }
  .top-actions { width: 100%; justify-content: space-between; padding-left: 2px; }
  .heading-group { width: calc(100% - 45px); flex: auto; }
  .breadcrumb { font-size: 8px; }
  .page-title { font-size: 17px; }
  .month { flex: 1; justify-content: space-between; max-width: 200px; }
  .month input { width: 123px; font-size: 11px; }
  .refresh-btn { margin-right: auto; }
  main { padding: 19px 14px 103px; gap: 18px; }
  #data { gap: 18px !important; }
  .section-intro h2 { font-size: 21px; }
  .section-intro .sub { font-size: 10px; }
  .period-badge { display: none; }
  .kpis { gap: 10px; }
  .kpi { padding: 15px 13px; gap: 10px; border-radius: 12px; }
  .kpi-head { gap: 5px; }
  .kpi .label { font-size: 9px; }
  .kpi-icon { width: 25px; height: 25px; border-radius: 7px; }
  .kpi-icon .icon { width: 15px; height: 15px; }
  .kpi .v { font-size: clamp(23px,6.4vw,28px); letter-spacing: -.7px; }
  .kpi .f { font-size: 8px; }
  .overview-grid, .cols { grid-template-columns: minmax(0,1fr); gap: 18px; }
  section.panel, .panel { padding: 17px; gap: 14px; border-radius: 12px; }
  .cash-chart { min-height: 155px; }
  .chart-legend { font-size: 9px; }
  .activity-item { padding: 12px 0; }
  form.entry { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .field.wide { grid-column: 1/-1; }
  .field input, .field select, .inp { min-height: 44px; font-size: 16px; }
  .field label { font-size: 11px; }
  .add-inline { min-height: 32px; padding: 5px 8px; }
  .quick-name-dialog { padding: 20px; border-radius: 14px; }
  .quick-dialog-head h2 { font-size: 18px; }
  .quick-dialog-actions .btn { flex: 1; }
  .btn { min-height: 40px; }
  .entry-section > summary { font-size: 12px; }
  .filter-field { flex: 1; min-width: 0; }
  .filter-search { flex-basis: 100%; }
  .filter-field input, .filter-field select { width: 100%; min-height: 44px; font-size: 16px; }
  .filter-sort { flex-basis: 33%; }
  .filters { gap: 10px; }
  .ledger-summary { padding: 12px 14px; gap: 8px 17px; }
  .ledger-summary .count { flex-basis: 100%; }
  .ledger-summary > span:not(.count) { flex-basis: 120px; padding: 11px; }
  .ledger-summary strong { font-size: 20px; }
  tr.total td.n { font-size: 15px; }
  th, td { padding: 10px; }
  .report-details { padding: 0; }
  .report-details > summary { padding: 17px; }
  .report-details > .cols { padding: 0 12px 12px; }
  .toolbar { width: 100%; }
  .toolbar input, .toolbar select { max-width: 100%; min-height: 40px; }
  .actions .msg { flex-basis: 100%; }
  .period-grid, .import-overview { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .period-card { padding: 17px; gap: 7px; }
  .period-card b { font-size: 29px; }
  .commission-strip { padding: 15px; gap: 15px; }
  .commission-strip > div { min-width: 125px; padding: 12px; }
  .commission-strip b { font-size: 21px; }
  .import-receipt { padding: 12px; gap: 8px; }
  .import-receipt .linkbtn { flex-shrink: 0; }
  .import-overview > div { padding: 14px; }
  .import-overview b { font-size: 15px; }
}
@media (max-width: 359px) {
  .kpis { grid-template-columns: minmax(0,1fr); }
  .kpi .v { font-size: 32px; }
  .top-actions { flex-wrap: wrap; }
  .top-actions #quickAdd { width: 100%; }
  .month { max-width: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: transform .2s; }
  .btn, nav.tabs button { transition: background .15s, color .15s; }
}
