/* Панель IdealSon — Quiet Luxury: изумруд, золото, крем. Сначала телефон. */
:root {
  --emerald: #1A2C21; --gold: #C8A96E; --cream: #FAFAF7; --card: #FFFFFF;
  --text: rgba(26, 44, 33, .92); --muted: rgba(26, 44, 33, .6); --line: rgba(26, 44, 33, .12);
  --ok-bg: #E7F2EA; --ok: #1F5E36; --err-bg: #FBEAE7; --err: #8E2B1C; --warn: #8A5A12;
  --radius: 16px; --shadow: 0 1px 16px rgba(26, 44, 33, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--text);
  font: 16px/1.5 "Futura PT", "Century Gothic", system-ui, sans-serif;
  padding: 0 16px calc(88px + env(safe-area-inset-bottom));
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
a { color: var(--emerald); }
h1 { font-size: 22px; font-weight: 600; margin: 20px 0 12px; text-wrap: balance; }
h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

.top { display: flex; justify-content: space-between; align-items: center; padding-top: calc(12px + env(safe-area-inset-top)); }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--emerald); }

.flash { border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 15px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .value.alert { color: var(--err); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.card .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card .title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(200, 169, 110, .18); color: var(--warn); white-space: nowrap; }
a.card { display: block; text-decoration: none; color: inherit; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
button, .btn {
  font: inherit; font-size: 15px; border-radius: 999px; padding: 10px 18px; border: 1px solid var(--emerald);
  background: var(--emerald); color: #fff; cursor: pointer; min-height: 44px;
  transition: background-color .15s, color .15s;
}
button.secondary { background: transparent; color: var(--emerald); }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button:hover { background: #24402F; }
button.secondary:hover { background: rgba(26, 44, 33, .06); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--text); width: 100%;
}
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; overflow-wrap: anywhere; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-x: contain; }
.filters a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.filters a[aria-current="page"] { background: var(--emerald); color: #fff; border-color: var(--emerald); }

nav.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: rgba(250, 250, 247, .96); border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
nav.tabbar a { text-decoration: none; font-size: 12px; color: var(--muted); text-align: center; min-width: 64px; padding: 4px; }
nav.tabbar a[aria-current="page"] { color: var(--emerald); font-weight: 600; }
nav.tabbar .icon { display: block; font-size: 20px; line-height: 1.2; }

.auth { max-width: 380px; margin: 12vh auto 0; }

@media (min-width: 900px) {
  body { padding: 0 32px 32px 232px; }
  nav.tabbar { top: 0; right: auto; width: 200px; flex-direction: column; justify-content: flex-start; gap: 4px; border-top: 0; border-right: 1px solid var(--line); padding: 24px 12px; }
  nav.tabbar a { display: flex; gap: 10px; align-items: center; font-size: 15px; text-align: left; padding: 10px 12px; border-radius: 12px; }
  nav.tabbar a[aria-current="page"] { background: rgba(26, 44, 33, .06); }
  nav.tabbar .icon { display: inline; font-size: 18px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.gap-top { margin-top: 12px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.btn:hover { background: #24402F; }
a.btn.btn-secondary { background: transparent; color: var(--emerald); }
a.btn.btn-secondary:hover { background: rgba(26, 44, 33, .06); }
.copy { background: var(--cream); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.qr { background: #fff; border-radius: 12px; display: flex; justify-content: center; }
.qr svg { width: 100%; max-width: 260px; height: auto; }
details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); min-height: 44px; cursor: pointer; }
label.check input { width: auto; min-width: 22px; min-height: 22px; }
nav.tabbar a { min-width: 56px; }
/* шаг 6: клиенты, лента, дела, канбан, склад */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form.search { display: flex; gap: 8px; }
form.search input { flex: 1; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.timeline .t-ic { width: 24px; text-align: center; flex: none; }
.timeline a { text-decoration: none; }
.timeline a:hover { text-decoration: underline; }
form.task { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; }
form.task input { flex: 1; min-width: 0; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; overscroll-behavior-x: contain; }
.board .col { background: rgba(26, 44, 33, .04); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.board .col.over { outline: 2px dashed var(--gold); }
.board h2 { font-size: 15px; margin: 4px 4px 8px; }
.board .kcard { cursor: grab; }
.board .empty { margin: 4px; }
ol.chat { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ol.chat li { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
ol.chat li p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
ol.chat li.out { align-self: flex-end; background: var(--ok-bg); }
textarea { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); width: 100%; resize: vertical; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.price-row .title { grid-column: 1 / -1; }
.price-row button { grid-column: 1 / -1; }
.codes { font-family: ui-monospace, monospace; font-size: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stock-row input[type=date] { grid-column: 1 / 3; }
.badge.late { background: var(--err-bg); color: var(--err); }
.chips.tpl { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.tpl button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.stock-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; }
.desk-only { display: none; }
nav.tabbar .desk-only { display: none; }
@media (min-width: 900px) {
  .desk-only { display: block; }
  nav.tabbar .desk-only { display: flex; }
  nav.tabbar .mob-only { display: none; }
}
.table-wrap { overflow-x: auto; padding: 0; }
table.funnel { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 640px; }
table.funnel th, table.funnel td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.funnel th:first-child, table.funnel td:first-child { text-align: left; white-space: normal; }
table.funnel th { color: var(--muted); font-weight: 500; font-size: 13px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.two-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
code { font-size: 13px; background: rgba(26, 44, 33, .06); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* Касса: номер и сумма крупно, кнопка копирования рядом */
.kassa-copy { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin-top: 10px;
  padding: 10px; border-radius: 12px; background: rgba(26, 44, 33, .04); }
.kassa-copy span { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.kassa-copy b { font-size: 22px; letter-spacing: .02em; overflow-wrap: anywhere; }
.kassa-copy button { white-space: nowrap; }
.kassa-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 10px; }
.kassa-inline label { flex: 1 1 180px; }
.kassa-card form:last-child button[type="submit"] { width: 100%; margin-top: 10px; }

/* экран «Сайт» */
.site-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.site-row .title, .site-row .check, .site-row button { grid-column: 1 / -1; }
.promo-strip { border-radius: 12px; padding: 10px 14px; text-align: center; font-size: 14px; font-weight: 600; margin: 8px 0; }
.promo-strip.gold { background: var(--gold); color: var(--emerald); }
.promo-strip.emerald { background: var(--emerald); color: var(--cream); }
.promo-strip.off { opacity: .4; }
