/* ==========================================================================
   Тема кабинета: белый и серый, один синий акцент. Последний слой поверх app.css и mobile.css.

   Палитра — прежней CRM (белый и серый slate, тёмное меню, синий акцент):
   тёплую «брендовую» от 28.09 вернули обратно по просьбе владельца. От
   редизайна остались шрифт, отступы, спокойные таблицы и формы. Здесь
   только оформление: разметка и классы прежние, JS не трогаем.
   ========================================================================== */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  /* вторичный текст: ≥4.5:1 на белом (прежний #94a3b8 давал 2.6:1 и не читался) */
  --faint: #687589;
  --placeholder: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --brown: #0f172a;
  --gold: #2563eb;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eff6ff;
  --accent: #2563eb;
  --nav-bg: #0f172a;
  --nav-ink: #cbd5e1;
  --nav-muted: #64748b;
  --ok: #15803d;
  --ok-50: #ecfdf3;
  --bad: #dc2626;
  --bad-50: #fef2f2;
  --warn: #b45309;
  --warn-50: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  /* Шрифт: шкала размеров (docs/design-system.md). Новые правила — только через неё. */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  /* Отступы: шаг 4 px. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
}

/* Имена и тексты на любом языке: направление строки — по первым буквам
   (арабское или ивритское имя не переворачивает соседние цифры и знаки). */
input, textarea, td, .cell-text { unicode-bidi: plaintext; }

body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
/* Цифры одной ширины: в таблицах и KPI столбцы не «пляшут». */
table, .kpi-n, .card .n, .sched-kpi b, .focus-tile b, .pct, td.pfc b { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { letter-spacing: -.01em; }
b, strong { font-weight: 600; }

/* ---- формы и кнопки ----------------------------------------------------- */
input, select, textarea {
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
label { color: var(--muted); font-weight: 500; }
button, .btn {
  background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: 9px;
  font-weight: 500; letter-spacing: .005em; transition: background .15s, border-color .15s, color .15s;
}
button:hover { background: var(--primary-600); }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button.secondary {
  background: #fff; color: var(--ink-2); border: 1px solid var(--line-2);
}
button.secondary:hover { background: #f8fafc; border-color: #94a3b8; color: var(--ink); }
button.danger, .btn-danger { background: #fff; color: var(--bad); border: 1px solid #fecaca; }
button.danger:hover, .btn-danger:hover { background: var(--bad-50); }
.err { color: var(--bad); }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }

/* ---- вход --------------------------------------------------------------- */
.login-wrap {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(37, 99, 235, .22), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(37, 99, 235, .18), transparent 60%),
    var(--nav-bg);
}
.login-card {
  border: 1px solid rgba(255, 255, 255, .06); border-radius: 16px; padding: 2rem 2rem 1.6rem;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.45rem; font-weight: 700; color: var(--ink); }
.login-card p { color: var(--muted); }
.login-card button { padding: .75rem; font-weight: 600; }

/* ---- боковое меню ------------------------------------------------------- */
.side {
  background: var(--nav-bg); color: var(--nav-ink); padding: 1rem .7rem;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.side .logo { color: #fff; font-weight: 600; font-size: .98rem; padding: .35rem .5rem 1.25rem; }
.side .logo small { color: var(--nav-muted); font-weight: 400; font-size: .74rem; margin-top: 2px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; font-weight: 700; font-size: .82rem;
  background: #2563eb; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.side button {
  color: var(--nav-ink); font-weight: 500; font-size: .88rem; border-radius: 8px;
  padding: .52rem .65rem; border: 0;
}
.side button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-head { display: flex; align-items: center; gap: .6rem; font-weight: 500 !important; color: #e2e8f0 !important; }
.nav-ico {
  width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center;
  color: var(--nav-muted); font-size: 0;
}
.nav-ico svg, .nav-caret svg { width: 100%; height: 100%; }
.nav-caret { width: 14px; height: 14px; margin-left: auto; color: var(--nav-muted); font-size: 0; }
.nav-group.current > .nav-head .nav-ico { color: var(--gold); }
.nav-items { margin: .1rem 0 .45rem; padding-left: 1.55rem; position: relative; }
.nav-items::before {
  content: ""; position: absolute; left: .95rem; top: .2rem; bottom: .2rem; width: 1px;
  background: rgba(255, 255, 255, .07);
}
.nav-items button { color: var(--nav-ink); font-size: .85rem; padding: .42rem .65rem; }
.side button.active, .nav-items button.active {
  background: rgba(255, 255, 255, .10); color: #ffffff; font-weight: 500;
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav-group.single.current > .nav-head { background: rgba(255, 255, 255, .10); box-shadow: inset 2px 0 0 var(--gold); }
.side .logout {
  color: var(--nav-muted); border: 1px solid rgba(255, 255, 255, .07); background: transparent;
  font-size: .85rem;
}
.side .logout:hover { color: #fff; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .03); }

/* ---- поверхности -------------------------------------------------------- */
.card, .panel, .kpi, .sched-kpi, .focus-tile, .ready-box, .today-box, .pick, .q-card, .emp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 1rem 1.1rem; }
.panel-h { border-bottom: 1px solid var(--line); }
.panel-h h3 { font-weight: 600; font-size: .98rem; color: var(--ink); }
.modal, .drawer {
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.modal-bg, .drawer-bg { background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
.modal h3, .modal h4 { color: var(--ink); font-weight: 600; }

/* KPI: крупная цифра, спокойная подпись. */
.kpi-t, .card .t, .sched-kpi span, .focus-tile span {
  color: var(--muted) !important; font-size: .72rem !important; font-weight: 500 !important;
  letter-spacing: .05em; text-transform: uppercase;
}
.kpi-n, .card .n { font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.kpi-s { color: var(--muted); }
.sched-kpi { padding: .7rem 1rem; min-width: 128px; }
.sched-kpi b { font-size: 1.25rem; font-weight: 650; }
.bar { background: #e2e8f0; border-radius: 99px; }
.bar span { border-radius: 99px; }

/* ---- таблицы ------------------------------------------------------------ */
table {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
th {
  background: #f8fafc !important; color: var(--muted) !important; font-weight: 500 !important;
  font-size: .72rem; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--line) !important;
}
td { border-bottom: 1px solid #eef2f6; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
.click-row:hover td, tr.run-row:hover { background: #f8fafc !important; }
.table-scroll, .sched-wrap, .mx-wrap { border-radius: var(--radius); }

/* План/факт: пустые ячейки не «кричат» розовым на весь экран — нулевой
   прогресс утром это норма, а не авария. Цвет несёт только цифра. */
td.pfc.none { background: #fbfcfe !important; }
td.pfc.none b { color: var(--bad); }
td.pfc.partial { background: var(--warn-50) !important; }
td.pfc.done { background: var(--ok-50) !important; }
td.pfc b small { color: var(--faint); font-weight: 400; }

/* ---- сегменты и табы ---------------------------------------------------- */
.seg, .page-seg, .pf-tabs {
  background: #e2e8f0; border: 0 !important; border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button, .page-seg button, .pf-tabs button {
  background: transparent !important; color: var(--muted) !important; border: 0 !important;
  border-radius: 8px !important; font-weight: 500 !important;
}
.seg button.on, .page-seg button.on, .pf-tabs button.on {
  background: #fff !important; color: var(--ink) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .1);
}
.bm-tabs button.on, .dr-tabs button.on { color: var(--primary) !important; border-color: var(--primary) !important; }

/* ---- бейджи и чипы ------------------------------------------------------ */
.tag, .chip, .mini-tag, .badge {
  background: #f1f5f9; color: var(--ink-2); border: 1px solid transparent; font-weight: 500;
}
.badge.ok, .chip-ok { background: var(--ok-50); color: var(--ok); border-color: #bbf7d0; }
.badge.bad { background: var(--bad-50); color: var(--bad); border-color: #fecaca; }
.badge.warn, .chip-warn, .chip-unconfirmed { background: var(--warn-50); color: var(--warn); border-color: #fde68a; }
.badge.muted, .chip-off { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }

/* ---- карточки точек ----------------------------------------------------- */
.bakery-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.bakery-card {
  background: var(--card) !important; color: var(--ink) !important; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.05rem 1.1rem; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s; font-weight: 400;
}
.bakery-card:hover, .bakery-card:focus-visible {
  border-color: #bfdbfe; box-shadow: 0 6px 20px rgba(15, 23, 42, .08); transform: translateY(-1px);
}
.bakery-card-top strong, .bakery-card-top b { font-size: 1rem; font-weight: 600; }
.bakery-card-meta { color: var(--muted); font-weight: 400; font-size: .84rem; }
/* Предупреждение — компактная плашка, а не оранжевый абзац в каждой карточке. */
.bakery-card-meta.warn {
  display: inline-block; margin-top: .45rem; padding: .2rem .55rem; border-radius: 6px;
  background: var(--warn-50); color: var(--warn); font-size: .76rem; font-weight: 500; line-height: 1.35;
}
.bakery-card-displays { margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--line); }
.bakery-card-displays .tag, .bakery-card-displays .chip { font-size: .74rem; padding: .18rem .5rem; }

/* ---- мастер-график ------------------------------------------------------ */
.sched-wrap { border: 1px solid var(--line); box-shadow: var(--shadow); }
.sched-table th, .sched-table td { border-right-color: #eef2f6 !important; border-bottom-color: #eef2f6 !important; }
.sched-table thead th { background: #f8fafc; }
.sched-name { background: #fff; }
.sched-weekend { background: #fffbeb !important; }
.sched-today .sched-dnum { color: var(--primary); }
.sched-sum td, .sched-sum .sched-name { background: #f8fafc !important; }
.sched-hint code { background: #e2e8f0; color: var(--ink-2); }
.sched-table td.sched-absent { background: var(--bad-50) !important; }
.sched-table td.sched-absent .sched-cell { color: var(--bad); font-weight: 600; text-align: center; }

/* ---- прочее ------------------------------------------------------------- */
a, .linklike { color: var(--primary); }
.empty, .pick-empty, .imp-empty { color: var(--muted); }
#topProgress span { background: linear-gradient(90deg, var(--gold), var(--primary)); }
.switch input:checked + span { background: var(--primary); }
::selection { background: rgba(37, 99, 235, .20); }


/* Жирное начертание — только там, где оно что-то значит. В прежней теме
   700–800 стояло на названиях, подписях и заголовках групп одновременно. */
.pf-name, .pf-name .linklike, .mx-name, .emp-cell b, .rank-top b, .pos-item-top b,
.prod-plan-name, .pm-group td, .perm-grp-t, .dr-sec-t, .ready-head, .pe-group-t,
.disp-chip .dc-name, .q-title, .cr-head h3 { font-weight: 600 !important; }
.pf-name .linklike { color: var(--ink); }
.dr-sec-t, .pm-group td { letter-spacing: .05em; font-size: .72rem; color: var(--muted); }

/* ---- общие настройки ---------------------------------------------------- */
.set-group { margin-bottom: 1rem; max-width: 980px; }
.set-group .panel-h { padding: .85rem 1.1rem; }
.set-list { display: flex; flex-direction: column; }
.set-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 1.25rem;
  align-items: center; padding: .85rem 1.1rem; border-top: 1px solid #eef2f6;
}
.set-row:first-child { border-top: 0; }
.set-label b { display: block; font-weight: 500; color: var(--ink); }
.set-label code { font-size: .72rem; color: var(--faint); }
.set-control { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; }
.set-control input, .set-control textarea { margin: 0; }
.set-control .set-num { max-width: 140px; }
.set-control textarea { min-height: 76px; resize: vertical; }
.set-state { font-size: .75rem; color: var(--muted); min-width: 5.5rem; }
.set-state.ok, .set-state.bad { font-weight: 500; }
@media (max-width: 700px) {
  .set-row { grid-template-columns: 1fr; gap: .5rem; }
  .set-control { justify-content: flex-start; }
}

/* Раскладка десктопа. На телефоне (≤768px) каркас задаёт mobile.css:
   фиксированная верхняя панель и нижний таб-бар — их здесь не трогаем. */
@media (min-width: 769px) {
  .shell { grid-template-columns: 256px 1fr; }
  /* ---- верхняя панель ------------------------------------------------------ */
  .main { padding: 0 1.75rem 2.5rem; }
  .topbar {
    position: sticky; top: 0; z-index: 20; margin: 0 -1.75rem 1.4rem; padding: 1rem 1.75rem .95rem;
    background: rgba(241, 245, 249, .88); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .crumb {
    color: var(--faint) !important; font-size: .72rem !important; font-weight: 500 !important;
    letter-spacing: .06em !important; text-transform: uppercase;
  }
  .topbar h2 { font-size: 1.4rem; font-weight: 650; color: var(--ink); margin-top: .1rem; }
  #userMeta {
    color: var(--muted) !important; font-size: .84rem !important; background: #fff;
    border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem;
  }
}
@media (min-width: 769px) and (max-width: 1000px) {
  .main { padding: 0 1rem 2rem; }
  .topbar { margin: 0 -1rem 1rem; padding: .8rem 1rem; }
  #userMeta { display: none; }
}
@media (max-width: 768px) {
  .crumb { display: none; }
  #userMeta { border: 0; background: transparent; padding: 0; }
}

/* ---- выручка и зарплата ------------------------------------------------- */
.pay-bar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.pay-bar-l, .pay-bar-r { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pay-bar select { width: auto; margin: 0; }
.pay-bar .seg { display: inline-flex; }
.pay-bar .seg button { width: auto; padding: .45rem .9rem; }
.pay-upload {
  display: inline-flex; align-items: center; width: auto; padding: .6rem .9rem; border-radius: 9px;
  cursor: pointer; margin: 0; color: #fff; font-weight: 500;
}
.pay-upload:hover { background: var(--primary-600); }
.pay-msg { min-height: 1.3em; font-size: .86rem; margin: 0 0 .4rem; color: var(--muted); }
.pay-msg.ok { color: var(--ok); } .pay-msg.bad { color: var(--bad); }
.pay-hint { font-size: .8rem; color: var(--muted); margin: .6rem 0; line-height: 1.5; max-width: 900px; }
.pay-empty { color: var(--muted); padding: 1.2rem; text-align: center; }
.pay-warn {
  background: var(--warn-50); color: var(--warn); border: 1px solid #fde68a; border-radius: 10px;
  padding: .6rem .8rem; font-size: .85rem; margin-bottom: .75rem;
}
.pay-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.pay-kpi { padding: .9rem 1rem; }
.pay-kpi .kpi-n { font-size: 1.45rem; margin: .2rem 0 .1rem; }
.pay-kpi .kpi-s { font-size: .78rem; }
.pay-kpi.good .kpi-n { color: var(--ok); } .pay-kpi.low .kpi-n { color: var(--bad); } .pay-kpi.mid .kpi-n { color: var(--warn); }
.pay-table { font-size: .84rem; }
.pay-table td, .pay-table th { white-space: nowrap; vertical-align: middle; padding: .55rem .6rem; }
.pay-table .num { text-align: right; }
.pay-table tfoot td { background: #f8fafc; border-top: 1px solid var(--line); }
.pay-sub { display: block; color: var(--muted); font-size: .75rem; }
.pay-table .badge { margin-right: .25rem; }
.pay-pill { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-weight: 500; font-size: .82rem; }
.pay-pill.good { background: var(--ok-50); color: var(--ok); }
.pay-pill.mid { background: var(--warn-50); color: var(--warn); }
.pay-pill.low { background: var(--bad-50); color: var(--bad); }

.rev-wrap {
  overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
}
.rev-table { border: 0; box-shadow: none; border-radius: 0; width: max-content; font-size: .8rem; }
.rev-table th, .rev-table td { padding: 0; border-right: 1px solid #eef2f6; border-bottom: 1px solid #eef2f6; }
.rev-table thead th { padding: .35rem .2rem; text-align: center; text-transform: none; letter-spacing: 0; }
.rev-table thead th b { display: block; color: var(--ink); font-size: .82rem; font-weight: 600; }
.rev-table thead th small { color: var(--faint); font-size: .66rem; }
.rev-table th.rev-we, .rev-table td.rev-we { background: #fffbeb !important; }
.rev-table th.rev-today b { color: var(--primary); }
.rev-name {
  position: sticky; left: 0; z-index: 2; background: #fff; min-width: 170px; max-width: 220px;
  padding: .45rem .7rem !important; font-weight: 500; color: var(--ink); text-align: left;
  box-shadow: 1px 0 0 var(--line);
}
.rev-table thead .rev-name { z-index: 4; background: #f8fafc !important; }
.rev-total {
  position: sticky; right: 0; background: #f8fafc !important; min-width: 100px;
  padding: .45rem .6rem !important; text-align: right; font-weight: 600; color: var(--ink);
  box-shadow: -1px 0 0 var(--line);
}
.rev-c { width: 84px; min-width: 84px; text-align: right; }
.rev-in {
  width: 84px; min-width: 0; margin: 0; border: 0; border-radius: 0; background: transparent; padding: .45rem .45rem;
  text-align: right; font-size: .8rem; font-variant-numeric: tabular-nums; box-shadow: none;
}
.rev-in:hover { background: #f8fafc; }
.rev-in:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
.rev-in.bad { box-shadow: inset 0 0 0 2px var(--bad); }
.rev-in.saved { background: var(--ok-50); transition: background .6s; }
.rev-pct, .rev-na { padding: .45rem .5rem !important; font-weight: 500; }
.rev-na { color: var(--faint); text-align: center; }
.rev-pct.good { color: var(--ok); background: #f0fdf4; }
.rev-pct.mid { color: var(--warn); background: #fffbeb; }
.rev-pct.low { color: var(--bad); background: #fef2f2; }
.rev-sum { color: var(--muted); padding: .45rem .45rem !important; font-size: .74rem; }
.rev-table tfoot td { background: #f8fafc; }
.rev-table tfoot .rev-name { background: #f8fafc; font-weight: 600; }

/* ---- подбор персонала ---------------------------------------------------- */
.hire-facts { display: grid; grid-template-columns: 110px 1fr; gap: .35rem .9rem; margin: 0 0 .6rem; }
.hire-facts dt { color: var(--muted); }
.hire-facts dd { margin: 0; color: var(--ink); font-weight: 500; }
.hire-req { margin: .4rem 0 .6rem; color: var(--ink-2); line-height: 1.5; }
.hire-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.hire-cand { display: flex; gap: .9rem; padding: .85rem 0; border-top: 1px solid #eef2f6; }
.hire-cand:first-child { border-top: 0; padding-top: 0; }
.hire-cand-photo {
  width: 72px; height: 88px; border-radius: 10px; overflow: hidden; flex: none; background: #f1f5f9;
  display: grid; place-items: center; color: var(--faint);
}
.hire-cand-photo svg { width: 54%; height: 54%; }
.hire-cand-photo img { width: 100%; height: 100%; object-fit: cover; }
.hire-cand-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.hire-cand-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hire-cand-top b { font-size: 1rem; color: var(--ink); }
.hire-cand-line { font-size: .85rem; color: var(--muted); }
.hire-cand-exp { font-size: .85rem; color: var(--ink-2); white-space: pre-wrap; line-height: 1.45; }
.hire-cand-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.hire-cand-acts button { width: auto; padding: .4rem .8rem; font-size: .85rem; }
.hire-feed { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--ink-2); }
.hire-feed span { color: var(--faint); margin-right: .4rem; font-variant-numeric: tabular-nums; }
.hire-feed i { color: var(--muted); font-style: normal; }
.hire-comment { display: flex; gap: .5rem; margin-top: .8rem; }
.hire-comment input { margin: 0; }
.hire-hh { display: flex; gap: .5rem; margin-bottom: .6rem; }
.hire-hh input { margin: 0; }
.today-selfie { float: left; margin: 0 .45rem 0 0; }
.today-selfie img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; }
#panel-hiring .panel-h { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; }
#panel-hiring .panel-b { padding: 1rem 1.1rem; }
#panel-hiring .pos-list .panel-b { padding: .4rem; }

/* Ошибка загрузки страницы — вместо вечной серой заглушки */
.load-error { max-width: 520px; margin: 2rem auto; text-align: center; }
.load-error b { display: block; font-size: 1rem; margin-bottom: .35rem; }
.load-error .hint { color: var(--muted); margin: 0 0 1rem; }

/* ==========================================================================
   Табель: мастер-график «план / факт» (schedule.js)
   ========================================================================== */
.ts-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.ts-toolbar select { width: auto; margin: 0; }
.ts-toolbar #schBakery { min-width: 200px; }
.ts-month { display: flex; gap: .3rem; align-items: center; }
.ts-icon { width: 2.2rem !important; padding: .45rem 0 !important; margin: 0 !important; font-size: 1.1rem; }
.ts-views { margin: 0; }
.ts-actions { display: flex; gap: .4rem; margin-left: auto; }
.ts-actions button, .ts-headbtn { width: auto !important; margin: 0 !important; }

.ts-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .7rem; align-items: stretch; }
.ts-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .85rem; box-shadow: var(--shadow); }
.ts-kpi span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ts-kpi b { display: block; font-size: 1.3rem; font-weight: 650; margin: .1rem 0; font-variant-numeric: tabular-nums; }
.ts-kpi small { color: var(--faint); font-size: .75rem; }
.ts-kpi-bad b { color: var(--bad); }
.ts-kpi-warn b { color: var(--warn); }
.ts-headbtn { align-self: center; }
.ts-neg { color: var(--bad) !important; }
.ts-pos { color: var(--ok) !important; }

.ts-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; margin: .2rem 0 .5rem; font-size: .78rem; color: var(--muted); }
.ts-lg { display: inline-flex; align-items: center; gap: .3rem; }
.ts-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid transparent; }
.ts-hint { color: var(--muted); font-size: .8rem; }
.ts-hint code { background: #e2e8f0; padding: .05rem .3rem; border-radius: 4px; }

.ts-wrap { max-height: 72vh; }
.ts-table td.ts-td { padding: 2px !important; }
.ts-table.ts-planfact td.ts-td, .ts-table.ts-planfact th { min-width: 62px; }
.ts-table.ts-hours td.ts-td, .ts-table.ts-hours th { min-width: 44px; }
.ts-table th.ts-today { background: var(--primary-50) !important; }
.ts-table th.ts-today .sched-dnum { color: var(--primary); font-weight: 700; }
.ts-table td.ts-today { background: #f5f9ff; }

.ts-cell {
  width: 100% !important; min-height: 38px; margin: 0 !important; padding: .2rem .15rem !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: transparent; border: 1px solid transparent !important; border-radius: 6px;
  color: var(--ink-2); font-size: .74rem; line-height: 1.15; font-weight: 500; box-shadow: none !important;
  position: relative; cursor: pointer; font-variant-numeric: tabular-nums;
}
.ts-cell:hover { border-color: var(--line-2) !important; background: #fff; }
.ts-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ts-cell .ts-p { color: var(--muted); font-weight: 500; white-space: nowrap; }
.ts-cell .ts-f { font-weight: 650; white-space: nowrap; }
.ts-cell .ts-add { color: transparent; font-size: 1rem; }
.ts-cell:hover .ts-add { color: var(--faint); }
.ts-cell .ts-code { font-weight: 700; font-size: .85rem; }
.ts-hcell b { font-size: .82rem; }
.ts-hcell small { font-size: .62rem; color: var(--muted); font-weight: 500; }
.ts-dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; }
.ts-dot-cover { background: #7c3aed; }
.ts-dot-photo { background: var(--ok); top: auto; bottom: 3px; }

/* статусы ячейки — те же цвета в легенде и в карточке дня */
.st-ok, .ts-sw.st-ok { background: var(--ok-50); }
.st-ok .ts-f { color: var(--ok); }
.st-late, .st-early, .st-late_early, .ts-sw.st-late { background: var(--warn-50); }
.st-late .ts-f, .st-early .ts-f, .st-late_early .ts-f { color: var(--warn); }
.st-no_show, .ts-sw.st-no_show { background: var(--bad-50); }
.st-no_show .ts-f, .st-no_show .ts-p { color: var(--bad); }
.st-unplanned, .ts-sw.st-unplanned { background: var(--primary-50); }
.st-unplanned .ts-f { color: var(--primary-600); }
.st-unplanned .ts-p { font-style: italic; font-size: .64rem; }
.st-open, .ts-sw.st-open { background: var(--ok-50); box-shadow: inset 3px 0 0 var(--ok) !important; }
.st-open .ts-f { color: var(--ok); }
.st-review, .ts-sw.st-review { background: #fff; border: 1.5px dashed var(--bad) !important; }
.st-review .ts-f { color: var(--bad); }
.st-absent, .ts-sw.st-absent { background: #f1f5f9; }
.st-absent .ts-code { color: #475569; }
.st-absent .ts-f { color: var(--faint); font-weight: 500; text-decoration: line-through; }
.st-waiting { background: var(--warn-50); }
.st-waiting .ts-f { color: var(--warn); font-weight: 500; }
.ts-sw.st-late { border-color: #fcd34d; }
.ts-sw.st-ok { border-color: #86efac; }
.ts-sw.st-no_show { border-color: #fca5a5; }
.ts-sw.st-unplanned { border-color: #93c5fd; }
.ts-sw.st-absent { border-color: #cbd5e1; }

.ts-flags { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .2rem; }
.ts-flag { font-size: .62rem; padding: 0 .3rem; border-radius: 999px; font-weight: 600; }
.ts-flag.st-no_show { color: var(--bad); }
.ts-flag.st-late { color: var(--warn); }
.ts-flag.st-review { color: var(--bad); border: 1px dashed var(--bad) !important; }
.ts-table .sched-name { min-width: 190px; max-width: 220px; }

/* карточка дня */
.ts-day { width: min(620px, 100%); position: relative; }
.ts-day .dr-close { position: absolute; top: .7rem; right: .7rem; width: auto !important; }
.ts-day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-right: 2.2rem; margin-bottom: .7rem; }
.ts-day-head h3 { margin: 0; }
.ts-day-sub { color: var(--muted); font-size: .85rem; }
.ts-chip { font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.ts-chip.st-ok, .ts-chip.st-open { color: var(--ok); }
.ts-chip.st-late, .ts-chip.st-early, .ts-chip.st-late_early, .ts-chip.st-waiting { color: var(--warn); }
.ts-chip.st-no_show, .ts-chip.st-review { color: var(--bad); }
.ts-chip.st-unplanned { color: var(--primary-600); }
.ts-chip.st-empty, .ts-chip.st-planned { background: #f1f5f9; color: var(--muted); }
.ts-day-fact { display: flex; gap: .8rem; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .8rem; }
.ts-day-fact img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.ts-day-fact div { display: flex; flex-direction: column; gap: .1rem; font-size: .85rem; }
.ts-day-fact span { color: var(--muted); }
.ts-warn-t { color: var(--warn) !important; }
.ts-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; }
.ts-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); margin: 0; }
.ts-form label small { color: var(--faint); font-weight: 400; }
.ts-form select, .ts-form input { margin: 0; }
.ts-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem .55rem; margin: 0; }
.ts-form legend { font-size: .78rem; color: var(--muted); padding: 0 .3rem; }
.ts-span2 { grid-column: 1 / -1; }
.ts-pair { display: flex; align-items: center; gap: .35rem; }
.ts-pair input { text-align: center; min-width: 0; }
.link-btn { background: none !important; border: 0 !important; color: var(--primary) !important; padding: .3rem 0 0 !important; width: auto !important; font-size: .78rem; box-shadow: none !important; cursor: pointer; }
.ts-day-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }
.ts-day-actions button { width: auto !important; margin: 0 !important; }
.ts-transfer { display: flex; gap: .4rem; margin-left: auto; }
.ts-transfer select { width: auto; margin: 0; }
.ts-hist-h { margin: 1rem 0 .4rem; font-size: .9rem; }
.ts-hist { max-height: 220px; overflow: auto; border-top: 1px solid var(--line); }
.ts-hrow { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid #f1f5f9; font-size: .8rem; }
.ts-hwhen, .ts-hwho { color: var(--muted); white-space: nowrap; }
.ts-hrow i { color: var(--muted); }

.ts-attn { margin: 0 0 .8rem; }
.ts-attn h3 { margin: 0 0 .3rem; font-size: 1rem; }
.ts-attn h4 { margin: .5rem 0 .3rem; font-size: .88rem; }
.ts-arow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .25rem 0; font-size: .85rem; }
.ts-arow button, .ts-arow select { width: auto !important; margin: 0 !important; }

@media (max-width: 768px) {
  .ts-actions { margin-left: 0; }
  .ts-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts-form { grid-template-columns: 1fr; }
  .ts-transfer { margin-left: 0; width: 100%; }
  .ts-hrow { grid-template-columns: 1fr; gap: .1rem; }
  .ts-table .sched-name { min-width: 130px; max-width: 150px; }
}

/* Таблицы-сетки со скроллом: overflow:hidden у table (скругление углов) делал
   саму таблицу контейнером прокрутки, и липкие колонки уезжали вместе с ней. */
.sched-table, .rev-table, .mx-table, .pm-table, .stock-table { overflow: visible !important; }
.ts-table .sched-total { width: 58px; min-width: 58px; max-width: 58px; }
.ts-table .ts-t1 { right: 116px; }
.ts-table .ts-t2 { right: 58px; }
.ts-table .ts-t3 { right: 0; }
.ts-attn summary { cursor: pointer; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; list-style: none; }
.ts-attn summary::-webkit-details-marker { display: none; }
.ts-attn summary::before { content: "▸"; color: var(--muted); }
.ts-attn[open] summary::before { content: "▾"; }
.ts-attn summary span { color: var(--muted); font-size: .85rem; }
.ts-attn[open] summary { margin-bottom: .4rem; }

@media (max-width: 768px) {
  /* KPI табеля на телефоне — лентой, чтобы сетка была видна без долгой прокрутки */
  .ts-kpis { display: flex; overflow-x: auto; gap: .5rem; padding-bottom: .2rem; scroll-snap-type: x proximity; }
  .ts-kpi { flex: 0 0 150px; scroll-snap-align: start; padding: .55rem .7rem; }
  .ts-kpi b { font-size: 1.1rem; }
  .ts-headbtn { flex: 0 0 auto; }
  .ts-legend .ts-hint { display: none; }
}
.ts-note-bad { background: var(--bad-50); color: #991b1b; border-radius: 10px; padding: .55rem .7rem; font-size: .84rem; margin-bottom: .8rem; }
@media (max-width: 768px) {
  /* На телефоне итоги не прилипают справа — иначе на сетку остаётся полэкрана */
  .ts-table .sched-total { position: static; }
  .sched-table thead th:first-child { z-index: 5 !important; }
  .ts-table.ts-planfact td.ts-td, .ts-table.ts-planfact th { min-width: 58px; }
}

/* ==========================================================================
   План / факт сети (analytics.js)
   ========================================================================== */
.pf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.pf-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.pf-tile span { display: block; font-size: .75rem; color: var(--muted); }
.pf-tile b { display: block; font-size: 1.6rem; font-weight: 650; margin: .15rem 0; letter-spacing: -.01em; }
.pf-tile small { color: var(--muted); font-size: .78rem; }
.pf-good { color: var(--ok); }
.pf-warn { color: var(--warn); }
.pf-bad { color: var(--bad); }
.pf-chart-card, .pf-table-card { padding: 1rem 1.1rem; margin-bottom: .9rem; }
.pf-chart-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: .6rem; }
.pf-chart-head h3 { margin: 0; font-size: 1rem; margin-right: auto; }
.pf-chart-head .seg { margin: 0; }
.pf-legend { display: flex; gap: .9rem; font-size: .8rem; color: var(--ink-2); }
.pf-legend span, .pf-tip-r { display: inline-flex; align-items: center; gap: .4rem; }
.pf-key-bar { width: 10px; height: 10px; border-radius: 2px; background: #2563eb; display: inline-block; }
.pf-key-line { width: 14px; height: 2px; border-radius: 2px; background: #eb6834; display: inline-block; }
.pf-chart { position: relative; }
.pf-grid { stroke: #eef2f6; stroke-width: 1; }
.pf-base { stroke: #cbd5e1; stroke-width: 1; }
.pf-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pf-cross { stroke: #94a3b8; stroke-width: 1; }
.pf-cross.hidden { display: none; }
.pf-hit { fill: transparent; cursor: crosshair; outline: none; }
.pf-hit:focus-visible { fill: rgba(37, 99, 235, .06); }
.pf-tip { position: absolute; top: 8px; min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: .5rem .65rem; font-size: .8rem; pointer-events: none; z-index: 5; }
.pf-tip-h { color: var(--muted); margin-bottom: .25rem; }
.pf-tip-r { display: flex; gap: .45rem; margin: .1rem 0; }
.pf-tip-r b { font-variant-numeric: tabular-nums; }
.pf-tip-r span { color: var(--muted); }
.pf-table { width: 100%; font-size: .85rem; }
.pf-table th, .pf-table td { white-space: nowrap; }
.pf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-table .txt { text-align: left; }
.pf-table td small { display: block; color: var(--muted); font-size: .7rem; }
.pf-table tfoot td { font-weight: 650; background: #f8fafc; border-top: 1px solid var(--line-2); }
.pf-sort { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; width: auto !important;
  color: inherit !important; font: inherit; font-weight: 600; text-transform: inherit; letter-spacing: inherit; cursor: pointer; box-shadow: none !important; }
.pf-table tbody tr { cursor: pointer; }
.pf-table tbody tr:hover td { background: var(--primary-50); }
@media (max-width: 768px) {
  .pf-tiles { display: flex; overflow-x: auto; gap: .5rem; }
  .pf-tile { flex: 0 0 170px; }
  .pf-tile b { font-size: 1.3rem; }
  .pf-table { font-size: .8rem; }
  .pf-table :is(th, td):first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
}
.pf-table tfoot tr.pf-empty td { font-weight: 400; color: var(--muted); background: transparent; border-top: 0; white-space: normal; font-size: .78rem; }
.pf-legend { border: 0 !important; padding: 0 !important; margin: 0 !important; }
.pf-empty-note { margin: .6rem 0 0; }
.pf-empty-note:empty { display: none; }
@media (max-width: 768px) {
  /* Телефон: без графиков, в таблице — только то, по чему принимают решение */
  .pf-chart-card { display: none; }
  .pf-table .pf-c-hours_plan, .pf-table .pf-c-hours_fact, .pf-table .pf-c-late, .pf-table .pf-c-unplanned,
  .pf-table .pf-c-revenue_plan_to_date, .pf-table .pf-c-revenue_fact, .pf-table .pf-c-fot_share { display: none; }
  .pf-table-card .pf-chart-head .ts-hint { display: none; }
  .pf-table { width: 100%; }
}
@media (max-width: 768px) {
  .pf-table-card { padding: .8rem .6rem; }
  .pf-table th, .pf-table td { padding: .45rem .35rem !important; }
  .pf-table th { font-size: .6rem !important; letter-spacing: 0 !important; }
  .pf-table .pf-c-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
}

/* ==========================================================================
   Кадры: проверка выходов, вкладка «Кадры», интеграция с 1С (personnel.js)
   ========================================================================== */
.ts-toolbar input[type=date] { width: auto; margin: 0; }
.ts-actions-btn { width: auto !important; margin: 0 0 0 auto !important; }
.ck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .8rem; }
.ck-card { display: flex; flex-direction: column; gap: .6rem; padding: .8rem; margin: 0; }
.ck-photos { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ck-photos figure { margin: 0; }
.ck-photos img, .ck-noref { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #f1f5f9; display: block; cursor: zoom-in; }
.ck-noref { display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .8rem; padding: .5rem; cursor: default; }
.ck-photos figcaption { font-size: .72rem; color: var(--muted); margin-top: .25rem; text-align: center; }
.ck-info { display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; color: var(--ink-2); }
.ck-info b { font-size: .95rem; color: var(--ink); }
.ck-info i { color: var(--muted); }
.ck-info em { font-style: normal; }
.ck-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.ck-acts button { width: auto !important; margin: 0 !important; flex: 1 1 auto; }
.hr-onec { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .9rem; background: #f8fafc; }
.hr-onec-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.hr-onec-h button { width: auto !important; margin: 0 !important; }
.hr-link { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .85rem; }
.hr-link:first-of-type { border-top: 0; }
.hr-link small { color: var(--muted); }
.hr-link button { width: auto !important; margin: 0 !important; align-self: center; }
.hr-link-add { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.hr-link-add select, .hr-link-add input { width: auto; flex: 1 1 160px; margin: 0; }
.hr-link-add button { width: auto !important; margin: 0 !important; }
#hrFound { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
#hrFound button { width: 100% !important; margin: 0 !important; text-align: left; justify-content: flex-start; }
.hr-sec { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem .8rem; margin: 0 0 .8rem; }
.hr-sec legend { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 .3rem; }
.hr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .7rem; }
.hr-grid label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); margin: 0; }
.hr-grid input, .hr-grid select, .hr-grid textarea { margin: 0; }
.hr-wide { grid-column: 1 / -1; }
.hr-foot { display: flex; gap: .8rem; align-items: center; }
.hr-foot button { width: auto !important; margin: 0 !important; }
@media (max-width: 768px) { .hr-grid { grid-template-columns: 1fr; } .ck-grid { grid-template-columns: 1fr; } }
.ts-toolbar > button { width: auto !important; margin: 0 !important; }

/* Условия оплаты (вкладка «Оплата») и импорт из 1С */
.pt-box { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin: 0 0 .9rem; background: var(--card); }
.pt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.pt-head button { margin: 0 !important; }
.pt-t { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pt-sum { font-size: 1rem; font-weight: 600; color: var(--ink); margin: .15rem 0; }
.pt-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .7rem; }
.pt-row { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.pt-row.off { opacity: .55; }
.pt-main { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.pt-main small { color: var(--muted); font-size: .75rem; }
.pt-act { display: flex; gap: .3rem; }
.pt-act button { width: 30px !important; height: 30px; padding: 0 !important; margin: 0 !important; }
.pt-act.pt-act-text { flex: 0 0 auto; }
.pt-act.pt-act-text button { width: auto !important; padding: 0 .75rem !important; white-space: nowrap; }
.pt-kind, .si-rec { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 6px;
  background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.pt-kind { min-width: 74px; text-align: center; margin-top: .1rem; }
.k-staff { background: #eff6ff; color: #1d4ed8; }
.k-contract { background: var(--warn-50); color: var(--warn); }
.k-self { background: var(--ok-50); color: var(--ok); }
.pt-form { margin-top: .7rem !important; }
.pt-form-foot { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: .6rem; }
.pt-form-foot .err { flex: 1; font-size: .8rem; }
.pt-form-foot button { margin: 0 !important; }
.pt-check { flex-direction: row !important; align-items: center; gap: .4rem !important; color: var(--ink-2) !important; font-size: .85rem !important; }
.pt-check input { width: auto; margin: 0; }
.emp-top { gap: .5rem; }
.si-modal { width: min(1180px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; gap: .7rem; }
.si-stats { display: flex; flex-wrap: wrap; gap: .4rem; }
.si-stats span { background: var(--bg); border-radius: 8px; padding: .3rem .6rem; font-size: .82rem; color: var(--ink-2); }
.si-stats .si-warn { background: var(--warn-50); color: var(--warn); }
.si-filter { display: flex; gap: .3rem; }
.si-filter button { width: auto !important; margin: 0 !important; background: #fff; color: var(--ink-2); border: 1px solid var(--line-2);
  padding: .3rem .7rem; font-size: .82rem; }
.si-filter button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.si-scroll { overflow: auto; flex: 1; min-height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.si-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.si-table th { position: sticky; top: 0; background: var(--bg); text-align: left; font-weight: 600; color: var(--muted);
  padding: .45rem .6rem; font-size: .75rem; z-index: 1; }
.si-table td { padding: .45rem .6rem; border-top: 1px solid var(--line); vertical-align: top; }
.si-table td small { display: block; color: var(--muted); font-size: .74rem; }
.si-table td .si-rec { margin: 0 .2rem .2rem 0; }
.si-note { color: var(--warn) !important; margin-top: .25rem; max-width: 260px; }
.si-missing summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.si-missing p { font-size: .8rem; color: var(--ink-2); }
.si-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: flex-end; }
.si-foot .ts-hint { flex: 1 1 260px; font-size: .78rem; }
.si-foot button { margin: 0 !important; }
.si-foot .pt-check { margin: 0; }
@media (max-width: 768px) {
  .si-modal { padding: 1rem; gap: .55rem; }
  .si-head .dr-close { width: 40px !important; flex: 0 0 40px; }
  .si-filter { flex-wrap: wrap; }
  .si-filter button { width: auto !important; min-height: 36px; flex: 1 1 auto; }
  .si-scroll { border: none; }
  .si-table td { flex-wrap: wrap; }
  .si-table td .si-note { max-width: none; }
  .si-foot button { flex: 1 1 40%; }
  .si-stats span { font-size: .78rem; }
}
.si-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.si-head h3 { margin: 0; }
.si-head .dr-close { width: 34px !important; flex: 0 0 34px; margin: 0 !important; }
.si-foot label.si-create { display: inline-flex !important; white-space: nowrap; }
.si-foot label.si-create input { flex: 0 0 auto; }
.si-foot label.si-create { flex: 0 0 auto; width: auto !important; min-width: max-content; }
.pt-head button { white-space: nowrap; flex: 0 0 auto; }
.dr-fields input:disabled, .dr-fields select:disabled { background: var(--bg); color: var(--ink-2); cursor: not-allowed; }
.si-modal .si-head button.dr-close { width: 40px !important; min-width: 0 !important; flex: 0 0 40px !important; padding: 0 !important; }
.si-modal .dr-alert { margin: 0; }
