/* =========================================================
   Сладкое сердце · Панель управления (демо)
   ========================================================= */
:root {
  --bg: #F6EEE9;
  --bg-2: #EFE3DC;
  --card: #FFFCFA;
  --ink: #3A221C;
  --ink-2: #5A3E36;
  --muted: #8A7169;
  --line: #ECDDD5;
  --rose: #A2645A;
  --rose-2: #8D4F46;
  --rose-soft: #F3E1DB;
  --ok: #2E9E6A;
  --warn: #D9822B;
  --bad: #C9473A;
  --shadow: 0 18px 50px -28px rgba(90, 50, 40, .38);
  --shadow-sm: 0 6px 20px -14px rgba(90, 50, 40, .35);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .9, .3, 1);
  --r: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.btn:active { transform: scale(.98); }
.btn--sm { height: 38px; padding: 0 14px; }
.btn--primary { background: linear-gradient(180deg, #AB6D62, var(--rose-2)); color: #FFF6F2; box-shadow: 0 10px 22px -12px rgba(141,79,70,.8); }
.btn--primary:hover { box-shadow: 0 14px 26px -12px rgba(141,79,70,.9); }
.btn--ghost { border: 1px solid var(--line); background: var(--card); }
.btn--ghost:hover { border-color: var(--rose); color: var(--rose); }
.btn--danger { color: var(--bad); border: 1px solid #F0C9C3; background: #FFF6F4; }
.btn--danger:hover { background: #FBE6E2; }
.btn--wa { background: #2F9E5B; color: #fff; }
.btn--wide { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); position: relative; transition: background .2s; }
.icon-btn:hover { background: var(--bg-2); }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 60% at 80% 10%, #F3D9D1, transparent 60%), radial-gradient(50% 50% at 10% 90%, #EFE0D2, transparent 60%), var(--bg); }
.login__card { width: min(440px, 100%); background: var(--card); border-radius: 28px; padding: 44px 38px 34px; box-shadow: var(--shadow); text-align: center; display: grid; gap: 4px; animation: rise .8s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
.login__script { font-family: var(--script); font-size: 40px; line-height: 1; }
.login__caps { font-size: 10px; letter-spacing: .4em; text-transform: uppercase; color: var(--rose); }
.login h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; margin: 22px 0 4px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.role { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.role__btn { border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: left; display: grid; gap: 2px; transition: border-color .2s, box-shadow .2s; }
.role__btn small { color: var(--muted); font-size: 12px; }
.role__btn.is-on { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(162,100,90,.14); }
.login__back { margin-top: 16px; color: var(--muted); font-size: 13px; }
.login__back:hover { color: var(--rose); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 14px; }
.side__brand { display: grid; padding: 0 12px 22px; line-height: 1; }
.side__script { font-family: var(--script); font-size: 30px; }
.side__caps { font-size: 9px; letter-spacing: .36em; text-transform: uppercase; color: var(--rose); margin-top: 4px; }
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; transition: background .2s, color .2s; }
.side__nav a:hover { background: var(--bg); }
.side__nav a.is-on { background: var(--rose-soft); color: var(--rose-2); }
.side__count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #2F7DD1; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side__count:empty { display: none; }
.side__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.side__user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.side__user b { display: block; font-size: 13px; }
.side__user small { color: var(--muted); font-size: 12px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--rose-soft); color: var(--rose-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.av--lg { width: 56px; height: 56px; font-size: 20px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 14px 28px; background: rgba(246,238,233,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top__menu { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch > svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.gsearch input { width: 100%; height: 42px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0 14px 0 42px; outline: none; transition: border-color .2s, box-shadow .2s; }
.gsearch input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(162,100,90,.12); }
.gsearch__res { position: absolute; left: 0; right: 0; top: 48px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 380px; overflow: auto; z-index: 30; }
.gres { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; width: 100%; text-align: left; }
.gres:hover { background: var(--bg); }
.gres small { margin-left: auto; color: var(--muted); }
.gres__h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.demo-pill { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: #FFF2DC; color: #9A6417; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bell { position: relative; }
.dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }
.bell__menu { position: absolute; right: 0; top: 48px; width: 340px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; z-index: 30; }
.bell__menu h4 { margin: 6px 10px 8px; font-size: 13px; }
.view { padding: 26px 28px 60px; animation: fade .4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { font-family: var(--serif); font-weight: 600; font-size: 36px; line-height: 1; margin: 0; }
.ph p { margin: 6px 0 0; color: var(--muted); }
.ph__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.is-on { background: var(--ink-2); color: #FFF4EF; }

/* ---------- Cards / KPI ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm); border: 1px solid rgba(236,221,213,.6); }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 0; }
.card__h h3 { margin: 0; font-size: 15px; }
.card__b { padding: 16px 20px 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi b { display: block; font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.1; margin-top: 6px; }
.kpi .delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.kpi__ico { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--rose-soft); color: var(--rose); }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid2b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { width: 100%; height: 240px; display: block; stroke: none; }
.donut text { stroke: none; }
.chart .bar { fill: var(--rose-soft); transition: fill .2s; }
.chart .bar:hover { fill: var(--rose); }
.chart .bar.today { fill: #E3B2A8; }
.chart .line { fill: none; stroke: var(--rose-2); stroke-width: 2.2; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart text { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-tip { position: fixed; pointer-events: none; z-index: 60; background: var(--ink); color: #FFF4EF; padding: 8px 10px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow); }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 150px; height: 150px; flex-shrink: 0; }
.donut circle { fill: none; stroke-width: 18; transition: stroke-width .2s; }
.donut circle:hover { stroke-width: 22; }
.legend { display: grid; gap: 7px; font-size: 13px; flex: 1; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.upc { display: grid; gap: 4px; }
.upc__row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.upc__row:hover { background: var(--bg); }
.upc__time { font-weight: 800; font-size: 13px; text-align: center; line-height: 1.15; }
.upc__time small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.upc__row b { font-size: 13.5px; }
.upc__row small { color: var(--muted); }
.top-list { display: grid; gap: 12px; }
.top-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.top-item img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.bar-mini { height: 6px; border-radius: 6px; background: var(--bg-2); margin-top: 5px; overflow: hidden; }
.bar-mini span { display: block; height: 100%; background: linear-gradient(90deg, #E3B2A8, var(--rose)); border-radius: inherit; width: 0; transition: width 1.2s var(--ease); }

/* ---------- Status chips ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
select.st-select { appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; padding: 5px 26px 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A7169' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 12px no-repeat; outline: none; }
.pay { font-size: 12px; font-weight: 700; }
.pay--paid { color: var(--ok); }
.pay--prepaid { color: var(--warn); }
.pay--unpaid { color: var(--muted); }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.tag--vip { background: #FFF0D6; color: #9A6417; }
.tag--new { background: #E2EEFB; color: #2F6BB0; }
.tag--loyal { background: #E3F3EA; color: #2D7D55; }
.tag--warn { background: #FBE6E2; color: var(--bad); }
.src { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Filters & table ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.fsel, .finput { height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 12px; outline: none; font-size: 13px; }
.fsel:focus, .finput:focus { border-color: var(--rose); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-size: 11px; color: var(--muted); }
.chip.is-on { background: var(--ink-2); color: #FFF4EF; border-color: var(--ink-2); }
.chip.is-on b { color: #E9D7CF; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 820px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.tbl th.sorted::after { content: " ↓"; }
.tbl th.sorted.asc::after { content: " ↑"; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr { transition: background .15s; }
.tbl tbody tr:hover { background: #FBF4F0; cursor: pointer; }
.tbl tbody tr.flash { animation: flash 2s var(--ease); }
@keyframes flash { 0%, 30% { background: #FFF0D6; } }
.cell-client b { display: block; font-weight: 700; }
.cell-client small { color: var(--muted); }
.oid { font-weight: 800; color: var(--rose-2); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px; color: var(--muted); font-size: 13px; }
.pager div { display: flex; gap: 6px; }
.empty-st { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-st .script { font-family: var(--script); font-size: 34px; color: var(--rose); display: block; margin-bottom: 4px; }
.bulk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--rose-soft); border-radius: 12px; margin-bottom: 12px; font-weight: 600; }
input[type="checkbox"].cb { width: 17px; height: 17px; accent-color: var(--rose); cursor: pointer; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--bg-2); border-radius: 18px; padding: 12px; min-height: 300px; transition: background .2s, box-shadow .2s; }
.col.over { background: #EADBD3; box-shadow: inset 0 0 0 2px var(--c); }
.col__h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; font-weight: 800; font-size: 13px; }
.col__h i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.col__h span { margin-left: auto; color: var(--muted); font-weight: 700; }
.col__sum { font-size: 11.5px; color: var(--muted); padding: 0 4px 10px; margin-top: -8px; }
.kcard { background: var(--card); border-radius: 14px; padding: 12px 13px; margin-bottom: 9px; box-shadow: var(--shadow-sm); cursor: grab; border-left: 3px solid var(--c); transition: transform .2s, box-shadow .2s, opacity .2s; }
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kcard.dragging { opacity: .4; }
.kcard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.kcard b { font-size: 13.5px; }
.kcard p { margin: 0 0 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
.kcard__foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.kcard__foot strong { color: var(--ink); }
.due { font-weight: 700; }
.due--today { color: var(--warn); }
.due--late { color: var(--bad); }

/* ---------- Calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0 8px; min-width: 190px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px; }
.cal__dow { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.cal__day { min-height: 104px; border-radius: 12px; background: var(--bg); padding: 7px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; border: 1px solid transparent; transition: border-color .2s, background .2s; overflow: hidden; }
.cal__day:hover { border-color: var(--rose-soft); }
.cal__day.other { opacity: .4; }
.cal__day.today { background: #FFF; border-color: var(--rose); }
.cal__day.sel { background: var(--rose-soft); }
.cal__day.closed { background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 6px, #EFE4DE 6px, #EFE4DE 12px); }
.cal__n { font-weight: 800; font-size: 12.5px; display: flex; justify-content: space-between; }
.cal__n small { color: var(--muted); font-weight: 700; }
.cal__pill { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__more { font-size: 11px; color: var(--muted); font-weight: 700; }
.day-list h4 { margin: 0 0 4px; font-size: 16px; }

/* ---------- Clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.seg-card { padding: 16px 18px; cursor: pointer; transition: transform .2s, box-shadow .2s; border: 2px solid transparent; }
.seg-card:hover { transform: translateY(-2px); }
.seg-card.is-on { border-color: var(--rose); }
.seg-card small { color: var(--muted); font-weight: 600; }
.seg-card b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }

/* ---------- Products ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { overflow: hidden; display: flex; flex-direction: column; }
.pcard__img { position: relative; aspect-ratio: 1.5; overflow: hidden; min-height: 0; }
.pcard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard.off .pcard__img img { filter: grayscale(.8) opacity(.6); }
.pcard__img .tag { position: absolute; left: 10px; top: 10px; }
.pcard__b { padding: 14px 16px 16px; display: grid; gap: 10px; }
.pcard__b h4 { margin: 0; font-size: 15px; }
.pcard__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-in { width: 110px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-weight: 800; font-size: 15px; background: #fff; outline: none; }
.price-in:focus { border-color: var(--rose); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 38px; height: 22px; border-radius: 22px; background: var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form { display: grid; gap: 14px; }
.fld { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.fld input, .fld select, .fld textarea { height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 0 12px; outline: none; font-size: 14px; font-weight: 500; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.fld textarea { height: auto; padding: 10px 12px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(162,100,90,.12); }
.fld.err input { border-color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hours-tbl { width: 100%; border-collapse: collapse; }
.hours-tbl td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-tbl td:last-child { text-align: right; font-weight: 700; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(58,34,28,.3); backdrop-filter: blur(2px); animation: fade .3s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(560px, 100%); background: var(--card); box-shadow: -30px 0 60px -30px rgba(58,34,28,.45); transform: translateX(105%); transition: transform .45s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.dr__h { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.dr__h h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.dr__h p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.dr__h .icon-btn { margin-left: auto; }
.dr__b { flex: 1; overflow-y: auto; padding: 18px 24px 30px; display: grid; gap: 16px; align-content: start; }
.dr__f { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.sec { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.sec h4 { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.items { display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.item img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.item small { color: var(--muted); }
.total-row { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); font-weight: 800; }
.total-row input { width: 130px; text-align: right; }
.statusbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.statusbar button { padding: 8px 4px; border-radius: 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid transparent; transition: .2s; }
.statusbar button.done { color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); }
.statusbar button.cur { color: #fff; background: var(--c); }
.timeline { display: grid; gap: 10px; position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.tl { position: relative; font-size: 13px; }
.tl::before { content: ""; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--card); border: 2px solid var(--rose); }
.tl small { display: block; color: var(--muted); font-size: 11.5px; }
.tl--note::before { background: var(--rose); }
.note-form { display: flex; gap: 8px; margin-top: 12px; }
.note-form input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; outline: none; }
.mini-orders { display: grid; gap: 6px; }
.mini-order { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 13px; }
.mini-order:hover { background: var(--bg-2); }
.mini-order span:last-child { margin-left: auto; font-weight: 800; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3 div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stats3 small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.stats3 b { display: block; font-size: 17px; font-weight: 800; }
.tags-edit { display: flex; gap: 6px; flex-wrap: wrap; }
.tags-edit .tag { cursor: pointer; }
.tags-edit .tag.on { background: var(--ink-2); color: #fff; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(58,34,28,.35); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .25s; overflow-y: auto; }
.modal__card { width: min(640px, 100%); background: var(--card); border-radius: 24px; box-shadow: var(--shadow); animation: rise .45s var(--ease); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal__card--sm { width: min(420px, 100%); }
.m__h { display: flex; align-items: center; padding: 20px 24px 0; }
.m__h h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 600; }
.m__h .icon-btn { margin-left: auto; }
.m__b { padding: 18px 24px; overflow-y: auto; display: grid; gap: 14px; }
.m__f { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 8px; }
.line-items { display: grid; gap: 8px; }
.li { display: grid; grid-template-columns: 1fr 90px 36px; gap: 8px; align-items: center; }
.li select, .li input { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; outline: none; }
.kind-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind-tabs button { padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; text-align: left; display: grid; gap: 2px; }
.kind-tabs button small { color: var(--muted); font-weight: 500; }
.kind-tabs button.is-on { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(162,100,90,.12); }
.client-pick { position: relative; }
.client-sugg { position: absolute; left: 0; right: 0; top: 66px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); z-index: 5; padding: 4px; max-height: 220px; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 30px; opacity: 0; z-index: 90; background: var(--ink); color: #FFF4EF; padding: 13px 20px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); transition: .4s var(--ease); pointer-events: none; display: flex; gap: 10px; align-items: center; }
.toast.on { translate: -50% 0; opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .client-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 45; width: 260px; transform: translateX(-105%); transition: transform .4s var(--ease); box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .top__menu { display: grid; }
  .top { padding: 12px 16px; }
  .view { padding: 20px 16px 50px; }
  .grid2, .grid2b, .set-grid { grid-template-columns: 1fr; }
  .top__site, .demo-pill { display: none; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 28px; }
  .kpi__ico { display: none; }
  .ph h1 { font-size: 30px; }
  .bell__menu { position: fixed; left: 12px; right: 12px; width: auto; top: 64px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .cal { gap: 3px; padding: 8px; }
  .cal__day { min-height: 62px; padding: 4px; }
  .cal__pill { font-size: 0; height: 6px; padding: 0; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .statusbar { grid-template-columns: repeat(3, 1fr); }
  #newOrderBtn span { display: none; }
}

/* ---------- Print (чек заказа) ---------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; padding: 20px; }
}
