/* СЕКТОР · палитра brand.md: #121417 #1E2329 #F4F1EA #E4572E #C9A227 #2E7D5B */
:root {
  --bg: #121417;
  --surface: #1E2329;
  --paper: #F4F1EA;
  --accent: #E4572E;
  --brass: #C9A227;
  --ok: #2E7D5B;
  --line: rgba(244, 241, 234, .12);
  --line-strong: rgba(244, 241, 234, .22);
  --muted: rgba(244, 241, 234, .68);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.4, 0, 1, 1);
  --font: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--paper);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--paper); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 650; }
h3 { font-size: clamp(18px, 2vw, 21px); font-weight: 600; }
p { margin: 0 0 1em; max-width: 72ch; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.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;
}
.hint { color: var(--muted); font-size: 14px; line-height: 1.45; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brass);
}
.eyebrow img { width: 18px; height: 18px; }

/* Верхняя панель */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 32px);
  background: rgba(18, 20, 23, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; letter-spacing: .04em; line-height: 1.05; }
.brand-text small { font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted); text-transform: none; }
.tabs {
  display: flex; align-items: center; gap: 4px; flex: 1 1 420px;
  overflow-x: auto; scrollbar-width: thin; padding: 2px;
}
.tabs::-webkit-scrollbar { height: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 8px 11px; border-radius: 10px; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; white-space: nowrap; text-decoration: none;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}
.tab img { width: 17px; height: 17px; opacity: .85; }
.tab:hover { color: var(--paper); background: rgba(244, 241, 234, .07); }
.tab.is-active { color: var(--paper); background: var(--surface); border-color: var(--line); }
.tab.is-active::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.tab[hidden] { display: none; }
.tab.is-locked { opacity: .62; }
.tab.is-locked img { opacity: .45; }
.tab.is-locked::before { content: "•"; margin-right: 2px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.role-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.role-switch select { text-transform: none; letter-spacing: 0; }

/* Формы */
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; color: var(--paper);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
input::placeholder, textarea::placeholder { color: rgba(244, 241, 234, .42); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
select { appearance: auto; }
label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; letter-spacing: 0; color: var(--paper); }
.consent { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; line-height: 1.4; }
.consent input { width: auto; margin: 3px 0 0; accent-color: var(--accent); }
.stack { display: grid; gap: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.inline-form label { flex: 1 1 200px; }
.form-status { min-height: 1.4em; margin: 0; font-size: 14px; color: var(--muted); }
.form-status.is-error { color: var(--accent); }
.form-status.is-ok { color: var(--ok); }
.lead-form { display: grid; gap: 12px; max-width: 620px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 11px 20px;
  font-weight: 600; font-size: 15px; line-height: 1.1; text-decoration: none;
  transition: transform 160ms var(--ease), filter 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-secondary { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--paper); filter: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--paper); background: rgba(244, 241, 234, .07); filter: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-ok { background: var(--ok); color: var(--paper); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Общая сетка */
.page-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px clamp(14px, 3vw, 30px); }
.screen { display: none; }
.screen.is-active { display: block; animation: fadeUp 220ms var(--ease) both; }
.block { margin: 0 0 34px; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.block-head h2 { margin-bottom: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .search { min-width: 220px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(14px, 2vw, 22px);
}
.panel > h3:first-child { display: flex; align-items: center; gap: 8px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18, 20, 23, .5); border-color: var(--line-strong); }
.card h3 { margin: 0; overflow-wrap: anywhere; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-icon { width: 34px; height: 34px; flex: 0 0 auto; }
.price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; white-space: nowrap; }
.price-sm { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.card-actions .btn { flex: 1 1 auto; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* Hero */
.hero { position: relative; min-height: clamp(440px, 62vh, 620px); display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% center; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 20, 23, .96) 0%, rgba(18, 20, 23, .82) 42%, rgba(18, 20, 23, .28) 78%, rgba(18, 20, 23, .42) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 620px; padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 64px); }
.hero-content h1 { margin-bottom: 14px; }
.hero-content .lead { font-size: clamp(16px, 2vw, 19px); color: var(--paper); max-width: 54ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 14px; }
.hero-note { font-size: 12px; letter-spacing: .02em; color: var(--muted); margin: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: -50px 0 32px; position: relative; z-index: 2; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat-num { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 600; color: var(--brass); }
.stat-label { display: block; font-size: 13px; color: var(--muted); }

/* Фичевые блоки */
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 30px); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 2vw, 22px); }
.feature > img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; }
.feature-reverse > img { order: 2; }
.icon-row { display: flex; flex-wrap: wrap; gap: 14px; }
.icon-row span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

/* Бронирование */
.booking-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  border: 1px solid var(--line-strong); background: var(--bg); border-radius: 10px;
  padding: 9px 6px; font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 14px; transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot.is-busy { color: rgba(244, 241, 234, .45); border-color: rgba(228, 87, 46, .45); background: rgba(228, 87, 46, .10); text-decoration: line-through; cursor: not-allowed; }
.slot.is-selected { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.slot small { display: block; font-size: 11px; font-family: var(--font); text-decoration: none; }
.cart-panel { position: sticky; top: 84px; }
.cart-list { display: grid; gap: 8px; margin-bottom: 12px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cart-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--paper); line-height: 1; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 16px; padding-top: 10px; border-top: 1px solid var(--line-strong); }
.cart-total strong { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 22px; }
.cart-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.find-result { display: grid; gap: 10px; }
.find-card { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 16px; }

/* Бейджи и статусы */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; letter-spacing: .03em; background: rgba(244, 241, 234, .1); color: var(--paper); white-space: nowrap; }
.badge-demo { background: rgba(201, 162, 39, .18); color: var(--brass); border: 1px solid rgba(201, 162, 39, .4); }
.badge-server { background: rgba(46, 125, 91, .2); color: var(--paper); border: 1px solid rgba(46, 125, 91, .5); }
.badge-accent { background: rgba(228, 87, 46, .16); color: var(--paper); border: 1px solid rgba(228, 87, 46, .45); }
.badge-ok { background: var(--ok); color: var(--paper); }
.badge-brass { background: rgba(201, 162, 39, .16); color: var(--brass); border: 1px solid rgba(201, 162, 39, .38); }
.badge-muted { background: rgba(244, 241, 234, .07); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; background: rgba(244, 241, 234, .08); color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-paid, .status-done, .status-confirmed { background: rgba(46, 125, 91, .22); color: var(--paper); }
.status-pending, .status-planned { background: rgba(201, 162, 39, .16); color: var(--brass); }
.status-cancelled, .status-refund, .status-error { background: rgba(228, 87, 46, .16); color: var(--paper); }
.status-paid::before, .status-done::before, .status-confirmed::before { background: var(--ok); }

/* Панель: заголовки экранов */
.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.screen-head h1 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 4px; }
.screen-head p { color: var(--muted); margin: 0; }
.screen-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 600; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-value.is-accent { color: var(--accent); }
.kpi-value.is-brass { color: var(--brass); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.section-gap { margin-top: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Таблицы */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); font-size: 14px; }
th { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: rgba(244, 241, 234, .03); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr { transition: background 160ms var(--ease); }
tbody tr:hover { background: rgba(244, 241, 234, .04); }
.row-click { cursor: pointer; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty img { width: 46px; height: 46px; margin: 0 auto 10px; opacity: .75; }
.empty p { margin: 0 auto; max-width: 42ch; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.toolbar label { flex: 1 1 170px; }
.toolbar .grow { flex: 1 1 240px; }
.count-note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

/* Канбан */
.kanban-scroll { width: 100%; overflow-x: auto; padding-bottom: 6px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; min-width: 900px; align-items: start; }
.kanban-col { background: rgba(30, 35, 41, .65); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 220px; transition: border-color 160ms var(--ease), background 160ms var(--ease); }
.kanban-col.is-over { border-color: var(--accent); background: rgba(228, 87, 46, .08); }
.kanban-col h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 2px 4px 10px; }
.kanban-col h3 span { font-family: var(--mono); color: var(--paper); }
.kcard {
  background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--brass);
  border-radius: 11px; padding: 10px 11px; margin-bottom: 8px; cursor: grab;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}
.kcard:active { cursor: grabbing; }
.kcard.is-dragging { transform: scale(1.02); box-shadow: 0 12px 26px rgba(18, 20, 23, .6); opacity: .85; }
.kcard.is-urgent { border-left-color: var(--accent); }
.kcard.is-vip { box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .5); }
.kcard-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.kcard-code { font-family: var(--mono); font-size: 12px; color: var(--brass); }
.kcard-title { font-weight: 600; font-size: 14px; margin: 0 0 2px; overflow-wrap: anywhere; }
.kcard-meta { font-size: 12px; color: var(--muted); }
.kcard-actions { display: flex; gap: 5px; margin-top: 7px; }
.kcard-actions button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.kcard-actions button:hover { color: var(--paper); border-color: var(--paper); }
.kanban-cancelled { margin-top: 12px; }

/* Календарь */
.cal-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: 120px repeat(7, minmax(92px, 1fr)); min-width: 820px; }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 54px; padding: 6px; font-size: 12px; }
.cal-grid > .cal-cell:nth-child(8n) { border-right: 0; }
.cal-head { background: rgba(244, 241, 234, .04); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-lane { color: var(--paper); font-size: 13px; display: flex; flex-direction: column; justify-content: center; }
.cal-lane small { color: var(--muted); font-size: 11px; }
.cal-booked { display: block; background: rgba(228, 87, 46, .14); border: 1px solid rgba(228, 87, 46, .4); border-radius: 7px; padding: 4px 5px; margin-bottom: 3px; font-size: 11px; overflow-wrap: anywhere; }
.cal-free { width: 100%; height: 100%; min-height: 40px; border: 1px dashed transparent; background: transparent; color: transparent; border-radius: 7px; font-size: 11px; }
.cal-free:hover { border-color: var(--ok); color: var(--paper); background: rgba(46, 125, 91, .12); }
.cal-free:focus-visible { border-color: var(--accent); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.cal-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--line-strong); }
.cal-legend .lg-busy::before { background: rgba(228, 87, 46, .5); }
.cal-legend .lg-free::before { background: rgba(46, 125, 91, .6); }

/* Уведомления */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 42px; height: 24px; border-radius: 999px; background: rgba(244, 241, 234, .16); border: 1px solid var(--line-strong); position: relative; transition: background 160ms var(--ease); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform 160ms var(--ease); }
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.chan-row { display: flex; align-items: center; gap: 8px; }
.chan-row img { width: 18px; height: 18px; }

/* Склад */
.stock-low { color: var(--accent); font-weight: 600; }
.stock-ok { color: var(--paper); }
.bar { height: 8px; border-radius: 999px; background: rgba(244, 241, 234, .12); overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.bar.is-low > span { background: var(--accent); }
.seg { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(244, 241, 234, .1); margin: 6px 0 2px; }
.seg span { display: block; height: 100%; }
.seg .s1 { background: var(--accent); }
.seg .s2 { background: var(--brass); }
.seg .s3 { background: var(--ok); }

/* Hermes */
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dataset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.dataset strong { display: block; font-family: var(--mono); font-size: 13px; color: var(--brass); }
.dataset small { color: var(--muted); font-size: 12px; }
.preview-box { background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px; font-size: 13px; overflow-wrap: anywhere; }
.diff-old { color: var(--muted); text-decoration: line-through; font-family: var(--mono); }
.diff-new { color: var(--brass); font-family: var(--mono); font-weight: 600; }
.receipt-list { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.receipt-list code { color: var(--paper); }

/* Графики */
.chart-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* Модальные окна */
#modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(18, 20, 23, .78); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 180ms var(--ease) both; }
.modal { width: min(640px, 100%); max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px rgba(18, 20, 23, .7); animation: fadeUp 220ms var(--ease) both; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-close { border: 1px solid var(--line); background: transparent; color: var(--paper); border-radius: 9px; width: 34px; height: 34px; font-size: 20px; line-height: 1; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.code-big { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .06em; color: var(--brass); margin: 8px 0; }

/* Тосты */
.toast-root { position: fixed; top: 78px; right: 16px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--ok); border-radius: 11px; padding: 10px 14px; font-size: 14px; box-shadow: 0 12px 28px rgba(18, 20, 23, .6); animation: toastIn 200ms var(--ease) both; }
.toast.is-error { border-left-color: var(--accent); }
.toast.is-info { border-left-color: var(--brass); }

/* Отказ генератора изображений: явная заглушка вместо тихой подмены */
.media-alert {
  margin: 0; padding: 12px clamp(14px, 3vw, 30px);
  background: rgba(228, 87, 46, .16); border-bottom: 1px solid var(--accent);
  color: var(--paper); font-size: 14px; line-height: 1.45;
}
.media-alert strong { color: var(--accent); }
.asset-fallback-box {
  display: grid; place-items: center; gap: 6px; text-align: center;
  min-height: 180px; padding: 20px; border: 1px dashed var(--accent);
  border-radius: 12px; background: rgba(228, 87, 46, .08); color: var(--muted);
  font-size: 13px; line-height: 1.4;
}
.asset-fallback-box strong { color: var(--paper); }
.hero .asset-fallback-box { min-height: 320px; }
.feature .asset-fallback-box { width: 100%; }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); background: rgba(30, 35, 41, .5); margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-top: 18px; padding-bottom: 18px; }

/* Анимации brand.md */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.cards-grid > .card, .kpi-grid > .kpi { animation: cardIn 240ms var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.nav-instant, .nav-instant * { animation: none !important; }

/* Адаптив */
@media (max-width: 1024px) {
  .booking-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .feature, .feature-reverse { grid-template-columns: 1fr; }
  .feature-reverse > img { order: 0; }
  .feature > img { max-height: 300px; }
}
@media (max-width: 860px) {
  .topbar { align-items: center; gap: 8px; flex-wrap: nowrap; padding: 8px 12px; }
  .brand { flex: 0 0 auto; }
  .brand-text { font-size: 14px; white-space: nowrap; }
  .brand-text small { display: none; }
  .tabs { order: 0; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; padding: 0; }
  .topbar .tab { padding: 6px 9px; font-size: 12px; }
  .topbar-actions { margin-left: 0; flex-wrap: nowrap; gap: 6px; }
  .topbar-actions #mode-badge { display: none; }
  .role-switch { font-size: 0; gap: 0; }
  .role-switch select { width: auto; min-width: 0; padding: 6px 8px; font-size: 12px; }
  .stat-strip { margin-top: -24px; }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .topbar { padding: 7px 10px; gap: 6px; }
  .brand-text { display: none; }
  .brand img { width: 26px; height: 26px; }
  .topbar .tab { padding: 6px 8px; }
  .topbar-actions #logout-btn { padding: 6px 8px; }
  .page-wrap { padding: 18px 14px; }
  .hero { min-height: 520px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(18, 20, 23, .64) 0%, rgba(18, 20, 23, .9) 58%, rgba(18, 20, 23, .98) 100%); }
  .hero-content { padding: 26px 16px 34px; align-self: flex-end; }
  .hero-img { object-position: 62% center; }
  .stat-strip { grid-template-columns: 1fr; margin-top: 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .block-head { align-items: flex-start; }
  .filters { width: 100%; }
  .filters .search, .filters label { flex: 1 1 100%; min-width: 0; }
  .toast-root { top: 66px; right: 10px; width: calc(100vw - 20px); }
  .modal { padding: 16px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1 1 100%; }
  .cart-panel { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .card:hover, .btn:active, .kcard.is-dragging { transform: none; }
}
