/* Оформление «Бюджет ASB Group». Две темы: тёмная (по умолчанию) и светлая — переключатель в шапке. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #06141b;
  --aurora: radial-gradient(900px 520px at 78% -8%, rgba(139, 92, 246, .42), transparent 62%),
            radial-gradient(820px 560px at 12% 4%, rgba(16, 185, 129, .30), transparent 60%),
            radial-gradient(900px 620px at 55% 108%, rgba(20, 184, 166, .26), transparent 62%),
            radial-gradient(700px 500px at 100% 70%, rgba(59, 130, 246, .20), transparent 60%);
  --ink: #ecf6f3; --muted: #9fb6b3; --faint: #6f8785;
  --panel: rgba(255, 255, 255, .06); --panel-2: rgba(255, 255, 255, .10); --side: rgba(4, 18, 24, .55);
  --line: rgba(255, 255, 255, .13); --line-soft: rgba(255, 255, 255, .07);
  --solid: #10242c; --field: rgba(255, 255, 255, .07);
  --brand: #34e3a8; --brand-2: #1fb98a; --brand-ink: #03251b; --brand-soft: rgba(52, 227, 168, .16);
  --ok: #4be6ab; --ok-bg: rgba(52, 227, 168, .15); --bad: #ff8a80; --bad-bg: rgba(255, 99, 88, .16);
  --warn: #f6c95c; --warn-bg: rgba(246, 201, 92, .15); --mute-bg: rgba(255, 255, 255, .09);
  --row0: rgba(52, 227, 168, .15); --row1: rgba(255, 255, 255, .075); --row2: rgba(255, 255, 255, .035);
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #edf5f0;
  --aurora: radial-gradient(900px 520px at 85% -10%, rgba(52, 211, 153, .30), transparent 62%),
            radial-gradient(800px 520px at 5% 0%, rgba(187, 247, 208, .55), transparent 60%),
            radial-gradient(900px 600px at 60% 110%, rgba(153, 246, 228, .40), transparent 62%);
  --ink: #13251e; --muted: #5d7168; --faint: #8a9b93;
  --panel: rgba(255, 255, 255, .82); --panel-2: rgba(255, 255, 255, .96); --side: rgba(255, 255, 255, .72);
  --line: rgba(19, 60, 44, .13); --line-soft: rgba(19, 60, 44, .07);
  --solid: #f2f8f4; --field: #fff;
  --brand: #17824f; --brand-2: #0f6b40; --brand-ink: #fff; --brand-soft: rgba(23, 130, 79, .11);
  --ok: #14774a; --ok-bg: #dff3e7; --bad: #b3261e; --bad-bg: #fde7e4;
  --warn: #8a5a00; --warn-bg: #fff2cf; --mute-bg: #e8eeea;
  --row0: #dcefe4; --row1: #edf5f0; --row2: #f7faf8;
  --shadow: 0 8px 24px rgba(23, 80, 55, .08);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; color: var(--ink);
  background: var(--aurora), var(--bg); background-attachment: fixed; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { background: var(--mute-bg); padding: 1px 6px; border-radius: 6px; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
  background: var(--side); border-right: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; line-height: 1.15; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), #7c6cf2); color: #fff; box-shadow: var(--shadow); }
.brand .mark svg { width: 22px; height: 22px; stroke-width: 2.2; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.side nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.side nav a.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-weight: 600; box-shadow: var(--shadow); }
.side .sep { height: 1px; background: var(--line-soft); margin: 8px 6px; }
.vcard { margin-top: auto; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.vcard b { display: block; font-size: 14px; }
.vcard .note { display: block; margin: 2px 0 8px; }

.work { padding: 18px 26px 40px; min-width: 0; }
.bar { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.bar .ttl { flex: 1; min-width: 260px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 26px 0 10px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.bar-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.user .ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(135deg, #7c6cf2, var(--brand)); color: #fff; }
.user form { display: flex; }
.iconbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer; padding: 0; }
.iconbtn.round { border-radius: 50%; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); }
.iconbtn:hover { background: var(--panel-2); color: var(--ink); }
[data-theme="dark"] .only-light, [data-theme="light"] .only-dark { display: none; }

/* ---------- кнопки, поля ---------- */
.btn, .toolbar button { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 550; padding: 8px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover, .toolbar button:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border-color: transparent; box-shadow: var(--shadow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 3px 10px; font-size: 12px; border-radius: 9px; box-shadow: none; }
select, input[type=text], input[type=search], input[type=password] { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--field); max-width: 100%; }
select:focus, input:focus, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar .grow input { width: 100%; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); flex-wrap: wrap; }
.seg a, .seg button { font: inherit; font-weight: 550; padding: 7px 16px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
.seg a.on, .seg button.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.tabs { margin: 0 0 16px; }

/* ---------- карточки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 16px; backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(14px); box-shadow: var(--shadow); min-width: 0; }
.kpi .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi .ic.warn { background: var(--warn-bg); color: var(--warn); }
.kpi .ic.bad { background: var(--bad-bg); color: var(--bad); }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d.ok { color: var(--ok); } .kpi .d.bad { color: var(--bad); }
.kpi.main { background: linear-gradient(135deg, var(--brand-soft), var(--panel)); border-color: var(--brand); }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 15px;
  background: radial-gradient(closest-side, var(--solid) 76%, transparent 78%), conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.ring.bad { background: radial-gradient(closest-side, var(--solid) 76%, transparent 78%), conic-gradient(var(--warn) calc(var(--p) * 1%), var(--line) 0); }
.progress { height: 10px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .3s; }
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.todo a:hover { background: var(--panel-2); text-decoration: none; }
.todo .num { font-size: 24px; font-weight: 700; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; color: var(--warn); }
.todo .num.zero { color: var(--ok); }
.todo .go { margin-left: auto; color: var(--muted); }

/* ---------- плашки и сообщения ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.mute { background: var(--mute-bg); color: var(--muted); }
.msg, .warnbox { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; }
.msg { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--brand); font-weight: 550; }
.warnbox { background: var(--warn-bg); border: 1px solid var(--warn); color: var(--ink); }
.note { color: var(--muted); font-size: 12px; }
.help { color: var(--muted); }
.help b { color: var(--ink); }

/* ---------- таблицы ---------- */
.tbl, .scroll { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); backdrop-filter: blur(14px); box-shadow: var(--shadow); margin-bottom: 16px; }
.tbl { overflow-x: auto; }
.scroll { overflow: auto; max-height: calc(100vh - 230px); }
.narrow { max-width: 1000px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
tbody tr:last-child td, table > tr:last-child td { border-bottom: 0; }
th { font-weight: 600; font-size: 12px; color: var(--muted); background: var(--solid); white-space: nowrap; border-bottom: 1px solid var(--line); }
.scroll th { position: sticky; top: 0; z-index: 2; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td, table > tr:hover td { background: var(--row2); }
tr.total td { font-weight: 700; background: var(--row0); }
tr.total:hover td { background: var(--row0); }
tr.hidden, .hidden { display: none !important; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* дерево плана: цвет строки задаётся переменной --rb, закреплённые ячейки кладут его поверх сплошного фона */
table.tree td { padding: 6px 10px; vertical-align: top; background: var(--rb, transparent); }
table.tree td.name { min-width: 320px; max-width: 520px; }
table.tree tr[data-level="0"] { --rb: var(--row0); font-weight: 700; }
table.tree tr[data-level="1"] { --rb: var(--row1); font-weight: 650; }
table.tree tr[data-level="2"] { --rb: var(--row2); font-weight: 600; }
table.tree tr.total { --rb: var(--row0); }
table.tree tr.k-article { --rb: transparent; font-weight: 550; }
table.tree tr.k-line { --rb: transparent; color: var(--muted); font-weight: 400; }
table.tree tr.k-article:hover, table.tree tr.k-line:hover { --rb: var(--row2); }
.tg { display: inline-block; width: 18px; cursor: pointer; color: var(--muted); user-select: none; }
td.code { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
table.tree td.cfo { white-space: nowrap; color: var(--muted); font-size: 12px; }
table.tree .hint { color: var(--faint); font-size: 12px; font-weight: 400; display: block; white-space: normal; }
table.tree td.tot, table.tree th:last-child { position: sticky; right: 0; border-left: 1px solid var(--line); font-weight: 650; }
table.tree td.tot { background-color: var(--solid); background-image: linear-gradient(var(--rb, transparent), var(--rb, transparent)); }
table.tree th:last-child { z-index: 3; }

/* разметка компаний */
table.alloc td { vertical-align: top; }
table.alloc td.c, table.alloc th.c { text-align: center; white-space: nowrap; }
table.alloc tr.art td { font-weight: 550; }
table.alloc input.amt { width: 116px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 7px; display: none; margin: 4px auto 0; border-radius: 8px; }
table.alloc tr.multi input.amt.on { display: block; }
table.alloc tr.sub { --rb: var(--row2); }
table.alloc tr.sub td { background: var(--rb); font-size: 13px; font-weight: 400; color: var(--muted); }
table.alloc td.state { white-space: nowrap; min-width: 190px; }
table.alloc .err { color: var(--bad); font-size: 12px; display: block; white-space: normal; max-width: 240px; }
table.alloc .rest { color: var(--warn); font-size: 12px; display: block; }

/* вход */
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 18px; font-size: 19px; }
.login label { display: block; font-size: 12px; color: var(--muted); margin-top: 12px; }
.login input { width: 100%; margin-top: 4px; }
.login .btn { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }

/* ---------- печать ---------- */
@media print {
  body { background: #fff; color: #000; }
  .side, .bar-r, .toolbar, .seg { display: none !important; }
  .shell { display: block; } .scroll { max-height: none; overflow: visible; }
  .card, .kpi, .tbl, .scroll { box-shadow: none; backdrop-filter: none; }
}

/* ручной ввод в черновике плана */
.editbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; }
.editbar > div { flex: 1; min-width: 300px; color: var(--muted); }
.editbar b { color: var(--ink); }
table.tree td.ed { cursor: cell; box-shadow: inset 0 0 0 1px var(--line-soft); min-width: 96px; }
table.tree td.ed:hover, table.tree td.ed:focus { box-shadow: inset 0 0 0 2px var(--brand); outline: none; background: var(--brand-soft) !important; }
table.tree td.chg { --rb: var(--warn-bg); color: var(--ink) !important; font-weight: 600; }
table.tree input.cell { width: 100%; min-width: 90px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 6px; border: 2px solid var(--brand); }
table.tree input.cell.bad { border-color: var(--bad); }

/* новые строки в черновике */
.addline, .delline { margin-left: 8px; opacity: .75; font-weight: 500; }
.addline:hover, .delline:hover { opacity: 1; }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(480px, 92vw); background: var(--solid); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }

/* =====================================================================
   Адаптация под устройства
   телефон ≤ 700 · планшет 701–1100 · ноутбук и монитор 1101–1799 · большой монитор ≥ 1800
   ===================================================================== */
.burger, .shade { display: none; }
.tbl, .scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.scroll { max-height: calc(100dvh - 230px); }

/* сенсорный экран: крупнее цели нажатия, поля без автоувеличения страницы */
@media (pointer: coarse) {
  .btn, .toolbar button, .seg a, .seg button, select, input[type=text], input[type=search], input[type=password] { min-height: 42px; }
  .btn.small { min-height: 34px; padding: 5px 12px; }
  select, input[type=text], input[type=search], input[type=password], table.tree input.cell { font-size: 16px; }
  input[type=checkbox] { width: 22px; height: 22px; }
  .side nav a { padding: 13px 12px; }
  table.tree td.ed { padding-top: 10px; padding-bottom: 10px; }
  .tg { width: 26px; font-size: 17px; }
}

/* большой монитор */
@media (min-width: 1800px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 264px minmax(0, 1fr); }
  .work { padding: 24px 40px 48px; }
  .narrow { max-width: 1240px; }
  table.tree td.name { max-width: 640px; }
  h1 { font-size: 29px; }
}
@media (min-width: 2400px) { body { font-size: 16px; } .shell { grid-template-columns: 290px minmax(0, 1fr); } }

/* планшет и небольшой ноутбук: меню сжимается до значков */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .side { padding: 14px 8px; align-items: center; }
  .side .brand { padding: 0 0 12px; } .side .brand > span:last-child { display: none; }
  .side nav { width: 100%; }
  .side nav a { justify-content: center; padding: 12px 0; }
  .side nav a span { display: none; }
  .side nav a svg.i { width: 21px; height: 21px; }
  .vcard { display: none; }
  .work { padding: 16px 18px 32px; }
  h1 { font-size: 23px; }
  .kpi .v { font-size: 19px; }
  table.tree td.name { min-width: 250px; max-width: 360px; }
  table.alloc td.name { position: sticky; left: 0; z-index: 1; min-width: 190px; max-width: 260px; white-space: normal;
    background-color: var(--solid); background-image: linear-gradient(var(--rb, transparent), var(--rb, transparent)); border-right: 1px solid var(--line); }
  table.alloc th.name { position: sticky; left: 0; z-index: 3; }
}

/* телефон: меню выдвигается кнопкой, всё в один столбец, таблицы листаются вбок */
@media (max-width: 700px) {
  .shell { display: block; }
  .burger { display: grid; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 84vw); height: 100dvh; z-index: 40; align-items: stretch; padding: 16px 12px;
    transform: translateX(-105%); background: var(--solid); overflow-y: auto; }
  .nav-open .side { transform: none; box-shadow: var(--shadow); }
  .nav-open .shade { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .5); }
  .nav-open { overflow: hidden; }
  .side .brand { padding: 4px 8px 16px; } .side .brand > span:last-child { display: inline; }
  .side nav a { justify-content: flex-start; padding: 13px 12px; }
  .side nav a span { display: inline; }
  .vcard { display: block; }

  .work { padding: 10px 10px 28px; }
  .bar { gap: 10px; margin-bottom: 12px; align-items: center; }
  .bar .ttl { min-width: 0; flex: 1 1 60%; }
  h1 { font-size: 20px; } h2 { font-size: 16px; margin: 20px 0 8px; }
  .sub { font-size: 13px; }
  .bar-r { width: 100%; order: 3; }
  .bar-r .btn { flex: 1; justify-content: center; }
  .user .uname { display: none; }
  .user { margin-left: auto; }

  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; gap: 8px; flex-direction: column; align-items: flex-start; border-radius: 14px; }
  .kpi .ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi .v { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  .kpi.main, .kpi:has(.ring) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .ring { width: 62px; height: 62px; font-size: 13px; }
  .todo { grid-template-columns: 1fr; gap: 8px; }
  .card { padding: 14px; border-radius: 14px; }
  .msg, .warnbox { padding: 10px 12px; align-items: flex-start; }

  .toolbar { gap: 8px; }
  .toolbar label, .toolbar .grow, .toolbar > .btn, .toolbar > a { width: 100%; min-width: 0; }
  .toolbar select { width: 100%; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .seg a, .seg button { flex: 1 0 auto; padding: 8px 12px; }
  .editbar form, .editbar form input, .editbar form .btn { width: 100%; min-width: 0 !important; }
  .row { gap: 10px; }

  .tbl, .scroll { border-radius: 12px; margin-left: -4px; margin-right: -4px; }
  .scroll { max-height: calc(100dvh - 150px); }
  .narrow { max-width: none; }
  th, td { padding: 7px 9px; }
  table { font-size: 13px; }

  /* дерево плана: название закреплено слева, код и ЦФО скрыты, «Всего» листается вместе с периодами */
  table.tree th:first-child, table.tree td.code, table.tree th:nth-child(3), table.tree td.cfo { display: none; }
  table.tree td.name, table.tree th:nth-child(2) { position: sticky; left: 0; min-width: 0; width: 44vw; max-width: 44vw; border-right: 1px solid var(--line); }
  table.tree td.name { z-index: 1; padding-left: 6px !important; overflow-wrap: break-word; hyphens: auto; font-size: 12.5px;
    background-color: var(--solid); background-image: linear-gradient(var(--rb, transparent), var(--rb, transparent)); }
  table.tree th:nth-child(2) { z-index: 3; white-space: normal; }
  table.tree td.tot, table.tree th:last-child { position: static; }
  table.tree .hint { display: none; }
  table.tree td.ed { min-width: 104px; }
  table.alloc td.name, table.alloc th.name { min-width: 0; width: 40vw; max-width: 40vw; }
  table.alloc td.code, table.alloc th.code { display: none; }
  dialog { width: 94vw; padding: 16px; }
  .login { padding: 22px; }
}
@media (max-width: 340px) { .kpis { grid-template-columns: 1fr; } }
