/* DOKA SITE — design system. Без внешних зависимостей (Bootstrap и шрифты иконок удалены). */

:root {
  color-scheme: dark;
  --bg: #0a0c13;
  --surface: #11141e;
  --surface-2: #171b28;
  --surface-3: #1e2333;
  --border: #252a3c;
  --border-strong: #353c57;
  --text: #eef0f8;
  --text-2: #a4abc6;
  --text-3: #6e7694;
  --brand: #7b83ff;
  --brand-2: #a374ff;
  --brand-soft: rgba(123, 131, 255, .14);
  --ok: #25c68c;
  --ok-soft: rgba(37, 198, 140, .14);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .15);
  --bad: #f3565d;
  --bad-soft: rgba(243, 86, 93, .14);
  --info: #38bdf8;
  --on-state: #0a0c13;
  --r: 16px;
  --r-sm: 11px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --surface-3: #eceef7;
  --border: #e0e3ef;
  --border-strong: #c9cee2;
  --text: #171a29;
  --text-2: #51587a;
  --text-3: #868daa;
  --brand: #4f58e6;
  --brand-2: #7c4ff0;
  --brand-soft: rgba(79, 88, 230, .10);
  --ok: #0f9d6b;
  --ok-soft: rgba(15, 157, 107, .11);
  --warn: #c77d06;
  --warn-soft: rgba(199, 125, 6, .12);
  --bad: #d63a42;
  --bad-soft: rgba(214, 58, 66, .10);
  --info: #0a84c1;
  --on-state: #ffffff;
  --shadow: 0 8px 24px rgba(40, 50, 100, .10);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
code { font: 500 .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Каркас ---------- */
.container { width: min(100% - 28px, 1080px); margin-inline: auto; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .container { height: 58px; display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 14px rgba(123, 131, 255, .35);
}
.brand-mark .i { width: 18px; height: 18px; }
.top-nav { margin-left: 18px; display: none; gap: 4px; }
.top-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.top-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.top-nav a.active { color: var(--text); background: var(--surface-3); }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.page { padding: 16px 0 calc(var(--nav-h) + 40px + env(safe-area-inset-bottom, 0px)); }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: .7rem; font-weight: 650; position: relative;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a .i { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }

@media (min-width: 900px) {
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .page { padding-bottom: 48px; }
  .container { width: min(100% - 48px, 1080px); }
  .only-mobile { display: none !important; }
}

/* ---------- Иконки ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.i-lg { width: 1.6em; height: 1.6em; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 650; font-size: .94rem; line-height: 1; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(123, 131, 255, .28); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); filter: brightness(1.08); }
.btn-ok { background: var(--ok); border-color: transparent; color: #04140d; }
.btn-ok:hover { background: var(--ok); filter: brightness(1.08); }
.btn-danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.08); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.btn-text-danger { color: var(--bad); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card-h h3 { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.card-h h3 .i { color: var(--brand); }
.card-h small { color: var(--text-3); font-weight: 500; font-size: .78rem; }
.card-b { padding: 16px; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h1, .page-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: .9rem; }
.back:hover { color: var(--text); text-decoration: none; background: var(--surface-3); }

/* ---------- Формы ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-size: .8rem; font-weight: 650; color: var(--text-2); }
.input {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-size: 1rem; appearance: none; -webkit-appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hint { font-size: .78rem; color: var(--text-3); }
.form-grid { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 42px; }

/* ---------- Чипы (фильтры, вкладки) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 6px; margin: 0 -14px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; scroll-snap-align: start; white-space: nowrap;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .count { font-size: .75rem; opacity: .8; font-weight: 700; }

/* ---------- Бейджи и пилюли ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 750; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok, .pill.success { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .pill.warning { background: var(--warn-soft); color: var(--warn); }
.badge.bad, .pill.danger { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--brand-soft); color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: .84rem; white-space: nowrap; }

/* ---------- Алерты и тосты ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 14px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: .92rem; transition: opacity .4s; }
.flash .i { margin-top: 2px; }
.flash.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.flash.warning { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.flash.info { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.flash span { color: var(--text); flex: 1; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 460px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: .92rem; animation: pop .18s ease-out; }
.toast.error { border-color: var(--bad); }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: var(--brand); font-weight: 700; padding: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Диалог подтверждения ---------- */
dialog.dlg { width: min(92vw, 400px); border: 1px solid var(--border-strong); border-radius: 20px; padding: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(4, 6, 12, .62); backdrop-filter: blur(3px); }
dialog.dlg h3 { margin-bottom: 8px; }
dialog.dlg p { color: var(--text-2); margin-bottom: 18px; }
dialog.dlg .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Меню ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.menu-pop > a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 0; background: none; color: var(--text); font-weight: 600; font-size: .92rem; text-align: left; }
.menu-pop > a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .danger { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }

/* ---------- Дашборд ---------- */
.hello { margin: 4px 0 16px; }
.hello p { color: var(--text-2); margin-top: 4px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700;
}
.quick a:hover { background: var(--surface-2); text-decoration: none; }
.quick .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.quick a:nth-child(2) .ico { background: var(--ok-soft); color: var(--ok); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 1rem; }
.section-title .i { color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.kpi b { display: block; font-size: 1.9rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi.money b { font-size: 1.45rem; }
.kpi span { display: block; margin-top: 6px; font-size: .8rem; color: var(--text-2); font-weight: 600; }
.kpi.ok b { color: var(--ok); } .kpi.warn b { color: var(--warn); } .kpi.bad b { color: var(--bad); } .kpi.accent b { color: var(--brand); }
.attn { display: grid; }
.attn a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; color: var(--text); border-top: 1px solid var(--border); }
.attn a:first-child { border-top: 0; }
.attn a:hover { background: var(--surface-2); text-decoration: none; }
.attn .t { flex: 1 1 150px; min-width: 0; }
.attn .pill { margin-left: auto; }
.attn .t b { display: block; font-weight: 700; }
.attn .t small { color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 8px; }
.chart .col { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; gap: 4px; min-width: 0; }
.chart .bar-wrap { display: flex; align-items: flex-end; justify-content: center; }
.chart .bar { width: min(100%, 38px); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); min-height: 3px; }
.chart .col.zero .bar { background: var(--surface-3); }
.chart .v { font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.chart .m { font-size: .72rem; color: var(--text-3); font-weight: 600; }
.chart .s { font-size: .68rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Заказы ---------- */
.toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-2); font-size: .85rem; }
.toolbar-row select { width: auto; min-height: 38px; font-size: .88rem; padding-top: 6px; padding-bottom: 6px; }
.oc {
  display: block; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 14px 12px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
.oc:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--surface) 90%, var(--surface-2)); }
.oc-top { display: flex; align-items: center; gap: 8px; }
.oc-num { font-weight: 800; color: var(--brand); font-size: 1.02rem; }
.oc-num:hover { text-decoration: none; }
.oc-name { margin-top: 6px; font-size: 1.05rem; font-weight: 700; }
.oc-note { margin-top: 4px; color: var(--text-2); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oc-addr { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 11px; background: var(--surface-2); font-size: .9rem; font-weight: 600; }
.oc-addr .i { color: var(--brand); margin-top: 2px; }
.oc-foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-prog { height: 4px; border-radius: 4px; background: var(--surface-3); margin: 12px 0 10px; overflow: hidden; }
.oc-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--ok)); border-radius: 4px; }
.stages { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.st {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 46px; padding: 4px 0; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-3); font-size: .58rem; font-weight: 800; letter-spacing: .03em; user-select: none;
}
button.st { cursor: pointer; }
button.st:active { transform: scale(.94); }
.st .i { width: 18px; height: 18px; }
.st-2 { background: var(--ok-soft); color: var(--ok); --on-state: var(--bg); }
.st-1 { background: var(--warn-soft); color: var(--warn); }
.st[aria-busy="true"] { opacity: .55; }
[data-theme="light"] .st-2 { --on-state: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .i { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; color: var(--text); }
.empty .btn { margin-top: 16px; }
.arch-act { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---------- Карточка заказа ---------- */
.info-list { display: grid; }
.info { padding: 11px 0; border-top: 1px solid var(--border); display: grid; gap: 3px; }
.info:first-child { border-top: 0; padding-top: 0; }
.info:last-child { padding-bottom: 0; }
.info .k { font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.info .v { font-size: 1.02rem; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info .v.big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.pay-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.pay-bar i { display: block; height: 100%; background: var(--warn); border-radius: 6px; }
.edit-form { display: none; }
.edit-form.show { display: block; }
.map-wrap { position: relative; }
.stage-list { display: grid; }
.stage-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 16px; background: none; border: 0; border-top: 1px solid var(--border); text-align: left; color: var(--text); }
.stage-row:first-child { border-top: 0; }
.stage-row:hover { background: var(--surface-2); }
.stage-row[aria-busy="true"] { opacity: .55; }
.stage-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.stage-name { flex: 1; font-weight: 650; }
.stage-state { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.stage-state .i { width: 22px; height: 22px; }
.stage-row[data-v="1"] .stage-state { color: var(--warn); }
.stage-row[data-v="2"] .stage-state { color: var(--ok); --on-state: var(--bg); }
[data-theme="light"] .stage-row[data-v="2"] .stage-state { --on-state: #fff; }

.drop { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 18px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .i { width: 28px; height: 28px; color: var(--brand); margin-bottom: 6px; }
.drop small { display: block; color: var(--text-3); }
.up-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 12px; display: none; }
.up-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .15s; }
.up-info { font-size: .8rem; color: var(--text-2); margin-top: 6px; display: none; }
.files-label { display: flex; align-items: center; gap: 7px; margin: 16px 0 8px; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .photos { grid-template-columns: repeat(4, 1fr); } }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .x { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(8, 10, 18, .72); color: #fff; padding: 0; }
.photo .x .i { width: 15px; height: 15px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.file-row .i-lg { color: var(--brand); }
.file-row .n { font-weight: 650; font-size: .9rem; word-break: break-word; }
.file-row small { color: var(--text-3); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 12, .94); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lightbox button { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }

.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.comment:first-child { border-top: 0; padding-top: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: .85rem; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; }
.comment .body { flex: 1; min-width: 0; }
.comment .meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-3); flex-wrap: wrap; }
.comment .meta b { color: var(--text); font-size: .88rem; }
.comment .text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.hist { display: grid; gap: 0; }
.hist-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.hist-item:first-child { border-top: 0; padding-top: 0; }
.hist-item time { display: block; color: var(--text-3); font-size: .74rem; margin-top: 2px; }

/* ---------- Авторизация ---------- */
.auth { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 20px 0; }
.auth-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .brand-mark { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 12px; }
.auth-logo .brand-mark .i { width: 30px; height: 30px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: .9rem; }

/* ---------- Профиль / админка ---------- */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.user-row:first-child { border-top: 0; padding-top: 0; }
.user-row .who { flex: 1; min-width: 160px; }
.user-row .who b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-row .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-row select.input { min-height: 38px; width: auto; font-size: .88rem; padding-top: 4px; padding-bottom: 4px; }
.code-box { font: 800 1.35rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; padding: 14px; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); user-select: all; word-break: break-all; }
.cmds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.cmds code { padding: 8px 10px; }
.tg-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-top: 8px; }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; }

/* ---------- Калькулятор ---------- */
.calc-grid { display: grid; gap: 12px; }
@media (min-width: 860px) { .calc-grid { grid-template-columns: minmax(300px, 400px) 1fr; align-items: start; } }
.calc-panel { display: none; }
.calc-panel.active { display: block; }
.result-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border); }
.result-row:first-child { border-top: 0; }
.result-label { color: var(--text-2); font-size: .9rem; }
.result-data { font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.result-data.lg { font-size: 1.15rem; color: var(--brand); }
.result-value { font-size: 1.9rem; font-weight: 800; color: var(--brand); text-align: center; padding: 6px 0 14px; letter-spacing: -.02em; }
.ok-text { color: var(--ok); font-weight: 750; } .bad-text { color: var(--bad); font-weight: 750; }
.note { padding: 11px 14px; border-radius: 12px; font-size: .88rem; background: var(--brand-soft); color: var(--text); line-height: 1.55; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.svg-box { background: #15171c; border-radius: 14px; padding: 10px; overflow-x: auto; }
.svg-box svg { display: block; width: 100%; min-width: 320px; height: auto; max-height: 520px; }
.placeholder { text-align: center; padding: 34px 14px; color: var(--text-3); }
.placeholder .i { width: 38px; height: 38px; margin-bottom: 8px; }

/* ---------- Ошибки ---------- */
.err { text-align: center; padding: 60px 16px; }
.err b { display: block; font-size: 4rem; font-weight: 800; color: var(--brand); letter-spacing: -.04em; }
.err p { color: var(--text-2); margin: 8px 0 20px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .topbar, .bottom-nav, .toasts { display: none; } body { background: #fff; color: #000; } }

/* переключатель темы: показываем одну из двух иконок */
.theme-toggle .ti-sun { display: none; }
[data-theme="light"] .theme-toggle .ti-sun { display: inline; }
[data-theme="light"] .theme-toggle .ti-moon { display: none; }
.kpis.two { grid-template-columns: repeat(2, 1fr); }
.kpis.two .kpi b { font-size: 1.35rem; }


/* DOKA motion refresh: subtle, fast and respects reduced-motion settings. */
@keyframes doka-rise { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes doka-shimmer { 0% { background-position: 180% 0; } 100% { background-position: -180% 0; } }
@keyframes doka-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(123,131,255,0); } 50% { box-shadow: 0 0 0 5px rgba(123,131,255,.08); } }
.page > .card, .page > .kpis, .page > .quick, .page > .employee-load { animation: doka-rise .42s both; }
.page > .kpis { animation-delay: .04s; }
.page > .employee-load { animation-delay: .08s; }
.card, .kpi, .quick a, .employee-card, .btn, .stage-row, .file-row, .photo { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
@media (hover:hover) {
  .card:hover { border-color: var(--border-strong); }
  .kpi:hover, .employee-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .quick a:hover, .btn:hover { transform: translateY(-1px); }
  .photo:hover { transform: scale(1.025); }
}
.employee-load { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 0 0 22px; }
.employee-card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: linear-gradient(145deg,var(--surface-2),var(--surface)); animation: doka-rise .38s both; animation-delay: var(--load-delay,0ms); }
.employee-top { display:flex; align-items:center; gap:9px; min-width:0; }
.employee-top b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.employee-avatar { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:11px; background:var(--brand-soft); color:var(--brand); font-weight:800; }
.employee-stats { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }
.employee-stats span { display:flex; flex-direction:column; gap:2px; padding:9px; border-radius:10px; background:var(--surface-3); }
.employee-stats b { font-size:1.3rem; line-height:1.1; font-variant-numeric:tabular-nums; }
.employee-stats small { color:var(--text-3); font-size:.72rem; }
.employee-pending b { color:var(--warn); }
.employee-working b { color:var(--info); }
.employee-track { height:4px; margin-top:12px; border-radius:9px; overflow:hidden; background:var(--surface-3); }
.employee-track i { display:block; height:100%; border-radius:9px; background:linear-gradient(90deg,var(--brand),var(--brand-2)); transition:width .6s ease; }
.lightbox .lb-actions { position:absolute; top:calc(12px + env(safe-area-inset-top,0px)); right:64px; display:flex; gap:8px; }
.lightbox .lb-actions button { position:static; }
.lightbox .lb-prev { left:12px; right:auto; top:50%; transform:translateY(-50%); }
.lightbox .lb-next { right:12px; top:50%; transform:translateY(-50%); }
@media(max-width:900px) { .employee-load { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .employee-load { gap:8px; } .employee-card { padding:11px; } .employee-top b { font-size:.82rem; } }
@media print {
  body.printing-image * { visibility:hidden !important; }
  body.printing-image #printImage, body.printing-image #printImage * { visibility:visible !important; }
  body.printing-image #printImage { display:block !important; position:fixed; inset:0; width:100%; height:100%; object-fit:contain; background:white; }
  .lightbox, .topbar, .bottom-nav, .toasts { display:none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .page > .card, .page > .kpis, .page > .quick, .page > .employee-load, .employee-card { animation:none !important; }
  .card, .kpi, .quick a, .employee-card, .btn, .stage-row, .file-row, .photo, .employee-track i { transition:none !important; }
}
.file-print-hint { flex: 1; min-width: 120px; color: var(--text-3); font-size: .72rem; }
