:root {
  --milk: #FBF7F3;
  --porcelain: #FFFFFF;
  --ink: #241E27;
  --rose: #C06B6B;
  --plum: #55364D;
  --line: #E7DAD1;
  --ok: #3E6B53;
  --warn: #8A5A21;
  --danger: #9B3B3B;
  --info: #4B5E75;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-hover: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(36, 30, 39, 0.07);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", "PT Serif", serif;
  --white: var(--porcelain);
  --sand: #F7F0EB;
  --dur-fast: 120ms;
  --ease: var(--ease-hover);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  font: 16px/1.6 var(--font-body);
  color: var(--ink);
  background: var(--milk);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 56px/1.05 var(--font-head); letter-spacing: 0; }
h2 { font: 400 32px/1.15 var(--font-head); }
h3 { font: 600 24px/1.25 var(--font-body); }
p { max-width: 72ch; }
a { color: var(--plum); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 60;
  background: var(--plum); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px;
}
.skip-link:focus { top: 0; }


.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--porcelain); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; flex: none; }
.brand-name { font: 400 25px/1.1 var(--font-head); color: var(--plum); }
.brand-sub { font-size: 12px; color: var(--ink); opacity: .72; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.demo-chip {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: var(--line); color: var(--ink); border-radius: 999px; padding: 5px 10px;
}
.role-label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.role-label select { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.role-switch { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.role-switch .role-label { padding: 0 6px; font-size: 10px; }
.role-btn { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; padding: 5px 9px; border-radius: 999px; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.role-btn[aria-pressed="true"] { background: var(--plum); color: var(--white); }
.role-btn:hover { background: var(--sand); color: var(--plum); }
.role-btn[aria-pressed="true"]:hover { background: var(--plum); color: var(--white); }
#role-select { display: none; }
select, input, textarea {
  background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; min-height: 40px; transition: border-color 120ms var(--ease-hover), box-shadow 120ms var(--ease-hover);
}
select:hover, input:hover, textarea:hover { border-color: #cdb9ab; }
input:focus, select:focus, textarea:focus { border-color: var(--plum); outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(85, 54, 77, .16); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--milk); border: 1px solid var(--line); border-radius: 999px;
  width: auto; min-width: 40px; height: 40px; padding: 0 9px;
  transition: background 120ms var(--ease-hover), transform 120ms var(--ease-hover);
}
.icon-btn:hover { background: var(--line); transform: translateY(-1px); }
.icon-count {
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--plum); color: #fff; font-size: 11px; font-weight: 600;
}
.ico { width: 22px; height: 22px; flex: none; color: var(--plum); }
.ico-lg { width: 30px; height: 30px; }
.ico-xl { width: 64px; height: 64px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
  padding: 8px clamp(16px, 4vw, 40px); background: var(--porcelain);
  border-bottom: 1px solid var(--line); position: sticky; top: 73px; z-index: 35;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  padding: 9px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: background 120ms var(--ease-hover), color 120ms var(--ease-hover), transform 120ms var(--ease-hover);
}
.tab:hover { background: var(--milk); transform: translateY(-1px); }
.tab[aria-selected="true"] { background: var(--plum); color: #fff; }
.tab[aria-selected="true"] .ico { color: #fff; }
.tab-count { font-size: 11px; background: var(--line); color: var(--ink); padding: 1px 6px; border-radius: 999px; }
.tab[aria-selected="true"] .tab-count { background: rgba(255,255,255,.22); color: #fff; }
.tab[hidden] { display: none; }

.demo-banner {
  padding: 9px clamp(16px, 4vw, 40px); font-size: 13px;
  background: var(--line); color: var(--ink); border-bottom: 1px solid #d8c7ba;
}
.demo-banner strong { color: var(--plum); }


.main { padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 40px) 56px; max-width: 1440px; margin: 0 auto; }
.screen { animation: screenIn 180ms var(--ease-out) both; min-width: 0; }
.screen[hidden] { display: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.screen-head h1, .screen-head h2 { margin-top: 3px; }
.screen-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--plum); margin-bottom: 5px; }
.lead { font-size: 20px; line-height: 1.45; margin-top: 12px; }
.muted { color: var(--ink); opacity: .68; font-size: 14px; }
.inline-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.inline-label select { min-height: 38px; padding: 7px 9px; }
.card {
  background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2 > * { min-width: 0; }
.hero-strip {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 44%);
  gap: 24px; align-items: center; background: var(--porcelain);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 16px; padding: clamp(18px, 3vw, 30px); position: relative;
}
.hero-strip::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: var(--rose); opacity: .12; pointer-events: none;
}
.hero-copy h2 { font-size: clamp(24px, 2.5vw, 34px); max-width: 24ch; }
.hero-img { width: 100%; height: 250px; object-fit: cover; border-radius: 12px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; line-height: 1.2; text-decoration: none;
  transition: background 120ms var(--ease-hover), color 120ms var(--ease-hover), border-color 120ms var(--ease-hover), transform 120ms var(--ease-hover), box-shadow 120ms var(--ease-hover);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { background: #472c41; color: #fff; box-shadow: 0 6px 16px rgba(85,54,77,.22); }
.btn-ghost { background: var(--porcelain); border-color: var(--line); color: var(--plum); }
.btn-ghost:hover { background: var(--milk); border-color: #cdb9ab; }
.btn-danger { background: var(--porcelain); border-color: #d9b4b4; color: var(--danger); }
.btn-sm { min-height: 32px; padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link-btn { border: 0; background: none; color: var(--plum); text-decoration: underline; font-size: 13px; padding: 4px; border-radius: 6px; }
.link-btn:hover { color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  background: var(--milk); border: 1px solid var(--line); padding: 3px 9px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-warn { color: var(--warn); border-color: #e4c9a4; background: #FCF4E8; }
.badge-ok { color: var(--ok); border-color: #bcd6c6; background: #F1F7F3; }
.badge-danger { color: var(--danger); border-color: #d9b4b4; background: #FBF0F0; }
.badge-info { color: var(--info); border-color: #c4cfdb; background: #F2F5F8; }
.badge-vip { color: var(--plum); border-color: #cdb9ab; background: #F6EFF3; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot-urgent { background: var(--rose); }
.dot-vip { background: var(--plum); }
.legend { font-size: 12px; white-space: nowrap; }


.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid-sm { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi {
  background: var(--porcelain); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  min-width: 0; transition: transform 120ms var(--ease-hover), box-shadow 120ms var(--ease-hover);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; color: var(--ink); opacity: .66; margin-bottom: 5px; }
.kpi-value { font: 600 27px/1.15 var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-hint { font-size: 12px; margin-top: 4px; color: var(--ink); opacity: .6; }

.kpi-value.plum { color: var(--plum); }
.kpi-inline { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.kpi-inline strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.kpi-inline span { display: block; font-size: 12px; opacity: .65; }


.category-rail { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.category-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--porcelain);
  font-size: 13px; font-weight: 500;
}
.category-pill .ico { width: 18px; height: 18px; }
.client-hero { display: flex; align-items: center; gap: 12px; }
.photo-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-fig { margin: 0; width: 112px; font-size: 11px; }
.photo-fig img { width: 112px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-fig figcaption { opacity: .68; margin-top: 2px; line-height: 1.3; }
.history-list { margin: 0; padding-left: 18px; font-size: 13px; max-height: 190px; overflow: auto; }
.history-list li { margin-bottom: 3px; }
.agenda-list { display: grid; }
.agenda-row {
  display: grid; grid-template-columns: 118px minmax(0,1fr) auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; padding: 11px 16px; min-height: 0;
}
.agenda-row:hover { background: var(--milk); }
.agenda-row small { display: block; font-size: 12px; opacity: .65; }
.canvas-wrap { width: 100%; overflow: hidden; }
canvas { width: 100%; max-width: 100%; height: auto; display: block; }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention-list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--milk); font-size: 14px;
}
.attention-list .go { border: 0; background: none; color: var(--plum); font-size: 13px; text-decoration: underline; white-space: nowrap; }
.stages { display: grid; gap: 13px; }
.stage-row { display: grid; gap: 6px; }
.stage-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.stage-top span:last-child { font-variant-numeric: tabular-nums; opacity: .7; }
.segbar {
  display: flex; gap: 3px; height: 9px; padding: 1px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.seg { display: block; width: var(--v, 33%); background: var(--line); border-radius: 999px; }
.seg-plum { background: var(--plum); }
.seg-rose { background: var(--rose); }
.stage-hint { font-size: 12px; opacity: .62; }
.upcoming { display: grid; gap: 8px; }
.upcoming-row {
  display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--plum); }
.upcoming-row small { display: block; font-size: 12px; opacity: .65; }
.agent-card { border-top: 4px solid var(--rose); }
.agent-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.agent-stats div { font-size: 13px; }
.agent-stats strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.consult-card { display: grid; grid-template-columns: 42% minmax(0,1fr); gap: 16px; align-items: center; }
.consult-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; }


.toolbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.search-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; min-width: min(100%, 280px); flex: 1 1 260px; }
.search-field input { width: 100%; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 12px; }
.check-line input { width: 18px; height: 18px; min-height: 0; accent-color: var(--plum); }
.form-note { font-size: 12px; opacity: .65; margin-top: 8px; }
.status-line { font-size: 13px; margin-top: 10px; padding: 7px 9px; border-radius: 8px; background: var(--milk); }
.status-line.ok { color: var(--ok); }
.status-line.warn { color: var(--warn); }


.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 16px 18px 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table caption { text-align: left; padding: 14px 18px 8px; font-weight: 600; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); opacity: .62; background: var(--milk); position: sticky; top: 0; z-index: 1; }
.data-table tbody tr:hover { background: #FDFAF7; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .actions { display: flex; gap: 5px; flex-wrap: wrap; }
.table-empty { padding: 18px; font-size: 14px; opacity: .7; }
.empty-illustration { width: 160px; height: 96px; margin-bottom: 8px; }
.cell-main { font-weight: 600; }
.cell-sub { display: block; font-size: 12px; opacity: .62; }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; font-size: 11px; margin: 1px 2px 1px 0; background: var(--milk); }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--line); color: var(--plum); font-size: 12px; font-weight: 700; vertical-align: middle; margin-right: 7px;
}


.kanban {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; padding-bottom: 4px; align-items: start; min-width: 0;
}
.kcol {
  background: #F7F0EB; border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0;
  min-height: 220px; transition: background 140ms var(--ease-out);
}
.kcol.drag-over { background: #F1E5DE; outline: 2px dashed var(--plum); outline-offset: -3px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 4px 9px; font-size: 13px; font-weight: 700; }
.kcol-head .count { font-size: 11px; background: var(--porcelain); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.kcards { display: grid; gap: 8px; min-height: 80px; }
.kcard {
  background: var(--porcelain); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  cursor: grab; transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), opacity 140ms var(--ease-out);
  min-width: 0;
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kcard.dragging { opacity: .55; transform: rotate(.5deg); }
.kcard.urgent { border-left: 4px solid var(--rose); }
.kcard.vip { border-right: 4px solid var(--plum); }
.kcard-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.kcard-title { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.kcard-meta { font-size: 12px; opacity: .7; margin-top: 4px; overflow-wrap: anywhere; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.kcard-price { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.kcard-badges { display: flex; gap: 3px; flex-wrap: wrap; }
.kcard .mini-btn { border: 1px solid var(--line); background: var(--milk); border-radius: 8px; font-size: 11px; padding: 3px 6px; }
.kcard .mini-btn:hover { background: var(--line); }
.drag-hint { margin: -6px 0 12px; }


.production-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px;
  background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; align-items: center;
}
.production-head img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; }
.production-note h3 { margin-bottom: 6px; }
.production-note .btn { margin-top: 12px; }
.prod-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prod-col { background: #F7F0EB; border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 220px; min-width: 0; }
.prod-col h3 { font-size: 15px; padding: 2px 4px 10px; display: flex; justify-content: space-between; gap: 8px; }
.prod-card { background: var(--porcelain); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.prod-card.urgent { border-left: 4px solid var(--rose); }
.prod-time { font-weight: 700; color: var(--plum); font-variant-numeric: tabular-nums; font-size: 13px; }
.prod-card p { font-size: 13px; margin: 3px 0; }
.prod-card .actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.doc-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; border: 1px solid var(--line); background: var(--milk); border-radius: 999px; padding: 2px 7px; margin-top: 4px; }
.photo-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.photo-strip img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }


.calendar-wrap { overflow-x: auto; padding: 0; }
.cal-grid { display: grid; grid-template-columns: 62px repeat(7, minmax(96px, 1fr)); min-width: 740px; }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 58px; padding: 4px; font-size: 11px; min-width: 0; }
.cal-cell.head { background: var(--milk); font-weight: 700; text-align: center; padding: 8px 4px; min-height: 40px; position: sticky; top: 0; z-index: 2; }
.cal-cell.time { text-align: right; padding: 6px 8px; opacity: .6; background: var(--milk); font-variant-numeric: tabular-nums; }
.cal-event { background: #EFE3EA; border: 0; border-left: 3px solid var(--plum); border-radius: 7px; padding: 4px 5px; margin: 2px 0; font-size: 11px; line-height: 1.3; cursor: pointer; width: 100%; text-align: left; }
.cal-event.rose { background: #F6E7E7; border-left-color: var(--rose); }
.cal-event b { display: block; font-size: 11px; }
.cal-label { font-size: 14px; white-space: nowrap; }


.channel-card { min-width: 0; }
.switch { position: relative; display: inline-flex; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; min-height: 0; margin: 0; }
.switch span:not(.sr-only) {
  width: 46px; height: 26px; background: var(--line); border-radius: 999px; position: relative; display: inline-block;
  transition: background 120ms var(--ease-hover);
}
.switch span:not(.sr-only)::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--porcelain); box-shadow: 0 1px 3px rgba(36,30,39,.25);
  transition: transform 120ms var(--ease-hover);
}
.switch input:checked + span { background: var(--plum); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 2px; }
.bot-card { margin-bottom: 16px; border-left: 4px solid var(--plum); }
.bot-chat { display: grid; gap: 7px; margin-top: 10px; }
.bot-bubble {
  max-width: 620px; background: var(--milk); border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 8px 11px; font-size: 13px;
}
.bot-bubble strong { display: block; font-size: 12px; color: var(--plum); margin-bottom: 2px; }
.bot-bubble small { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.template-list { display: grid; gap: 8px; }
.template {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--milk); font-size: 13px;
}
.template strong { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.template p { font-size: 12px; margin-top: 3px; opacity: .78; }
.quiet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }


.warehouse-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: center; margin-bottom: 16px; }
.warehouse-head img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; }


.doc-status { font-weight: 600; }
.doc-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-actions .btn { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.pending-note { font-size: 12px; opacity: .66; }


.empty-state { text-align: center; background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 20px; max-width: 620px; margin: 30px auto; }
.empty-state .ico { margin: 0 auto 10px; }
.empty-state p { margin: 8px auto 16px; font-size: 15px; opacity: .72; }
.footer {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink); opacity: .7;
}
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(36, 30, 39, .55);
  display: grid; place-items: center; padding: 16px; animation: fadeIn 220ms var(--ease-out) both;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(620px, 100%); max-height: 90vh; overflow: auto; background: var(--porcelain);
  border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.25);
  animation: modalIn 220ms var(--ease-out) both;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--porcelain); z-index: 1; }
.modal-head h2 { font-size: 24px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); z-index: 70;
  background: var(--plum); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; max-width: min(92vw, 560px); text-align: center;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }


@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-strip { grid-template-columns: 1fr; }
  .hero-img { height: 230px; }
  .kanban { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .consult-card { grid-template-columns: 38% minmax(0,1fr); }
}
@media (max-width: 820px) {
  h1 { font-size: 36px; }
  .topbar { align-items: flex-start; }
  .tabs { top: 0; position: static; }
  .grid-2, .production-head, .warehouse-head { grid-template-columns: 1fr; }
  .prod-board { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .hero-img, .production-head img, .warehouse-head img { height: 210px; }
  .consult-card { grid-template-columns: 1fr; }
  .consult-card img { height: 190px; }
  .screen-head { align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-name { font-size: 21px; }
  .brand-sub { display: none; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .main { padding: 16px 12px 40px; }
  .tabs { padding: 7px 12px; }
  .tab { padding: 8px 10px; font-size: 13px; }
  .card { padding: 14px; }
  .hero-strip { padding: 16px; }
  .hero-img { height: 190px; }
  .toolbar { padding: 10px; }
  .inline-label { width: 100%; justify-content: space-between; }
  .inline-label select { flex: 1; }
  .field-row, .quiet-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 11px; }
  .kpi-value { font-size: 22px; }
  .upcoming-row { grid-template-columns: 52px minmax(0,1fr); }
  .upcoming-row .badge { grid-column: 2; justify-self: start; }
  .footer { display: grid; }
  .modal { max-height: 94vh; }
  .muted { font-size: 13px; }
  .kanban { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .screen, .modal, .modal-backdrop { animation: none; }
  .btn:hover, .kpi:hover, .kcard:hover, .icon-btn:hover, .tab:hover { transform: none; }
}

/* Витрина: полный каталог услуг */
.storefront-catalog { margin-top: 16px; }
.storefront-catalog h3 { font: 400 24px/1.2 var(--font-head); margin-bottom: 12px; }
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  min-width: 0;
}
.catalog-group {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--milk);
}
.catalog-group h4 { margin: 0 0 8px; font: 600 14px/1.3 var(--font-body); color: var(--plum); }
.service-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.service-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.service-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.service-list strong { color: var(--plum); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .catalog-grid { grid-template-columns: 1fr; } }
