:root {
  /* Стиль FAND (как каталог): белый фон, бордовый акцент */
  --bg: #ffffff;
  --card: #f5f3f1;
  --text: #140f0b;
  --hint: #717171;
  --accent: #540111;
  --accent-text: #ffffff;
  --green: #2e7d4f;
  --red: #b3261e;
  --blue: #540111;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, 'SF Pro Text', Roboto, sans-serif; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
/* моноширинные цифры в числовых блоках, чтобы значения не «прыгали» */
.stat-value, .stat-mini, .stat-value.big, .totals .tval, .op-sum, .sold-price, #earnedAmount, .fin-table td, .pf-v, .ch-meta { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.brand, .title, .dash-title, .wiz-step h3, .denied h2 { font-family: 'Raleway', 'Inter', sans-serif; }
/* числа — всегда Inter с моноширинными цифрами (Raleway цифры «прыгают») */
.stat-value, .stat-value.big, .stat-mini, .totals .tval, .op-sum, .sold-price, #earnedAmount, .pf-v { font-family: 'Inter', -apple-system, sans-serif; }
/* ссылка-кнопка должна быть как блок (выравнивание в карточке товара) */
a.btn { display: block; text-decoration: none; text-align: center; box-sizing: border-box; }
.link-block { margin-bottom: 12px; }
.link-block .btn { margin-bottom: 6px; }
.btn-copy { font-size: 14px; padding: 11px; }
.page { display: none; padding: 14px 16px 32px; max-width: 560px; margin: 0 auto; }
.page.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 38px; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.title { font-size: 17px; font-weight: 700; flex: 1; }
.back { background: var(--card); border: 0; color: var(--text); width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; }
.bell { margin-left: auto; background: var(--card); border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 17px; position: relative; }
.dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hidden { display: none !important; }
.k-tag { display: inline-block; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 10px; padding: 1px 5px; border-radius: 5px; margin-right: 4px; }
.chip.k { border-color: var(--accent); }
.chip small { display: block; color: var(--hint); font-size: 11px; margin-top: 2px; }
.mini-btn { background: var(--card); border: 0; color: var(--text); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }

.card { background: var(--card); border-radius: 16px; padding: 16px; border: 1px solid rgba(0,0,0,.06); }
.dash-big { margin-bottom: 16px; }
.stat-label { font-size: 12px; color: var(--hint); margin-bottom: 4px; }
.stat-value.big { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.stat-value.pos { color: var(--green); } .stat-value.neg { color: var(--red); }
.dash-split { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.dash-cell { background: rgba(0,0,0,.04); border-radius: 12px; padding: 10px; }
.stat-mini { font-size: 16px; font-weight: 700; }
.stat-mini.pos { color: var(--green); } .stat-mini.neg { color: var(--red); }
.stat-sub { font-size: 11px; color: var(--hint); margin-top: 8px; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.btn { border: 0; border-radius: 14px; font-size: 16px; font-weight: 700; padding: 15px; background: var(--accent); color: var(--accent-text); width: 100%; }
.btn.big { text-align: left; }
.btn.ghost { background: #fff; color: var(--text); margin-top: 14px; border: 1px solid rgba(0,0,0,.15); }
.btn.danger { background: var(--red); color: #fff; }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .5; }
.badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 12px; padding: 2px 7px; margin-left: 6px; }

/* мастер */
.wiz-progress { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.wstep { flex-shrink: 0; background: var(--card); border: 1px solid rgba(0,0,0,.1); color: var(--hint); padding: 6px 11px; border-radius: 100px; font-size: 12px; white-space: nowrap; font-weight: 600; }
.wstep.done { color: var(--text); border-color: var(--accent); }
.wstep.cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.wstep-list { color: var(--accent); }
.wiz-step h3 { font-size: 18px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--card); border: 1.5px solid transparent; color: var(--text); border-radius: 12px; padding: 11px 14px; font-size: 15px; }
.chip:active, .chip.sel { border-color: var(--accent); }
.input, select.input { width: 100%; background: var(--card); border: 1.5px solid transparent; border-radius: 12px; color: var(--text); font-size: 17px; padding: 14px; margin-bottom: 10px; outline: none; -webkit-appearance: none; appearance: none; }
.input:focus { border-color: var(--accent); }
.field { margin-bottom: 12px; }
.field-label { font-size: 12px; color: var(--hint); margin-bottom: 4px; padding-left: 4px; }
.wiz-nav { margin-top: 16px; display: flex; gap: 10px; }
.skip { background: var(--card); color: var(--hint); }
.summary { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.8; }
.summary b { float: right; text-align: right; max-width: 60%; }
.summary div { clear: both; }

/* вкладки */
.tabs { display: flex; gap: 6px; background: var(--card); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 1; background: transparent; border: 0; color: var(--hint); padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.tab.active { background: rgba(0,0,0,.08); color: var(--text); }
.tab span { color: var(--hint); margin-left: 4px; font-weight: 500; }

/* задачи */
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { background: var(--card); border-radius: 14px; padding: 13px 14px; border-left: 4px solid var(--accent); }
.task.done { border-left-color: var(--green); opacity: .75; }
.task-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.task-meta { font-size: 12px; color: var(--hint); display: flex; flex-wrap: wrap; gap: 6px; }
.task-actions { margin-top: 10px; display: flex; gap: 8px; }
.task-actions .btn { padding: 9px 14px; font-size: 14px; width: auto; }
.tag { background: rgba(0,0,0,.07); padding: 2px 8px; border-radius: 8px; }
.tag.auto { color: var(--accent); }
.group-label { font-size: 13px; color: var(--hint); margin: 12px 0 2px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* операции */
.month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.month-nav select { flex: 1; background: var(--card); color: var(--text); border: 0; border-radius: 10px; padding: 10px 12px; font-size: 16px; -webkit-appearance: none; appearance: none; }
.totals { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.totals .tcell { background: var(--card); border-radius: 10px; padding: 9px 10px; text-align: center; }
.totals .tcell .tlabel { font-size: 10px; color: var(--hint); }
.totals .tcell .tval { font-size: 14px; font-weight: 700; margin-top: 2px; }
.totals .tcell .tval.pos { color: var(--green); }
.totals .tcell .tval.neg { color: var(--red); }
.ops { display: flex; flex-direction: column; gap: 8px; }
.op { background: var(--card); border-radius: 12px; padding: 10px 12px; border-left: 4px solid #555; }
.op.income { border-left-color: var(--green); }
.op.expense { border-left-color: var(--red); }
.op.ndo { border-left-color: var(--blue); }
.op-top { display: flex; align-items: baseline; gap: 8px; }
.op-top .op-date { font-size: 11px; color: var(--hint); }
.op-top .op-sum { margin-left: auto; font-weight: 700; font-size: 15px; }
.op-top .op-sum.pos { color: var(--green); }
.op-top .op-sum.neg { color: var(--red); }
.op-desc { font-size: 14px; margin-top: 2px; }
.op-meta { font-size: 11px; color: var(--hint); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.op-edit { background: transparent; border: 0; color: var(--accent); font-size: 12px; margin-top: 6px; padding: 0; }

/* события */
.feed { display: flex; flex-direction: column; gap: 8px; }
.event { background: var(--card); border-radius: 12px; padding: 11px 13px; font-size: 14px; }
.event .time { font-size: 11px; color: var(--hint); margin-top: 3px; }

/* тосты */
#toasts { position: fixed; top: 10px; left: 12px; right: 12px; z-index: 99; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--card); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateY(-16px); opacity: 0; } }

.denied { text-align: center; padding-top: 80px; }
.denied-icon { font-size: 52px; margin-bottom: 14px; }
.denied p { margin-top: 10px; color: var(--hint); }
.muted { font-size: 13px; }
.empty { color: var(--hint); text-align: center; padding: 28px 0; font-size: 14px; }

/* блочные заголовки на главной */
.dash-title { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--hint); margin: 0 4px 6px; }
.dash-split.four { grid-template-columns: 1fr 1fr; gap: 10px; }
.invest-extra { font-size: 12px; color: var(--hint); margin-top: 10px; }

/* Что продано */
.sold-list { display: flex; flex-direction: column; gap: 10px; }
.sold-card { background: var(--card); border-radius: 14px; padding: 10px; display: flex; gap: 12px; align-items: center; }
.sold-photo { width: 64px; height: 64px; border-radius: 10px; background: rgba(0,0,0,.08); object-fit: cover; flex-shrink: 0; }
.sold-photo.empty { display: flex; align-items: center; justify-content: center; color: var(--hint); font-size: 22px; }
.sold-body { flex: 1; min-width: 0; }
.sold-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.sold-meta { font-size: 11px; color: var(--hint); display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.sold-price { font-weight: 700; color: var(--green); font-size: 15px; }

/* таблицы Финансы */
.table-wrap { background: var(--card); border-radius: 12px; padding: 10px; overflow-x: auto; }
.fin-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.fin-table th, .fin-table td { padding: 4px 8px; border-bottom: 1px solid rgba(0,0,0,.05); white-space: nowrap; }
.fin-table th { font-weight: 600; color: var(--hint); text-align: left; background: rgba(0,0,0,.03); }
.fin-table td { color: var(--text); }

/* Таблицы Финансы — обводка ячеек, как в Sheets */
.fin-table { border: 1px solid rgba(0,0,0,.12); }
.fin-table th, .fin-table td { border: 1px solid rgba(0,0,0,.08); padding: 6px 10px; }
.fin-table tr:nth-child(odd) td { background: rgba(0,0,0,.02); }
.fin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.fin-table td.neg { color: var(--red); }
.fin-table td.pos { color: var(--green); }

/* Категории задач */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 1px 8px; -webkit-overflow-scrolling: touch; }
.cat-tab { flex-shrink: 0; background: var(--card); border: 0; color: var(--hint); padding: 8px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cat-tab.active { background: var(--accent); color: var(--accent-text); }
.cat-tab .cnt { margin-left: 4px; opacity: .7; }
.cat-tab.urgent { color: var(--red); }
.cat-tab.urgent.active { background: var(--red); color: #fff; }

/* Подсветка важных задач */
.task.urgent { border-left-color: var(--red); }

/* Платформы под продажей */
.sold-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.platform { font-size: 11px; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.05); }
.platform.ok { background: rgba(63,191,111,.18); color: var(--green); }
.platform.bad { background: rgba(224,92,92,.18); color: var(--red); }
.platform.warn { background: rgba(232,184,75,.18); color: var(--accent); }
.platform .lbl { opacity: .8; margin-right: 4px; }

/* Несколько блоков прибыли (admin) */
.profit-stack { display: flex; flex-direction: column; gap: 10px; }
.profit-stack .partner-name { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }

/* Удаление операции */
.op-actions { margin-top: 6px; display: flex; gap: 10px; }
.op-actions button { background: transparent; border: 0; font-size: 12px; padding: 0; }
.op-edit-btn { color: var(--accent); }
.op-del-btn { color: var(--red); }

.earned-month { background: rgba(0,0,0,.06); color: var(--text); border: 0; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-bottom: 10px; width: 100%; }

.ch-input { display:block; width:100%; box-sizing:border-box; background:#fff; color: var(--text); border:1px solid rgba(0,0,0,.15); border-radius:10px; padding:11px; font-size:15px; margin-bottom:10px; font-family:inherit; }
.ch-input:focus { outline:none; border-color: var(--accent); }
.ch-item { margin-bottom:10px; }
.ch-row { display:flex; align-items:center; gap:8px; }
.ch-meta { font-size:12px; color: var(--hint); flex:1; }
.ch-meta a { color: var(--blue); }
.ch-text { margin-top:6px; white-space:pre-wrap; font-size:14px; }

/* Выкладка товаров в канал */
#page-channel .card { margin-bottom: 14px; }
#page-channel .card:last-of-type { margin-bottom: 0; }
.prod-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.prod-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: rgba(0,0,0,.05); border-radius: 12px; }
.prod-info { min-width: 0; flex: 1; }
.prod-info b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-info .ch-meta { font-size: 12px; color: var(--hint); white-space: normal; }
.prod-btn { flex-shrink: 0; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 700; white-space: nowrap; width: auto; }
.prod-btn:active { opacity: .8; }
.ch-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-grid2 .ch-input { margin-bottom: 0; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: var(--card); border-radius: 16px; padding: 20px; width: 100%; max-width: 380px; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-sku { font-size: 18px; font-weight: 700; margin: 2px 0 8px; }

/* Сетка выбора фото в модалке */
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm-tile { position: relative; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.05); border: 2px solid transparent; }
.pm-tile.sel { border-color: var(--accent); }
.pm-tile img { width: 100%; height: 84px; object-fit: cover; display: block; }
.pm-badge { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pm-name { display: block; font-size: 10px; color: var(--hint); padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Очередь: карточка с обложкой */
.q-item { display: flex; gap: 12px; align-items: center; padding: 10px; }
.q-cover { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.06); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.q-cover img { width: 100%; height: 100%; object-fit: cover; }
.q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-actions { display: flex; gap: 6px; margin-top: 6px; }

/* Главная: переключатель дашбордов, поиск товара, карточка товара */
.dash-seg { margin-bottom: 14px; }
.srch-cover { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.06); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.srch-cover img { width: 100%; height: 100%; object-fit: cover; }
#homeSearchResults { margin-bottom: 14px; }
#homeSearchResults:empty { margin-bottom: 0; }
.prod-photo { width: 100%; border-radius: 14px; overflow: hidden; margin-bottom: 12px; background: rgba(0,0,0,.05); }
.prod-photo img { width: 100%; display: block; object-fit: cover; max-height: 360px; }
.pf-card { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid rgba(0,0,0,.06); padding-bottom: 6px; }
.pf-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pf-k { color: var(--hint); flex-shrink: 0; max-width: 48%; }
.pf-v { text-align: right; font-weight: 600; word-break: break-word; }
.wiz-suggest { margin-bottom: 10px; }

/* Кнопка «скоро» (неактивный канал) */
.btn.ch-soon { opacity: .6; }
.btn.ch-soon span { font-size: 12px; font-weight: 500; opacity: .8; margin-left: 6px; }

/* Переключатель «Сейчас / По времени» */
.seg { display: flex; gap: 6px; background: rgba(0,0,0,.06); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg-btn { flex: 1; background: transparent; border: 0; color: var(--hint); padding: 10px; border-radius: 9px; font-size: 15px; font-weight: 600; }
.seg-btn.active { background: var(--accent); color: var(--accent-text); }

/* Предложения по выкладке */
.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec-card { background: var(--card); border-radius: 16px; padding: 12px; }
.rec-head { display: flex; gap: 12px; align-items: flex-start; }
.rec-cover { width: 72px; height: 72px; border-radius: 10px; background: rgba(0,0,0,.06); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.rec-cover img { width: 100%; height: 100%; object-fit: cover; }
.rec-info { flex: 1; min-width: 0; }
.rec-info b { display: block; font-size: 15px; line-height: 1.2; margin-bottom: 2px; }
.rec-info .prod-btn { margin-top: 8px; }
.ph-skel { width: 100%; height: 100%; background: linear-gradient(90deg, rgba(0,0,0,.04), rgba(0,0,0,.1), rgba(0,0,0,.04)); }
.ph-none { font-size: 10px; color: var(--hint); text-align: center; }
.rec-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.rec-strip .ph { flex-shrink: 0; width: 84px; display: flex; flex-direction: column; gap: 4px; }
.rec-strip .ph img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: rgba(0,0,0,.05); }
.rec-strip .ph span { font-size: 10px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
