/* Resource planner: design tokens and components (spec 8, prototypes Main/Events/Staff/Dicts).
   One hand-written file, no build step. Colors that come from data (events, roles, avatars,
   status hatches) arrive through CSS variables set in templates: --ev-*, --tag-*, --av-*,
   --hatch-*, --sw-*. */

/* ---------- Fonts (Inter, vendored woff2) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-cyrillic-400-normal.5343aec6e59f.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.f837d382a885.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-cyrillic-500-normal.eab3e6621f02.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.42b95430773b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-cyrillic-600-normal.5c2465a3cb14.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.75fb76ec3559.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/inter-cyrillic-700-normal.be9491830eef.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/inter-latin-700-normal.3714175d15f3.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  --bg: #F4F5F9;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --surface-3: #FCFCFD;
  --text: #101828;
  --text-2: #475467;
  --text-3: #667085;
  --text-4: #98A2B3;
  --text-strong: #344054;
  --border: #D0D5DD;
  --border-soft: #EAECF0;
  --divider: #F0F1F4;
  --muted-bg: #F2F4F7;
  --segment-bg: #E9EBF1;
  --accent: #3B5BDB;
  --accent-hover: #2F4AC0;
  --accent-soft: #EEF2FF;
  --accent-soft-text: #2F3FA8;
  --selected-row: #F5F7FF;
  --nav: #1B2232;
  --nav-2: #232B3D;
  --nav-active: #2E3850;
  --nav-text: #CDD2DB;
  --nav-muted: #98A2B3;
  --logo-bg: #FDECC8;
  --logo-fg: #7A4B00;
  --weekend: #D92D20;
  --weekend-bg: #FAFAFC;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --error-soft: #FEE4E2;
  --conflict: #F04438;
  --success: #085D3A;
  --success-bg: #DCFAE6;
  --warning: #B54708;
  --warning-bg: #FFFAEB;
  --radius-card: 18px;
  --radius-panel-inner: 14px;
  --radius-field: 10px;
  --radius-toolbar: 12px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 28px rgba(16, 24, 40, .06);
  --shadow-panel: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 28px rgba(16, 24, 40, .08);
  --shadow-pop: 0 4px 10px rgba(16, 24, 40, .08), 0 18px 48px rgba(16, 24, 40, .18);
  --shadow-tab: 0 1px 2px rgba(16, 24, 40, .12);
  --nav-width: 232px;
  --nav-width-collapsed: 72px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 13px/1.45 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell: sidebar + main (spec 6.1, DS9) ---------- */
.shell { display: flex; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; flex: none; width: var(--nav-width);
  background: var(--nav); color: #E4E7EC; display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px; transition: width .2s ease, padding .2s ease; overflow-x: hidden; overflow-y: auto;
  z-index: 20;
}
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.nav-logo {
  width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--logo-bg);
  color: var(--logo-fg); display: inline-flex; align-items: center; justify-content: center;
}
.nav-title { font-weight: 700; font-size: 15px; color: #FFFFFF; white-space: nowrap; }
.nav-toggle {
  margin-left: auto; width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px;
  background: var(--nav-2); color: var(--nav-text); display: inline-flex; align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: var(--nav-active); }
.nav-toggle svg { transition: transform .2s ease; }
.nav-org { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--nav-muted); padding: 0 4px; }
.nav-org select {
  height: 36px; border-radius: 10px; border: 1px solid #344054; background: var(--nav-2);
  color: #FFFFFF; padding: 0 10px; font-size: 13px; width: 100%;
}
.nav-org label { display: flex; flex-direction: column; gap: 6px; }
.nav-org-name { color: #FFFFFF; font-size: 13px; font-weight: 600; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--nav-text); white-space: nowrap;
}
.nav-link:hover { background: var(--nav-2); color: #FFFFFF; }
.nav-link[aria-current="page"] { background: var(--nav-active); color: #FFFFFF; font-weight: 600; }
.nav-footer {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 2px 0;
  border-top: 1px solid var(--nav-active);
}
.nav-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-user-text { display: flex; flex-direction: column; min-width: 0; }
.nav-user-name { color: #FFFFFF; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-role { color: var(--nav-muted); font-size: 11px; }
.nav-actions { display: flex; flex-direction: column; gap: 2px; }
.nav-action {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 32px;
  padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--nav-text);
  font-size: 12.5px; white-space: nowrap; text-align: left;
}
.nav-action:hover { background: var(--nav-active); color: #FFFFFF; }
.nav-actions form { display: contents; }

html.nav-collapsed .nav { width: var(--nav-width-collapsed); padding: 20px 12px; }
html.nav-collapsed .nav-brand { flex-direction: column; }
html.nav-collapsed .nav-toggle { margin-left: 0; }
html.nav-collapsed .nav-toggle svg { transform: rotate(180deg); }
html.nav-collapsed .nav-text { display: none; }
html.nav-collapsed .nav-link { justify-content: center; padding: 0; }
html.nav-collapsed .nav-user { justify-content: center; }
html.nav-collapsed .nav-actions { flex-direction: column; align-items: center; }
html.nav-collapsed .nav-action { width: 36px; padding: 0; justify-content: center; }

.main {
  flex: 1 1 auto; min-width: 0; padding: 24px 28px 36px; display: flex; flex-direction: column;
  gap: 16px;
}

/* Phone tab bar and "Ещё" sheet (spec 6.1, < 768 px) */
.tabbar { display: none; }
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .4); z-index: 60;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--surface);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow-pop); padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px; max-height: 80vh; overflow-y: auto;
}
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 10px; }
.sheet-title { font-weight: 700; font-size: 15px; padding: 0 4px 6px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0;
  border-radius: 12px; background: transparent; color: var(--text); font-size: 14px; text-align: left; width: 100%;
}
.sheet-item:hover { background: var(--surface-2); color: var(--text); }
.sheet-item svg { color: var(--text-3); }
.sheet-org { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 12px; font-size: 12px; font-weight: 600; color: var(--text-strong); }
.sheet form { margin: 0; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.page-title { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.page-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.page-sub { color: var(--text-2); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px;
  padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text-strong); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #FFFFFF; font-weight: 600; padding: 0 20px; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FFFFFF; }
.btn-lg { height: 40px; padding: 0 18px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-accent-outline { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-accent-outline:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: var(--error-bg); color: var(--error); }
.btn-dashed { border-style: dashed; border-color: var(--text-4); }
.btn-ghost { border-color: transparent; background: transparent; }
.icon-btn {
  width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--muted-bg);
  color: var(--text-strong); display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--border-soft); color: var(--text); }
.icon-btn-plain { background: transparent; color: var(--text-3); }
.round-btn {
  width: 38px; height: 38px; flex: none; border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--text-strong); display: inline-flex; align-items: center; justify-content: center;
}
.round-btn:hover { background: var(--surface-2); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: inherit; }
.link-btn:hover { color: var(--accent-hover); }

/* Pills (spec 8: height 32-38, radius 16-19; pressed - dark) */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 19px; background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pill:hover { background: var(--surface-2); color: var(--text); }
.pill-sm { height: 32px; padding: 0 12px; border-radius: 16px; }
.pill[aria-pressed="true"], .pill.is-on { background: var(--text); border-color: var(--text); color: #FFFFFF; }
.pill-danger { border-color: transparent; background: var(--error-soft); color: var(--error); font-weight: 600; height: 32px; padding: 0 12px; border-radius: 16px; }
.pill-count {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--muted-bg);
  color: var(--text-strong); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.pill-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ev-dot, var(--text-4)); flex: none; }

/* Segment control (spec 6.3 "на #E9EBF1") */
.segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--segment-bg); }
.segment-item {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 0;
  border-radius: 9px; background: transparent; color: var(--text-strong); font-size: 13px; white-space: nowrap;
}
.segment-item:hover { color: var(--text); }
.segment-item[aria-current="page"], .segment-item[aria-selected="true"], .segment-item.is-on,
.segment-item:has(input:checked) {
  background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-tab);
}
.segment-item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segment-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; background: #DDE1E8; color: var(--text-strong);
}
.segment-item[aria-current="page"] .segment-count, .segment-item[aria-selected="true"] .segment-count {
  background: var(--accent-soft); color: var(--accent-soft-text);
}
.segment-lg .segment-item { height: 34px; }

/* ---------- Toolbar fields ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar-sep { width: 1px; height: 24px; background: var(--border); }
.search {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-toolbar); background: var(--surface);
  color: var(--text-2); min-width: 220px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { color: var(--text-3); }
.search input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; min-width: 0; color: var(--text); }
.select-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-toolbar); background: var(--surface); color: var(--text-2);
}
.select-pill select { height: 34px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--text); max-width: 220px; }
.select-pill:focus-within { border-color: var(--accent); }

/* ---------- Form fields (panels) ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-strong); min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-strong); }
.input, .select {
  height: 40px; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-field);
  padding: 0 12px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 400;
}
.select { padding: 0 10px; }
.input:focus, .select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm, .select-sm { height: 36px; font-size: 13px; padding: 0 8px; }
.field-invalid .input, .field-invalid .select { border-color: var(--error); }
.field-hint { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.field-error { font-weight: 500; color: var(--error); font-size: 12px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.field-inline .field { font-size: 11px; font-weight: 500; color: var(--text-2); gap: 4px; }
.form-errors {
  padding: 10px 12px; border-radius: 12px; background: var(--error-bg); color: var(--error); font-weight: 500;
}
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; font-weight: 400; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* Switch (Фриланс) */
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-strong); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 36px; height: 20px; border-radius: 10px; background: var(--border); position: relative; flex: none;
  transition: background .15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform .15s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Toggle chips (categories, spec 6.10) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle {
  position: relative; display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text-strong);
  font-size: 12.5px; font-weight: 400; cursor: pointer; white-space: nowrap;
}
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-toggle:has(input:checked) {
  font-weight: 600; border-color: var(--tag-fg, var(--text-strong)); background: var(--tag-bg, var(--muted-bg));
  color: var(--tag-fg, var(--text-strong));
}
.chip-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Color swatches (radio inputs) */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; background: var(--sw-bg);
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sw-fg) 20%, transparent);
}
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.swatch:has(input:checked) { border-color: var(--sw-fg); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-event { box-shadow: inset 0 0 0 5px var(--sw-bg), inset 0 0 0 20px var(--sw-dot); }
.swatch-event:has(input:checked) { border-color: var(--sw-dot); }
.swatch-hatch {
  width: 56px; border-radius: 12px; box-shadow: none; border-color: var(--border-soft);
  background: repeating-linear-gradient(135deg, var(--hatch-tone) 0 5px, var(--hatch-light) 5px 10px);
}
.swatch-hatch:has(input:checked) { border-color: var(--text-strong); }

/* ---------- Cards and panels ---------- */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-clip { overflow: hidden; }
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.card-title { font-weight: 700; font-size: 15px; }
.card-sub { color: var(--text-2); margin-top: 2px; }
.card-note { padding: 12px 18px; color: var(--text-3); font-size: 12px; border-top: 1px solid var(--divider); }
.empty { padding: 28px; border-radius: var(--radius-card); background: var(--surface); color: var(--text-2); }
.empty-inline { padding: 28px 18px; color: var(--text-2); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; }
.split-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.panel {
  background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border-soft); }
.panel-heading { flex: 1; min-width: 0; }
.panel-title { font-weight: 700; font-size: 16px; }
.panel-sub { color: var(--text-2); margin-top: 2px; }
.panel-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.panel-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 14px 18px; background: var(--surface-2); border-top: 1px solid var(--border-soft);
}
.panel-foot .push { margin-left: auto; }
.panel-close { display: none; }
.preview-box {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius-panel-inner);
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.preview-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.preview-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.preview-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.subblock { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Data grids (div-based tables) ---------- */
.grid-scroll { overflow-x: auto; }
/* A visible scrollbar: an overlay one (macOS) hides that a narrow table scrolls, and the
   cut-off right column looks clipped (ADMIN-MANAGEMENT-002). */
.grid-scroll::-webkit-scrollbar { height: 8px; }
.grid-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.grid-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
.grid-head {
  display: grid; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); color: var(--text-3);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; align-items: center;
}
.grid-row {
  display: grid; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--divider);
  color: var(--text); background: var(--surface);
}
.grid-row:last-child { border-bottom: 0; }
a.grid-row:hover, .grid-row.is-link:hover { background: #FAFBFF; color: var(--text); }
.grid-row.is-selected { background: var(--selected-row); box-shadow: inset 3px 0 0 var(--accent); }
.grid-row.is-archived { opacity: .55; }
.grid-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.grid-actions form { display: contents; }
.cell-label { display: none; }

/* ---------- Tags, pills, badges ---------- */
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--tag-bg, var(--muted-bg));
  color: var(--tag-fg, var(--text-strong));
}
.tag-plain { background: var(--muted-bg); color: var(--text-2); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.role-pill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px;
  font-weight: 700; white-space: nowrap; background: var(--tag-bg, var(--muted-bg)); color: var(--tag-fg, var(--text-strong));
}
.role-swatch {
  display: inline-block; vertical-align: middle; width: 40px; height: 22px; border-radius: 11px; background: var(--tag-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-fg) 20%, transparent);
}
.status {
  justify-self: start; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--text-2); flex: none;
}
.status-active { background: var(--success-bg); color: var(--success); }
.status-warn { background: var(--warning-bg); color: var(--warning); }
.badge-num {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 15px; background: var(--ev-bg, var(--muted-bg));
  color: var(--ev-fg, var(--text-3));
}
.badge-num.is-closed { background: var(--muted-bg); color: var(--text-3); }
.dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--ev-dot, var(--text-4)); }
.event-bar {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 10px;
  font-size: 12px; background: var(--ev-bg, #FDECC8); color: var(--ev-fg, #6B3F00); white-space: nowrap;
}

/* Hatch for absences (spec 8) */
.hatch {
  background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 4px, var(--hatch-light, #F5F6F8) 4px 8px);
}
.hatch-bar {
  display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px; font-weight: 600;
  color: var(--text-strong);
  background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 5px, var(--hatch-light, #F5F6F8) 5px 10px);
}
.hatch-chip { width: 26px; height: 16px; border-radius: 8px; flex: none; }

/* Avatars (spec 2.5: initials, color pk % 6) */
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 12px; background: var(--av-bg, #E0E7FF); color: var(--av-fg, #3730A3);
  letter-spacing: .02em;
}
.avatar-38 { width: 38px; height: 38px; font-size: 14px; }
.avatar-40 { width: 40px; height: 40px; font-size: 14px; }
.avatar-44 { width: 44px; height: 44px; font-size: 16px; }
.avatar-user { background: var(--accent); color: #FFFFFF; font-weight: 600; }

/* Mini strips: event days (Events) and week (Staff) */
.strip { display: flex; gap: 2px; }
.strip-seg { flex: 1; height: 8px; border-radius: 4px; background: #EEF0F3; }
.strip-seg.is-on { background: var(--ev-dot, var(--text-4)); }
.strip.is-closed .strip-seg.is-on { background: var(--border); }
.strip-text { color: var(--text-3); font-size: 11.5px; }
.week-strip { display: flex; gap: 3px; }
.week-day { width: 22px; height: 10px; border-radius: 5px; background: var(--muted-bg); }
.week-day.is-event { background: var(--ev-dot); }
.week-day.is-conflict { background: var(--conflict); }
.week-day.is-absent { background: repeating-linear-gradient(135deg, #C9CED6 0 2px, #EEF0F3 2px 4px); }

/* ---------- Alerts and toasts ---------- */
.alert { padding: 10px 12px; border-radius: 12px; background: var(--error-bg); color: var(--error); }
.alert-title { font-weight: 600; }
.toasts {
  position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--text);
  color: #FFFFFF; box-shadow: var(--shadow-pop); font-weight: 500; animation: toast-in .18s ease-out;
}
.toast-error { background: var(--error-bg); color: var(--error); border: 1px solid #FECDCA; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Slot popover / bottom sheet (spec 6.5, 6.9) ---------- */
.popover-layer:empty { display: none; }
.popover {
  position: absolute; z-index: 50; width: 340px; max-width: calc(100vw - 24px); background: var(--surface);
  border-radius: var(--radius-card); box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 20px 48px rgba(16, 24, 40, .18);
  display: flex; flex-direction: column; overflow: hidden;
}
.popover-grip, .popover-backdrop { display: none; }
.popover-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.popover-heading { flex: 1; min-width: 0; }
.popover-title { font-weight: 700; font-size: 15px; }
.popover-sub { color: var(--text-2); margin-top: 2px; }
.popover-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 14px; max-height: min(60vh, 520px); overflow-y: auto; }
.popover-foot {
  display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; background: var(--surface-2);
  border-top: 1px solid var(--border-soft);
}
.popover-foot form { display: contents; }
.popover-foot .btn { height: 36px; }
.pop-warn { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--error-bg); color: #912018; }
.pop-warn svg { color: #D92D20; margin-top: 1px; }
.pop-warn-text { display: flex; flex-direction: column; gap: 3px; }
.pop-warn-note { color: var(--text-2); font-size: 11.5px; }
.pop-section { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.pop-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.pop-label-hint { font-weight: 500; color: var(--text-3); }
.pop-hint { color: var(--text-3); font-size: 11.5px; }
.pop-event {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); font-size: 13px;
}
.pop-event:hover { border-color: var(--ev-dot); color: var(--text); }
.pop-event.is-on { background: var(--ev-bg); border-color: var(--ev-dot); }
.pop-event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pop-event-range { margin-left: auto; color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.pop-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-role {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.pop-role:hover { background: var(--surface-2); }
.pop-role.is-category { font-weight: 700; background: var(--accent-soft); border-color: #C7D2FE; color: var(--accent-soft-text); }
.pop-role[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #FFFFFF; }
.pop-statuses { display: flex; gap: 6px; }
.pop-status {
  flex: 1; min-width: 0; height: 34px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pop-status:hover { border-color: var(--text-3); }
.pop-status.is-on {
  font-weight: 700; border-color: var(--text-3);
  background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 4px, var(--hatch-light, #F5F6F8) 4px 8px);
}
.pop-item {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 6px 6px 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.pop-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-page .popover { position: static; width: 100%; max-width: 440px; box-shadow: var(--shadow-panel); }

/* ---------- Auth pages (spec 6.2) ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel); padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.auth-text { color: var(--text-2); }
.auth-card .btn-primary { height: 42px; width: 100%; }
.auth-foot { display: flex; justify-content: center; }
.main-narrow { max-width: 460px; }

/* ---------- Events (spec 6.8) ---------- */
.ev-group { display: flex; flex-direction: column; gap: 10px; }
.ev-row {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 14px 18px; padding: 14px 18px;
  border-bottom: 1px solid var(--divider); color: inherit;
}
.ev-row:last-child { border-bottom: 0; }
.ev-row:hover { background: #FAFBFF; color: inherit; }
.ev-row.is-closed { opacity: .8; }
.ev-row.is-new { background: var(--selected-row); box-shadow: inset 3px 0 0 var(--accent); }
.ev-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-dates { color: var(--text-2); }
.ev-span { flex: 0 1 190px; display: flex; flex-direction: column; gap: 5px; }
.ev-people { flex: 0 0 76px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-strong); }
.ev-people svg, .ev-chevron { color: var(--text-4); }

.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.fact { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact-label { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fact-value { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.fact-sub { color: var(--text-3); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: contents; }
.event-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.people-list { display: flex; flex-direction: column; }
.people-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.people-row:last-child { border-bottom: 0; }
.people-records { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 300px; }

/* ---------- Staff (spec 6.10) ---------- */
.staff-grid { grid-template-columns: minmax(150px, 1.5fr) 140px minmax(100px, 1.3fr) 178px 76px; }
.staff-table { min-width: 730px; }
.person-text .person-phone { display: none; }
.split-staff { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-note { color: var(--text-3); font-size: 12px; }
.phone { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.phone svg { color: var(--text-3); }
.week-cell { display: flex; flex-direction: column; gap: 6px; }
.week-text { color: var(--text-2); font-size: 12px; }
.week-nav { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.week-nav a { color: var(--text-3); display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; }
.week-nav a:hover { background: var(--muted-bg); color: var(--text); }
.absence-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.absence-item form { display: contents; }
.absence-text { flex: 1; min-width: 0; }
.details summary { cursor: pointer; color: var(--accent); list-style: none; font-weight: 500; }
.details summary::-webkit-details-marker { display: none; }
.details[open] summary { margin-bottom: 8px; }
.back-link { display: none; }

/* ---------- Dictionaries (spec 6.11) ---------- */
.roles-grid { grid-template-columns: 100px minmax(150px, 1.6fr) 60px 100px 110px 76px; }
.roles-table { min-width: 660px; }
.status-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 18px; }
.status-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--border-soft);
  background: var(--surface-3);
}
.status-card.is-archived { opacity: .55; }
.status-card.is-selected { border-color: var(--accent); background: var(--selected-row); }
.stat-line { display: flex; justify-content: space-between; color: var(--text-2); }
.stat-line b { color: var(--text); }
.status-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status-actions .btn { flex: 1 1 auto; }
.status-actions form { display: contents; }
.fixed-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.fixed-list { display: flex; flex-direction: column; gap: 8px; }
.fixed-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.fixed-item-day { background: #FFF8EB; color: #DC8B0B; }
.fixed-item-night { background: #EEF1F8; color: #5B6B8C; }
.fixed-item b { color: var(--text); }
.fixed-code {
  width: 44px; height: 24px; border-radius: 12px; background: var(--segment-bg); color: var(--text-strong);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.fixed-hint { margin-left: auto; color: var(--text-3); }
/* Login and name shrink and wrap; the actions column takes room for both buttons when there is
   some and stacks them otherwise, so "Убрать" is never cut off next to the side form. */
.access-grid { grid-template-columns: minmax(100px, 1.2fr) minmax(90px, 1fr) 140px minmax(160px, 250px); }
.access-grid > :nth-child(-n+2) { min-width: 0; overflow-wrap: anywhere; }
.access-table { min-width: 540px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form .select-sm { width: auto; }
.reset-details { position: relative; }
.reset-details[open] .reset-form { margin-top: 6px; }

/* ---------- Schedule: page, toolbar, legend (spec 6.3, 6.4) ---------- */
.sched-nav { display: inline-flex; align-items: center; gap: 6px; }
.toolbar-form, .legend { display: contents; }
.legend-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 6px 0 12px; max-width: 340px;
  border: 1px solid var(--border); border-radius: 17px; background: var(--surface); color: var(--text);
  font-size: 12.5px; white-space: nowrap;
}
.legend-pill:hover { background: var(--surface-2); color: var(--text); }
.legend-pill b { font-weight: 700; }
.legend-pill.is-closed { border-style: dashed; }
.legend-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.legend-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600; background: var(--ev-bg); color: var(--ev-fg); flex: none;
}
.legend-pill.is-on { background: var(--text); border-color: var(--text); color: #FFFFFF; }
.legend-pill.is-on .legend-count { background: rgba(255, 255, 255, .18); color: #FFFFFF; }
.pill-xs { height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; }
.tag-xs { height: 18px; padding: 0 6px; border-radius: 9px; font-size: 10px; flex: none; }
.sched-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--text-2); }
.caption-item { display: inline-flex; align-items: center; gap: 8px; }
.caption-swatch { width: 28px; height: 14px; border-radius: 7px; flex: none; }
.caption-bar { background: #FDECC8; }
.caption-conflict { background: #FFFFFF; box-shadow: 0 0 0 2px var(--conflict); }
.caption-dots { display: inline-flex; gap: 3px; }
.caption-amber { --ev-dot: #F59E0B; }
.caption-sky { --ev-dot: #3B82F6; }
.mv-conflict.caption-static { position: static; }

.sched-card { overflow: hidden; }
.sched-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sched-empty { position: sticky; left: 0; width: min(100%, 100vw); padding: 28px 18px; color: var(--text-2); }
.shift-sun { color: #DC8B0B; display: inline-flex; }
.shift-moon { color: #5B6B8C; display: inline-flex; }

/* ---------- Week grid: CSS grid, 240 px + 21 slots of 46 px, two lines (spec 6.3, DS3, DS6, DS7) ---------- */
.wk { --name-w: 240px; --cell: 46px; --line: 46px; width: max-content; min-width: 100%; }
.wk-head {
  display: grid; grid-template-columns: var(--name-w) repeat(7, calc(var(--cell) * 3));
  border-bottom: 1px solid var(--border-soft);
}
.wk-corner {
  position: sticky; left: 0; z-index: 4; background: var(--surface); padding: 16px 18px 10px; display: flex;
  align-items: flex-end; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.wk-day { height: 78px; display: flex; flex-direction: column; justify-content: space-between; border-left: 1px solid var(--border-soft); background: var(--surface); }
.wk-day.is-weekend { background: var(--weekend-bg); }
.wk-day-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 12px 10px 6px; }
.wk-date { display: flex; flex-direction: column; gap: 1px; }
.wk-wd { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-3); }
.is-weekend .wk-wd, .is-weekend-text { color: var(--weekend); }
.wk-num-line { display: flex; align-items: baseline; gap: 4px; }
.wk-num { font-size: 22px; font-weight: 700; line-height: 26px; }
.wk-month { color: var(--text-3); font-size: 12px; }
.wk-people {
  height: 22px; padding: 0 8px; border-radius: 11px; background: var(--muted-bg); color: var(--text-strong);
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; flex: none;
}
.wk-types { display: flex; padding-bottom: 6px; }
.wk-types span { flex: 1; text-align: center; font-size: 10px; color: var(--text-3); font-weight: 600; }

.wk-row {
  display: grid; grid-template-columns: var(--name-w) repeat(21, var(--cell));
  grid-template-rows: var(--line) var(--line); border-bottom: 1px solid var(--divider);
}
.wk-row:last-child { border-bottom: 0; }
.wk-name {
  grid-column: 1; grid-row: 1 / 3; position: sticky; left: 0; z-index: 3; background: var(--surface);
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 18px; min-width: 0;
}
.wk-person { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wk-person-name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.wk-phone {
  display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap; align-self: flex-start;
}
.wk-phone svg { color: var(--text-3); }
.wk-phone:hover { color: var(--accent); }
.wk-tags { display: flex; gap: 4px; overflow: hidden; }
.wk-tag { font-size: 10.5px; line-height: 18px; padding: 0 7px; border-radius: 9px; background: var(--muted-bg); color: var(--text-2); white-space: nowrap; }
.wk-shifts { align-self: stretch; display: grid; grid-template-rows: 1fr 1fr; align-items: center; padding-right: 2px; }
.wk-row.is-archived .wk-person-name, .wk-row.is-archived .avatar { opacity: .6; }

.wk-bg { grid-row: 1 / 3; border-left: 1px solid var(--border-soft); }
.wk-bg.is-weekend { background: var(--weekend-bg); }
.wk-bg.d1 { grid-column: 2 / span 3; }
.wk-bg.d2 { grid-column: 5 / span 3; }
.wk-bg.d3 { grid-column: 8 / span 3; }
.wk-bg.d4 { grid-column: 11 / span 3; }
.wk-bg.d5 { grid-column: 14 / span 3; }
.wk-bg.d6 { grid-column: 17 / span 3; }
.wk-bg.d7 { grid-column: 20 / span 3; }
.seg { position: relative; z-index: 1; display: flex; min-width: 0; }
.seg.r1 { grid-row: 1; }
.seg.r2 { grid-row: 2; }
.seg.c1 { grid-column-start: 2; }
.seg.c2 { grid-column-start: 3; }
.seg.c3 { grid-column-start: 4; }
.seg.c4 { grid-column-start: 5; }
.seg.c5 { grid-column-start: 6; }
.seg.c6 { grid-column-start: 7; }
.seg.c7 { grid-column-start: 8; }
.seg.c8 { grid-column-start: 9; }
.seg.c9 { grid-column-start: 10; }
.seg.c10 { grid-column-start: 11; }
.seg.c11 { grid-column-start: 12; }
.seg.c12 { grid-column-start: 13; }
.seg.c13 { grid-column-start: 14; }
.seg.c14 { grid-column-start: 15; }
.seg.c15 { grid-column-start: 16; }
.seg.c16 { grid-column-start: 17; }
.seg.c17 { grid-column-start: 18; }
.seg.c18 { grid-column-start: 19; }
.seg.c19 { grid-column-start: 20; }
.seg.c20 { grid-column-start: 21; }
.seg.c21 { grid-column-start: 22; }
.seg.n1 { grid-column-end: span 1; }
.seg.n2 { grid-column-end: span 2; }
.seg.n3 { grid-column-end: span 3; }
.seg.n4 { grid-column-end: span 4; }
.seg.n5 { grid-column-end: span 5; }
.seg.n6 { grid-column-end: span 6; }
.seg.n7 { grid-column-end: span 7; }
.seg.n8 { grid-column-end: span 8; }
.seg.n9 { grid-column-end: span 9; }
.seg.n10 { grid-column-end: span 10; }
.seg.n11 { grid-column-end: span 11; }
.seg.n12 { grid-column-end: span 12; }
.seg.n13 { grid-column-end: span 13; }
.seg.n14 { grid-column-end: span 14; }
.seg.n15 { grid-column-end: span 15; }
.seg.n16 { grid-column-end: span 16; }
.seg.n17 { grid-column-end: span 17; }
.seg.n18 { grid-column-end: span 18; }
.seg.n19 { grid-column-end: span 19; }
.seg.n20 { grid-column-end: span 20; }
.seg.n21 { grid-column-end: span 21; }
.bar {
  position: absolute; inset: 4px 3px; border-radius: 10px; display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 9px 0; line-height: 14px; font-size: 11.5px; overflow: hidden; pointer-events: none; white-space: nowrap;
  background: var(--ev-bg); color: var(--ev-fg); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05);
  transition: opacity .15s ease;
}
.bar.is-short { padding: 6px 2px 0; justify-content: center; }
.bar-role { font-weight: 700; flex: none; }
.bar-role.is-long { font-size: 9px; }
.bar-text { opacity: .85; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ev-dot); flex: none; margin-top: 3.5px; }
.seg.is-conflict .bar { box-shadow: 0 0 0 2px var(--conflict); }
.bar-multi { background: #FFFFFF; color: var(--error); font-size: 9.5px; gap: 2px; padding-left: 1px; padding-right: 1px; }
.bar-multi > b { flex: none; }
.bar-multi b { font-size: 11.5px; }
.bar-absence {
  align-items: center; justify-content: center; padding: 0 6px; border-radius: 9px; color: var(--text-2); box-shadow: none;
  background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 4px, var(--hatch-light, #F5F6F8) 4px 8px);
  text-overflow: ellipsis;
}
.seg.is-dim .bar { opacity: .25; }
.seg-absence.is-dim .bar { opacity: .4; }

.slot {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 100%; margin: 0; padding: 0 0 9px; border: 0;
  border-radius: 10px; background: transparent; display: flex; align-items: flex-end; justify-content: center;
  font: 700 9.5px/1 var(--font); letter-spacing: .03em; color: color-mix(in srgb, var(--ev-fg, transparent) 70%, transparent);
}
.seg-multi .slot { color: var(--error); }
.seg.is-dim .slot { color: color-mix(in srgb, var(--ev-fg, transparent) 25%, transparent); }
button.slot { cursor: pointer; }
button.slot:hover { background: rgba(59, 91, 219, .07); }
.seg-event button.slot:hover, .seg-absence button.slot:hover { background: rgba(255, 255, 255, .28); }
button.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.slot.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Day view (spec 6.6, DS4; restyled Mobile prototype) ---------- */
.day-head { display: flex; flex-direction: column; gap: 12px; }
.day-strip { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 16px; }
.strip-arrow {
  width: 34px; height: 54px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-strong); border-radius: 12px;
}
.strip-arrow:hover { background: var(--surface-2); color: var(--text); }
.strip-day {
  flex: 1; min-width: 0; height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: var(--text);
}
.strip-day:hover { background: var(--surface-2); color: var(--text); }
.strip-wd { font-size: 11px; color: var(--text-3); }
.strip-day.is-weekend .strip-wd { color: var(--weekend); }
.strip-num { font-size: 15px; font-weight: 700; line-height: 18px; }
.strip-dots { display: flex; gap: 2px; height: 5px; }
.strip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ev-dot); }
.strip-day.is-on, .strip-day.is-on:hover { background: var(--text); color: #FFFFFF; }
.strip-day.is-on .strip-wd { color: #D0D5DD; }
.day-title-row { display: flex; align-items: center; gap: 10px; }
.day-title { flex: 1; font-size: 16px; font-weight: 700; text-align: center; }
.day-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; min-height: 28px; align-items: center; }
.day-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px;
  background: var(--ev-bg); color: var(--ev-fg); font-size: 12.5px; white-space: nowrap;
}
.day-chip.is-closed { opacity: .65; }

.day-card { max-width: 860px; width: 100%; }
.dv { --dv-name: 200px; --dv-shift: 26px; --dv-line: 40px; min-width: 100%; width: max-content; }
.dv-head, .dv-row { display: grid; grid-template-columns: var(--dv-name) var(--dv-shift) repeat(3, minmax(86px, 1fr)); }
.dv-head {
  height: 36px; align-items: center; border-bottom: 1px solid var(--border-soft); color: var(--text-3);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.dv-corner {
  grid-column: 1 / 3; height: 100%; display: flex; align-items: center; padding-left: 14px; position: sticky; left: 0;
  z-index: 3; background: var(--surface);
}
.dv-col { text-align: center; }
.dv-row { grid-template-rows: var(--dv-line) var(--dv-line); border-bottom: 1px solid var(--divider); }
.dv-row:last-child { border-bottom: 0; }
.dv-name {
  grid-column: 1; grid-row: 1 / 3; position: sticky; left: 0; z-index: 2; background: var(--surface);
  padding: 6px 8px 6px 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0;
}
.dv-person-name { font-weight: 600; font-size: 12.5px; line-height: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.dv-cats { font-size: 11px; color: var(--text-3); }
.dv-phone { font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; align-self: flex-start; }
.dv-shifts {
  grid-column: 2; grid-row: 1 / 3; display: grid; grid-template-rows: 1fr 1fr; align-items: center; justify-items: center;
  position: sticky; left: var(--dv-name); z-index: 2; background: var(--surface); border-right: 1px solid var(--divider);
}
.dcell {
  margin: 3px; padding: 0 4px; border: 0; border-radius: 10px; background: transparent; min-width: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
  font: 600 12px/1 var(--font); color: var(--text);
}
button.dcell { cursor: pointer; }
button.dcell.is-empty:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); }
.dv-row.is-weekend .dcell.is-empty { background: var(--weekend-bg); }
.dcell.is-event { background: var(--ev-bg); color: var(--ev-fg); }
.dcell-sub { font-size: 10px; font-weight: 500; opacity: .8; }
.dcell.is-absence {
  color: var(--text-strong); font-size: 11px;
  background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 4px, var(--hatch-light, #F5F6F8) 4px 8px);
}
.dcell-status { overflow: hidden; text-overflow: ellipsis; }
.dcell.is-conflict { box-shadow: inset 0 0 0 2px var(--conflict); }
.dcell.is-selected { box-shadow: inset 0 0 0 2px var(--text); }
.dcell:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* ---------- Month view (spec 6.7) ---------- */
.mv { width: max-content; min-width: 100%; }
.mv-head, .mv-row { display: flex; }
.mv-head { border-bottom: 1px solid var(--border-soft); }
.mv-row { border-bottom: 1px solid var(--divider); }
.mv-row:last-child { border-bottom: 0; }
.mv-corner, .mv-name { width: 200px; flex: none; position: sticky; left: 0; z-index: 2; background: var(--surface); }
.mv-corner {
  padding: 12px 14px 8px; display: flex; align-items: flex-end; color: var(--text-3); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.mv-day {
  width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px;
  border-left: 1px solid var(--divider); color: var(--text); font-size: 13px;
}
.mv-day:hover { background: var(--accent-soft); color: var(--text); }
.mv-wd { font-size: 10px; color: var(--text-3); font-weight: 600; }
.mv-day.is-weekend { background: var(--weekend-bg); }
.mv-day.is-weekend .mv-wd { color: var(--weekend); }
.mv-name { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 14px; font-weight: 600; font-size: 12.5px; min-width: 0; }
.mv-row.is-archived .mv-name { color: var(--text-3); }
.mv-cell {
  position: relative; width: 34px; height: 38px; flex: none; border-left: 1px solid var(--divider); display: flex;
  flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; padding: 0 4px;
}
.mv-cell.is-weekend { background: var(--weekend-bg); }
.mv-cell.hatch { background: repeating-linear-gradient(135deg, var(--hatch-tone) 0 4px, var(--hatch-light) 4px 8px); }
.mv-cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.mv-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ev-dot); flex: none; }
.mv-conflict { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--conflict); }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }

/* ---------- Staffing table of the event card (spec 6.9, DS5; restyled Event prototype) ---------- */
.staffing { display: flex; flex-direction: column; gap: 14px; }
.staffing-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.section-h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.staffing-summary { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.staffing-summary b { color: var(--text); }
.staffing-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.cell-sample { width: 22px; height: 14px; border-radius: 5px; background: #EEF0F3; border: 1px dashed var(--text-4); }
.staffing-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.staffing-card { flex: 999 1 640px; min-width: 0; }
.staffing-add { flex: 1 1 300px; max-width: 380px; }
.st { width: max-content; min-width: 100%; }
.st-head { display: flex; border-bottom: 1px solid var(--border-soft); }
.st-corner {
  width: 220px; flex: none; position: sticky; left: 0; z-index: 3; background: var(--surface); padding: 12px 14px 8px;
  display: flex; align-items: flex-end; color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.st-day { width: 138px; flex: none; border-left: 1px solid var(--border-soft); }
.st-day.is-weekend { background: var(--weekend-bg); }
.st-day-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 8px 6px 10px; }
.st-day-title { font-size: 13px; }
.st-row { display: flex; border-bottom: 1px solid var(--divider); }
.st-row:last-child { border-bottom: 0; }
.st-name {
  width: 220px; flex: none; position: sticky; left: 0; z-index: 2; background: var(--surface); display: flex;
  align-items: center; gap: 10px; padding: 0 6px 0 14px; min-width: 0;
}
.st-name form { display: contents; }
.st-person { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.st-cats { font-size: 11px; color: var(--text-3); min-height: 14px; }
.st-shifts { align-self: stretch; display: grid; grid-template-rows: 1fr 1fr; align-items: center; }
.st-row.is-archived .st-person { opacity: .6; }
.st-lines { display: flex; flex-direction: column; }
.st-line { display: flex; height: 42px; }
.scell {
  position: relative; width: 46px; height: 42px; flex: none; margin: 0; padding: 0; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font: 700 11px/1 var(--font); color: var(--text);
}
.scell.is-day-start { border-left: 1px solid var(--border-soft); }
.scell.is-weekend { background: var(--weekend-bg); }
.scell::before { content: ""; position: absolute; inset: 3px; border-radius: 9px; }
.scell-label { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; max-width: 40px; }
.scell.is-own { color: var(--ev-fg); }
.scell.is-own::before { background: var(--ev-bg); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05); }
.scell.is-busy { color: var(--ev-dot); }
.scell.is-busy::before { background: #EEF0F3; border: 1px dashed var(--text-4); }
.scell.is-absence { color: var(--text-strong); font-size: 10px; font-weight: 600; }
.scell.is-absence::before { background: repeating-linear-gradient(135deg, var(--hatch-tone, #E4E7EC) 0 4px, var(--hatch-light, #F5F6F8) 4px 8px); }
.scell.is-conflict::before { box-shadow: inset 0 0 0 2px var(--conflict); }
.scell.is-selected::before { box-shadow: inset 0 0 0 2px var(--accent); }
button.scell { cursor: pointer; }
button.scell.is-empty:hover::before { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); }
button.scell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.add-filters { gap: 10px; padding: 14px 18px; }
.search-block, .select-block { width: 100%; min-width: 0; }
.select-block select { flex: 1; max-width: none; }
.candidates { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.candidate { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--divider); }
.candidate-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.candidate-cats { font-size: 11.5px; color: var(--text-3); }
.hint-free { font-size: 11.5px; font-weight: 600; color: var(--success); }
.hint-busy { font-size: 11.5px; font-weight: 600; color: var(--warning); }
.candidates-empty { display: none; padding: 16px 18px; color: var(--text-2); border-top: 1px solid var(--divider); }
.candidates:not(:has(.candidate:not([hidden]))) .candidates-empty { display: block; }

/* ---------- Responsive (spec 7) ---------- */
/* Narrow desktops with the side form or card open (ADMIN-MANAGEMENT-002): a slimmer panel, and
   the staff list (its card panel is always shown on a desktop) moves the phone under the name
   so the "Статус" column stays in view. */
@media (min-width: 1200px) and (max-width: 1379px) {
  .split { grid-template-columns: minmax(0, 1fr) 320px; }
  .split-staff { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (min-width: 768px) and (max-width: 1379px) {
  .split-staff .staff-grid { grid-template-columns: minmax(140px, 1.5fr) minmax(90px, 1fr) 178px 76px; }
  .split-staff .staff-table { min-width: 0; }
  .split-staff .staff-phone { display: none; }
  .split-staff .person-text .person-phone { display: inline-flex; font-size: 12px; }
}
@media (max-width: 1199px) {
  .split, .split-staff { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .nav { display: none; }
  .main { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); gap: 14px; }
  .page-title h1 { font-size: 22px; }
  .page-head > .btn-lg { width: 100%; }
  .toolbar { gap: 8px; }
  .search { min-width: 0; flex: 1 1 100%; height: 44px; }
  .select-pill { height: 44px; flex: 1 1 auto; }
  .segment { flex: 1 1 100%; overflow-x: auto; }
  .segment-item { height: 38px; flex: 1 0 auto; justify-content: center; }
  .btn, .input, .select { min-height: 44px; }
  .btn-sm, .icon-btn { min-height: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .round-btn { width: 44px; height: 44px; }
  .pill { height: 44px; }
  .chip-toggle { height: 40px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }

  /* Lists become cards */
  .grid-scroll { overflow: visible; }
  .staff-table, .roles-table, .access-table { min-width: 0; }
  .grid-head { display: none; }
  .grid-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .access-grid { grid-template-columns: minmax(0, 1fr); }
  .cell-label { display: inline; color: var(--text-3); font-size: 12px; }
  .ev-row { gap: 10px 14px; flex-wrap: wrap; }
  .ev-span { flex: 1 1 100%; }
  .ev-chevron { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-cards { grid-template-columns: minmax(0, 1fr); padding: 14px; }

  /* Collapsible create panel (spec 6.8: under the "Новое мероприятие" button) */
  .panel-collapsible:not(.is-open) { display: none; }
  .panel-close { display: inline-flex; }

  /* Staff card as a separate page */
  .split.has-panel > .split-main { display: none; }
  .back-link { display: inline-flex; align-items: center; gap: 6px; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface);
    border-top: 1px solid var(--border-soft); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; border: 0; border-radius: 12px; background: transparent; color: var(--text-3);
    font-size: 11px; font-weight: 500;
  }
  .tab[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tab[aria-current="page"] svg { color: var(--accent); }
  .toasts { left: 14px; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  /* Popover becomes a bottom sheet (spec 6.6, 7) */
  .popover-backdrop { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(16, 24, 40, .4); }
  .popover {
    position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; z-index: 70; width: auto; max-width: none;
    max-height: 88vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .popover-grip { display: block; margin: 8px auto 0; }
  .popover-body { max-height: none; overflow-y: auto; }
  .popover .btn, .pop-event, .pop-status { min-height: 44px; }
  .pop-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pop-role { height: 44px; padding: 0 4px; border-radius: 12px; font-size: 13px; }
  .popover-foot .btn { flex: 1; height: 44px; }
  .popover-page .popover { position: static; border-radius: var(--radius-card); max-height: none; }
  .popover-page .popover-backdrop, .popover-page .popover-grip { display: none; }

  /* Schedule on phones */
  .sched-head .segment { order: 3; }
  .sched-nav { margin-left: auto; }
  .wk { --name-w: 168px; }
  .wk-name { padding: 0 6px 0 10px; gap: 8px; }
  .wk-name .avatar { width: 28px; height: 28px; font-size: 11px; }
  .legend-pill { height: 36px; }
  .day-card { margin: 0 -14px; width: auto; border-radius: 0; }
  .dv { --dv-name: 130px; --dv-shift: 20px; --dv-line: 36px; width: auto; }
  .dv-head, .dv-row { grid-template-columns: var(--dv-name) var(--dv-shift) repeat(3, minmax(76px, 1fr)); }
  .dv-phone { font-size: 10.5px; }
  .dv-phone svg { display: none; }
  .dv-name { padding: 4px 6px 4px 12px; }
  .dv-person-name { font-size: 12px; }
  .dcell { margin: 2px; border-radius: 8px; }
  .day-strip { margin: 0 -6px; padding: 4px; }
  .strip-arrow { width: 26px; }
  .staffing-add { max-width: none; }
  .st-corner, .st-name { width: 150px; }
  .st-name { gap: 6px; padding-left: 10px; }
  .st-name .avatar { display: none; }
  .staffing-head .btn-primary { width: 100%; margin-left: 0; }
  .auth-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Additions: forms inside panels, fieldsets, mobile list cards ---------- */
.panel > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 8px; }
.card-foot-pad { padding: 0 18px 18px; }
.text-strong { color: var(--text-strong); }
.archived-toggle { display: flex; align-items: center; gap: 8px; }
.access-actions { justify-content: flex-start; flex-wrap: wrap; align-items: flex-start; }
.panel .segment { display: flex; }
.panel .segment .segment-item { flex: 1; justify-content: center; }
.reset-details summary { list-style: none; }
.reset-details summary::-webkit-details-marker { display: none; }
@media (max-width: 767px) {
  .roles-grid {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "code name actions" "people used used";
  }
  .role-code { grid-area: code; }
  .role-name { grid-area: name; }
  .role-people { grid-area: people; }
  .role-used { grid-area: used; }
  .role-actions { grid-area: actions; }
  .role-color { display: none; }
  .staff-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "person status" "phone phone" "tags tags" "week week";
  }
  .staff-person { grid-area: person; }
  .staff-phone { grid-area: phone; }
  .staff-tags { grid-area: tags; }
  .staff-week { grid-area: week; }
  .staff-status { grid-area: status; }
  .card-head { flex-wrap: wrap; }
}
.panel-section { border-top: 1px solid var(--border-soft); gap: 8px; }
.panel-empty { align-items: flex-start; }
@media (max-width: 767px) {
  .split:not(.has-panel) > #staff-panel { display: none; }
  .field-inline > .field { flex: 1 1 120px; }
}
.toggle-panel:not(.is-open) { display: none; }
.event-head { display: flex; flex-direction: column; gap: 8px; }
.event-name { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.edit-panel { max-width: 720px; }
.edit-panel .panel-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edit-panel .panel-body > .preview-box, .edit-panel .panel-body > .form-errors, .edit-panel .panel-body > .fieldset { grid-column: 1 / -1; }
.edit-panel .field-row { grid-column: 1 / -1; }
@media (max-width: 767px) {
  .edit-panel .panel-body { grid-template-columns: minmax(0, 1fr); }
  .event-name { font-size: 20px; }
}
.push-right { margin-left: auto; }
.pill-danger { display: inline-flex; align-items: center; gap: 6px; }
