:root {
  color-scheme: light;
  --bg:#f4f6fa; --paper:#fff; --nav:#10223b; --ink:#15243b; --muted:#56667c; --line:#e2e8f1;
  --blue:#1d5be6; --blue-dark:#174bc1; --soft:#edf3ff; --teal:#047767; --amber:#925411; --rose:#a72d34;
  --shadow:0 1px 2px #17294a08, 0 3px 14px #2b466c06;
  font-family: 'Segoe UI', system-ui, sans-serif; font-size:14px; color:var(--ink); background:var(--bg);
}
* { box-sizing:border-box; }
body { margin:0; min-width:320px; }
a { color:inherit; text-decoration:none; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:3px solid #6595ff; outline-offset:2px; }
button:disabled { opacity:.66; cursor:wait; }
h1,h2,h3,p { margin:0; }
h1 { font-size:32px; font-weight:720; letter-spacing:-1.15px; line-height:1.2; }
h2 { font-size:17px; letter-spacing:-.28px; }
h3 { font-size:15px; }
small { color:var(--muted); }
[hidden] { display:none !important; }
.ico { display:inline-block; vertical-align:middle; width:19px; height:19px; flex:none; }
.loading { padding:40px; }

.shell { min-height:100dvh; display:grid; grid-template-columns:230px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; padding:26px 17px 18px; background:var(--nav); color:#fff; }
.brand,.mobile-brand { display:flex; align-items:center; gap:12px; font-weight:720; }
.brand { margin:0 8px 46px; }
.brand img,.mobile-brand img { height:39px; width:39px; border-radius:11px; box-shadow:0 4px 13px #050e24a0; }
.brand strong { display:block; font-size:17px; letter-spacing:-.25px; }
.brand span { display:block; margin-top:1px; color:#a5b8d3; font-size:12px; font-weight:500; }
.sidebar nav { display:grid; gap:7px; }
.nav-link { min-height:45px; border-radius:9px; display:flex; align-items:center; gap:12px; padding:0 13px; color:#b5c5dc; font-weight:610; white-space:nowrap; }
.nav-link:is(:hover,.current) { color:#fff; background:#1b3558; }
.nav-link.current { box-shadow:inset 3px 0 #6697ff; }
.nav-link.current .ico { color:#82aaff; }
.sidebar-footer { display:flex; align-items:center; gap:11px; margin-top:auto; border-top:1px solid #2a3e59; padding:17px 4px 3px; white-space:nowrap; }
.workspace-icon { width:33px;height:33px;display:grid;place-items:center;border-radius:8px;background:#203957;color:#abc1eb; }
.sidebar-footer strong { display:block;font-size:12px;font-weight:620; }
.sidebar-footer small { display:block;margin-top:2px;color:#9bb0ce;font-size:11px; }
.workspace { min-width:0; display:flex; flex-direction:column; }
.topbar { height:70px; padding:0 clamp(18px,3vw,40px); display:flex; justify-content:space-between; align-items:center; background:var(--paper); border-bottom:1px solid var(--line); }
.breadcrumb,.top-actions,.account { display:flex; align-items:center; gap:10px; }
.breadcrumb { color:var(--muted);font-size:13px; }
.breadcrumb .ico { width:13px;height:13px;color:#8996ad; }
.breadcrumb strong { color:var(--ink); }
.top-actions { gap:20px; }
.account { padding-left:17px;border-left:1px solid var(--line); }
.account strong,.account small { display:block;white-space:nowrap; }
.account strong { max-width:140px;overflow:hidden;text-overflow:ellipsis;font-size:13px; }
.account small { font-size:11px;margin-top:1px; }
.avatar { width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#eaf0ff;color:#2859b5;font-size:12px;font-weight:750; }
.status-button { display:flex;align-items:center;gap:7px;border:1px solid #dce6ed;background:#f9fcfb;color:#326153;min-height:31px;padding:4px 9px;border-radius:20px;font-size:12px;font-weight:650; }
.status-button i,.chip i { display:inline-block;height:6px;width:6px;border-radius:100%;background:currentColor;flex:none; }
.status-button i { color:#1a9875; }
.status-button.offline { color:#805522;background:#fff8e9;border-color:#ead9bc; }
.status-button.offline i { color:#a97429; }
.status-button .ico { width:15px;height:15px; }
.mobile-brand,.mobile-nav { display:none; }
#main { width:100%;max-width:1560px;min-height:560px;margin:0 auto;padding:34px clamp(18px,3vw,40px) 30px; }
.workspace-footer { margin-top:auto;padding:16px clamp(18px,3vw,40px);display:flex;align-items:center;justify-content:space-between;gap:10px;color:#65748a;font-size:12px; }
.workspace-footer .ico { width:15px;height:15px;margin-right:4px; }
.page-title { display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px; }
.page-title p { margin-top:7px;color:var(--muted);line-height:1.5; }
.title-actions,.inline-actions,.detail-status { display:flex;flex-wrap:wrap;gap:7px;align-items:center; }
.title-actions { flex:none; }
.back-link { display:inline-flex;align-items:center;color:var(--blue-dark);font-weight:650;margin-bottom:14px; }
.back-link:hover,.row-link:hover { text-decoration:underline; }

.button,.symbol { display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;border:1px solid transparent;border-radius:8px;line-height:1.2;font-weight:660; }
.button { min-height:38px;padding:8px 13px; }
.button .ico { width:17px;height:17px; }
.primary { background:var(--blue);color:white;border-color:var(--blue);box-shadow:0 1px 2px #152e673a; }
.primary:not(:disabled):hover { background:var(--blue-dark);border-color:var(--blue-dark); }
.secondary { background:#fff;color:#33445b;border-color:#dbe3ee; }
.secondary:hover,.ghost:hover,.symbol:hover { background:#eef3fa;color:#1751c6; }
.ghost { color:#3b5374;background:transparent; }
.danger { background:#a72d34;color:white;border-color:#a72d34; }
.danger:hover { background:#882028; }
.symbol { width:31px;height:31px;padding:0;background:transparent;color:#51657f; }
.symbol .ico { width:17px;height:17px; }
.stats { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:23px; }
.invoice-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stat { min-width:0;min-height:110px;display:flex;align-items:flex-start;gap:12px;padding:17px 15px;background:var(--paper);border:1px solid var(--line);border-radius:11px;box-shadow:var(--shadow); }
.stat-icon,.table-icon,.empty-icon { place-items:center;display:inline-grid;flex:none; }
.stat-icon { width:39px;height:39px;border-radius:9px; }
.stat-icon .ico { width:21px;height:21px; }
.stat p { font-size:12px;color:#475c78;font-weight:650; }
.stat strong { display:block;margin:4px 0;font-size:26px;letter-spacing:-.7px;line-height:1.15;overflow-wrap:anywhere; }
.stat small { display:block;font-size:11px;line-height:1.4; }
.blue { color:#235dc7;background:#ebf2ff; }
.green,.teal { color:#04715d;background:#e6f6f0; }
.amber { color:var(--amber);background:#fff4df; }
.violet { color:#6343af;background:#f0ebfd; }
.muted { color:#475971;background:#edf1f6; }
.red { color:#a22b36;background:#fce9eb; }
.chip { min-height:23px;display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:20px;font-size:11px;font-weight:680;white-space:nowrap; }
.chip .ico { width:13px;height:13px; }
.panel { min-width:0;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);overflow:hidden;margin-bottom:17px; }
.list-head,.section-head { display:flex;align-items:center;justify-content:space-between;min-height:59px;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line); }
.list-head { border-bottom:0; }
.list-head p { font-size:12px;color:var(--muted);margin-top:4px; }
.segmented { display:flex;align-items:center;gap:3px;background:#f0f3f8;padding:3px;border-radius:8px; }
.segmented button { box-shadow:none;background:transparent;border:1px solid transparent;padding:6px 10px;border-radius:6px;color:#516179;font-size:12px;font-weight:650; }
.segmented button.selected { color:#234d9c;background:white;border-color:#e4eaf3;box-shadow:0 1px 2px #2b466c11; }
.toolbar,.date-filters { padding:0 18px 14px;display:flex;gap:9px;align-items:flex-end; }
.toolbar .field span { position:absolute;clip-path:inset(50%); }
.toolbar .field select { min-width:146px; }
.searchbox { display:flex;align-items:center;gap:9px;flex:1;max-width:510px;min-height:38px;border-radius:8px;border:1px solid #dbe3ee;padding:0 11px;background:white;color:#70839d; }
.searchbox:focus-within { outline:2px solid #6595ff;outline-offset:1px; }
.searchbox .ico { width:17px;height:17px; }
.searchbox input { border:0;background:none;outline:none;min-width:0;width:100%;height:36px; }
.searchbox input:focus-visible { outline:none; }
.table-scroll { overflow-x:auto; }
table { width:100%;border-collapse:collapse;text-align:left; }
th { background:#f5f7fb;color:#53647c;font-weight:660;font-size:12px;white-space:nowrap; }
th,td { padding:11px 13px;border-bottom:1px solid #eaf0f6;vertical-align:middle; }
th:first-child,td:first-child { padding-left:18px; }
tbody tr:hover { background:#fbfcff; }
tbody tr:last-child td { border-bottom:none; }
td { font-size:13px;line-height:1.4; }
td :is(strong,small) { display:block; }
td small { margin-top:3px;white-space:nowrap;font-size:11px; }
.table-identity { display:flex;align-items:center;gap:9px;white-space:nowrap; }
.table-icon { width:32px;height:32px;border-radius:8px;background:#eef3fe;color:#3262bc; }
.table-icon .ico { width:17px;height:17px; }
.row-link { color:#17489c;font-weight:720;overflow-wrap:anywhere; }
.date-stack { white-space:nowrap;display:grid;gap:3px;font-size:12px; }
.date-stack small { color:#65758e;display:inline-block;min-width:24px;margin:0; }
.container-count { display:flex;align-items:center;gap:5px;white-space:nowrap; }
.container-count .ico,.row-pending .ico { width:13px;height:13px; }
.row-pending .ico { margin-right:4px; }
.empty { padding:38px 20px;text-align:center;max-width:100%;color:var(--muted); }
.empty-icon { margin-bottom:10px;width:42px;height:42px;background:#eef3fe;color:#486eae;border-radius:11px; }
.empty strong { display:block;color:var(--ink); }
.empty p { margin-top:5px;font-size:13px; }
.notice { display:flex;align-items:center;gap:9px;padding:10px 13px;border-radius:8px;margin-bottom:14px;border:1px solid #f1deb7;background:#fffaed;color:#7b4b12; }
.notice.danger { border-color:#eec7ca;background:#fff0f1;color:#912333; }
.notice > span { flex:1; }
.detail-grid { display:grid;grid-template-columns:1.2fr 1fr;gap:15px; }
.detail-status { margin:-10px 0 17px; }
.facts { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0;padding:16px 18px; }
dt { margin:0 0 4px;font-size:12px;color:var(--muted); }
dd { margin:0;font-weight:650;overflow-wrap:anywhere; }
.section-tools { padding:6px 12px; }
.settings-body { padding:16px 18px;line-height:1.5; }
.settings-body p { color:var(--muted);margin-bottom:12px; }
.settings-body .facts { padding:0;margin-bottom:15px; }
.settings-body .inline-error { color:var(--rose); }
.wide { grid-column:1/-1; }

dialog { width:min(760px,calc(100% - 24px));max-height:calc(100dvh - 28px);padding:0;border:1px solid var(--line);border-radius:14px;color:var(--ink);box-shadow:0 20px 60px #09172c44; }
dialog::backdrop { background:#0b193873; }
.dialog-head,.dialog-foot { padding:15px 20px;display:flex;align-items:center;justify-content:space-between;gap:10px; }
.dialog-head { border-bottom:1px solid var(--line); }
.dialog-head h2 { font-size:20px; }
.dialog-head p { color:var(--muted);margin-top:4px;overflow-wrap:anywhere; }
.dialog-body { padding:17px 20px; }
.dialog-body p { line-height:1.55; }
.dialog-foot { border-top:1px solid var(--line);justify-content:flex-end; }
.dialog-subtitle { margin:18px 0 9px; }
.form-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px; }
.field { min-width:0;display:grid;gap:5px;align-content:start; }
.field > span { font-size:12px;color:#3f526e;font-weight:660; }
.field :is(input,select,textarea) { min-width:0;width:100%;border:1px solid #d8e1ee;border-radius:8px;padding:8px 9px;min-height:38px;background:white;color:var(--ink); }
.field textarea { resize:vertical; }
.field input[type=file] { padding:6px; }
.field input[type=file]::file-selector-button { background:#edf3ff;color:#2559b8;border:0;border-radius:5px;font:inherit;padding:4px 8px;margin-right:9px; }
.form-subhead { margin:16px 0 9px;display:flex;align-items:center;justify-content:space-between;gap:10px; }
.container-row { display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:end;margin-bottom:8px; }
.form-note { color:var(--muted);margin:10px 0; }
.form-error,.form-warnings,.unsaved { padding:10px 12px;margin:8px 0;border:1px solid #f0c6cc;border-radius:8px;color:#96232e;background:#fff1f2; }
.form-warnings,.unsaved { color:#854c10;background:#fff7e7;border-color:#f0debc; }
.form-warnings div,.unsaved { display:flex;gap:7px;align-items:center;flex-wrap:wrap; }
.form-warnings .ico,.unsaved .ico { width:16px;height:16px; }
.form-total { display:flex;justify-content:space-between;gap:5px;background:#f1f6ff;color:#1e4eac;padding:11px 12px;border-radius:8px; }
.conflict-actions { display:flex;gap:9px;flex-wrap:wrap;margin-top:17px; }
.pdf-preview { border:1px solid var(--line);width:100%;height:min(55vh,570px);margin-bottom:8px;border-radius:8px; }
.image-preview { display:block;max-width:100%;max-height:55vh;margin:auto; }
.timeline { margin:0;padding-left:25px; }
.timeline li { padding:7px 0; }
.timeline small { display:block;margin-top:3px; }
.timeline details { margin:6px 0; }
.timeline summary { cursor:pointer;color:#244e98; }
#toast { position:fixed;right:18px;bottom:18px;z-index:20;pointer-events:none; }
.toast { display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:9px;background:#112d46;color:white;box-shadow:0 4px 18px #0f24464a; }
.toast.error { background:#8c2b34; }
.spin { animation:spin 1.05s linear infinite; }
.pop { animation:pop .25s ease-out; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes pop { from { transform:scale(.7);opacity:.45; } to { transform:scale(1);opacity:1; } }

.login-layout { min-height:100dvh;display:grid;grid-template-columns:minmax(320px,42%) 1fr; }
.login-intro { min-height:460px;position:relative;display:flex;flex-direction:column;justify-content:center;gap:21px;overflow:hidden;background:#10233d;color:white;padding:clamp(26px,7vw,115px); }
.login-intro > img { width:55px;height:55px;z-index:1; }
.login-intro > div:not(.login-mark) { z-index:1; }
.login-intro p { color:#bbcff0;line-height:1.6;margin-top:13px;max-width:300px; }
.login-intro span { color:#8cb2ff;font-size:11px;font-weight:720;letter-spacing:2px; }
.login-intro h1 { font-size:clamp(36px,5vw,68px);line-height:1;letter-spacing:-1.5px;margin-top:8px; }
.login-mark { position:absolute;opacity:.09;bottom:-50px;right:-95px; }
.login-mark svg { width:390px;height:390px; }
.login-area { display:grid;place-items:center;padding:28px 18px; }
.login-card { width:min(100%,420px);padding:26px 28px;background:white;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow); }
.login-card h2 { font-size:25px;letter-spacing:-.7px; }
.login-card p { margin:6px 0 18px;color:var(--muted);line-height:1.5; }
.login-card form { display:grid;gap:14px; }
.demo-options { display:grid;gap:9px;border-top:1px solid var(--line);margin-top:18px;padding-top:14px;color:var(--muted);font-size:12px; }
.demo-options div { display:flex;flex-wrap:wrap;gap:6px; }

@media (max-width:1100px) {
  .shell { grid-template-columns:190px minmax(0,1fr); }
  .sidebar { padding-left:13px;padding-right:13px; }
  .stat { padding:14px 11px;gap:8px; }
  .stat-icon { width:32px;height:32px; }
}
@media (max-width:900px) {
  .stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:9px; }
  .detail-grid { grid-template-columns:1fr;gap:0; }
  .toolbar { flex-wrap:wrap; }
  .searchbox { max-width:none; }
  .date-filters { flex-wrap:wrap; }
}
@media (max-width:700px) {
  .shell { display:block; }
  .sidebar,.breadcrumb,.account > div { display:none; }
  .mobile-brand { display:flex;gap:8px; }
  .mobile-brand img { width:31px;height:31px;box-shadow:none; }
  .mobile-nav { display:flex;justify-content:space-around;position:fixed;bottom:0;left:0;right:0;z-index:10;background:var(--nav);padding:4px 5px max(4px,env(safe-area-inset-bottom)); }
  .mobile-nav .nav-link { display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:88px;padding:5px 7px;min-height:47px;font-size:11px; }
  .mobile-nav .nav-link.current { box-shadow:inset 0 2px #6697ff; }
  .account { padding-left:8px;gap:2px; }
  .topbar { padding:0 13px;height:56px; }
  .top-actions { gap:8px; }
  .avatar { width:30px;height:30px; }
  #main { padding:22px 13px;min-height:440px; }
  .workspace-footer { padding:12px 13px 77px;flex-wrap:wrap; }
  h1 { font-size:27px; }
  .page-title { align-items:flex-start;gap:10px;margin-bottom:17px; }
  .page-title p { font-size:13px; }
  .title-actions { flex-shrink:1;justify-content:flex-end; }
  .stats { margin-bottom:14px; }
  .stat { min-height:92px; }
  .stat strong { font-size:22px; }
  .list-head,.section-head { padding:11px; }
  .list-head { flex-wrap:wrap; }
  .section-head .button { white-space:normal; }
  .toolbar,.date-filters { padding:0 11px 12px; }
  .searchbox { flex-basis:100%; }
  .toolbar .field { flex:1; }
  .button { min-height:37px;padding:7px 9px;font-size:13px; }
  th,td { padding:9px 10px; }
  th:first-child,td:first-child { padding-left:11px; }
  .facts { padding:12px; }
  #toast { bottom:62px;right:10px;max-width:calc(100% - 20px); }
  .dialog-head,.dialog-foot,.dialog-body { padding:12px; }
  .container-row { grid-template-columns:1fr 1fr; }
  .container-row .button { grid-column:1/-1;justify-self:end;min-height:28px; }
  .form-grid { gap:9px; }
  .login-layout { grid-template-columns:1fr; }
  .login-intro { min-height:220px;padding:26px;gap:12px; }
  .login-intro h1 br { display:none; }
  .login-intro h1 br::after { content:' '; }
  .login-intro h1 { font-size:34px; }
  .login-intro > img { width:42px;height:42px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important;scroll-behavior:auto !important; } }

.nav-short { display:none; }
.po-toolbar { padding-top:13px; }
.dash-menu { display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px; }
.bar-chart { display:grid;gap:9px;padding:15px 18px; }
.chart-bar { display:grid;grid-template-columns:78px minmax(0,1fr) auto;align-items:center;gap:13px;padding:7px 0;color:#234d9c; }
.chart-bar:hover strong { text-decoration:underline; }
.chart-bar progress { width:100%;height:17px;accent-color:#1d5be6; }
.allocation-row { display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;align-items:end;gap:7px;margin:9px 0; }
.reminder-bell { position:relative; }
.reminder-bell span { position:absolute;right:-6px;top:-4px;min-width:16px;padding:2px 4px;border-radius:12px;background:#1d5be6;color:#fff;font-size:10px; }
.reminder-notice > div { flex:1;min-width:0; }
.reminder-notice p { margin-top:4px;overflow-wrap:anywhere; }
.review-dialog { width:min(1150px,calc(100% - 24px)); }
.ocr-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px; }
.ocr-document { position:sticky;top:0;align-self:start;min-width:0; }
.ocr-values { min-width:0;display:grid;gap:8px; }
.ocr-value { display:grid;gap:5px;border-bottom:1px solid var(--line);padding-bottom:8px; }
.ocr-value small { overflow-wrap:anywhere; }
.ocr-alternative { display:block;padding-left:8px; }
.ocr-tabs { display:none; }
@media (max-width:1023px) {
  .ocr-tabs { display:flex;gap:7px;margin-bottom:10px; }
  .ocr-layout { display:block; }
  .ocr-layout[data-pane="document"] .ocr-values,.ocr-layout[data-pane="values"] .ocr-document { display:none; }
  .ocr-document { position:static; }
}
@media (max-width:700px) {
  .mobile-nav .nav-link { flex:1;min-width:0;padding-inline:3px;font-size:10px; }
  .mobile-nav a[href="#transfer"] .nav-full { display:none; }
  .mobile-nav .nav-short { display:inline; }
  .allocation-row { grid-template-columns:1fr 1fr; }
  .allocation-row .button { grid-column:2;justify-self:end; }
  .reminder-notice { flex-wrap:wrap; }
  .chart-bar { grid-template-columns:62px minmax(0,1fr) auto;gap:6px;font-size:12px; }
}
