/* MyQor (rsp) — design tokens follow the product deck (deep green, amber for suppliers) */
:root {
  --green-900: #143627; --green-800: #1b4433; --green-700: #245840; --green-600: #2f7d5b; --green-500: #3e9a70;
  --green-100: #dcefe2; --green-50: #eef7f1;
  --amber-700: #8a5a12; --amber-600: #b8741a; --amber-500: #e0a23a; --amber-100: #fdf0d5; --amber-50: #fff8ea;
  --blue-700: #2f5f9a; --blue-100: #dce8f5; --blue-50: #eef4fb;
  --red-600: #d64545; --red-100: #fbe1e1;
  --bg: #f4f6f4; --card: #ffffff; --line: #e3e8e4; --text: #1b2a24; --muted: #6b7a72; --muted-2: #9aa7a0;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(20, 54, 39, .05), 0 6px 20px rgba(20, 54, 39, .06);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --accent: var(--green-600); --accent-soft: var(--green-100); --accent-text: var(--green-800);
}
[data-role="supplier"] { --accent: var(--amber-600); --accent-soft: var(--amber-100); --accent-text: var(--amber-700); }
[data-role="admin"] { --accent: var(--blue-700); --accent-soft: var(--blue-100); --accent-text: var(--blue-700); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafbfa; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.danger { color: var(--red-600); }
.ok { color: var(--green-600); }
.warn { color: var(--amber-600); }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--green-900); color: #dfeae3; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
[data-role="supplier"] .sidebar { background: #3f2a0c; }
[data-role="admin"] .sidebar { background: #16263a; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; font-size: 11px; opacity: .65; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #cfdcd4; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a svg { width: 18px; height: 18px; opacity: .85; }
.nav .badge { margin-left: auto; }
.sidebar .spacer { flex: 1; }
.sidebar .user { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 12px; }
.sidebar .user b { display: block; color: #fff; font-size: 13px; }
.sidebar .user button { margin-top: 8px; background: none; border: 1px solid rgba(255, 255, 255, .2); color: #dfeae3; border-radius: 7px; padding: 4px 8px; font-size: 12px; }
.main { padding: 22px 28px calc(60px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar .title small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.topbar .tools { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.pill.off .dot { background: var(--red-600); }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.tight { padding: 12px 14px; }
.card h2 { margin-bottom: 12px; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card .head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.main-side { grid-template-columns: 1.7fr 1fr; }
.grid.side-main { grid-template-columns: 1fr 1.7fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.kpi-card { padding: 16px 18px; }
.kpi-card .label { color: var(--muted); font-size: 13px; }
.kpi-card .value { font-size: 30px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-card .sub { color: var(--muted); font-size: 12px; }
.kpi-card .value.red { color: var(--red-600); } .kpi-card .value.blue { color: var(--blue-700); } .kpi-card .value.amber { color: var(--amber-600); } .kpi-card .value.green { color: var(--green-600); }

/* ---------- badges ---------- */
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badge.green { background: var(--green-100); color: var(--green-800); }
.badge.amber { background: var(--amber-100); color: var(--amber-700); }
.badge.blue { background: var(--blue-100); color: var(--blue-700); }
.badge.red { background: var(--red-100); color: var(--red-600); }
.badge.gray { background: #eef1ef; color: var(--muted); }
.badge.dark { background: var(--green-800); color: #fff; }
.badge.sm { font-size: 11px; padding: 2px 8px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; padding: 8px 14px; font-weight: 600; font-size: 13px; border: 1px solid var(--line); background: #fff; color: var(--text); white-space: nowrap; }
.btn:hover { background: #f6f8f6; text-decoration: none; }
.btn.primary { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.btn.primary:hover { background: var(--green-700); }
[data-role="supplier"] .btn.primary { background: var(--amber-700); border-color: var(--amber-700); }
[data-role="supplier"] .btn.primary:hover { background: var(--amber-600); }
.btn.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn.danger { color: var(--red-600); border-color: #f0c9c9; }
.btn.danger:hover { background: #fff3f3; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef1ef; color: var(--text); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: #fff; outline: none; }
.input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(62, 154, 112, .15); }
.input.sm { padding: 5px 8px; font-size: 13px; border-radius: 7px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--muted-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 6px 13px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 12px; color: var(--text); }
.chip.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
[data-role="supplier"] .chip.active { background: var(--amber-700); border-color: var(--amber-700); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: 0; padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d5dcd7; border: 0; transition: background .15s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle.on { background: var(--green-600); }
.toggle.on::after { left: 21px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 600; }
.bar { height: 6px; border-radius: 4px; background: #e9eeeb; overflow: hidden; width: 120px; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--amber-500); }
.bar i.red { background: var(--red-600); } .bar i.green { background: var(--green-500); }
.progress { height: 8px; border-radius: 4px; background: #e9eeeb; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-600); }
.progress i.amber { background: var(--amber-500); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-item .r { text-align: right; }
.list-item.link { cursor: pointer; }
.list-item.link:hover .t { color: var(--green-700); }

/* ---------- order stepper ---------- */
.stepper { display: flex; align-items: flex-start; justify-content: space-between; position: relative; padding: 6px 0 4px; }
.stepper::before { content: ''; position: absolute; left: 24px; right: 24px; top: 26px; height: 2px; background: var(--line); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100px; text-align: center; font-size: 12px; color: var(--muted); }
.step .ic { width: 40px; height: 40px; border-radius: 50%; background: #eef1ef; display: grid; place-items: center; border: 2px solid #fff; }
.step.done .ic { background: var(--green-100); color: var(--green-800); }
.step.current .ic { background: var(--amber-100); color: var(--amber-700); box-shadow: 0 0 0 3px var(--amber-100); }
.step.done, .step.current { color: var(--text); font-weight: 600; }
.step.bad .ic { background: var(--red-100); color: var(--red-600); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline li:last-child { border: 0; }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- catalog ---------- */
.product { display: flex; flex-direction: column; gap: 4px; padding: 14px; position: relative; }
.product .img { height: 90px; border-radius: 10px; background: #f0f3f1; display: grid; place-items: center; color: #b8c4bd; margin-bottom: 8px; }
.product .img svg { width: 40px; height: 40px; }
.step .ic svg { width: 18px; height: 18px; }
.brand .logo svg { width: 18px; height: 18px; }
.btn svg { width: 15px; height: 15px; }
.kpi-card svg, .info svg { width: 16px; height: 16px; vertical-align: -3px; }
.product .name { font-weight: 700; }
.product .sup { color: var(--muted); font-size: 12px; }
.product .price { font-size: 18px; font-weight: 700; margin-top: 6px; }
.product .price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.product .yours { color: var(--green-600); font-weight: 600; font-size: 12px; }
.product .meta { color: var(--muted); font-size: 12px; }
.product .rec { position: absolute; top: 20px; left: 20px; }
.product .btn { margin-top: 8px; }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-ctl button { border: 0; background: #f6f8f6; width: 28px; height: 28px; }
.qty-ctl input { width: 64px; border: 0; text-align: center; padding: 4px; }

/* ---------- drawer / modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 54, 39, .35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: 520px; max-width: 100%; height: 100%; background: #fff; box-shadow: -8px 0 30px rgba(0, 0, 0, .12); padding: 22px 24px; overflow: auto; }
.overlay.center { align-items: center; justify-content: center; }
.modal { width: 560px; max-width: calc(100% - 32px); background: #fff; border-radius: 16px; padding: 22px 24px; max-height: 90vh; overflow: auto; }
.drawer .head, .modal .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; max-width: 380px; animation: pop .15s ease-out; }
.toast.err { background: var(--red-600); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.notif { position: relative; }
.notif .btn { position: relative; }
.notif .count { position: absolute; top: -6px; right: -6px; background: var(--red-600); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; font-weight: 700; }
.notif-panel { position: absolute; right: 0; top: 42px; width: 380px; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); z-index: 30; max-height: 480px; overflow: auto; }
.notif-panel .item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-panel .item.unread { background: var(--green-50); }
.notif-panel .item b { display: block; font-size: 13px; }
.notif-panel .item span { font-size: 12px; color: var(--muted); }

/* ---------- charts ---------- */
.chart { width: 100%; height: 240px; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; cursor: pointer; background: #fafbfa; }
.day.active { border-color: var(--green-600); background: var(--green-50); }
.day.today .d { color: var(--green-700); }
.day .d { font-weight: 700; font-size: 12px; }
.day .n { font-size: 28px; font-weight: 700; line-height: 1.1; margin: 4px 0; }
.day .s { font-size: 11px; color: var(--muted); }
.day .s .a { color: var(--green-600); }
.info { background: var(--amber-50); border: 1px solid #f5e2b8; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--amber-700); }
.info.green { background: var(--green-50); border-color: #cfe6d8; color: var(--green-800); }
.info.blue { background: var(--blue-50); border-color: #cddcef; color: var(--blue-700); }
.matrix td input { width: 70px; }
.matrix .base td { background: #f7f9f8; font-weight: 600; }
.matrix .client-price { color: var(--green-600); font-weight: 600; }

/* ---------- acceptance (QR, phone at the loading dock) ---------- */
.phone { max-width: 420px; margin: 0 auto; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 20px; }
.phone .ok-banner { background: var(--green-100); color: var(--green-800); padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.phone .line { background: #f6f8f6; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.phone .line .row { justify-content: space-between; }
.qr { display: grid; place-items: center; padding: 10px; }
/* light mode: #shell[data-light] — no sidebar/topbar, one column, big touch targets, sticky bottom action bar */
#shell[data-light] { grid-template-columns: 1fr; }
#shell[data-light] .sidebar, #shell[data-light] .topbar { display: none; }
#shell[data-light] .main { width: 100%; max-width: 600px; margin: 0 auto; padding: 12px 12px calc(110px + env(safe-area-inset-bottom, 0px)); }
html[data-light] .toast-wrap { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; align-items: center; }
.accept { display: flex; flex-direction: column; gap: 10px; }
.accept .accept-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 2px; }
.accept .accept-head h2 { font-size: 20px; }
.accept .ok-banner { background: var(--green-100); color: var(--green-800); padding: 12px 14px; border-radius: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.accept .line { background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.accept .line .row { justify-content: space-between; }
.accept .line .name { font-weight: 700; font-size: 16px; }
.accept .qty-ctl { border-radius: 12px; }
.accept .qty-ctl button { width: 48px; height: 48px; font-size: 22px; font-weight: 600; }
.accept .qty-ctl input { width: 96px; min-height: 48px; font-size: 18px; font-weight: 600; }
.accept .input { min-height: 46px; font-size: 16px; }
.accept select.input { flex: 0 0 130px; width: 130px; }
.accept .btn, .accept-bar .btn { min-height: 48px; font-size: 15px; border-radius: 12px; }
.accept .accept-help { margin-top: 6px; color: var(--muted); font-size: 13px; }
.accept .accept-help summary { cursor: pointer; font-weight: 600; padding: 10px 2px; min-height: 44px; display: flex; align-items: center; }
.accept .accept-help .card { margin-bottom: 8px; }
.accept-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(20, 54, 39, .08); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.accept-bar .inner { max-width: 576px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.accept-bar .sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.accept-bar .sum b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.accept-bar .sum b.warn { color: var(--amber-600); }
.accept-bar .actions { display: flex; gap: 8px; }
.accept-bar .actions .primary { flex: 1; }

/* ---------- notification channels (Telegram) ---------- */
.channels .link-box { background: var(--blue-50); border: 1px solid #cddcef; border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.channels .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: .04em; background: #fff; border: 1px dashed #b9cde6; border-radius: 8px; padding: 6px 10px; display: inline-block; user-select: all; }
.push-card .list-item .t .badge { vertical-align: 1px; }
/* installable app: the sidebar offer (the browser decides when installation is possible) */
.sidebar .user #install-app { display: block; width: 100%; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }

/* ---------- login / landing ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .hero { background: var(--green-900); color: #fff; padding: 60px 64px; position: relative; overflow: hidden; }
.auth .hero::before { content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: rgba(255, 255, 255, .05); right: -160px; top: -140px; }
.auth .hero::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .04); right: -60px; bottom: -200px; }
.auth .hero h1 { font-size: 40px; line-height: 1.1; margin: 20px 0 14px; }
.auth .hero .lead { font-size: 18px; color: #c9dccf; margin-bottom: 30px; max-width: 520px; }
.auth .hero .tags { display: flex; gap: 10px; flex-wrap: wrap; }
.auth .hero .tag { border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px; padding: 10px 16px; font-weight: 600; background: rgba(255, 255, 255, .06); }
.auth .form { display: grid; place-items: center; padding: 40px; }
.auth .form .card { width: 420px; max-width: 100%; }
.demo-list { display: grid; gap: 8px; margin-top: 12px; }
.demo-list button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; }
.demo-list button:hover { border-color: var(--green-500); background: var(--green-50); }
.demo-list b { display: block; font-size: 13px; }
.demo-list span { font-size: 12px; color: var(--muted); }
.cycle { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 34px; }
.cycle div { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px; font-size: 12px; color: #c9dccf; }
.cycle div b { display: block; color: #fff; margin-bottom: 4px; font-size: 13px; }

@media (max-width: 1100px) { .grid.kpi { grid-template-columns: repeat(2, 1fr); } .grid.main-side, .grid.side-main, .grid.two, .grid.three { grid-template-columns: 1fr; } .cycle { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .nav { display: flex; flex-wrap: wrap; gap: 2px; } .sidebar .user { display: none; } .sidebar .spacer { display: none; }
  .main { padding: 16px; }
  .auth { grid-template-columns: 1fr; } .auth .hero { padding: 40px 24px; } .auth .hero h1 { font-size: 30px; }
  .drawer { width: 100%; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .notif-panel { width: min(380px, calc(100vw - 32px)); }
}
/* phones: touch targets ≥ 44px, no iOS zoom on focus (16px inputs). Full responsive rework is sprint W3. */
@media (max-width: 640px) {
  .btn { min-height: 44px; }
  .btn.sm { padding: 6px 12px; }
  .input, select.input { min-height: 44px; font-size: 16px; }
  .chip { min-height: 40px; }
  .toast-wrap { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); align-items: center; }
  .toast { max-width: 100%; }
  .modal { max-width: calc(100% - 16px); padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- integrations ---------- */
.int-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.int-tile:hover { border-color: var(--green-500); }
.int-tile.active { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 2px rgba(62, 154, 112, .15); }
.int-tile.planned { opacity: .6; }
.int-tile.planned:hover { border-color: var(--line); }
.int-tile .n { font-weight: 700; }
.int-tile .d { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.chip input[type=checkbox] { vertical-align: -2px; margin-right: 4px; }

/* ---------- priority positions ---------- */
tr.prio td { background: #fffbf0; }
tr.prio td:first-child { box-shadow: inset 3px 0 0 var(--amber-500); }
tr.prio:hover td { background: #fff6e0; }
.star { background: none; border: 0; color: #d5dcd7; font-size: 17px; line-height: 1; padding: 2px 4px; cursor: pointer; }
.star.on { color: var(--amber-500); }
.star:hover { color: var(--amber-600); }
.star-cell { width: 28px; padding-left: 6px; padding-right: 0; }
.num-cell { width: 34px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; padding-right: 4px; }

/* ---------- attachments (views/files.js) ---------- */
.files { display: grid; gap: 8px; }
.file { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.file:hover, .file:focus-visible { border-color: var(--green-500, #3e9a70); outline: none; }
.file .thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px; background: var(--bg, #f3f5f4); display: grid; place-items: center; overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .ext { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted, #6b7280); }
.file .meta { display: grid; gap: 1px; min-width: 0; flex: 1; font-size: 12px; }
.file .meta b { font-size: 13px; }
.file .meta span { color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product .img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
img.pthumb { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; }

/* ---------- coming prices (price lists) ---------- */
.product .upcoming { font-size: 12px; margin: 2px 0 4px; padding: 2px 8px; border-radius: 6px; display: inline-block; }
.product .upcoming.up { background: #fff4e0; color: #8a5a00; }
.product .upcoming.down { background: #e6f4ec; color: #1f6f4a; }

/* ---------- language switch ---------- */
.lang-switch { margin-left: 6px; }

/* ---------- requisites form (views/requisites.js) ---------- */
.input.invalid { border-color: var(--red-600); box-shadow: 0 0 0 2px rgba(200, 60, 60, .12); }
.field .err { display: block; color: var(--red-600); font-size: 12px; margin-top: 3px; }
.field .err:empty { display: none; }
.field.wide { grid-column: 1 / -1; }

/* ---------- print forms (views/print.js): счёт на оплату, накладная З-2 ---------- */
#shell[data-print] .main { max-width: 900px; padding: 12px 12px 40px; }
.print-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.print-warn { display: grid; gap: 8px; margin-bottom: 10px; }
.print-warn:empty { display: none; }
.print-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.print-doc { background: #fff; color: #000; box-shadow: var(--shadow); border-radius: 4px; padding: 12mm 11mm; margin: 0 auto; width: 100%; max-width: 210mm; min-width: 680px;
  font: 11px/1.35 Arial, 'Helvetica Neue', Helvetica, sans-serif; }
.print-doc p { margin: 6px 0; }
.print-doc table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.print-doc th, .print-doc td { border: 1px solid #000; padding: 3px 5px; vertical-align: top; font-size: 10.5px; color: #000; background: none; white-space: normal; text-align: left; }
.print-doc th { font-weight: 600; text-align: center; vertical-align: middle; }
.print-doc tr:hover td { background: none; }
.print-doc tr:last-child td { border-bottom: 1px solid #000; }
.print-doc .pd-plain tr:last-child td { border-bottom: 0; }
.print-doc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.print-doc .c { text-align: center; }
.print-doc .right { text-align: right; }
.print-doc .nowrap { white-space: nowrap; }
.print-doc .pd-plain td { border: 0; padding: 2px 0; }
.print-doc .pd-plain td.k { width: 92px; }
.print-doc .pd-title { font-size: 15px; font-weight: 700; margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 2px solid #000; }
.print-doc .pd-title.c { border-bottom: 0; text-align: center; letter-spacing: .02em; }
.print-doc .pd-bank .w-wide { width: 52%; }
.print-doc .pd-bank .w-narrow { width: 18%; }
.print-doc .pd-totals { width: auto; margin-left: auto; }
.print-doc .pd-totals td { padding: 1px 0 1px 18px; text-align: right; }
.print-doc .pd-words { font-size: 11.5px; }
.print-doc .pd-note { font-size: 10px; border-top: 1px solid #000; padding-top: 6px; margin-top: 10px; }
.print-doc .pd-gap { display: inline-block; min-width: 90px; border-bottom: 1px solid #000; height: 1em; vertical-align: bottom; }
.print-doc .pd-u { border-bottom: 1px solid #000; padding: 0 4px; }
.print-doc .pd-box { display: inline-block; border: 1px solid #000; padding: 1px 6px; letter-spacing: .08em; min-width: 110px; }
.print-doc .pd-signs { margin-top: 18px; }
.print-doc .pd-sign { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; margin: 0 2px; }
.print-doc .pd-sign .pd-line { display: block; min-width: 64px; border-bottom: 1px solid #000; text-align: center; padding: 0 4px; height: 1.35em; white-space: nowrap; }
.print-doc .pd-sign.name .pd-line { min-width: 104px; }
.print-doc .pd-sign small { font-size: 8px; color: #000; white-space: nowrap; }
.print-doc .pd-signs p { white-space: nowrap; }
.print-doc .pd-cols { display: grid; grid-template-columns: 56% 1fr; gap: 14px; }
.print-doc .pd-mp { padding-left: 40px; }
.print-doc .pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.print-doc .pd-form-ref { text-align: right; font-size: 9px; line-height: 1.3; }
.print-doc .pd-form-ref b { font-size: 10px; }
.print-doc .pd-qr { display: flex; gap: 8px; align-items: center; font-size: 9px; }
.print-doc .pd-qr img, .print-doc .pd-qr canvas { width: 92px; height: 92px; }
.print-doc .pd-docno { width: auto; margin-left: auto; }
.print-doc .pd-docno td, .print-doc .pd-docno th { min-width: 110px; }
.print-doc .pd-colnum td { text-align: center; font-size: 9px; padding: 1px; }
.print-doc .pd-total td { font-weight: 600; }
.print-doc .pd-sides td { height: 34px; }
@media (max-width: 640px) { #shell[data-print] .main { padding: 8px 4px 32px; } .print-bar .btn { flex: 1 1 auto; } }
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  .no-print, .sidebar, .topbar, .toast-wrap, .overlay, .notif-panel { display: none !important; }
  .shell, #shell[data-light] { display: block; min-height: 0; }
  #shell[data-print] .main { max-width: none; padding: 0; margin: 0; }
  .print-scroll { overflow: visible; }
  .print-doc { box-shadow: none; border-radius: 0; padding: 0; margin: 0; max-width: none; min-width: 0; }
  .print-doc tr, .print-doc .pd-signs { break-inside: avoid; }
  .print-doc thead { display: table-header-group; }
}

/* ---------- signup & invites (signup.html, views/partners.js) ---------- */
.kind-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kind-toggle button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; text-align: left; font-weight: 700; min-height: 44px; }
.kind-toggle button small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.kind-toggle button.active { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 2px rgba(62, 154, 112, .15); }
.kind-toggle button:disabled:not(.active) { opacity: .45; cursor: default; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* partner lists: one bordered row per supplier / restaurant / invite, actions wrap under the text on phones */
.plist { display: grid; gap: 8px; }
.prow { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.prow .ptext { min-width: 0; flex: 1; }
.prow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.prow.attn { border-color: #f5e2b8; background: var(--amber-50); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .prow { flex-direction: column; align-items: stretch; } .prow .acts { justify-content: flex-start; } }
.auth .form .card.wide { width: 480px; }
.auth .hero .points { display: grid; gap: 10px; margin-top: 26px; max-width: 520px; }
.auth .hero .points div { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #c9dccf; }
.auth .hero .points b { display: block; color: #fff; margin-bottom: 2px; }
