/* OBO HR — дизайн ONE BY ONE: чёрно-белый, серое поле, белые карточки, чёрное выделение, цвет — только по смыслу.
   Классы описаны в docs/DEV.md. */
@font-face { font-family: "Brand"; src: url("/static/fonts/jost-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Brand"; src: url("/static/fonts/jost-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Flex"; src: url("/static/fonts/roboto-flex-cyrillic-wdth-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Flex"; src: url("/static/fonts/roboto-flex-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }

:root {
  --bg: #F4F4F4; --surface: #FFFFFF; --ink: #1A1A1A; --ink-2: #5E5E5E; --ink-3: #9A9A9A;
  --line: #E6E6E6; --line-strong: #CFCFCF; --accent: #000000; --accent-ink: #FFFFFF; --hover: #F0F0F0; --tile: #F7F7F7;
  --ok: #1F7A4D; --ok-bg: #E3F2EA; --warn: #A86400; --warn-bg: #FBF0DC; --danger: #C2253B; --danger-bg: #FBE6E9;
  --info: #2457C5; --info-bg: #E6EDFB; --violet: #6B3FB8; --violet-bg: #EFE8FA;
  --side-w: 248px; --top-h: 60px; --r: 2px;
  --shadow: 0 1px 2px rgba(0,0,0,.04); --shadow-pop: 0 12px 40px rgba(0,0,0,.14);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0B; --surface: #151515; --ink: #F2F2F2; --ink-2: #A8A8A8; --ink-3: #737373; --line: #262626; --line-strong: #3A3A3A;
    --accent: #FFFFFF; --accent-ink: #000000; --hover: #1E1E1E; --tile: #1A1A1A;
    --ok: #5BC48C; --ok-bg: #12291D; --warn: #F0A43A; --warn-bg: #2D2210; --danger: #FF6B80; --danger-bg: #331419;
    --info: #7EA6FF; --info-bg: #152039; --violet: #B596F0; --violet-bg: #241B36; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0B0B; --surface: #151515; --ink: #F2F2F2; --ink-2: #A8A8A8; --ink-3: #737373; --line: #262626; --line-strong: #3A3A3A;
  --accent: #FFFFFF; --accent-ink: #000000; --hover: #1E1E1E; --tile: #1A1A1A;
  --ok: #5BC48C; --ok-bg: #12291D; --warn: #F0A43A; --warn-bg: #2D2210; --danger: #FF6B80; --danger-bg: #331419;
  --info: #7EA6FF; --info-bg: #152039; --violet: #B596F0; --violet-bg: #241B36; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Flex", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .brand { font-family: "Brand", "Flex", sans-serif; font-weight: 500; letter-spacing: .01em; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), var(--bg) var(--side-w)); }
.layout.collapsed { --side-w: 64px; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.side .logo { height: var(--top-h); display: flex; align-items: center; padding: 0 20px; font-family: "Brand"; font-weight: 600; letter-spacing: .32em; font-size: 15px; text-decoration: none; white-space: nowrap; }
.side .search { margin: 4px 12px 10px; display: flex; gap: 6px; }
.side .search button.k { flex: 1; text-align: left; background: var(--tile); border: 1px solid var(--line); padding: 8px 10px; color: var(--ink-3); cursor: pointer; display: flex; justify-content: space-between; }
.nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; text-decoration: none; color: var(--ink-2); border-left: 2px solid transparent; white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--hover); color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.nav a .ic { width: 18px; display: inline-flex; flex: none; }
.nav a .cnt { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }
.nav .sub { display: flex; flex-direction: column; padding-left: 30px; }
.nav .sub a { padding: 6px 12px; font-size: 13px; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }
.side .bottom { margin-top: auto; padding: 8px; border-top: 1px solid var(--line); }
.layout.collapsed .nav a span:not(.ic), .layout.collapsed .side .search, .layout.collapsed .nav .sub, .layout.collapsed .logo span { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .crumbs { display: flex; gap: 8px; align-items: center; color: var(--ink-2); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top .crumbs a { text-decoration: none; } .top .crumbs a:hover { color: var(--ink); }
.top .sp { flex: 1; }
.top .me { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; }
.top .me:hover { background: var(--hover); }
.bell { position: relative; } .bell .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.page { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .sub { width: 100%; color: var(--ink-2); margin-top: -8px; }

/* ---------- элементы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; text-decoration: none; white-space: nowrap; border-radius: var(--r); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-family: "Brand"; text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; font-weight: 500; }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 28px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-group { display: inline-flex; } .btn-group .btn + .btn { margin-left: -1px; } .btn-group .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card > .card-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .card-h h2, .card > .card-h h3 { margin-right: auto; }
.card > .card-b { padding: 18px; }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side-r { grid-template-columns: minmax(0, 1fr) 340px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.kpi { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; }
.kpi .v { font-family: "Brand"; font-size: 28px; font-weight: 500; line-height: 1.1; }
.kpi .l { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 12px; line-height: 20px; background: var(--tile); border: 1px solid var(--line); white-space: nowrap; border-radius: var(--r); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.violet { background: var(--violet-bg); color: var(--violet); border-color: transparent; }
.badge.dark { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.dot-s { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.dot-s.ok { background: var(--ok); } .dot-s.warn { background: var(--warn); } .dot-s.danger { background: var(--danger); } .dot-s.info { background: var(--info); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tile); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; overflow: hidden; color: var(--ink-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 28px; } .avatar.md { width: 48px; height: 48px; font-size: 15px; } .avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.person { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.person .nm { font-weight: 500; } .person .ps { color: var(--ink-2); font-size: 12px; }

/* вкладки */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .cnt { color: var(--ink-3); margin-left: 4px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; cursor: pointer; }
.pills button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* таблицы */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; cursor: default; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: var(--ink); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover td { background: var(--hover); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.list-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; color: var(--ink-2); font-size: 12.5px; }

/* панель списка: поиск, фильтры, вид, экспорт */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search-in { flex: 1; min-width: 200px; max-width: 420px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 12.5px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 0 4px; }

/* формы */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; color: var(--ink-2); }
.field > label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r); outline: none; }
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { grid-column: 1 / -1; font-family: "Brand"; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; }
.kv > div:nth-child(odd) { color: var(--ink-2); }

/* модальное окно / шторка */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.sheet.wide { max-width: 980px; } .sheet.narrow { max-width: 440px; }
.sheet > .sh-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet > .sh-h h2 { margin-right: auto; }
.sheet > .sh-b { padding: 20px; }
.sheet > .sh-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--surface); z-index: 101; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.drawer > .sh-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer > .sh-h h2 { margin-right: auto; } .drawer > .sh-b { padding: 20px; overflow-y: auto; flex: 1; }

/* выпадающее меню */
.menu { position: absolute; z-index: 150; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); min-width: 200px; padding: 4px 0; max-height: 70vh; overflow-y: auto; }
.menu button, .menu a { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 14px; border: 0; background: none; text-align: left; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .sep { border-top: 1px solid var(--line); margin: 4px 0; }
.menu .danger { color: var(--danger); }

/* ⌘K */
.cmdk { max-width: 620px; } .cmdk input { border: 0; border-bottom: 1px solid var(--line); height: 54px; font-size: 16px; padding: 0 20px; width: 100%; outline: none; background: var(--surface); }
.cmdk .res a { display: flex; gap: 10px; padding: 10px 20px; text-decoration: none; } .cmdk .res a:hover, .cmdk .res a.sel { background: var(--hover); }

/* канбан */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban .col { flex: 0 0 280px; background: var(--tile); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban .col-h { padding: 10px 12px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface); }
.kanban .col-h b { margin-right: auto; }
.kanban .col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kanban .col.drop .col-b { background: var(--hover); outline: 2px dashed var(--line-strong); outline-offset: -4px; }
.kcard { background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; cursor: grab; }
.kcard:hover { border-color: var(--ink-3); }
.kcard.late { border-left: 3px solid var(--warn); } .kcard.very-late { border-left: 3px solid var(--danger); }

/* лента, виджеты главной */
.hero { height: 120px; background: linear-gradient(120deg, #111 0%, #3a3a3a 60%, #777 100%); color: #fff; display: flex; align-items: flex-end; padding: 18px 24px; margin-bottom: 18px; }
.hero h1 { font-size: 28px; }
.feed-item { padding: 16px 18px; border-bottom: 1px solid var(--line); } .feed-item:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week div { padding: 6px 0; border: 1px solid var(--line); font-size: 12px; }
.week .we { background: var(--tile); color: var(--ink-3); } .week .today { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* календарь-сетка (люди × дни) */
.cal { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
.cal table { border-collapse: collapse; }
.cal th, .cal td { border: 1px solid var(--line); min-width: 30px; height: 34px; text-align: center; font-size: 12px; padding: 0; }
.cal th.name, .cal td.name { position: sticky; left: 0; background: var(--surface); text-align: left; min-width: 220px; padding: 0 10px; z-index: 1; }
.cal .we { background: var(--tile); } .cal .hol { background: var(--warn-bg); } .cal .today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .abs { display: block; height: 22px; margin: 0 1px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--surface); }
.month > div { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; font-size: 12px; }
.month > .hd { min-height: 0; text-align: center; color: var(--ink-2); padding: 8px; }
.month .out { color: var(--ink-3); background: var(--tile); } .month .td .n { background: var(--accent); color: var(--accent-ink); padding: 0 5px; }
.month .ev { display: block; margin-top: 3px; padding: 1px 4px; background: var(--info-bg); color: var(--info); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* полосы-диаграммы для отчётов (без библиотек) */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 180px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 14px; background: var(--tile); position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .bar .fill { background: var(--ink-2); }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.vbars > div { flex: 1; background: var(--accent); min-height: 2px; position: relative; }
.vbars > div span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* статья базы знаний */
.article { max-width: 820px; } .article .body { line-height: 1.65; font-size: 15px; } .article .body h2 { margin: 22px 0 8px; }

/* настройки-хаб */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.set-grid a { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.set-grid a:hover { border-color: var(--ink); }
.set-grid a b { display: block; margin-bottom: 2px; font-weight: 500; }
.set-group { margin: 22px 0 10px; font-family: "Brand"; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--ink-2); }

/* матрица прав */
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }

/* вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); padding: 36px 32px; }
.login .logo { font-family: "Brand"; letter-spacing: .4em; font-size: 22px; text-align: center; margin-bottom: 6px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 10px 18px; z-index: 300; display: none; max-width: calc(100% - 32px); }
#toast.show { display: block; } #toast.err { background: var(--danger); color: #fff; }

.mob-nav { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; background: var(--bg); }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 120; box-shadow: var(--shadow-pop); }
  .top { padding: 0 12px; }
  .page { padding: 16px; padding-bottom: calc(80px + var(--safe-b)); }
  .grid.c2, .grid.c3, .grid.c4, .grid.side-r, .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv > div:nth-child(even) { margin-bottom: 10px; }
  .bar { grid-template-columns: 110px 1fr 54px; }
  .mob-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: calc(60px + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--line); z-index: 50; }
  .mob-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; text-decoration: none; color: var(--ink-2); gap: 2px; }
  .mob-nav a.active { color: var(--ink); font-weight: 600; }
  .mob-nav a .ic { font-size: 18px; }
  .overlay { padding: 0; align-items: flex-end; } .sheet { max-width: none !important; max-height: 92vh; overflow-y: auto; }
  .hide-m { display: none !important; }
}
@media print { .side, .top, .mob-nav, .toolbar, .btn { display: none !important; } .layout { display: block; } body { background: #fff; } }
