/* «Лагерь» — панель управления. Палитра строго из brand.md. */
:root {
  --sand: #FBF6EC;
  --surface: #FFFFFF;
  --ink: #1C2B27;
  --sun: #F2B544;
  --green: #1F6F5C;
  --green-dark: #145043;
  --neutral: #DCE6E0;
  --coral: #E8614D;
  --sky: #4E93C8;
  --muted: #60736C;
  --ok: #2F7D57;
  --warn: #B26A00;
  --err: #B83A2E;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 43, 39, .05), 0 10px 30px rgba(28, 43, 39, .06);
  --shadow-hover: 0 2px 4px rgba(28, 43, 39, .06), 0 16px 36px rgba(28, 43, 39, .10);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-close: cubic-bezier(0.4, 0, 1, 1);
  --font-head: "Manrope", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 700; }
h2 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--ink); }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--green); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- layout ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: 264px; flex: 0 0 264px;
  display: flex; flex-direction: column;
  background: var(--green); color: #fff;
  padding: 18px 14px 14px;
  overflow-y: auto;
}
.brand-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--sand); padding: 3px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font: 700 22px/1.1 var(--font-head); letter-spacing: -0.01em; }
.brand-text span { font-size: 12px; letter-spacing: .04em; color: #DCE6E0; }
.sidebar-close { display: none; margin-left: auto; color: #fff; background: rgba(255,255,255,.12); }

.sidebar-pattern { position: absolute; right: -90px; top: 90px; width: 280px; opacity: .10; pointer-events: none; filter: brightness(0) invert(1); }
.sidebar { position: fixed; }
.main-nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #DCE6E0; font-size: 14.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .14s var(--ease), color .14s var(--ease), transform .14s var(--ease);
  min-height: 44px;
}
.nav-item:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
.nav-item img { width: 21px; height: 21px; filter: brightness(0) invert(1); opacity: .92; flex: none; }
.nav-item.active { background: var(--sand); color: var(--green-dark); font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.nav-item.active img { filter: none; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  margin-left: auto; font: 700 11px/1 var(--font-body); background: var(--sun); color: var(--ink);
  border-radius: 999px; padding: 4px 6px;
}
.nav-group-label { margin: 16px 12px 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #DCE6E0; }

.sidebar-foot { margin-top: auto; padding: 18px 8px 4px; border-top: 1px solid rgba(255,255,255,.16); }
.demo-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #DCE6E0; margin-bottom: 12px; line-height: 1.35; }
.demo-note strong { color: #fff; font-size: 13px; }
.dot-live { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--sun); flex: none; }
.sidebar-legal { margin: 10px 0 0; font-size: 11px; color: #DCE6E0; line-height: 1.4; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }

.main-col { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  background: rgba(251, 246, 236, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--neutral);
  padding: 12px clamp(16px, 3vw, 34px);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.demo-badge { background: var(--sun); color: var(--ink); font: 700 11px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; padding: 7px 9px; border-radius: 999px; }
.role-switch { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--neutral); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.role-switch select { border: 0; background: var(--sand); border-radius: 999px; padding: 7px 26px 7px 10px; font-size: 13px; font-weight: 600; color: var(--ink); max-width: 170px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--neutral); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; font-weight: 600; max-width: 220px; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }

main { flex: 1; width: 100%; padding: clamp(16px, 2.6vw, 30px) clamp(16px, 3vw, 34px) 36px; }
.view { max-width: 1280px; margin: 0 auto; min-width: 0; }
.app-footer { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; padding: 18px clamp(16px, 3vw, 34px) 26px; border-top: 1px solid var(--neutral); color: var(--muted); font-size: 12.5px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- primitives ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: clamp(24px, 2.6vw, 34px); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.caption { font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid transparent; background: var(--green); color: #fff;
  font: 600 14px/1.1 var(--font-body); text-decoration: none;
  transition: background .14s var(--ease), color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn img { width: 18px; height: 18px; }
.btn-accent { background: var(--sun); color: var(--ink); }
.btn-accent:hover { background: #F2B544; }
.btn-outline { background: transparent; color: var(--green-dark); border-color: var(--green); }
.btn-outline:hover { background: rgba(31,111,92,.08); }
.btn-quiet { background: var(--sand); color: var(--ink); border-color: var(--neutral); }
.btn-quiet:hover { background: #FBF6EC; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #B83A2E; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.btn-xs { min-height: 28px; padding: 4px 9px; font-size: 11.5px; border-radius: 8px; }
.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--neutral); border-radius: 50%; background: var(--surface); color: var(--ink);
  transition: background .14s var(--ease), transform .14s var(--ease);
}
.icon-btn:hover { background: var(--sand); }
.icon-btn:active { transform: scale(.96); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  font: 700 11px/1.5 var(--font-body); letter-spacing: .02em; white-space: nowrap;
  background: var(--neutral); color: var(--ink);
}
.badge-green { background: rgba(31,111,92,.12); color: var(--green-dark); }
.badge-sun { background: rgba(242,181,68,.24); color: #B26A00; }
.badge-coral { background: rgba(232,97,77,.16); color: #B83A2E; }
.badge-sky { background: rgba(78,147,200,.16); color: #4E93C8; }
.badge-ok { background: rgba(47,125,87,.14); color: #2F7D57; }
.badge-warn { background: rgba(178,106,0,.15); color: #B26A00; }
.badge-err { background: rgba(184,58,46,.14); color: #B83A2E; }
.badge-gray { background: var(--neutral); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: clamp(14px, 2vw, 22px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { font-size: 17px; }
.card-sub { color: var(--muted); font-size: 12.5px; margin: 0; }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }

.kpi { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.kpi-value { font: 700 clamp(22px, 2.4vw, 30px)/1.1 var(--font-head); letter-spacing: -0.01em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--muted); }
.icon-tile { width: 38px; height: 38px; border-radius: 11px; background: var(--sand); display: grid; place-items: center; flex: none; }
.icon-tile img { width: 22px; height: 22px; }
.icon-tile.sky { background: rgba(78,147,200,.13); }
.icon-tile.sun { background: rgba(242,181,68,.2); }
.icon-tile.coral { background: rgba(232,97,77,.12); }
.icon-tile.green { background: rgba(31,111,92,.1); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 200px; min-width: 150px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field > span .req { color: var(--err); }
.input, .select, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--neutral); border-radius: 10px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
textarea.input { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,111,92,.13); outline: none; }
.search { position: relative; min-width: 0; }
.search input { padding-left: 36px; }
.search::before {
  content: ""; position: absolute; left: 13px; top: 50%; width: 13px; height: 13px;
  border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-60%);
  box-shadow: 6px 6px 0 -4px var(--muted);
}
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink); line-height: 1.4; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.form-note { font-size: 12px; color: var(--muted); }
.form-error { color: var(--err); font-size: 12.5px; font-weight: 600; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--neutral); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 12px; background: #FBF6EC; border-bottom: 1px solid var(--neutral); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid #DCE6E0; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .14s var(--ease); }
table.data tbody tr:hover { background: #FBF6EC; }
table.data tr.low td { background: rgba(232,97,77,.055); }
table.data tr.clickable { cursor: pointer; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person > span { min-width: 0; }
.person strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.person small { color: var(--muted); font-size: 11.5px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 34px 20px; color: var(--muted); }
.empty img { width: min(210px, 60%); height: auto; }
.empty strong { color: var(--ink); font: 600 17px/1.3 var(--font-head); }

.segbar { display: flex; gap: 3px; height: 10px; width: 100%; }
.segbar .seg { flex: 1 1 0; background: var(--neutral); border-radius: 3px; transition: background .2s var(--ease); }
.segbar .seg.on { background: var(--green); }
.segbar.warm .seg.on { background: var(--sun); }
.segbar.hot .seg.on { background: var(--coral); }
.segbar-lg { height: 13px; gap: 4px; }
.seg-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--sand); border: 1px solid var(--neutral); border-radius: 999px; padding: 4px 9px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip-click { cursor: pointer; transition: background .14s var(--ease), color .14s var(--ease); }
.chip-click:hover { border-color: var(--green); color: var(--green-dark); }

/* ---------- dashboard ---------- */
.chart-wrap { width: 100%; min-width: 0; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.attention-list { display: flex; flex-direction: column; gap: 8px; }
.attention-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--neutral); border-radius: 10px; background: #FBF6EC; font-size: 13px; }
.attention-item .badge { margin-left: auto; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.quick-action { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--neutral); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease); }
.quick-action:hover { border-color: var(--green); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-action img { width: 20px; height: 20px; }
.activity { display: flex; flex-direction: column; gap: 0; }
.activity-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #DCE6E0; font-size: 12.5px; }
.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); margin-top: 6px; flex: none; }
.activity-row time { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--neutral); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tab { border: 0; background: transparent; padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; min-height: 44px; transition: color .14s var(--ease), border-color .14s var(--ease); }
.tab:hover { color: var(--green-dark); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--sun); }

/* ---------- kanban ---------- */
.kanban-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; min-width: 0; }
.kcol { background: #FBF6EC; border: 1px solid var(--neutral); border-radius: 14px; min-width: 190px; display: flex; flex-direction: column; min-height: 220px; transition: border-color .12s var(--ease), background .12s var(--ease); }
.kcol.drop-target { border-color: var(--green); background: rgba(31,111,92,.08); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 11px 8px; font-size: 12px; font-weight: 700; }
.kcount { background: var(--surface); border: 1px solid var(--neutral); border-radius: 999px; padding: 1px 7px; font-size: 11px; color: var(--muted); }
.kbody { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; min-height: 120px; }
.order-card {
  background: var(--surface); border: 1px solid var(--neutral); border-radius: 12px;
  padding: 10px 11px; cursor: grab; position: relative;
  box-shadow: 0 1px 2px rgba(28,43,39,.04);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
  min-width: 0;
}
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #DCE6E0; }
.order-card:active { cursor: grabbing; }
.order-card.dragging { opacity: .55; transform: scale(.98); }
.order-card.vip { border-left: 4px solid var(--sun); }
.order-card.urgent { border-left: 4px solid var(--coral); }
.order-card.vip.urgent { border-left: 4px solid var(--coral); }
.order-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.order-num { font: 700 12px/1 var(--font-body); color: var(--green-dark); letter-spacing: .01em; }
.order-client { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-sum { font: 700 13px/1.2 var(--font-body); font-variant-numeric: tabular-nums; margin-top: 6px; }
.order-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.move-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.move-row label { font-size: 10.5px; color: var(--muted); }
.move-row select { flex: 1; min-width: 0; font-size: 11px; padding: 4px 6px; border: 1px solid var(--neutral); border-radius: 7px; background: #FBF6EC; }

/* ---------- list / detail ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--neutral); border-radius: 11px; background: var(--surface); font-size: 13px; min-width: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }
.detail-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detail-grid dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0,1fr); gap: 9px; padding-bottom: 12px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--neutral); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-top: 2px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--neutral); }
.tl-item time { font-size: 11px; color: var(--muted); }
.tl-item strong { font-size: 13px; display: block; }

/* ---------- modal / drawer ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(28,43,39,.42); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .16s var(--ease); }
.modal-card { background: var(--surface); border-radius: 18px; width: min(640px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.3); animation: modalIn .24s var(--ease); }
.modal-wide { width: min(780px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--neutral); }
.modal-head h3 { font-size: 20px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 20px 18px; border-top: 1px solid var(--neutral); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.drawer-scrim { position: fixed; inset: 0; background: rgba(28,43,39,.38); z-index: 55; animation: fadeIn .16s var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100%); background: var(--surface); z-index: 56; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.22); animation: drawerIn .28s var(--ease); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--neutral); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px 18px; border-top: 1px solid var(--neutral); display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 14px 40px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; z-index: 90; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .16s var(--ease), transform .18s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--green-dark); }
.toast.error { background: var(--err); }
.toast.sun { background: var(--sun); color: var(--ink); }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo { border: 1px solid var(--neutral); border-radius: 12px; overflow: hidden; background: var(--surface); min-width: 0; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo figcaption { padding: 8px 10px; font-size: 12px; }
.photo figcaption strong { display: block; font-size: 12.5px; }
.photo figcaption span { color: var(--muted); font-size: 11px; }
.upload-box { border: 1.5px dashed #DCE6E0; border-radius: 12px; padding: 14px; background: #FBF6EC; }
.upload-preview { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.upload-preview img { width: 74px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--neutral); }

/* ---------- calendar ---------- */
.cal-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { font: 700 18px/1.2 var(--font-head); min-width: 170px; }
.calendar { border: 1px solid var(--neutral); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); background: #FBF6EC; border-bottom: 1px solid var(--neutral); }
.cal-dow span { padding: 8px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-cell { min-height: 96px; border-right: 1px solid #DCE6E0; border-bottom: 1px solid #DCE6E0; padding: 5px; min-width: 0; background: var(--surface); cursor: pointer; transition: background .14s var(--ease); }
.cal-cell:hover { background: #FBF6EC; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: #FBF6EC; color: var(--muted); }
.cal-cell.today .cal-day { background: var(--sun); color: var(--ink); }
.cal-day { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.cal-chip { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; font-size: 9.5px; line-height: 1.3; background: rgba(31,111,92,.12); color: var(--green-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.sky { background: rgba(78,147,200,.16); color: #4E93C8; }
.cal-more { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); font-weight: 600; }
.agenda { display: none; }
.cal-detail { margin-top: 14px; }

/* ---------- storefront ---------- */
.storefront { background: var(--sand); }
.storefront .hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0;
  background: var(--surface); border: 1px solid var(--neutral); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px;
}
.hero-copy { padding: clamp(22px, 3.4vw, 46px); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hero-copy h2 { font-size: clamp(28px, 3.6vw, 44px); max-width: 16ch; }
.hero-copy p { margin: 12px 0 18px; color: #60736C; font-size: 16px; max-width: 42ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-media { position: relative; min-height: 300px; background: var(--neutral); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-badge { position: absolute; left: 14px; bottom: 14px; background: rgba(251,246,236,.94); border-radius: 999px; padding: 6px 11px; font-size: 11.5px; font-weight: 700; color: var(--green-dark); display: flex; gap: 7px; align-items: center; }
.hero-badge img { width: 18px; height: 18px; }
.section { margin: 26px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h3 { font-size: clamp(22px, 2.4vw, 30px); }
.section-head p { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; max-width: 60ch; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.feature { background: var(--surface); border: 1px solid var(--neutral); border-radius: 14px; padding: 16px; min-width: 0; transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature img { width: 34px; height: 34px; margin-bottom: 10px; }
.feature h4 { font-size: 15px; margin-bottom: 4px; }
.feature p { font-size: 12.5px; color: var(--muted); margin: 0; }
.shift-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.shift-card { background: var(--surface); border: 1px solid var(--neutral); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
.shift-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shift-media { position: relative; aspect-ratio: 4 / 3; background: var(--neutral); }
.shift-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.shift-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.shift-body h4 { font-size: 17px; }
.shift-facts { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.shift-price { font: 700 20px/1.1 var(--font-head); font-variant-numeric: tabular-nums; margin-top: auto; }
.shift-price small { font: 400 11px/1 var(--font-body); color: var(--muted); }
.room-block { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--neutral); border-radius: 18px; overflow: hidden; }
.room-media { position: relative; min-height: 260px; background: var(--neutral); }
.room-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.room-copy { padding: clamp(20px, 3vw, 34px); display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.room-types { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.room-type { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--neutral); border-radius: 10px; background: #FBF6EC; font-size: 12px; font-weight: 600; }
.room-type img { width: 30px; height: 30px; }
.diary-block { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); background: var(--green-dark); color: #fff; border-radius: 18px; overflow: hidden; }
.diary-block .diary-copy { padding: clamp(20px, 3vw, 34px); }
.diary-block h3 { color: #fff; }
.diary-block p { color: #DCE6E0; }
.diary-media { position: relative; min-height: 240px; }
.diary-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.diary-entry { border-top: 1px solid rgba(255,255,255,.2); padding-top: 10px; margin-top: 10px; font-size: 12.5px; color: #DCE6E0; }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--neutral); border-radius: 12px; padding: 12px 14px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq details p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.lead-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--neutral); border-radius: 18px; overflow: hidden; }
.lead-side { background: var(--green); color: #fff; padding: clamp(20px, 3vw, 34px); }
.lead-side h3 { color: #fff; }
.lead-side p { color: #DCE6E0; font-size: 13.5px; }
.lead-side ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #DCE6E0; }
.lead-side li { display: flex; gap: 7px; align-items: flex-start; }
.lead-side li::before { content: "✓"; color: var(--sun); font-weight: 700; }
.lead-form { padding: clamp(20px, 3vw, 34px); }
.store-footer { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--neutral); font-size: 12.5px; color: var(--muted); }

/* ---------- auth / access ---------- */
.access-denied { max-width: 620px; margin: 30px auto; text-align: center; }
.access-denied .card { padding: 28px; }
.access-denied h2 { margin: 12px 0 6px; }
.role-note { display: flex; gap: 8px; align-items: flex-start; background: rgba(78,147,200,.09); border: 1px solid rgba(78,147,200,.28); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; color: #4E93C8; margin-bottom: 14px; }
.role-note img { width: 18px; height: 18px; flex: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 44px; height: 26px; border-radius: 999px; background: #DCE6E0; transition: background .16s var(--ease); position: relative; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s var(--ease); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--sky); outline-offset: 2px; }

.channel-card { border: 1px solid var(--neutral); border-radius: 14px; padding: 16px; background: var(--surface); min-width: 0; }
.channel-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.channel-head h4 { display: flex; align-items: center; gap: 8px; }
.channel-head img { width: 24px; height: 24px; }
.channel-card .field { margin-top: 10px; }

/* ---------- utility animation ---------- */
.stagger > * { animation: riseIn .24s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.fade-in { animation: fadeIn .2s var(--ease) both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes drawerIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shift-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar { width: 236px; flex-basis: 236px; }
  .main-col { margin-left: 236px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .28s var(--ease); width: 270px; }
  .sidebar.open { transform: none; }
  .sidebar-close { display: inline-flex; }
  .main-col { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(28,43,39,.42); z-index: 35; }
  .grid-side { grid-template-columns: minmax(0,1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar-title h1 { max-width: 38vw; }
}
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0,1fr); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .hero { grid-template-columns: minmax(0,1fr); }
  .hero-media { min-height: 250px; order: -1; }
  .room-block, .diary-block, .lead-block { grid-template-columns: minmax(0,1fr); }
  .room-media, .diary-media { min-height: 220px; }
  .shift-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .faq { grid-template-columns: minmax(0,1fr); }
  .detail-grid { grid-template-columns: minmax(0,1fr); }
  .topbar { flex-wrap: wrap; }
  .topbar-tools { width: 100%; justify-content: flex-start; }
  .topbar-title { order: 2; }
  .menu-btn { order: 1; }
  .topbar-tools { order: 3; }
  .topbar-title h1 { max-width: 70vw; }
}
@media (max-width: 640px) {
  .user-chip span { display: none; }
  .user-chip { padding: 4px; }
  .role-switch span { display: none; }
  .role-switch { padding-left: 4px; }
  .shift-grid, .feature-grid, .quick-actions { grid-template-columns: minmax(0,1fr); }
  .page-head { align-items: flex-start; }
  .page-head h2 { font-size: 26px; }
  .nav-group-label { display: none; }
  .cal-cell { min-height: 64px; }
  .cal-chip { display: none; }
  .calendar { display: none; }
  .agenda { display: block; }
  .modal-body, .drawer-body { padding: 14px; }
  .drawer-head, .modal-head { padding: 14px 14px 10px; }
  .drawer-foot, .modal-foot { padding: 10px 14px 14px; }
  main { padding-left: 12px; padding-right: 12px; }
  .app-footer { padding-left: 14px; padding-right: 14px; }
  .toast { bottom: 14px; }
}
@media (max-width: 380px) {
  .topbar-tools .demo-badge { display: none; }
  .hero-copy { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .stagger > * { animation-delay: 0ms !important; }
  .order-card:hover, .feature:hover, .shift-card:hover, .quick-action:hover { transform: none; }
}

@media print {
  .sidebar, .topbar, .app-footer { display: none; }
  .main-col { margin: 0; }
  body { background: #fff; }
}
