/* WorkControl — дизайн-система.
   Телефон: нижняя плавающая навигация и шторки. Десктоп: тёмный сайдбар + контент. */

:root {
  /* поверхности */
  --canvas: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --ink: #0b1220;
  --ink-2: #33415a;
  --muted: #6b7a94;
  --line: #e4e9f2;
  --line-2: #eef1f7;

  /* бренд и семантика */
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef1ff;
  --accent: #4f46e5;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #7c5cf5 100%);
  --sky: #0ea5e9;
  --ok: #12a35b;
  --warn: #e8930c;
  --danger: #dc2626;
  --blocked: #e11d48;
  --blocked-bg: #fff4f6;
  --sidebar: #0a1020;

  /* форма и глубина */
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 10px 24px -14px rgba(11, 18, 32, .16);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, .04), 0 26px 50px -22px rgba(11, 18, 32, .24);
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
/* атрибут hidden должен работать поверх авторских display-правил */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 100% -5%, #e9edfb 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 0%, #edf6fb 0%, transparent 55%),
    var(--canvas);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.022em; }
p { margin: 0; }
img { display: block; }
::selection { background: #dfe3ff; }

/* служебные */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 14px 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; gap: 12px; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.mt { margin-top: 14px; }
.error-box {
  background: #fff5f5; color: #991b1b; border: 1px solid #fbd5d5; padding: 12px 14px; border-radius: var(--radius-sm);
}

/* иконки (SVG из ui.js) */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon--solid { fill: currentColor; stroke: currentColor; stroke-width: 1.2; }
.icon.sm { width: 15px; height: 15px; }
.icon.md { width: 20px; height: 20px; }
.icon.lg { width: 24px; height: 24px; }

/* ------------------------------------------------------------ кнопки */

button.primary, button.ghost, button.warn, button.danger, button.link, button.link-danger, a.ghost, a.link {
  border-radius: var(--radius-sm); padding: 9px 15px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; transition: transform .12s, box-shadow .16s, background .16s, filter .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
a.ghost, a.link { text-decoration: none; }
button.primary {
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .06), 0 10px 20px -12px rgba(79, 70, 229, .85);
}
button.primary:hover { filter: brightness(1.06); box-shadow: 0 1px 2px rgba(11, 18, 32, .06), 0 14px 26px -12px rgba(79, 70, 229, .95); }
button.warn { background: linear-gradient(135deg, #f6a723, #e8930c); color: #241a00; box-shadow: 0 10px 20px -14px rgba(232, 147, 12, .95); }
button.danger { background: linear-gradient(135deg, #e64545, #c81e1e); color: #fff; box-shadow: 0 10px 20px -14px rgba(220, 38, 38, .9); }
button.ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
button.ghost:hover { background: var(--surface-2); border-color: #d5dcea; color: var(--ink); }
button.ghost.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
button.big { padding: 13px 18px; font-size: 15.5px; border-radius: 13px; }
button.full { width: 100%; }
button.link { color: var(--brand); padding: 6px 9px; background: transparent; }
button.link:hover { background: var(--brand-soft); }
button.link-danger { color: var(--danger); padding: 6px 9px; }
button.link-danger:hover { background: #fff1f1; }
button:active { transform: translateY(1px) scale(.99); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--ring);
}
button.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  box-shadow: var(--shadow-sm); position: relative; transition: .15s;
}
button.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: #d5dcea; }
button.chip {
  background: var(--surface-3); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; transition: .15s;
}
button.chip:hover { background: #e6ebf6; border-color: var(--line); }
button.chip.running-chip { background: #e6eeff; color: #1d4ed8; border-color: #cfddff; font-variant-numeric: tabular-nums; }

/* чип локальной очереди: виден только без сети или когда есть несохранённые действия */
button.chip.queue-chip { background: #fff4e6; color: #b45309; border-color: #fde3c2; white-space: nowrap; font-size: 12px; padding: 5px 10px; gap: 5px; }
button.chip.queue-chip.is-offline { animation: pulse-soft 2.4s ease-in-out infinite; }
button.chip.queue-chip b { font-weight: 700; }
.queue-sheet .simple-row div { min-width: 0; }
@keyframes pulse-soft { 50% { border-color: #f5b96a; } }

/* --------------------------------------------------------------- авторизация */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr; gap: 28px;
  padding: calc(28px + var(--safe-top)) 18px 34px;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(56, 189, 248, .28) 0%, transparent 58%),
    radial-gradient(760px 520px at 92% 8%, rgba(139, 92, 246, .32) 0%, transparent 60%),
    radial-gradient(620px 420px at 60% 108%, rgba(79, 70, 229, .38) 0%, transparent 62%),
    linear-gradient(165deg, #080e1d 0%, #131f3f 46%, #241f52 100%);
  align-content: center; justify-items: center; color: #e9edfa;
}
.auth-card {
  width: min(430px, 100%); background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: 0 40px 90px -34px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .35);
  animation: rise .5s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.auth-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 22px; }
.auth-brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.logo {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: 20px; letter-spacing: -.03em; background: var(--brand-grad);
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .95), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.auth-note {
  background: #fff5f5; color: #991b1b; border: 1px solid #fbd5d5; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 12px; font-weight: 600;
}
.auth-form { display: grid; gap: 13px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.demo { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 9px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.auth-side { display: none; max-width: 430px; animation: rise .6s .08s cubic-bezier(.22, .8, .3, 1) both; }
.feature {
  display: flex; gap: 13px; padding: 13px 15px; border-radius: var(--radius); margin-bottom: 10px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
}
.feature b { display: block; font-size: 14.5px; }
.feature p { color: #b8c3e0; font-size: 13px; margin-top: 2px; }
.feature-ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .12); color: #dbe4ff;
}
.auth-title { font-size: 30px; line-height: 1.18; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-lede { color: #aab6d4; font-size: 14.5px; margin-bottom: 20px; max-width: 38ch; }

/* ------------------------------------------------------------------- каркас */

.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar {
  display: none; align-content: start; gap: 2px; padding: 18px 12px calc(16px + var(--safe-bottom));
  background:
    radial-gradient(520px 260px at 20% -8%, rgba(99, 102, 241, .34) 0%, transparent 62%),
    linear-gradient(180deg, #0a1020 0%, #0d1526 60%, #0a1020 100%);
  color: #cbd5e1; overflow-y: auto;
}
/* на телефоне боковое меню прячется за бургер и выезжает слева */
body.nav-open .sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; display: grid; width: min(300px, 86vw);
  box-shadow: 26px 0 64px -30px rgba(4, 9, 20, .75); animation: drawer-in .2s ease-out;
}
body.nav-open::after {
  content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(9, 14, 26, .52); animation: fade-in .2s;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; color: #fff; padding: 0 4px; }
.brand b { font-size: 15.5px; letter-spacing: -.02em; }
.brand span { font-size: 11.5px; color: #8fa0c0; display: block; margin-top: 1px; }
.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-weight: 600;
  color: #a8b6d0; width: 100%; text-align: left; transition: .15s; position: relative; font-size: 14.5px;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.on { background: linear-gradient(120deg, rgba(99, 102, 241, .28), rgba(124, 92, 245, .16)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.nav-item.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(#8b93ff, #6366f1); }
.nav-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .07); color: #c3cdf0;
}
.nav-item.on .nav-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.badge { margin-left: auto; background: rgba(255, 255, 255, .18); border-radius: 999px; font-size: 11px; padding: 1px 8px; font-weight: 700; color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.side-foot b { color: #fff; font-size: 13.5px; display: block; }
.side-foot span { color: #8fa0c0; font-size: 12px; }
.side-foot .link { color: #d5def5; justify-self: start; font-weight: 650; border-radius: 10px; }
.side-foot .link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@keyframes drawer-in { from { transform: translateX(-102%); } }
@keyframes fade-in { from { opacity: 0; } }
.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px; min-height: 58px;
  background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-title { font-size: 16.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; gap: 8px; align-items: center; }
.burger { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.bell-count {
  position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 10.5px; padding: 1px 5px; font-weight: 700; border: 2px solid #fff; min-width: 18px; text-align: center;
}
main { flex: 1; padding: 16px 14px calc(92px + var(--safe-bottom)); max-width: 1280px; width: 100%; margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; gap: 2px;
  padding: 7px 10px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line); box-shadow: 0 -14px 30px -22px rgba(11, 18, 32, .4);
}
.tab {
  position: relative; display: grid; gap: 3px; justify-items: center; padding: 7px 14px; border-radius: 13px;
  color: #8b98ae; font-size: 11px; font-weight: 650; transition: .16s; min-width: 62px;
}
.tab-ico { display: grid; place-items: center; }
.tab.on { color: var(--brand); background: var(--brand-soft); }
.tab-badge {
  position: absolute; top: 3px; right: 9px; background: var(--brand); color: #fff; border-radius: 999px;
  font-size: 10px; padding: 0 5px; min-width: 16px; text-align: center; border: 2px solid #fff;
}

.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; }
.page-head p { font-size: 13.5px; }
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 2px;
  box-shadow: var(--shadow-sm);
}
.seg button { padding: 7px 13px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); transition: .14s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand-soft); color: var(--brand-strong); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .18); }

/* ------------------------------------------------------------------ KPI */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow); transition: transform .14s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--kpi-bar, transparent);
}
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.kpi-value { display: block; font-size: 26px; margin-top: 5px; letter-spacing: -.03em; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 3px; display: block; }
.kpi.accent { --kpi-bar: var(--brand-grad); }
.kpi.accent .kpi-value { color: var(--brand-strong); }
.kpi.ok { --kpi-bar: linear-gradient(90deg, #12a35b, #34d399); }
.kpi.ok .kpi-value { color: #0f8a4d; }
.kpi.warn { --kpi-bar: linear-gradient(90deg, #e8930c, #f6c34b); }
.kpi.warn .kpi-value { color: #b45309; }
.kpi.danger { --kpi-bar: linear-gradient(90deg, #dc2626, #f87171); }
.kpi.danger .kpi-value { color: var(--danger); }

/* ------------------------------------------------------------------ панели */

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fbfcff, #f7f9fd);
}
.panel-head h2 { font-size: 14.5px; letter-spacing: -.015em; display: flex; align-items: center; gap: 9px; }
.panel-head > div { flex: 1; min-width: 0; }
.panel-head > div span { display: block; margin-top: 2px; }
.panel-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); flex: none; }
.panel-head > .muted { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
/* тело панели: текст и поля не должны липнуть к рамке */
.panel-body { display: grid; gap: 12px; padding: 15px 16px 16px; }
.panel-body > .about { padding: 0; }
.panel-body > .simple-list, .panel-body > .staff-list { margin: -15px -16px -16px; }
.dash-body { display: grid; gap: 16px; }
.dash-cols { display: grid; gap: 16px; }

/* ------------------------------------------------------------ таймер-карта */

.timer-card {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.timer-card.running {
  background: linear-gradient(120deg, #131f3f 0%, #3b34a8 60%, #5b46e0 100%); color: #fff; border: 0;
  box-shadow: 0 18px 34px -20px rgba(79, 70, 229, .9); position: relative; overflow: hidden;
}
.timer-card.running::before {
  content: ""; position: absolute; inset: -40% 55% -40% -10%; background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent);
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translateX(120%) scale(1.15); } }
.timer-card.idle { background: var(--surface); border: 1px dashed #cfd8ea; box-shadow: none; }
.timer-card.idle .timer-clock { color: #c3ccdd; }
.timer-copy { flex: 1; min-width: 0; position: relative; }
.timer-copy b { display: block; font-size: 12.5px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.timer-copy span { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.timer-clock { font-variant-numeric: tabular-nums; font-size: 23px; font-weight: 750; letter-spacing: -.01em; position: relative; }
.timer-right { display: flex; align-items: center; gap: 10px; position: relative; }
.timer-right .live-timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 750; }
button.stop {
  background: rgba(255, 255, 255, .18); color: #fff; border-radius: 11px; padding: 9px 14px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(4px);
}
button.stop:hover { background: rgba(255, 255, 255, .28); }
.task-link { text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ------------------------------------------------------------------- списки */

.task-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.task-row {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 12px 16px;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .16s, border-color .16s;
}
.task-row::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--rail, #d7deea);
}
.task-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: #d8dfec; }
.task-row.is-done { background: var(--surface-2); }
.task-row.is-done .task-title { color: var(--muted); }
.task-row.is-overdue { --rail: var(--danger); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(11, 18, 32, .04); }
.task-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.task-title { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.012em; }
.task-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-sub .dur { white-space: nowrap; }
.task-side { display: flex; align-items: center; gap: 8px; flex: none; }
.live-timer { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 750; color: var(--brand); }
.camera { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.due.danger { color: var(--danger); font-weight: 700; }
.due.warn { color: #b45309; font-weight: 650; }
.assignee { font-weight: 650; color: var(--ink-2); }
.project-tag { font-weight: 650; }

/* ----------------------------------------- пауза, повтор, массовый выбор */

.task-row.is-blocked { background: var(--blocked-bg); border-color: #f6d7de; }
.blk { display: inline-flex; align-items: center; gap: 4px; color: var(--blocked); font-weight: 700; white-space: nowrap; }
.blk .icon { width: 13px; height: 13px; }
.repeat { display: inline-flex; color: var(--muted); }
.pick-box {
  width: 21px; height: 21px; border-radius: 7px; border: 1.5px solid #c7d0e2; background: #fff; flex: none;
  display: grid; place-items: center; color: transparent; transition: background .14s, border-color .14s, color .14s;
}
.pick-box .icon { width: 14px; height: 14px; }
.pick-box.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bulk-bar { position: sticky; top: 6px; z-index: 5; margin-bottom: 10px; }
.bulk-inner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 9px 11px; box-shadow: var(--shadow-lg);
}
.bulk-inner > b { font-size: 15px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.bulk-inner .input { width: auto; padding: 7px 9px; font-size: 13px; border-radius: 9px; min-width: 128px; }
.blocked-note {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px;
  background: var(--blocked-bg); border: 1px solid #f6d7de;
}
.blocked-note > .icon { color: var(--blocked); flex: none; }
.blocked-note div { display: grid; gap: 2px; min-width: 0; }
.rec-row { display: flex; align-items: center; gap: 8px; }
.rec-row .input { width: auto; min-width: 168px; }

/* ------------------------------------------------- сворачиваемые секции */

.sec {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.sec-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
  text-align: left; transition: background .15s;
}
.sec-head:hover { background: var(--surface-2); }
.sec-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--ink-2);
}
.sec-title { font-size: 14px; font-weight: 700; letter-spacing: -.012em; white-space: nowrap; }
.sec-count {
  font-size: 12px; font-weight: 750; color: var(--ink-2); background: var(--surface-3);
  border-radius: 999px; padding: 2px 9px; min-width: 24px; text-align: center; flex: none;
}
.sec-count.glow { background: var(--brand); color: #fff; --glow: rgba(79, 70, 229, .5); animation: sec-glow 2.4s ease-out infinite; }
.sec-hint {
  flex: 1; min-width: 0; text-align: right; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none;
}
.sec.collapsed .sec-hint { display: block; }
.sec-chev { flex: none; display: grid; place-items: center; color: var(--muted); margin-left: auto; transition: transform .22s ease; }
.sec.collapsed .sec-chev { transform: rotate(-90deg); }
.sec-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .24s ease; }
.sec.collapsed .sec-wrap { grid-template-rows: 0fr; }
.sec-body { min-height: 0; overflow: hidden; display: grid; gap: 8px; padding: 2px 12px 12px; transition: padding .24s ease; }
.sec.collapsed .sec-body { padding-top: 0; padding-bottom: 0; }
.sec-body .task-row { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.sec-body .task-row:hover { background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
/* статус уже написан в заголовке секции — повторяющая плашка в строках не нужна */
.sec-body .task-side .pill { display: none; }
.sec.accent .sec-ico { background: var(--brand-soft); color: var(--brand); }
.sec.warn .sec-ico { background: #fff4e2; color: #b45309; }
.sec.danger .sec-ico { background: #fdeaea; color: var(--danger); }
.sec.ok .sec-ico { background: #e6f7ee; color: var(--ok); }
.sec.accent .sec-title { color: var(--brand-strong); }
.sec.warn .sec-title { color: #b45309; }
.sec.danger .sec-title { color: var(--danger); }
.sec.ok .sec-title { color: #0f8a4d; }
.sec.warn .sec-count.glow { background: var(--warn); --glow: rgba(232, 147, 12, .55); }
.sec.danger .sec-count.glow { background: var(--danger); --glow: rgba(220, 38, 38, .5); }
.section-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sec-block-title {
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750;
  color: var(--ink-2); margin-top: 6px; letter-spacing: -.015em;
}
.sec-block-title .icon { color: var(--muted); }
.my-cabinet { gap: 12px; }
@keyframes sec-glow {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 9px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sec-count.glow { animation: none; }
  .sec-wrap, .sec-body, .sec-chev { transition: none; }
}

.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: 999px;
  white-space: nowrap; padding: 3px 9px; color: var(--pill); letter-spacing: -.005em;
  background: color-mix(in srgb, var(--pill) 12%, white);
  border: 1px solid color-mix(in srgb, var(--pill) 26%, white);
}
.pill .icon { width: 12px; height: 12px; stroke-width: 2.2; }

.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; flex: 1 1 140px; min-width: 120px; }
.filters .search { flex: 1 1 100%; min-width: 0; padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%238b98ae' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px 50%; }
.switch {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600;
  padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #d7deea; position: relative; transition: .18s; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .18s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(14px); }

.fab-row { display: flex; justify-content: center; margin-top: 6px; }
.fab {
  background: var(--brand-grad); color: #fff; border-radius: 999px; padding: 13px 22px; font-weight: 700;
  box-shadow: 0 16px 30px -14px rgba(79, 70, 229, .95); display: inline-flex; align-items: center; gap: 8px;
}
.fab:hover { filter: brightness(1.06); }

/* --------------------------------------------------------------- человек */

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .06); }
.avatar.initials { display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: -.02em; }
.avatar.big { width: 92px !important; height: 92px !important; border-radius: 24px; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow); display: grid; gap: 12px; transition: transform .14s, box-shadow .18s, border-color .18s;
}
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d8dfec; }
.pc-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pc-name { min-width: 0; }
.pc-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name span { font-size: 12.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-status { min-height: 22px; }
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.pc-stat { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 3px; }
.pc-stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.pc-stat span { font-size: 11px; color: var(--muted); white-space: nowrap; }

.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- таблицы */

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
td { padding: 11px 14px; border-top: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover, tr:hover td { background: #f8faff; }
table tr { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.running { color: var(--brand); font-weight: 700; }
table th:last-child, table td:last-child { text-align: right; }
.log-table { font-size: 13px; }
/* в узкой колонке дашборда таблица людей должна влезать без прокрутки */
.people-table { font-size: 13px; }
.people-table th, .people-table td { padding: 9px 10px; }

/* ------------------------------------------------------------------ табель */

.timesheet .page-head { align-items: center; }
.ts-body { display: grid; gap: 16px; }
.ts-week-label { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
button.icon-round { width: 38px; height: 38px; padding: 0; flex: none; }
button.icon-round .flip { display: block; transform: rotate(180deg); }

.ts-summary { display: grid; gap: 12px; padding: 14px 16px; }
.ts-top { display: flex; align-items: center; gap: 12px; }
.ts-top .pill { flex: none; }
.ts-meter { flex: 1; height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ts-meter i { display: block; height: 100%; border-radius: 999px; background: var(--meter, var(--brand)); transition: width .3s ease; }
.ts-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 10px; align-items: center; }
.ts-figure b { display: block; font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ts-figure span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.ts-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.ts-note { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; padding: 8px 12px; border-radius: var(--radius-sm); }
.ts-note.warn { background: #fff4e2; color: #b45309; }
.ts-note.ok { background: #e6f7ee; color: #0f8a4d; }

.ts-card { padding: 0; }
.ts-scroll { overflow-x: auto; }
.ts-table { min-width: 620px; font-size: 12.5px; }
.ts-table th, .ts-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line-2); }
.ts-table thead th { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ts-table .ts-task, .ts-table th.ts-task {
  position: sticky; left: 0; z-index: 1; text-align: left; min-width: 180px; max-width: 240px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.ts-table thead .ts-task { background: var(--surface-2); }
.ts-table td.ts-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-plan { width: 56px; color: var(--muted); }
.ts-total { width: 68px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-day b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ts-day span { display: block; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ts-day em { display: block; font-style: normal; font-size: 10px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.ts-day.off { background: var(--surface-3); }
.ts-day.absent em { color: var(--warn); font-weight: 700; }
.ts-cell { font-variant-numeric: tabular-nums; }
.ts-cell.blank { color: #c3ccdd; }
.ts-cell-btn { min-width: 42px; padding: 4px 6px; border-radius: 8px; font-weight: 650; color: var(--brand-strong); transition: background .14s; }
.ts-cell-btn:hover { background: var(--brand-soft); }
.ts-link { font-weight: 600; text-align: left; color: var(--ink); text-decoration: none; }
.ts-link:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.ts-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: none; }
.ts-foot td { background: var(--surface-2); font-weight: 700; color: var(--ink-2); border-top: 1px solid var(--line); }
.ts-foot .ts-task { background: var(--surface-2); }

.ts-logrow, .ts-abs { padding: 10px 0; border-top: 1px solid var(--line-2); align-items: flex-start; }
.ts-logrow:first-child, .ts-abs:first-child { border-top: 0; }
.ts-daybox { display: grid; gap: 12px; }
.ts-form { display: grid; gap: 12px; }
.ts-quick { display: flex; flex-wrap: wrap; gap: 7px; }
.ts-audit { display: grid; gap: 2px; }
.ts-audit-row { padding: 7px 0; border-top: 1px dashed var(--line-2); font-size: 12.5px; gap: 12px; }
.ts-audit-row:first-child { border-top: 0; }
.ts-person .pc-stats { grid-template-columns: repeat(3, 1fr); }
.ts-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ts-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); }
.ts-export { flex-wrap: wrap; padding: 2px 2px 0; }
.calendar-add { flex-wrap: wrap; }
.calendar-add .input { flex: 1 1 130px; width: auto; }

/* ------------------------------------------------------------------- графики */

.chart-bars {
  display: flex; align-items: flex-end; gap: 6px; padding: 16px 16px 0; position: relative; overflow-x: auto;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 100% 25%; background-position: 0 12px; background-repeat: repeat-y;
}
.bar-col { flex: 1 1 26px; min-width: 26px; display: grid; justify-items: center; gap: 5px; align-content: end; }
.bar {
  width: 100%; max-width: 34px; border-radius: 7px 7px 4px 4px; min-height: 3px;
  background: linear-gradient(180deg, #6d72f4, #4f46e5); box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .8);
  transition: filter .15s;
}
.bar-col:hover .bar { filter: brightness(1.12) saturate(1.1); }
.bar-value { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-label { font-size: 10.5px; color: #93a0b6; white-space: nowrap; }
.baseline { display: none; }

.donut-wrap { display: flex; gap: 18px; align-items: center; padding: 16px; flex-wrap: wrap; }
.donut-total { font-size: 27px; font-weight: 750; fill: var(--ink); letter-spacing: -.03em; }
.donut-caption { font-size: 11px; fill: var(--muted); letter-spacing: .04em; }
.donut-track { fill: none; stroke: var(--line-2); }
.legend { display: grid; gap: 7px; flex: 1; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-row span { flex: 1; color: var(--muted); }
.legend-row b { font-variant-numeric: tabular-nums; }

.hbars { display: grid; gap: 11px; padding: 16px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 11px; align-items: center; font-size: 13px; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar-track { background: var(--surface-3); border-radius: 999px; height: 10px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .08); }
.hbar-value { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.now-list { display: grid; }
.now-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); text-align: left; width: 100%; transition: background .14s; }
.now-row:hover { background: #f8faff; }
.now-copy { flex: 1; min-width: 0; }
.now-copy span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.feed { display: grid; }
.feed-row { display: flex; gap: 11px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line-2); text-align: left; width: 100%; transition: background .14s; }
.feed-row:hover { background: #f8faff; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; box-shadow: 0 0 0 3px rgba(11, 18, 32, .04); }
.feed-task { font-weight: 650; }
.feed-row span:last-child { margin-left: auto; white-space: nowrap; }

/* ------------------------------------------------------------- шторка/модал */

.sheet-wrap {
  position: fixed; inset: 0; background: rgba(8, 12, 24, .48); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; z-index: 50; padding: 0;
}
.sheet-wrap.open { opacity: 1; }
.sheet {
  background: var(--canvas); width: min(780px, 100%); max-height: 94vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; flex-direction: column; transform: translateY(18px); transition: transform .22s cubic-bezier(.22, .8, .3, 1);
  box-shadow: 0 -20px 60px -24px rgba(8, 12, 24, .5); border: 1px solid var(--line);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 42px; height: 4px; border-radius: 999px; background: #d3dae8; margin: 8px auto 0; flex: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); z-index: 2;
}
.sheet-head h2 { font-size: 15px; color: var(--ink); }
.sheet-body { padding: 16px 14px calc(22px + var(--safe-bottom)); overflow: auto; display: grid; gap: 15px; grid-template-columns: minmax(0, 1fr); }

.task-detail { display: grid; gap: 14px; min-width: 0; }
.td-head { display: grid; gap: 4px; }
.td-title { font-size: 20px; line-height: 1.25; }
.td-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.td-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; }
.meta-cell span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.meta-value { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13.5px; margin-top: 3px; min-width: 0; }
.td-desc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; color: var(--ink-2); white-space: pre-wrap; }
.timer-block, .report-block, .decide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 11px; }
.timer-block { background: linear-gradient(180deg, #fbfcff, #f6f8fe); }
.timer-block-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timer-block .live-timer { font-size: 21px; }
.progress { height: 9px; background: var(--surface-3); border-radius: 999px; overflow: visible; position: relative; }
.progress i { display: block; height: 100%; border-radius: 999px; box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .08); }
.progress-label { position: absolute; right: 0; top: 12px; font-size: 11.5px; color: var(--muted); }
.td-section { display: grid; gap: 10px; min-width: 0; }
.td-section h3 { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; display: grid; gap: 10px; }
.report-text { white-space: pre-wrap; color: var(--ink-2); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.photo-tile, .thumb { border-radius: 12px; overflow: hidden; background: var(--surface-3); aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.photo-tile img, .thumb { width: 100%; height: 100%; object-fit: cover; }
.photo-tile:hover { border-color: var(--brand); }
.photo-view img { width: 100%; border-radius: var(--radius); max-height: 66vh; object-fit: contain; background: #080e1d; }
.danger-row { border-top: 1px dashed var(--line); padding-top: 10px; }

/* ------------------------------------------------------------------- формы */

.field { display: grid; gap: 6px; min-width: 0; }
.field-label, .field > span:first-child { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field-hint { font-size: 11.5px; color: #93a0b6; }
.input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; outline: none; transition: border-color .14s, box-shadow .14s, background .14s;
}
.input::placeholder { color: #9aa6bb; }
.input:hover { border-color: #d5dcea; }
.input:focus { border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
select.input {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a94' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=color].input { height: 44px; padding: 4px; }
.grid-2 { display: grid; gap: 11px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.task-form, .staff-form, .confirm { display: grid; gap: 13px; }
.confirm p { font-size: 15px; color: var(--ink-2); }
.staff-form > .staff-photo-row, .profile-photo { display: flex; align-items: center; gap: 13px; }
.profile-grid { display: grid; gap: 16px; }
.profile-fields { display: grid; gap: 11px; }

.empty {
  text-align: center; padding: 40px 18px; color: var(--muted); background: var(--surface);
  border: 1px dashed #cfd8ea; border-radius: var(--radius);
}
.empty-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto; background: var(--surface-3); color: #8b98ae; }
.empty h3 { margin: 11px 0 5px; color: var(--ink); font-size: 15.5px; }
.loading { display: grid; place-items: center; gap: 11px; padding: 34px; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid #dde3f0; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.simple-list { display: grid; }
.simple-row, .staff-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.simple-row:first-child, .staff-row:first-child { border-top: 0; }
.simple-row:hover, .staff-row:hover { background: #f8faff; }
.staff-copy { flex: 1; min-width: 0; }
.staff-copy span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings > .panel { padding-bottom: 6px; }
.about { padding: 14px 16px; display: grid; gap: 11px; color: var(--ink-2); font-size: 13.5px; }

/* ------------------------------------------------------- теги и бюджеты */

.tg-dots { display: inline-flex; align-items: center; gap: 3px; flex: none; color: #a7b2c6; }
.tg-dots .icon { width: 13px; height: 13px; margin-right: 1px; }
.tg-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  background: var(--surface-3); border: 1px solid transparent; border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 650; color: var(--ink-2); transition: background .15s, border-color .15s, color .15s;
}
.tag-chip:hover { background: #e6ebf6; }
.tag-chip.on {
  background: color-mix(in srgb, var(--tag) 14%, white);
  border-color: color-mix(in srgb, var(--tag) 55%, white);
  color: color-mix(in srgb, var(--tag) 78%, #0b1220);
}
.tag-block {
  display: grid; gap: 10px; padding: 13px 15px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tag-block-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tag-block-top .icon { color: var(--muted); }
.tag-copy { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag-add { flex-wrap: wrap; margin-top: 4px; }
.tag-add .input[type="text"] { flex: 1 1 150px; }
.tag-add input[type="color"] { flex: none; width: 48px; padding: 4px; }

.project-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
.project-spend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12.5px; color: var(--muted); }
.project-spend-sheet {
  display: grid; gap: 10px; margin: 6px 0 16px; padding: 13px 15px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.spend-total { font-size: 13.5px; color: var(--ink-2); }
.spend-people, .cost-people { display: grid; gap: 7px; }
.spend-person { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.spend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 9px; }
.cost-figure { display: grid; gap: 2px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cost-figure b { font-size: 17px; letter-spacing: -.025em; }
.cost-figure span { font-size: 11.5px; color: var(--muted); }
.cost-table { display: grid; margin-top: 12px; }
.cost-head, .cost-row {
  display: grid; grid-template-columns: minmax(0, 1.7fr) .7fr .9fr 1.1fr; gap: 9px; align-items: center;
  padding: 8px 0; font-size: 13px;
}
.cost-head { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cost-row + .cost-row { border-top: 1px solid var(--line-2); }
.cost-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-filter { flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; margin: 0 0 14px; }
.cost-filter .field { flex: 0 1 168px; }
.cost-filter .input { padding: 9px 11px; font-size: 13.5px; }
.cost-people { margin-top: 14px; }

/* ------------------------------------------------------------------ тосты */

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 12px);
  background: #101a2e; color: #fff; padding: 12px 17px; border-radius: 13px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: .22s cubic-bezier(.22, .8, .3, 1); z-index: 90;
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .08); max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: linear-gradient(180deg, #c02626, #991b1b); }
.toast.warn { background: linear-gradient(180deg, #b45309, #92400e); }
.toast.info { background: linear-gradient(180deg, #17243c, #0f1a2e); }

.boot-splash {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 15px; color: #fff;
  background: linear-gradient(165deg, #080e1d 0%, #131f3f 46%, #241f52 100%);
}
.boot-title { font-weight: 750; letter-spacing: -.02em; font-size: 17px; }
.boot-splash .spinner { border-color: rgba(255, 255, 255, .22); border-top-color: #fff; }
.boot-help {
  min-height: 100vh; display: grid; place-content: center; padding: 22px; color: #fff;
  background: linear-gradient(165deg, #080e1d 0%, #131f3f 46%, #241f52 100%);
}
.boot-help-card {
  max-width: 460px; background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: var(--radius-lg);
  padding: 22px; display: grid; gap: 12px; box-shadow: 0 40px 90px -34px rgba(0, 0, 0, .8);
}
.boot-help-card h2 { font-size: 18px; }
.boot-help-card p { color: var(--ink-2); font-size: 14px; }
.boot-help-card .row { gap: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------- десктоп */

@media (min-width: 860px) {
  .app { grid-template-columns: 256px 1fr; }
  .sidebar, body.nav-open .sidebar {
    display: grid; position: sticky; inset: auto; top: 0; height: 100vh; width: auto;
    padding: 20px 14px; border-right: 1px solid rgba(255, 255, 255, .06); box-shadow: none; animation: none;
  }
  body.nav-open::after { content: none; }
  .nav-item.on::before { left: -14px; }
  .tabbar { display: none; }
  .burger { display: none; }
  .topbar { padding: 12px 24px; min-height: 64px; background: rgba(255, 255, 255, .72); }
  main { padding: 24px 24px 44px; }
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi-value { font-size: 24px; }
  .dash-cols { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .sheet-wrap { align-items: center; padding: 26px; }
  .sheet { border-radius: var(--radius-lg); max-height: 88vh; transform: translateY(10px) scale(.99); }
  .sheet-grab { display: none; }
  .toast { bottom: 30px; }
  .sidebar-mobile-only { display: none; }
  .page-head h1 { font-size: 25px; }
}

@media (min-width: 980px) {
  .auth { grid-template-columns: minmax(0, 430px) minmax(0, 430px); justify-content: center; align-items: center; gap: 56px; }
  .auth-side { display: block; }
}

@media (max-width: 420px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 21px; }
  .td-meta { grid-template-columns: 1fr 1fr; }
  .task-sub { white-space: normal; line-height: 1.4; }
  .sec-body .task-title { white-space: normal; line-height: 1.28; }
  .task-side { gap: 6px; }
  .task-side .pill { padding: 3px 7px; }
  .tab { min-width: 56px; padding: 7px 8px; }
  .timer-card.idle { flex-direction: column; align-items: flex-start; gap: 8px; }
  .timer-card.idle .timer-clock { display: none; }
  .timer-copy span { white-space: normal; }
  .ts-table .ts-task, .ts-table th.ts-task { min-width: 132px; }
  .ts-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts-actions { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------------- печать */

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff !important; color: #0b1220 !important; }
  .sidebar, .topbar, .tabbar, .sheet-wrap, .toast, .ts-export, .ts-actions, .ts-audit { display: none !important; }
  button.primary, button.ghost, button.link, button.link-danger, button.icon-btn, button.icon-round, button.burger, button.nav-item, button.tab, a.ghost { display: none !important; }
  .app, .main-col { display: block !important; }
  main { padding: 0 !important; overflow: visible !important; }
  .panel, .ts-card { break-inside: avoid; box-shadow: none !important; border: 1px solid #c9d2e3 !important; background: #fff !important; }
  .ts-scroll { overflow: visible !important; }
  .ts-table { font-size: 11px; }
  /* кнопки-ячейки остаются в печати, но выглядят как текст таблицы */
  .ts-cell-btn, .ts-link { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; color: #0b1220 !important; font-weight: inherit; }
  .ts-add { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
