/* Склад ТЕО — визуальная система интерфейса */
:root {
  color-scheme: light;
  --neutral-0: oklch(99.2% 0.003 80);
  --neutral-50: oklch(97.8% 0.003 80);
  --neutral-100: oklch(94.8% 0.004 80);
  --neutral-200: oklch(89.5% 0.005 80);
  --neutral-300: oklch(82.5% 0.006 80);
  --neutral-500: oklch(54.5% 0.008 80);
  --neutral-700: oklch(35% 0.008 80);
  --neutral-900: oklch(22.5% 0.008 80);
  --orange-50: oklch(96% 0.025 65);
  --orange-200: oklch(86% 0.09 55);
  --orange-500: oklch(70.5% 0.205 43);
  --orange-600: oklch(64% 0.19 42);
  --green-50: oklch(95.5% 0.035 155);
  --green-200: oklch(86% 0.075 155);
  --green-700: oklch(43% 0.095 155);
  --blue-50: oklch(95.5% 0.02 245);
  --blue-200: oklch(85% 0.055 245);
  --blue-700: oklch(45% 0.1 245);
  --surface-page: var(--neutral-50);
  --surface-raised: var(--neutral-0);
  --surface-subtle: var(--neutral-100);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-500);
  --action-accent: var(--orange-500);
  --action-primary: var(--neutral-900);
  --on-primary: var(--neutral-0);
  --bg-50: var(--surface-raised);
  --bg-100: var(--surface-page);
  --bg-200: var(--surface-subtle);
  --bg-300: var(--neutral-200);
  --bg-400: var(--neutral-300);
  --fg-950: var(--text-primary);
  --fg-900: var(--text-primary);
  --fg-800: var(--neutral-700);
  --fg-700: var(--neutral-700);
  --fg-600: var(--text-secondary);
  --fg-500: var(--text-secondary);
  --fg-400: var(--neutral-500);
  --fg-300: var(--neutral-300);
  --pri-50: var(--orange-50);
  --pri-100: var(--orange-50);
  --pri-200: var(--orange-200);
  --pri-300: var(--orange-200);
  --pri-500: var(--action-accent);
  --pri-600: var(--orange-600);
  --pri-700: var(--orange-600);
  --pri-900: var(--neutral-900);
  --acc-50: var(--orange-50);
  --acc-200: var(--orange-200);
  --acc-700: var(--orange-600);
  --acc-800: var(--orange-600);
  --font-head: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 1px rgb(23 23 23 / 0.025);
  --shadow-md: 0 14px 34px -24px rgb(23 23 23 / 0.35);
}

[data-theme="dark"] {
  color-scheme: dark;
  --neutral-0: oklch(25% 0.008 80);
  --neutral-50: oklch(21% 0.008 80);
  --neutral-100: oklch(28% 0.008 80);
  --neutral-200: oklch(35% 0.008 80);
  --neutral-300: oklch(43% 0.008 80);
  --neutral-500: oklch(73% 0.008 80);
  --neutral-700: oklch(84% 0.006 80);
  --neutral-900: oklch(96% 0.004 80);
  --orange-50: oklch(30% 0.035 50);
  --orange-200: oklch(48% 0.11 45);
  --orange-500: oklch(73% 0.18 50);
  --orange-600: oklch(76% 0.17 55);
  --green-50: oklch(29% 0.035 155);
  --green-200: oklch(43% 0.07 155);
  --green-700: oklch(79% 0.11 155);
  --blue-50: oklch(29% 0.035 245);
  --blue-200: oklch(43% 0.06 245);
  --blue-700: oklch(78% 0.09 245);
  --action-primary: var(--orange-500);
  --on-primary: oklch(22.5% 0.008 80);
  --shadow-sm: none;
  --shadow-md: 0 16px 36px -24px rgb(0 0 0 / 0.7);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-page); }
body {
  min-height: 100dvh;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main {
  width: 100%;
  max-width: 1240px;
  padding: 32px 32px 80px;
}
main > * { animation: none; }
h1, h2, h3 { font-family: var(--font-head); }
h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -0.045em;
}
h2 { font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; }
a, button, .btn, input, select, textarea, .tile, .card, .row, .orow, .prow {
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out, opacity 180ms ease-out, transform 180ms ease-out;
}
::selection { background: var(--orange-200); color: var(--fg-950); }

/* Верхняя навигация */
.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1176px) / 2));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  background: color-mix(in oklab, var(--surface-page) 92%, transparent);
  border-bottom: 1px solid var(--bg-300);
  backdrop-filter: blur(14px);
}
.topbar > a { font-family: var(--font-body); }
.topbar > a:hover { opacity: 1; }
.brand { gap: 12px; }
.brand-mark {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--action-accent);
  box-shadow: 0 0 0 5px var(--orange-50);
}
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: 0.055em; }
.brand-sub { margin-top: 2px; font-size: 11px; color: var(--text-secondary); }
.desktop-nav { display: flex; align-items: stretch; gap: 28px; }
.desktop-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--action-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-out;
}
.desktop-nav a:hover, .desktop-nav a.on { color: var(--text-primary); }
.desktop-nav a.on::after { transform: scaleX(1); }
.who { gap: 10px; }
.themebtn, .usermenu-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--bg-300);
  border-radius: 4px;
  box-shadow: none;
  color: var(--fg-800);
}
.themebtn:hover, .usermenu-btn:hover { background: var(--surface-raised); border-color: var(--fg-400); color: var(--fg-950); }
.usermenu-btn { gap: 12px; }
.user-label { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-drop {
  top: calc(100% + 10px);
  min-width: 232px;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
}
.usermenu-drop a { min-height: 44px; padding: 12px 16px; color: var(--fg-800); }
.usermenu-drop a:last-child { color: var(--fg-800); }
.usermenu-drop a:hover { background: var(--surface-subtle); }
.usermenu-drop a i, .usermenu-drop a:last-child i { color: var(--text-secondary); }

/* Формы и кнопки */
button, .btn {
  min-height: 44px;
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--action-primary);
  color: var(--on-primary);
  border: 1px solid var(--action-primary);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
button:hover, .btn:hover {
  background: var(--action-accent);
  color: oklch(22.5% 0.008 80);
  border-color: var(--action-accent);
  transform: translateY(-1px);
  box-shadow: none;
}
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost, .viewswitch, button.btn-ghost, button.small, button.editbtn, button.delbtn,
button.dist-toggle, button.rename-order-btn, .stbtn, .themebtn, .usermenu-btn,
.lb-close, .lb-prev, .lb-next, .lb-zoom button, .gdel {
  clip-path: none;
  border-radius: 4px;
}
.btn-ghost, .viewswitch, button.btn-ghost {
  background: var(--surface-raised);
  color: var(--fg-800);
  border: 1px solid var(--bg-300);
}
.btn-ghost:hover, .viewswitch:hover, button.btn-ghost:hover { background: var(--surface-subtle); color: var(--fg-950); border-color: var(--fg-400); }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], input[type="date"], select, textarea {
  min-height: 44px;
  padding: 11px 13px;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 4px;
  color: var(--fg-900);
  font-size: 15px;
}
input:focus, select:focus, textarea:focus { border-color: var(--action-accent); box-shadow: 0 0 0 3px var(--orange-50); }
input::placeholder { color: var(--text-secondary); opacity: 0.75; }
.field label { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.045em; text-transform: uppercase; color: var(--text-secondary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--action-accent);
  outline-offset: 3px;
}
button:focus-visible, .btn:focus-visible { box-shadow: inset 0 0 0 3px var(--orange-200); }

/* Общие рабочие поверхности */
.panel, .card, .tile, .prof-card, .statusbar, .feed, .olist, .plist {
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.panel { padding: 24px; margin-bottom: 24px; }
.panel h2 { margin-bottom: 18px; }
.card:hover, .tile:hover { border-color: var(--fg-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lead, .info, .meta { color: var(--text-secondary); }
.lead { max-width: 68ch; font-size: 16px; line-height: 1.6; }
.crumb {
  padding: 4px 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.page-head { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--bg-300); }
.page-head h1 { font-size: clamp(34px, 4vw, 48px); }
.page-head .lead { margin-top: 8px; }
.head-actions { align-items: center; }
.pill, .chip, .badge {
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.25;
}
.pill { padding: 7px 10px; margin: 0; }
.chip { padding: 6px 9px; }
.pill.green, .badge.mine, .fico.green { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.pill.amber, .badge.free, .fico.amber { background: var(--orange-50); border-color: var(--orange-200); color: var(--orange-600); }
.pill.blue, .fico.blue { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.ok-note, .loaded-file, .upload-progress { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.empty { background: transparent; border-color: var(--bg-300); border-radius: 6px; color: var(--text-secondary); }

/* Главная: рабочий обзор */
.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  margin-bottom: 28px;
  background-color: var(--surface-subtle);
  background-image: radial-gradient(var(--bg-400) 1px, transparent 1px);
  background-size: 24px 24px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
}
.home-intro { padding: clamp(32px, 5vw, 64px); align-self: center; }
.home-kicker, .home-summary-kicker, .section-kicker {
  display: block;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--orange-600);
}
.home-intro h1 { max-width: 700px; margin: 0 0 20px; }
.home-intro .lead { max-width: 570px; margin: 0; color: var(--fg-800); }
.home-hero-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 32px; font-size: 13px; font-weight: 650; color: var(--fg-800); }
.home-hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--action-accent); }
.home-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 48px);
  background: oklch(22.5% 0.008 80);
  color: oklch(97.8% 0.003 80);
}
.home-summary-kicker { margin-bottom: 10px; color: var(--orange-500); }
.home-total { display: block; font-size: clamp(72px, 8vw, 108px); font-weight: 700; line-height: 0.95; letter-spacing: -0.065em; font-variant-numeric: tabular-nums; }
.home-total-label { display: block; margin-top: 8px; color: oklch(82.5% 0.006 80); font-size: 15px; }
.home-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; padding-top: 24px; border-top: 1px solid oklch(43% 0.008 80); }
.home-summary-grid b { display: block; font-size: 25px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.home-summary-grid span { display: block; margin-top: 5px; color: oklch(82.5% 0.006 80); font-size: 12px; }
.global-search { margin: 0 0 32px; }
.global-search .searchform {
  gap: 8px;
  padding: 7px;
  flex-wrap: nowrap;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 6px;
}
.global-search .searchform input { min-height: 48px; padding-left: 42px; background: transparent; border: 0; box-shadow: none; font-size: 16px; }
.global-search .searchico { left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }
.global-search .searchform button { min-height: 48px; padding-inline: 26px; }
.global-search .searchform .btn-ghost { border: 0; background: transparent; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.home-layout.no-admin { grid-template-columns: 1fr; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 22px; }
.section-head .info { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.year-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.year-card { position: relative; min-height: 190px; padding: 24px; border-radius: 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
.year-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(var(--bg-300) 0.8px, transparent 0.8px); background-size: 20px 20px; opacity: 0; transition: opacity 180ms ease-out; }
.year-card:hover::after { opacity: 0.65; }
.year-card .tile-top { position: relative; z-index: 1; height: 100%; margin: 0; flex-direction: column; }
.year-index { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-secondary); }
.year-card .big { margin-top: 18px; font-size: 50px; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.year-card .meta { margin-top: 6px; font-size: 14px; }
.year-card-bottom { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 24px; font-size: 13px; font-weight: 700; }
.year-card .tile-arrow { width: auto; height: auto; background: transparent; border: 0; color: var(--fg-950); font-size: 22px; }
.year-card:hover .tile-arrow { background: transparent; color: var(--orange-600); transform: translateX(3px); }
.create-order { position: sticky; top: 100px; margin: 0; }
.create-order .section-kicker { margin-bottom: 10px; }
.create-order h2 { margin-bottom: 8px; }
.create-order .info { display: block; margin-bottom: 22px; line-height: 1.55; }
.create-order form { flex-direction: column; align-items: stretch; gap: 16px; }
.create-order .field, .create-order input { width: 100%; }
.create-order button { width: 100%; margin-top: 4px; }
.search-results { margin-bottom: 28px; }
.search-results .ulist { border-radius: 4px; }
.search-results .urow { min-height: 72px; }

/* Реестр заказов */
.year-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.year-workspace.no-admin { grid-template-columns: 1fr; }
.year-workspace .create-order { top: 100px; }
.olist, .plist { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.orow, .prow {
  min-height: 84px;
  margin-bottom: 8px;
  padding: 16px 18px;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 4px;
}
.orow:last-child, .prow:last-child { border-bottom: 1px solid var(--bg-300); }
.orow:hover, .prow:hover { background: var(--surface-raised); border-color: var(--fg-400); }
.onum {
  width: 62px;
  height: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.oname, .pese { font-size: 16px; }
.obar-line { max-width: 420px; }
.obar { width: 160px; height: 3px; border-radius: 0; background: var(--bg-300); }
.obar-fill, .prog-fill, .up-fill { background: var(--action-accent); border-radius: 0; }
.ocount { font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.projhead {
  margin: 28px 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.projhead i { color: var(--orange-600); }
.projcount { border-radius: 3px; font-size: 11px; }
.renameform { padding-left: 18px; background: var(--surface-subtle); }

/* Заказ, упаковка, документы */
.statusbar { padding: 14px 16px; }
.statusbtns { background: var(--surface-subtle); border-radius: 4px; }
.stbtn { min-height: 40px; background: transparent; color: var(--fg-600); border: 0; }
.stbtn:hover { background: var(--surface-raised); color: var(--fg-950); }
.stbtn.on, [data-theme="dark"] .stbtn.on { background: var(--action-primary); color: var(--on-primary); }
.tabs {
  gap: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--bg-300);
  border-radius: 0;
}
.tab {
  min-height: 50px;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-secondary);
}
.tab:hover { background: transparent; color: var(--fg-950); }
.tab.on, [data-theme="dark"] .tab.on {
  background: transparent;
  border-bottom-color: var(--action-accent);
  box-shadow: none;
  color: var(--fg-950);
}
.tab .cnt, .tab.on .cnt, [data-theme="dark"] .tab.on .cnt { background: var(--surface-subtle); color: var(--text-secondary); border-radius: 3px; }
.tab.on .cnt { color: var(--orange-600); }
.specbar { gap: 0; background: var(--surface-raised); border: 1px solid var(--bg-300); border-radius: 6px; }
.spec { background: transparent; border: 0; border-right: 1px solid var(--bg-300); border-radius: 0; box-shadow: none; padding: 20px; }
.spec:last-child { border-right: 0; }
.spec .k { font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); }
.spec .v { font-size: 20px; font-variant-numeric: tabular-nums; }
.pico, .stat-ico, .fico, .loaded-ico, .dist-ico {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}
.pico { width: 32px; border-radius: 0; }
.postable { font-size: 14px; }
.postable th { font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); }
.postable td { line-height: 1.5; }
.postable .tqty, .postable .tnum { font-variant-numeric: tabular-nums; }
.ese-head { background: var(--surface-subtle); border: 1px solid var(--bg-300); border-left: 1px solid var(--bg-300); border-radius: 4px; }
.ulist { background: var(--surface-raised); border-radius: 4px; }
.urow { min-height: 64px; }
.uava { border-radius: 4px; }
.uava.adm { background: var(--action-primary); color: var(--on-primary); }
.dist-indicator { border-radius: 6px; }
.dist-indicator.ok { background: var(--green-50); border-color: var(--green-200); }
.dist-indicator.warn { background: var(--orange-50); border-color: var(--orange-200); }
.loaded-file { border-radius: 4px; }
.loaded-meta { color: var(--green-700); }
.gitem, .orphan-item { border-radius: 4px; }
.dropzone { border-radius: 4px; background: var(--surface-subtle); }
.dropzone.dz-over { background: var(--orange-50); box-shadow: 0 0 0 3px var(--orange-50); }
.prof-ava { border-radius: 6px; background: var(--action-primary); color: var(--on-primary); box-shadow: none; }
.qlink { border-radius: 4px; }
.rename-order-btn { min-width: 36px; min-height: 36px; padding: 6px; background: transparent; color: var(--text-secondary); border: 0; vertical-align: middle; }
.rename-order-btn:hover { background: var(--surface-subtle); color: var(--orange-600); }

/* Подвал и мобильная навигация */
.site-footer { padding: 22px max(24px, calc((100vw - 1176px) / 2)); background: transparent; border-top: 1px solid var(--bg-300); }
.foot-name { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; }
.viewswitch { background: transparent; font-size: 12px; }
.bottomnav { background: color-mix(in oklab, var(--surface-page) 94%, transparent); }
.bottomnav a.on { color: var(--orange-600); }

/* Экран входа */
.login-body { background: var(--surface-page); }
.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1176px) / 2));
  border-bottom: 1px solid var(--bg-300);
}
.login-topbar .brand { display: flex; align-items: center; gap: 12px; }
.login-topnote { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.login-shell {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.72fr);
  gap: clamp(40px, 8vw, 100px);
  align-items: center;
}
.login-intro { padding: 32px 0; }
.login-intro h1 { max-width: 620px; margin-bottom: 24px; font-size: clamp(42px, 5.5vw, 70px); }
.login-intro .lead { max-width: 520px; }
.login-capabilities { display: flex; gap: 12px 24px; flex-wrap: wrap; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--bg-300); }
.login-capabilities span { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.045em; text-transform: uppercase; color: var(--text-secondary); }
.login-card {
  width: 100%;
  padding: 32px;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.login-card h2 { margin-bottom: 8px; font-size: 24px; }
.login-card .lead { margin-bottom: 24px; font-size: 14px; }
.login-card .email-form label { display: block; margin: 14px 0 6px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; color: var(--text-secondary); }
.login-card .email-form input { width: 100%; margin: 0; }
.login-card .email-form button { width: 100%; margin-top: 20px; }
.login-card .divider { margin: 22px 0; }
.login-card .reglink { line-height: 1.5; }
.login-card .backlink { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--bg-300); text-align: center; font-size: 13px; }
.demo-access { margin: 0 0 20px; padding: 12px; background: var(--orange-50); border: 1px solid var(--orange-200); border-radius: 4px; font-size: 12px; line-height: 1.55; color: var(--fg-800); }
.demo-access b { display: block; margin-bottom: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.demo-access code { font-family: var(--font-mono); color: var(--fg-950); }
.login-footer { padding: 20px 32px; border-top: 1px solid var(--bg-300); text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

@media (max-width: 980px) {
  .topbar { gap: 24px; }
  .desktop-nav { gap: 18px; }
  .user-label { display: none; }
  .home-layout, .year-workspace { grid-template-columns: 1fr; }
  .create-order { position: static; }
  .home-layout .create-order { max-width: none; }
  .login-shell { gap: 40px; }
}

@media (max-width: 700px) {
  main { padding: 20px 16px 64px; }
  h1 { font-size: 36px; }
  .topbar { height: 64px; padding: 0 16px; grid-template-columns: 1fr auto; gap: 12px; }
  .desktop-nav { display: none; }
  .brand-sub { display: none; }
  .brand-mark { width: 12px; height: 12px; }
  .themebtn, .usermenu-btn { min-height: 44px; }
  .home-hero { grid-template-columns: 1fr; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
  .home-intro { padding: 30px 24px 32px; }
  .home-intro h1 { font-size: 38px; }
  .home-intro .lead { font-size: 15px; }
  .home-hero-meta { margin-top: 24px; gap: 12px; }
  .home-summary { padding: 26px 24px; }
  .home-total { font-size: 72px; }
  .home-summary-grid { margin-top: 24px; padding-top: 20px; }
  .global-search .searchform { flex-direction: column; align-items: stretch; padding: 7px; }
  .global-search .searchform input { width: 100%; min-width: 0; }
  .global-search .searchico { top: 31px; transform: none; }
  .global-search .searchform button, .global-search .searchform .btn-ghost { width: 100%; }
  .year-grid { grid-template-columns: 1fr; }
  .year-card { min-height: 172px; }
  .page-head { padding-bottom: 22px; }
  .page-head h1 { font-size: 36px; }
  .head-pills { gap: 7px; }
  .head-pills .pill { font-size: 11px; }
  .panel { padding: 20px; }
  .orow, .prow { padding: 15px; }
  .onum { width: 48px; font-size: 13px; }
  .obar { width: 110px; max-width: 34vw; }
  .oside .pill { font-size: 11px; }
  .tabs { gap: 20px; }
  .tab { min-height: 48px; font-size: 13px; }
  .specbar { grid-template-columns: 1fr 1fr; }
  .spec { padding: 16px; border-bottom: 1px solid var(--bg-300); }
  .spec:nth-child(2n) { border-right: 0; }
  .spec:nth-last-child(-n+2) { border-bottom: 0; }
  .spec .v { font-size: 17px; }
  .statusbar { padding: 14px; }
  .bottomnav { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { min-height: 48px; justify-content: center; }
  .site-footer { padding: 20px 16px; }
  .login-topbar { min-height: 64px; padding: 0 16px; }
  .login-topnote { display: none; }
  .login-shell { grid-template-columns: 1fr; padding: 32px 16px 48px; gap: 24px; }
  .login-intro { padding: 0; }
  .login-intro h1 { font-size: 42px; }
  .login-capabilities { margin-top: 24px; padding-top: 18px; }
  .login-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Финальные исправления после визуальной проверки */
a { color: inherit; text-decoration: none; }
.brand { color: var(--fg-950); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { color: var(--fg-950); }
.brand-sub { display: block; }
.reglink a, .backlink a { color: var(--orange-600); font-weight: 650; }
.reglink a:hover, .backlink a:hover { text-decoration: underline; text-underline-offset: 3px; }
.projcount { margin-left: 4px; padding: 2px 7px; background: var(--surface-subtle); color: var(--text-secondary); }
.dist-indicator.ok .dist-ico { background: transparent; color: var(--green-700); }
.dist-indicator.warn .dist-ico { background: transparent; color: var(--orange-600); }
.searchbar:not(.global-search) .searchform { flex-direction: row; flex-wrap: nowrap; }
.searchbar:not(.global-search) .searchform input { min-width: 0; }
.searchbar:not(.global-search) .searchico { top: 50%; transform: translateY(-50%); }
.searchbar:not(.global-search) .searchform button, .searchbar:not(.global-search) .searchform .btn-ghost { width: auto; flex-shrink: 0; }
@media (max-width: 700px) {
  .brand-sub { display: none; }
  .searchbar:not(.global-search) .searchform button { padding-inline: 14px; }
}

/* Живой современный интерфейс — согласованный концепт */
:root {
  --hero-bg: oklch(20% 0.008 80);
  --hero-panel: oklch(25% 0.008 80);
  --hero-line: oklch(35% 0.008 80);
  --hero-text: oklch(97.8% 0.003 80);
  --hero-muted: oklch(78% 0.006 80);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.18, 0.9, 0.24, 1.08);
}

[data-theme="dark"] {
  --hero-bg: oklch(17% 0.007 80);
  --hero-panel: oklch(23% 0.008 80);
  --hero-line: oklch(32% 0.008 80);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fill-x {
  from { transform: scaleX(0.08); }
  to { transform: scaleX(1); }
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--green-700) 38%, transparent); }
  55% { box-shadow: 0 0 0 7px transparent; }
}

.reveal-item {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out), border-color 180ms ease-out, box-shadow 180ms ease-out;
  will-change: opacity, transform;
}
.reveal-item.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* Главный операционный экран */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(330px, 0.86fr);
  min-height: 430px;
  background: var(--hero-bg);
  color: var(--hero-text);
  border: 1px solid var(--hero-line);
  border-radius: 12px;
  clip-path: none;
  overflow: hidden;
  box-shadow: 0 30px 64px -46px rgb(23 23 23 / 0.75);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(oklch(35% 0.008 80) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.7;
  mask-image: linear-gradient(90deg, #000 0 58%, transparent 92%);
}
.home-hero::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -38%;
  width: 54%;
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(color-mix(in oklab, var(--action-accent) 20%, transparent), transparent 68%);
  filter: blur(6px);
}
.home-intro {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: clamp(38px, 5vw, 66px);
  animation: rise-in 520ms var(--ease-out) both;
}
.home-kicker { color: var(--orange-600); }
.home-intro h1 { color: var(--hero-text); }
.home-intro .lead { color: var(--hero-muted); }
.home-hero-meta { color: var(--hero-muted); }
.live-dot {
  background: var(--green-700);
  animation: pulse-live 2.4s ease-out infinite;
}
.home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.home-action {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background 180ms ease-out, border-color 180ms ease-out;
}
.home-action.primary {
  background: var(--action-accent);
  color: oklch(22.5% 0.008 80);
  box-shadow: 0 14px 30px -16px color-mix(in oklab, var(--action-accent) 78%, transparent);
}
.home-action.secondary {
  background: rgb(255 255 255 / 0.035);
  color: var(--hero-text);
  border: 1px solid var(--hero-line);
}
.home-action:hover { transform: translateY(-3px); }
.home-action:active { transform: translateY(-1px) scale(0.985); }
.home-summary {
  position: relative;
  z-index: 1;
  overflow: hidden;
  justify-content: center;
  background: transparent;
  border-left: 1px solid var(--hero-line);
  animation: rise-in 620ms 90ms var(--ease-out) both;
}
.home-summary::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgb(255 255 255 / 0.055), rgb(255 255 255 / 0.015));
  border: 1px solid var(--hero-line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  transform: rotate(-1.2deg);
}
.home-summary::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 28px;
  width: 54%;
  height: 40%;
  pointer-events: none;
  border-bottom: 1px dashed color-mix(in oklab, var(--action-accent) 70%, transparent);
  border-radius: 50%;
  transform: rotate(-11deg);
  opacity: 0.7;
}
.home-summary > * { position: relative; z-index: 1; }
.home-summary-grid {
  gap: 12px;
  border-top-color: var(--hero-line);
}
.home-summary-grid > div {
  padding: 14px;
  background: rgb(255 255 255 / 0.045);
  border: 1px solid var(--hero-line);
  border-radius: 9px;
  transition: transform 190ms var(--ease-out), border-color 190ms ease-out, background 190ms ease-out;
}
.home-summary-grid > div:first-child { transform: rotate(1deg); }
.home-summary-grid > div:last-child { transform: rotate(-0.8deg); }
.home-summary-grid > div:hover {
  transform: translateY(-4px) rotate(0);
  border-color: color-mix(in oklab, var(--action-accent) 62%, var(--hero-line));
  background: color-mix(in oklab, var(--action-accent) 12%, transparent);
}

/* Поиск как стеклянная панель поверх hero */
.global-search {
  position: relative;
  z-index: 3;
  margin: -68px 24px 36px;
}
.global-search .searchform {
  padding: 10px;
  background: color-mix(in oklab, var(--surface-raised) 82%, transparent);
  border-color: color-mix(in oklab, var(--fg-300) 55%, transparent);
  border-radius: 10px;
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 48px -34px rgb(23 23 23 / 0.42);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 180ms ease-out;
}
.global-search .searchform:focus-within {
  transform: translateY(-2px);
  border-color: var(--action-accent);
  box-shadow: 0 0 0 4px var(--orange-50), 0 26px 54px -34px rgb(23 23 23 / 0.5);
}
.global-search .searchico { left: 24px; }
.global-search .searchform button,
.create-order button {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background 180ms ease-out, border-color 180ms ease-out;
}
.global-search .searchform button::after,
.create-order button::after,
.btn::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgb(255 255 255 / 0.22), transparent);
  transform: skewX(-18deg) translateX(-120%);
  transition: transform 520ms var(--ease-out);
}
.global-search .searchform button:hover::after,
.create-order button:hover::after,
.btn:hover::after { transform: skewX(-18deg) translateX(360%); }
.global-search .searchform button:hover,
.create-order button:hover,
.btn:hover { transform: translateY(-2px); }
.global-search .searchform button:active,
.create-order button:active,
.btn:active { transform: translateY(0) scale(0.985); }

/* Карточки архива и быстрые действия */
.year-grid { gap: 16px; }
.year-card {
  border-radius: 10px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transform-origin: 50% 70%;
  animation: rise-in 460ms var(--ease-out) both;
}
.year-grid .year-card:nth-child(2) { animation-delay: 85ms; }
.year-grid .year-card:nth-child(3) { animation-delay: 160ms; }
.year-grid .year-card:nth-child(4) { animation-delay: 225ms; }
.year-card:hover,
.year-card:focus-visible {
  border-color: var(--action-accent);
  box-shadow: 0 0 0 4px var(--orange-50), 0 24px 44px -30px color-mix(in oklab, var(--action-accent) 55%, black);
  transform: translateY(-8px) rotate(-0.45deg);
}
.year-card:hover .big { color: var(--orange-600); }
.create-order {
  border-radius: 10px;
  transition: transform 200ms var(--ease-out), border-color 180ms ease-out, box-shadow 200ms var(--ease-out);
}
.create-order:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--action-accent) 48%, var(--bg-300));
  box-shadow: 0 22px 44px -34px color-mix(in oklab, var(--action-accent) 52%, black);
}
input[type="text"], input[type="email"], input[type="password"], input[type="file"], input[type="date"], select, textarea {
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background 160ms ease-out, transform 160ms var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 4px var(--orange-50);
}

/* Реестры, результаты поиска и рабочие списки */
.page-head, .crumb { animation: rise-in 420ms var(--ease-out) both; }
.projhead { animation: rise-in 360ms var(--ease-out) both; }
.orow, .prow, .search-results .urow {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 190ms var(--ease-out), border-color 180ms ease-out, box-shadow 190ms var(--ease-out), background 180ms ease-out;
}
.orow::before, .prow::before, .search-results .urow::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--action-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 200ms var(--ease-out);
}
.orow:hover, .prow:hover, .search-results .urow:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--action-accent) 54%, var(--bg-300));
  box-shadow: 0 18px 36px -28px color-mix(in oklab, var(--action-accent) 56%, black);
}
.orow:hover::before, .prow:hover::before, .search-results .urow:hover::before { transform: scaleY(1); }
.obar {
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
}
.obar-fill, .prog-fill, .up-fill {
  border-radius: inherit;
  transform-origin: left;
  animation: fill-x 700ms 120ms var(--ease-out) both;
}
.ochev {
  transition: transform 180ms var(--ease-out), background 180ms ease-out, color 180ms ease-out;
}
.orow:hover .ochev, .urow:hover .ochev {
  transform: translateX(4px);
  color: var(--orange-600);
}
.pill, .chip, .badge {
  transition: transform 170ms var(--ease-out), background 170ms ease-out, border-color 170ms ease-out;
}
.orow:hover .pill, .prow:hover .pill, .urow:hover .pill { transform: translateY(-1px); }
.statusbar, .panel, .card, .tile, .specbar, .dist-indicator, .loaded-file {
  transition: transform 190ms var(--ease-out), border-color 180ms ease-out, box-shadow 190ms var(--ease-out), background 180ms ease-out;
}
.panel:hover, .specbar:hover, .dist-indicator:hover, .loaded-file:hover {
  border-color: color-mix(in oklab, var(--action-accent) 38%, var(--bg-300));
}
.tab { position: relative; overflow: hidden; }
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--action-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease-out);
}
.tab:hover::after, .tab.on::after { transform: scaleX(1); }
.tab.on { border-bottom-color: transparent; }

/* Мобильная навигация и тактильность */
.bottomnav {
  border-top: 1px solid color-mix(in oklab, var(--bg-300) 82%, transparent);
  box-shadow: 0 -14px 34px -26px rgb(23 23 23 / 0.38);
  backdrop-filter: blur(18px);
}
.bottomnav a {
  position: relative;
  border-radius: 8px;
  transition: color 180ms ease-out, background 180ms ease-out, transform 180ms var(--ease-out);
}
.bottomnav a i { transition: transform 190ms var(--ease-spring); }
.bottomnav a.on { background: var(--orange-50); }
.bottomnav a.on::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: var(--action-accent);
  transform: translateX(-50%);
}
.bottomnav a:hover i, .bottomnav a.on i { transform: translateY(-2px); }
.bottomnav a:active { transform: scale(0.97); }

[data-theme="dark"] .global-search .searchform {
  background: color-mix(in oklab, var(--surface-raised) 78%, transparent);
  box-shadow: 0 24px 52px -34px rgb(0 0 0 / 0.8);
}
[data-theme="dark"] .year-card:hover,
[data-theme="dark"] .orow:hover,
[data-theme="dark"] .prow:hover,
[data-theme="dark"] .search-results .urow:hover {
  box-shadow: 0 20px 42px -28px rgb(0 0 0 / 0.9), 0 0 0 1px color-mix(in oklab, var(--action-accent) 30%, transparent);
}

@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .home-summary { border-top: 1px solid var(--hero-line); border-left: 0; }
  .home-summary::before { transform: rotate(0.7deg); }
}

@media (max-width: 700px) {
  .home-hero { border-radius: 10px; }
  .home-intro { animation-duration: 420ms; }
  .home-actions { margin-top: 24px; }
  .home-action { flex: 1 1 180px; }
  .home-summary-grid > div:first-child,
  .home-summary-grid > div:last-child { transform: none; }
  .global-search { margin: -62px 12px 28px; }
  .global-search .searchform { border-radius: 9px; }
  .year-card:hover, .year-card:focus-visible { transform: translateY(-4px); }
  .orow:hover, .prow:hover, .search-results .urow:hover { transform: translateY(-2px); }
  .bottomnav a { margin: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-item { opacity: 1; transform: none; transition: none; }
  .home-intro, .home-summary, .year-card, .page-head, .crumb, .projhead,
  .obar-fill, .prog-fill, .up-fill, .live-dot { animation: none !important; }
  .global-search .searchform button::after,
  .create-order button::after,
  .btn::after { display: none; }
}

/* Скруглённая геометрия — мягкий современный контур */
:root {
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 99px;
}

/* Кнопки: убраны срезанные углы, мягкий контур */
button, .btn {
  border-radius: var(--r-md);
  clip-path: none;
  overflow: hidden;
}
.btn-ghost, .viewswitch, button.btn-ghost, button.small, button.editbtn, button.delbtn,
button.dist-toggle, button.rename-order-btn, .stbtn, .themebtn, .usermenu-btn,
.lb-close, .lb-prev, .lb-next, .lb-zoom button, .gdel { border-radius: var(--r-sm); }
.home-action { border-radius: var(--r-md); }
.global-search .searchform button, .create-order button { border-radius: var(--r-sm); }

/* Поля ввода */
input[type="text"], input[type="email"], input[type="password"], input[type="file"], input[type="date"], select, textarea {
  border-radius: var(--r-md);
}

/* Рабочие поверхности */
.panel, .card, .tile, .prof-card, .statusbar, .feed, .olist, .plist { border-radius: var(--r-lg); }
.empty { border-radius: var(--r-md); }
.usermenu-drop { border-radius: var(--r-lg); overflow: hidden; }
.usermenu-drop a { border-radius: var(--r-sm); }

/* Чипы и метки — «пилюли» */
.pill, .chip, .badge, .projcount, .tab .cnt, .tab.on .cnt, [data-theme="dark"] .tab.on .cnt {
  border-radius: var(--r-pill);
}
.tab .cnt, .tab.on .cnt { padding: 2px 9px; }

/* Главная */
.home-hero { border-radius: var(--r-xl); }
.home-summary::before { border-radius: var(--r-lg); }
.home-summary-grid > div { border-radius: var(--r-md); }
.global-search .searchform { border-radius: var(--r-lg); }
.year-card { border-radius: var(--r-lg); clip-path: none; }
.create-order { border-radius: var(--r-lg); }

/* Реестры и списки */
.orow, .prow, .search-results .urow { border-radius: var(--r-md); }
.search-results .ulist, .ulist { border-radius: var(--r-md); }
.uava { border-radius: var(--r-sm); }
.prof-ava { border-radius: var(--r-md); }
.qlink { border-radius: var(--r-sm); }
.renameform { border-radius: 0 0 var(--r-md) var(--r-md); }

/* Заказ и документы */
.statusbtns { border-radius: var(--r-md); padding: 4px; }
.stbtn { border-radius: var(--r-sm); }
.specbar { border-radius: var(--r-lg); overflow: hidden; }
.pico { border-radius: var(--r-sm); }
.ese-head { border-radius: var(--r-md); }
.dist-indicator { border-radius: var(--r-md); }
.loaded-file { border-radius: var(--r-md); }
.gitem, .orphan-item { border-radius: var(--r-md); }
.dropzone { border-radius: var(--r-md); }
.demo-access { border-radius: var(--r-md); }

/* Экран входа */
.login-card { border-radius: var(--r-xl); clip-path: none; }

/* Нижняя навигация */
.bottomnav { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.bottomnav a { border-radius: var(--r-md); }

@media (max-width: 700px) {
  .home-hero { border-radius: var(--r-lg); }
  .global-search .searchform { border-radius: var(--r-md); }
}

/* Уведомления и участники заказа */
.bellbtn {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--bg-300);
  border-radius: var(--r-md);
  color: var(--fg-800);
  font-size: 18px;
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 180ms var(--ease-out);
}
.bellbtn:hover { background: var(--surface-raised); border-color: var(--fg-400); color: var(--fg-950); transform: translateY(-1px); }
.bellbtn.has-unread { border-color: color-mix(in oklab, var(--action-accent) 55%, var(--bg-300)); color: var(--orange-600); }
.bellbtn.has-unread i { animation: bell-sway 2.6s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes bell-sway {
  0%, 100% { transform: rotate(0); }
  6% { transform: rotate(9deg); }
  12% { transform: rotate(-7deg); }
  18% { transform: rotate(4deg); }
  24% { transform: rotate(0); }
}
.bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--action-accent);
  color: oklch(22.5% 0.008 80);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px var(--surface-page);
  animation: rise-in 300ms var(--ease-out) both;
}

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-row { gap: 14px; }
.notif-row.unread { border-color: color-mix(in oklab, var(--action-accent) 45%, var(--bg-300)); }
.notif-row.unread .pico { color: var(--orange-600); }
.notif-row.unread .notif-text { font-weight: 700; }
.notif-text { font-size: 15px; }
.notif-row .meta { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 11px; }

.participants {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-secondary);
}
.part-chip { background: var(--surface-subtle); }

.empty-state { text-align: center; padding: 48px 32px; }
.empty-state .pico { width: 48px; margin: 0 auto 14px; font-size: 26px; }

@media (prefers-reduced-motion: reduce) {
  .bellbtn.has-unread i { animation: none; }
}

/* Должности и переназначение привязки */
.assign-form, .roleform { margin: 0; }
.assign-form select, .roleform select {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--bg-300);
  color: var(--fg-800);
  max-width: 170px;
}
.assign-form select:hover, .roleform select:hover { border-color: var(--fg-400); }

.roles-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Баннер установки приложения на рабочий стол */
.pwa-banner{
  position: fixed; left: 50%; bottom: 84px; z-index: 900;
  transform: translate(-50%, 30px); opacity: 0;
  transition: transform .4s cubic-bezier(.2,.9,.25,1.2), opacity .35s ease;
  display: flex; align-items: center; gap: 12px;
  max-width: min(480px, calc(100vw - 32px));
  background: var(--panel, #fff); color: var(--fg-950, #1c1b1a);
  border: 1px solid var(--bg-300, #e3e1dc);
  border-radius: var(--r-lg, 18px);
  box-shadow: 0 18px 44px rgba(28,27,26,.18);
  padding: 12px 14px;
}
.pwa-banner.show{ transform: translate(-50%, 0); opacity: 1; }
.pwa-ico{
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pri-600, #b4562a); color: #fff; font-size: 19px;
}
.pwa-txt{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-txt b{ font-size: 14px; }
.pwa-txt span{ font-size: 12.5px; color: var(--fg-400, #7d7a75); }
.pwa-btn{
  flex: none; border: none; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--pri-600, #b4562a); color: #fff;
  border-radius: var(--r-pill, 99px); padding: 9px 16px; font-size: 13.5px;
}
.pwa-btn:hover{ background: var(--pri-700, #9a4a24); }
.pwa-close{
  flex: none; border: none; background: none; cursor: pointer;
  color: var(--fg-400, #7d7a75); font-size: 17px; padding: 6px; border-radius: 8px;
}
.pwa-close:hover{ background: var(--bg-100, #f0efec); }
@media (max-width: 600px){
  .pwa-banner{ bottom: 76px; }
}

/* Сворачиваемые панели (состояние запоминается) */
.collapse-head{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 0; margin: 0; border: none; background: none;
  cursor: pointer; font: inherit; color: inherit; text-align: left;
  border-radius: 10px;
}
.collapse-head h2{ margin: 0; }
.collapse-chevron{
  flex: none; font-size: 20px; color: var(--fg-400, #7d7a75);
  transition: transform .3s ease;
}
.collapse-head:hover .collapse-chevron{ color: var(--fg-950, #1c1b1a); }
.collapse-wrap{
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .35s cubic-bezier(.2,.8,.25,1);
}
.collapse-body{ overflow: hidden; min-height: 0; }
.collapse-body > :first-child{ margin-top: 14px; }
.collapsible.collapsed .collapse-wrap{ grid-template-rows: 0fr; }
.collapsible.collapsed .collapse-chevron{ transform: rotate(-90deg); }
.no-anim, .no-anim .collapse-wrap, .no-anim .collapse-chevron{ transition: none !important; }

/* === Мобильный пакет: навигация, кнопки, списки, шапка === */

/* Тень у закреплённой шапки при прокрутке */
.topbar.scrolled { box-shadow: 0 12px 32px -20px rgb(23 23 23 / 0.42); }
[data-theme="dark"] .topbar.scrolled { box-shadow: 0 12px 32px -18px rgb(0 0 0 / 0.7); }

@media (max-width: 600px) {
  /* 1. Нижняя навигация: активный пункт крупнее и ярче, бейдж уведомлений */
  .bottomnav a { font-size: 10px; padding: 8px 2px 6px; gap: 4px; }
  .bottomnav a.on { font-weight: 700; }
  .bottomnav a.on i { font-size: 23px; transform: translateY(-2px); }
  .bottomnav a.on::before { width: 28px; }
  .bn-badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 2px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--action-accent);
    color: oklch(22.5% 0.008 80);
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--surface-raised);
  }

  /* 2. Крупные кнопки действий — на весь экран */
  .panel form button[type="submit"]:not(.editbtn):not(.delbtn),
  .create-order button[type="submit"],
  .panel > a.btn,
  .collapse-body form button[type="submit"]:not(.editbtn):not(.delbtn) {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 15px;
  }
  .panel form.inline { flex-direction: column; align-items: stretch; }
  .panel form.inline .field { margin-bottom: 10px; }
  .statusbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .statusbar .statusbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .statusbar .stbtn { min-height: 48px; font-size: 14px; justify-content: center; }
  .statusbar .stbtn form, .statusbar form { display: contents; }

  /* 3. Списки позиций: компактнее, крупные чекбоксы, жирные цифры */
  .postable th, .postable td { padding: 7px 6px; font-size: 13.5px; }
  .postable .tname { min-width: 120px; }
  input.poscheck {
    width: 26px;
    height: 26px;
    accent-color: var(--orange-500);
    cursor: pointer;
    flex-shrink: 0;
  }
  .postable .tnum { font-weight: 700; }
  .postable .chip { font-weight: 700; padding: 5px 8px; }
  .prow { padding: 12px 14px; }
  .prow .pill, .orow .pill { font-weight: 700; }
  .editbtn, .delbtn { min-width: 42px; min-height: 42px; font-size: 17px; }
  .ese-head { font-size: 15px; padding: 10px 12px; }
}
