:root{--bg:#f3f4f7;--surface:#fff;--ink:#171d29;--muted:#7e8a9e;--line:#dce1e9;--accent:#2b78d6;--accent-bg:#e6f0fc;--good:#108963;--bad:#d74730;font-family:"Golos Text",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg)}
*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}h1,h2,h3,p{margin-top:0}h1{font-size:32px;line-height:1.15;margin-bottom:8px}h2{font-size:21px;margin-bottom:12px}h3{font-size:17px;margin-bottom:10px}p{line-height:1.5}.muted{color:var(--muted)}.small{font-size:13px}.error{color:var(--bad)}.money{font-variant-numeric:tabular-nums;white-space:nowrap}.positive{color:var(--good)}.negative{color:var(--bad)}
.shell{display:grid;grid-template-columns:242px minmax(0,1fr);min-height:100vh}.sidebar{background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:26px 15px}.brand{font-size:25px;font-weight:750;padding:0 12px 25px}.nav{display:grid;gap:4px}.nav button{background:transparent;border:0;border-radius:10px;padding:11px 12px;text-align:left;color:#4f5b70}.nav button.active{background:var(--accent-bg);color:var(--accent);font-weight:700}.nav button:hover{background:#f0f4fa}.account{margin-top:auto;padding:15px 12px;color:var(--muted);display:grid;gap:7px}.account strong{color:var(--ink)}.link{border:0;background:none;color:var(--accent);text-align:left;padding:0;text-decoration:underline;text-underline-offset:3px}.content{padding:34px 38px 64px;max-width:1700px;width:100%;min-width:0}.heading{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin-bottom:25px}.heading p{color:var(--muted);margin-bottom:0}.actions{display:flex;gap:9px;flex-wrap:wrap}.btn{border:1px solid #cdd5e1;background:#fff;border-radius:9px;padding:10px 16px;color:var(--ink);font-weight:550}.btn:hover{background:#f7f9fc}.btn.primary{background:var(--accent);border-color:var(--accent);color:white}.btn.primary:hover{filter:brightness(1.06)}.btn.small{padding:6px 10px;font-size:13px}.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 3px 10px rgba(20,30,50,.03);overflow:hidden;margin-bottom:22px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 21px;border-bottom:1px solid var(--line)}.panel-head h2{margin:0}.panel-body{padding:20px}.scroll{overflow:auto}.table{width:100%;border-collapse:collapse;font-size:14px}.table th{text-align:left;color:var(--muted);font-size:12px;font-weight:650;padding:12px 17px;white-space:nowrap}.table td{border-top:1px solid var(--line);padding:14px 17px;vertical-align:top}.table tr:hover td{background:#fafbfd}.table .end{text-align:right}.table strong{font-weight:700}.table .sub{display:block;color:var(--muted);font-size:12px;margin-top:4px}.empty{color:var(--muted);padding:25px}.tag{display:inline-block;border-radius:30px;background:var(--accent-bg);color:var(--accent);padding:3px 10px;font-size:12px;font-weight:600}.tag.gray{background:#f0f2f6;color:#667386}.list{display:grid;gap:10px}.list-row{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);border-radius:9px;padding:11px 13px;gap:12px}
.editor{padding:22px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.field{display:grid;gap:7px;color:#49566b;font-size:13px;font-weight:550}.field.full,.form-actions,.section-line{grid-column:1/-1}.field input,.field select,.field textarea{border:1px solid #cbd3df;border-radius:9px;padding:11px 12px;width:100%;background:#fff;color:var(--ink);min-width:0}.field textarea{min-height:80px;resize:vertical}.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid var(--accent);outline-offset:1px}.field-inline{display:flex;gap:8px}.field-inline select,.field-inline input{flex:1}.section-line{border-top:1px solid var(--line);padding-top:16px;font-size:15px;font-weight:700}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.check{display:flex;align-items:center;gap:9px;color:var(--ink);font-weight:500}.check input{width:auto}.hint{font-size:12px;color:var(--muted);font-weight:400}.grid-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.grid-cards .panel{margin:0}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(420px,100%);background:white;border:1px solid var(--line);border-radius:17px;padding:30px;box-shadow:0 15px 45px rgba(30,40,60,.08)}.login-card .field{margin:18px 0}.login-card .btn{width:100%;justify-content:center}.login-card p{color:var(--muted)}.loading{padding:45px;color:var(--muted)}dialog{border:0;border-radius:15px;padding:25px;width:min(560px,calc(100% - 24px));max-height:calc(100vh - 40px);overflow:auto;box-shadow:0 24px 70px rgba(10,20,40,.3)}dialog::backdrop{background:rgba(20,27,40,.45)}dialog h2{margin-bottom:16px}dialog .form-grid{gap:13px}#notice{position:fixed;bottom:22px;right:22px;background:#1f2b3d;color:white;padding:12px 18px;border-radius:10px;box-shadow:0 10px 25px rgba(0,0,0,.2);max-width:min(400px,calc(100vw - 40px));display:none;z-index:10}#notice.show{display:block}
.editor fieldset.form-grid{border:0;padding:0;margin:0;min-width:0}
@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{position:static;padding:14px 18px;gap:8px}.brand{padding:0}.nav{display:flex;overflow:auto}.nav button{white-space:nowrap}.account{display:flex;align-items:center;padding:0}.account .link{margin-left:auto}.content{padding:22px 16px}.heading{align-items:flex-start}.form-grid,.grid-cards{grid-template-columns:1fr}.table{min-width:750px}}
[hidden]{display:none!important}.form-grid>.full{grid-column:1/-1}dialog[data-kind="project"]{width:min(760px,calc(100% - 24px))}
.nav-group{display:grid;gap:3px}.nav-heading{padding:14px 12px 4px;color:var(--muted);font-size:12px;font-weight:700}.nav-group:first-child .nav-heading{padding-top:0}
@media(max-width:900px){.nav-group{display:flex;align-items:center;flex:none}.nav-heading{display:none}}
@media(max-width:600px){.field-inline{flex-wrap:wrap}.field-inline .btn{width:100%}.heading{display:block}.heading .btn{margin-top:14px}}
.metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:20px}.metrics .panel{margin:0}.metric{padding:20px;display:grid;gap:8px}.metric span{color:var(--muted);font-size:13px}.metric strong{font-size:24px;font-variant-numeric:tabular-nums}.tabs{display:flex;gap:4px;background:#f3f5f9;border-radius:9px;padding:3px}.tabs button{border:0;border-radius:7px;background:transparent;color:#5a687c;padding:7px 12px;font-size:13px}.tabs button.active{background:white;color:var(--ink);box-shadow:0 1px 4px #00000014;font-weight:700}.row-actions{white-space:nowrap}.row-actions .btn+.btn{margin-left:5px}.payment-form{padding-top:17px;border-top:1px solid var(--line)}
@media(max-width:650px){.metrics{grid-template-columns:1fr}.panel-head{align-items:flex-start;flex-wrap:wrap}.tabs{overflow:auto;max-width:100%}.row-actions{white-space:normal}}
.preset{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#f4f7fb;border:1px solid var(--line);border-radius:10px;padding:13px;margin:22px 0}.preset div{display:grid;gap:3px;flex:1;min-width:190px}.preset span{font-size:12px;color:var(--muted)}.preset select{border:1px solid #cbd3df;border-radius:9px;padding:9px 11px;background:#fff;min-width:220px}.rights-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:25px}.rights-directions{display:grid;gap:14px;margin-bottom:22px}.rights-direction{border:1px solid var(--line);border-radius:10px;padding:17px}.rights-direction h4{margin:0 0 15px;font-size:16px}.project-checks{border:1px solid var(--line);border-radius:9px;padding:10px 12px;display:grid;gap:8px;max-height:175px;overflow:auto}.project-checks label{display:flex;align-items:center;gap:8px;font-weight:400;color:var(--ink)}#password-dialog{width:min(520px,calc(100% - 24px))}#password-dialog p{color:var(--muted)}#password-dialog .form-actions{margin-top:18px}
@media(max-width:700px){.rights-sections{grid-template-columns:1fr}.preset select{width:100%;min-width:0}}
.date-filter{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:22px}.date-filter .field{min-width:170px}.date-filter .btn{height:42px}.cashflow-tabs{border-bottom:1px solid var(--line);border-radius:0;flex-wrap:wrap}
@media(max-width:600px){.date-filter .field{flex:1;min-width:130px}.date-filter .btn{width:100%}}
.analytics-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
.control-filters{align-items:center;margin-bottom:18px}.control-filters select,.table select,.table input[type=date]{border:1px solid #cbd3df;border-radius:8px;padding:8px 10px;background:#fff;color:var(--ink);max-width:220px}.control-filters select{min-width:170px}
.grid-cards>.full{grid-column:1/-1}.table input[type=number]{border:1px solid #cbd3df;border-radius:8px;padding:8px 10px;width:105px;background:#fff;color:var(--ink)}
.cal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;padding:18px}.cal-month{border:1px solid var(--line);border-radius:10px;padding:12px}.cal-month h3{font-size:15px;margin:0 0 10px}.cal-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}.cal-weekday{text-align:center;font-size:11px;color:var(--muted)}.cal-day{border:0;background:#f3f7fc;border-radius:5px;padding:5px 0;min-width:0;font-size:12px}.cal-day.off{background:#fff0ef;color:#a7392c}.cal-day:hover:not(:disabled){outline:2px solid var(--accent)}.cal-day:disabled{cursor:default;opacity:1}@media(max-width:1000px){.cal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.cal-grid{grid-template-columns:1fr}}
@media(max-width:750px){.analytics-metrics{grid-template-columns:1fr}}
.metric-button{text-align:left;color:var(--ink);cursor:pointer;font:inherit}.metric-button:hover{border-color:var(--accent)}
.metric-button small{color:var(--muted);font-size:12px;font-weight:400}.service-summary{display:grid;grid-template-columns:190px minmax(0,1fr);align-items:center;gap:20px;padding:18px}.service-donut{width:174px;height:174px;border-radius:50%;display:grid;place-items:center}.service-donut span{width:116px;height:116px;border-radius:50%;background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:12px;text-align:center}.service-donut strong{color:var(--ink);font-size:16px;margin-top:5px}.service-color{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:8px}@media(max-width:750px){.service-summary{grid-template-columns:1fr}.service-donut{margin:auto}}
.chart-wrap{padding:18px 20px 4px;overflow-x:auto}.chart-wrap svg{display:block;width:100%;min-width:620px;height:auto}.chart-label{fill:var(--ink);font-size:14px;font-weight:600}.chart-value{fill:#556174;font-size:12px}.chart-income{fill:var(--good)}.chart-expense{fill:var(--bad)}.chart-legend{display:flex;gap:20px;padding:4px 20px 18px;color:var(--muted);font-size:12px}.chart-legend span{display:inline-flex;align-items:center;gap:6px}.chart-swatch{display:inline-block;width:10px;height:10px;border-radius:2px}
.contract-files{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}.contract-files h3{margin-bottom:12px}.contract-files .field-inline{margin-top:12px;align-items:center}.contract-files input[type=file]{min-width:0;flex:1}
.work-stages{display:flex;flex-wrap:wrap;gap:7px;margin:18px 0 14px}
.cashflow-articles{padding:6px 20px 20px}.cashflow-section{padding:15px 0;border-bottom:1px solid var(--line)}.cashflow-section:last-child{border-bottom:0}.cashflow-section h3{margin:0 0 10px}.cashflow-article{border:1px solid var(--line);border-radius:9px;margin:7px 0}.cashflow-article summary{cursor:pointer;display:flex;justify-content:space-between;gap:14px;padding:12px 14px;list-style:none}.cashflow-article summary::-webkit-details-marker{display:none}.cashflow-article summary:before{content:'▸';color:var(--accent);margin-right:6px}.cashflow-article[open] summary:before{content:'▾'}.cashflow-article summary span{flex:1}.cashflow-article summary small{color:var(--muted)}.cashflow-article .scroll{border-top:1px solid var(--line)}.cashflow-aggregate{display:flex;justify-content:space-between;gap:16px;padding:12px 14px;background:#f7f9fc;border-radius:9px}

/* The live interface follows the final (v6) visual tokens in Сальдо.html. */
:root {
  --bg:#F4F5F8; --surface:#FFFFFF; --surface-2:#F3F4F7;
  --ink:#141A26; --ink-2:#4B5565; --ink-3:#808A9B;
  --muted:var(--ink-3); --line:#E6E8EE; --line-2:#D3D7E0;
  --accent:#2A78D6; --accent-bg:#E6F0FC;
  --good:#178C62; --bad:#D4482F;
  --shadow:0 1px 2px rgba(20,26,38,.04),0 12px 32px -20px rgba(20,26,38,.18);
}
body { background:var(--bg); color:var(--ink); font:13.5px/1.5 "Golos Text",system-ui,-apple-system,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
h1,h2,h3 { letter-spacing:-.015em; }
h1 { font-size:26px; font-weight:650; line-height:1.2; }
h2 { font-size:15px; font-weight:600; }
.shell { grid-template-columns:236px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100dvh; overflow-y:auto; padding:20px 12px; background:var(--surface); }
.brand { display:flex; align-items:center; gap:10px; font-size:17px; font-weight:650; padding:0 8px 20px; }
.brand b { display:block; line-height:1.2; }
.brand span { display:block; color:var(--ink-3); font-size:11.5px; font-weight:400; margin-top:2px; }
.nav { gap:2px; }
.nav-group { gap:2px; }
.nav-heading { color:var(--ink-3); font-size:11px; font-weight:600; letter-spacing:.02em; padding:14px 10px 4px; }
.nav button { display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--ink-2); border-radius:9px; padding:7px 10px; font-size:13.5px; font-weight:500; }
.nav button.active { background:var(--accent-bg); color:var(--accent); font-weight:600; }
.nav button:hover { background:var(--surface-2); color:var(--ink); }
.nav-badge { min-width:20px; border-radius:999px; padding:1px 6px; background:var(--bad); color:#fff; text-align:center; font-size:11px; font-weight:600; }
.nav-badge.doc { background:#6250D6; }
.nav-badge.warn { background:#B07A10; }
.linkbtn { border:0; background:transparent; color:var(--accent); font:inherit; padding:0; text-align:left; }
.linkbtn:hover { text-decoration:underline; }
.account { padding:16px 10px 0; gap:6px; font-size:12.5px; }
.content { padding:26px 36px 64px; max-width:1440px; }
.content.full { max-width:none; }
.heading { align-items:flex-end; margin-bottom:18px; }
.heading p { color:var(--ink-3); font-size:13px; max-width:70ch; margin-top:6px; }
.actions { gap:8px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 13px; border-color:var(--line-2); border-radius:9px; font-size:13.5px; font-weight:500; box-shadow:0 1px 1px rgba(20,26,38,.03); }
.btn.small { padding:5px 9px; font-size:12.5px; }
.panel { border-color:var(--line); border-radius:16px; box-shadow:var(--shadow); margin-bottom:18px; }
.panel-head { padding:16px 20px 10px; border-bottom:0; }
.panel-head h2 { font-size:14.5px; font-weight:600; }
.panel-body { padding:6px 20px 18px; }
.table { font-size:13.5px; }
.table th { color:var(--ink-3); font-size:12.5px; font-weight:500; padding:9px 12px; border-bottom:1px solid var(--line); }
.table td { padding:10px 12px; border-top:0; border-bottom:1px solid var(--line); }
.table tr:last-child td { border-bottom:0; }
.table th:first-child,.table td:first-child { padding-left:18px; }
.table th:last-child,.table td:last-child { padding-right:18px; }
.table tr:hover td { background:var(--surface-2); }
.table .sub { color:var(--ink-3); font-size:12.5px; }
.field { color:var(--ink-2); font-size:13px; font-weight:500; }
.field input,.field select,.field textarea { border-color:var(--line-2); }
.tabs { background:var(--surface-2); border:1px solid var(--line); padding:2px; gap:2px; }
.tabs button { color:var(--ink-2); }
.tag { font-weight:500; }
.entity-title { color:var(--ink); text-decoration:none; font-weight:600; }
.entity-title:hover { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.project-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 18px; }
.project-toolbar .tabs { display:inline-flex; width:max-content; flex:none; }
.project-toolbar .hint { color:var(--ink-3); font-size:12px; }
.projects-table { min-width:1317px; }
.projects-table th:nth-child(1) { min-width:122px; }
.projects-table th:nth-child(2) { min-width:103px; }
.projects-table th:nth-child(3) { min-width:181px; }
.projects-table th:nth-child(4) { min-width:113px; }
.projects-table th:nth-child(5) { min-width:120px; }
.projects-table th:nth-child(6) { min-width:58px; }
.projects-table .nowrap { white-space:nowrap; }
.user-avatar { display:inline-grid; place-items:center; width:21px; height:21px; margin-right:7px; border-radius:50%; background:#3157CC; color:white; font-size:11px; font-weight:600; }
.direction-pill { display:inline-block; margin:1px 2px 1px 0; padding:2px 8px; border-radius:999px; background:var(--accent-bg); color:var(--accent); font-size:12px; white-space:nowrap; }
.breadcrumbs { display:flex; align-items:center; gap:8px; color:var(--ink-3); margin:0 0 12px; font-size:12.5px; }
.breadcrumbs .link { color:var(--ink-2); }
.sharebar { display:flex; justify-content:flex-end; margin-bottom:12px; }
.project-detail-head { margin:0 0 12px; }
.project-detail-head h1 { margin:3px 0 3px; }
.project-detail-head p { margin:0; color:var(--ink-3); font-size:12.5px; }
.project-detail-head a,.project-contract-row a { color:var(--accent); text-decoration:none; }
.project-detail-head a:hover,.project-contract-row a:hover { text-decoration:underline; }
.project-detail-actions { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.project-contract-row { display:grid; grid-template-columns:minmax(220px,1fr) minmax(0,2fr); gap:16px; align-items:center; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:12px 16px; margin:0 0 14px; }
.project-contract-row>div { display:grid; gap:3px; }
.project-contract-row strong { font-size:13.5px; }
.project-financial { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); border:1px solid var(--line); border-radius:12px; background:white; overflow:hidden; margin:0 0 18px; }
.project-financial>div { display:grid; align-content:start; gap:3px; min-width:0; padding:12px 14px; border-right:1px solid var(--line); }
.project-financial>div:last-child { border-right:0; }
.project-financial span,.project-financial small { color:var(--ink-3); font-size:11.5px; }
.project-financial strong { font-size:15px; font-weight:650; overflow-wrap:anywhere; }
.project-financial .user-avatar { vertical-align:middle; }
.project-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 24px; }
.project-facts>div { display:grid; align-content:start; gap:3px; min-width:0; }
.project-facts span,.project-kpi span { color:var(--ink-3); font-size:12.5px; }
.project-facts strong { font-size:13.5px; font-weight:600; overflow-wrap:anywhere; }
.project-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.project-kpi { display:grid; gap:4px; padding:14px 18px; margin:0; }
.project-kpi strong { font-size:19px; font-weight:600; font-variant-numeric:tabular-nums; }
.empty-state { display:grid; justify-items:start; gap:10px; padding:18px 20px 22px; color:var(--ink-3); }
.empty-state p { margin:0; }
.work-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 18px; }
.work-table { min-width:1580px; }
.work-table th { vertical-align:middle; }
.work-table th:first-child,.work-table td:first-child { width:32px; padding-left:12px; padding-right:0; }
.work-table td { vertical-align:top; }
.work-table .nowrap { white-space:nowrap; }
.work-filter-row td { padding:5px 6px 9px; background:#fafbfc; border-bottom:1px solid var(--line); }
.work-filter-row td:first-child { padding-left:12px; }
.work-filter-row input,.work-filter-row select { width:100%; min-width:86px; max-width:none; border:1px solid var(--line-2); border-radius:6px; padding:4px 6px; background:white; color:var(--ink-2); font-size:11.5px; }
.table-sort { background:none; border:0; padding:0; text-align:inherit; color:inherit; font-size:inherit; font-weight:inherit; white-space:nowrap; }
.table-sort:hover,.table-sort.active { color:var(--accent); }
.work-expand { border:0; background:none; color:var(--ink-3); font-size:16px; padding:0 3px; line-height:1; }
.work-expand:hover { color:var(--accent); }
.work-expanded-row td { background:var(--surface-2); padding:8px 12px; }
.work-expanded-row .table { background:white; font-size:12px; }
.work-table-note { border-top:1px solid var(--line); color:var(--ink-3); font-size:12px; padding:9px 18px; }
.document-count { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 5px; background:#E8E2FF; color:#6250D6; border-radius:6px; font-size:11px; }
.document-badges { display:inline-flex; gap:4px; flex-wrap:wrap; }
.document-badge { border:1px dashed var(--line-2); border-radius:6px; padding:1px 6px; color:var(--ink-3); font-size:11.5px; white-space:nowrap; }
.document-badge.ok { border-color:transparent; background:#DFF5EA; color:#178C62; }
.document-badge.wip { border-color:transparent; background:#E9E2FF; color:#6250D6; }
.document-badge.bad { border-color:transparent; background:#FDE9E4; color:#D4482F; }
@media(max-width:900px) {
  .shell { grid-template-columns:1fr; }
  .sidebar { position:static; height:auto; overflow:visible; padding:10px 12px; }
  .brand { padding:0; }
  .content { padding:18px 14px 44px; }
  .project-facts,.project-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-financial { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .project-financial>div:nth-child(3) { border-right:0; }
  .project-financial>div:nth-child(-n+3) { border-bottom:1px solid var(--line); }
}
@media(max-width:600px) { .project-facts,.project-kpis { grid-template-columns:1fr; }
  .project-financial { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-financial>div { border-bottom:1px solid var(--line); }
  .project-financial>div:nth-child(2n) { border-right:0; }
  .project-financial>div:nth-last-child(-n+2) { border-bottom:0; }
  .project-contract-row { grid-template-columns:1fr; }
}

/* Summary, operations, and document register use the prototype's compact layout. */
.prototype-toolbar { align-items:center; gap:8px; margin:14px 0 18px; }
.prototype-toolbar .field { display:flex; align-items:center; gap:7px; min-width:0; }
.prototype-toolbar .field>span { color:var(--ink-2); font-size:13px; }
.prototype-toolbar .field input { width:170px; height:36px; padding:5px 10px; }
.prototype-toolbar select { width:auto; min-width:168px; height:36px; padding:5px 10px; border:1px solid var(--line-2); border-radius:9px; background:white; color:var(--ink); }
.prototype-toolbar .tabs { width:max-content; }
.prototype-toolbar .tabs button { white-space:nowrap; }
.prototype-toolbar .btn { height:36px; }
.report-kpis { gap:10px; margin:16px 0 12px; }
.report-kpis-four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.report-kpis-five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.report-kpis-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.report-kpis .metric { min-width:0; min-height:104px; align-content:start; padding:14px 16px 12px; gap:3px; border-radius:14px; }
.report-kpis .metric span { color:var(--ink-2); font-size:12px; font-weight:500; }
.report-kpis .metric strong { font-size:clamp(18px,1.6vw,24px); line-height:1.2; overflow-wrap:anywhere; }
.report-kpis .metric small { color:var(--ink-3); font-size:11.5px; }
.direction-business-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:16px 0; }
.direction-business-card { display:block; min-width:0; text-align:left; padding:18px; color:var(--ink); cursor:pointer; }
.direction-business-card:hover { border-color:var(--accent); }
.direction-business-card h2 { margin:0 0 12px; color:var(--accent); }
.direction-business-card dl { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px 8px; margin:0; }
.direction-business-card dt { color:var(--ink-2); }
.direction-business-card dd { margin:0; font-weight:600; font-variant-numeric:tabular-nums; }
.report-table { min-width:900px; }
.report-table th { padding:8px 12px; font-size:11.5px; }
.report-table td { padding:8px 12px; }
.report-group-row td { background:color-mix(in srgb,var(--accent-bg) 55%,white); font-weight:600; }
.report-total-row td { background:var(--surface-2); border-top:1px solid var(--line-2); font-weight:700; }
.report-indent { padding-left:30px!important; }
.report-note { padding:10px 20px 14px; color:var(--ink-3); font-size:12px; border-top:1px solid var(--line); }
.report-drill summary { cursor:pointer; white-space:nowrap; }
.report-drill-list { display:grid; gap:5px; padding:7px 0; min-width:180px; }
.report-drill-list button { font-size:11px; }
.cash-chart-label { fill:var(--ink-3); font-size:10px; }
.cash-chart-line { width:16px; height:2px; background:var(--accent); display:inline-block; }
.cashflow-secondary { justify-content:flex-start; }
.cashflow-secondary .field>span { display:none; }
.cashflow-secondary .tabs { border:1px solid var(--line); border-radius:9px; }
.control-group-tabs { max-width:100%; overflow:auto; }
.payment-group { margin-bottom:16px; }
.payment-group summary { cursor:pointer; list-style:none; }
.payment-group summary::-webkit-details-marker { display:none; }
.payment-group summary h2 { font-size:15px; }
.debt-mode-tabs,.close-month-tabs { width:max-content; max-width:100%; overflow:auto; border:1px solid var(--line); margin:10px 0 18px; }
.close-month-picker { margin-bottom:12px; }
.close-progress .panel-body { display:flex; align-items:center; gap:15px; padding:16px 18px; flex-wrap:wrap; }
.close-progress h2 { margin:0; white-space:nowrap; }
.close-progress-track { height:8px; flex:1 1 180px; background:var(--surface-2); border:1px solid var(--line); border-radius:99px; overflow:hidden; }
.close-progress-track i { display:block; height:100%; background:var(--good); }
.close-check { display:flex; align-items:center; gap:10px; }
.close-check-icon { display:inline-grid; place-items:center; width:19px; height:19px; flex:none; border:1.5px solid var(--line-2); border-radius:5px; color:white; font-size:13px; }
.close-check-icon.done { background:var(--good); border-color:var(--good); }
.table td a+a { margin-left:10px; }
.tag.success { background:#E3F4EC; color:var(--good); }
:root { --payroll-0:#2A78D6; --payroll-1:#EB6834; --payroll-2:#6250D6; --payroll-3:#1BAF7A; --payroll-4:#EDA100; }
.payroll-allocation-bar { display:flex; width:min(260px,100%); height:8px; border-radius:999px; overflow:hidden; background:var(--surface-2); margin:3px 0 4px; }
.payroll-allocation-bar i { display:block; height:100%; }
.dictionary-tabs { width:max-content; max-width:100%; margin:4px 0 18px; border:1px solid var(--line); }
.counterparties-tabs { width:max-content; max-width:100%; margin:4px 0 18px; border:1px solid var(--line); }
.journal-filter-row { margin:7px 0 10px; }
.journal-collection-tabs { max-width:100%; overflow:auto; }
.journal-search-form { display:flex; flex-wrap:wrap; gap:7px; }
.journal-search-form input { width:165px; padding:8px 10px; border:1px solid var(--line-2); border-radius:8px; background:white; }
.journal-search-form .btn { padding:7px 12px; }
.journal-events { padding:4px 18px; }
.journal-event { display:grid; grid-template-columns:130px 24px minmax(0,1fr); gap:8px; align-items:start; padding:13px 0; border-bottom:1px solid var(--line); }
.journal-event:last-child { border-bottom:0; }
.journal-event time { color:var(--ink-3); font-size:12px; white-space:nowrap; }
.journal-avatar { display:grid; place-items:center; width:21px; height:21px; border-radius:50%; background:#3256cb; color:white; font-size:11px; font-weight:700; }
.journal-event-note { display:block; color:var(--ink-3); font-size:12px; margin-top:2px; }
@media(max-width:650px){.journal-event{grid-template-columns:24px minmax(0,1fr)}.journal-event time{grid-column:1/-1}}
@media(max-width:1100px){.report-kpis-five,.report-kpis-four { grid-template-columns:repeat(2,minmax(0,1fr)); }.direction-business-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }}
@media(max-width:700px){.report-kpis-five,.report-kpis-four,.report-kpis-three,.direction-business-cards { grid-template-columns:1fr; }}
.summary-kpi-grid { display:grid; gap:10px; margin:0 0 10px; }
.summary-kpi-primary { grid-template-columns:minmax(230px,1.45fr) repeat(5,minmax(0,1fr)); }
.summary-kpi-secondary { grid-template-columns:repeat(5,minmax(0,1fr)); }
.summary-kpi-grid .metric { min-width:0; min-height:126px; margin:0; align-content:start; padding:14px 16px 12px; gap:2px; border-radius:14px; }
.summary-kpi-grid .metric span { color:var(--ink-2); font-size:12px; font-weight:500; }
.summary-kpi-grid .metric strong { font-size:clamp(17px,1.55vw,24px); line-height:1.2; letter-spacing:-.025em; white-space:normal; overflow-wrap:anywhere; }
.summary-kpi-grid .metric.hero strong { font-size:clamp(20px,1.9vw,28px); }
.summary-kpi-grid .metric.positive strong,.summary-kpi-grid .metric strong.positive { color:var(--good); }
.summary-kpi-grid .metric.negative strong,.summary-kpi-grid .metric strong.negative { color:var(--bad); }
.summary-kpi-grid .metric small { color:var(--ink-3); font-size:11.5px; line-height:1.4; }
.summary-hint { margin:0 0 18px; }
.summary-analytics-grid { margin-bottom:18px; }
.summary-analytics-grid .panel { min-width:0; }
.summary-analytics-grid .table { font-size:12px; }
.summary-analytics-grid .table th { font-size:11px; }
.summary-analytics-grid .table td { padding:7px 9px; }
.operation-heading { margin-bottom:12px; }
.operation-actions { margin:0 0 14px; }
.operation-search { margin:0 0 14px; }
.operation-search-form { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.operation-search-form input { width:min(420px,100%); height:36px; border:1px solid var(--line-2); border-radius:9px; background:white; padding:6px 10px; }
.operation-register { overflow:hidden; }
.operation-strip { display:flex; align-items:center; flex-wrap:wrap; gap:10px 22px; padding:13px 18px; color:var(--ink-2); font-size:12px; border-bottom:1px solid var(--line); }
.operation-strip strong { color:var(--ink); }
.operation-strip strong.positive { color:var(--good); }
.operation-strip strong.negative { color:var(--bad); }
.operation-table { min-width:1650px; table-layout:auto; }
.operation-table th { font-size:11.5px; }
.operation-table td { font-size:12.5px; }
.operation-table .nowrap { white-space:nowrap; }
.operation-table td a { color:var(--ink); text-decoration:none; }
.operation-table td a:hover { color:var(--accent); text-decoration:underline; }
.operation-filter-row th { background:var(--surface-2); padding:5px 6px; }
.operation-filter-row select,.operation-filter-row input { width:100%; min-width:70px; border:1px solid var(--line-2); border-radius:6px; background:white; color:var(--ink-2); padding:5px 6px; font-size:11.5px; }
.operation-filter-row .operation-dates { display:flex; gap:3px; }
.operation-filter-row .operation-dates input { min-width:115px; }
.document-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 0 14px; }
.document-kpis .metric { min-height:104px; padding:14px 16px; margin:0; align-content:start; }
.document-kpis .metric strong { font-size:24px; }
.document-kpis .metric strong.negative { color:var(--bad); }
.document-toolbar { display:flex; align-items:center; gap:6px 8px; flex-wrap:wrap; margin:0 0 18px; }
.document-toolbar .tabs { max-width:100%; overflow-x:auto; }
.document-toolbar .tabs:last-child { flex-basis:100%; width:max-content; }
.document-toolbar .tabs button { white-space:nowrap; padding:5px 9px; font-size:12px; }
.document-table { min-width:1250px; }
.document-table th { font-size:11.5px; }
.document-table td { font-size:12.5px; }
.document-table .nowrap { white-space:nowrap; }
.document-kind { color:var(--accent); font-size:11px; font-weight:650; }
.document-status { min-width:150px; padding:5px 8px; border:1px solid var(--line-2); border-radius:8px; background:white; color:var(--ink); text-align:left; font-size:12px; }
.document-status:hover { border-color:var(--accent); }
.settings-access { margin-bottom:20px; }
.settings-access .panel-body { padding-top:8px; }
.settings-entities .panel-head p,.settings-entity-head p { margin:3px 0 0; }
.settings-entity { border-top:1px solid var(--line); }
.settings-entity:first-of-type { border-top:0; }
.settings-entity-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; padding:12px 18px; }
.settings-entity-head>div:first-child { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px; }
.settings-entity-head strong { font-size:13px; }
.settings-entity .table th { font-size:11.5px; }
.settings-entity .table td { padding:8px 12px; font-size:12.5px; }
.settings-entity .table th:first-child,.settings-entity .table td:first-child { padding-left:18px; }
.settings-entity .row-actions { text-align:right; }
@media(max-width:1280px) {
  .summary-kpi-primary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .summary-kpi-secondary { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:780px) {
  .summary-kpi-primary,.summary-kpi-secondary,.document-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .prototype-toolbar .tabs { order:3; }
}
@media(max-width:520px) {
  .summary-kpi-primary,.summary-kpi-secondary,.document-kpis { grid-template-columns:1fr; }
  .prototype-toolbar .field { flex:1; }
  .prototype-toolbar .field input { width:100%; min-width:130px; }
}
