/* ── Юнитка Ozon Global (15.11) ─────────────────────────────────────────────
   Цветные блоки колонок, как в таблице владельца: ввод — жёлтый, из Ozon —
   голубой, расчёт — серый, результат — оранжевый, цена и наценка — зелёный.
   Фоны мягкие, текст основного цвета: «красочно, но читаемо». */
:root {
  --og-in: #fff6cf; --og-in-h: #f2d75a;
  --og-oz: #e3f1fc; --og-oz-h: #8cc2ee;
  --og-calc: #eef1f5; --og-calc-h: #b8c2cf;
  --og-res: #ffe8d1; --og-res-h: #f3a663;
  --og-price: #dff4e6; --og-price-h: #7ccb98;
  --og-rv: #efe6fb; --og-rv-h: #b394e6;
  --og-neg: #c62828; --og-ok: #1b7f45; --og-below: #9a6a00;
  --og-v-loss: #fbd5d5; --og-v-below: #fff0b8; --og-v-ok: #d3f1dd;
}
[data-theme="dark"] {
  --og-in: #3a3418; --og-in-h: #8a7a2a;
  --og-oz: #16283a; --og-oz-h: #2f5f8c;
  --og-calc: #1e2233; --og-calc-h: #3a4160;
  --og-res: #3a2616; --og-res-h: #8a5426;
  --og-price: #15301f; --og-price-h: #2d6c44;
  --og-rv: #2a1f3d; --og-rv-h: #6a4fa0;
  --og-neg: #ff8a80; --og-ok: #6fdc9b; --og-below: #f3c969;
  --og-v-loss: #5a1f24; --og-v-below: #4a3c12; --og-v-ok: #1d4a2e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --og-in: #3a3418; --og-in-h: #8a7a2a;
    --og-oz: #16283a; --og-oz-h: #2f5f8c;
    --og-calc: #1e2233; --og-calc-h: #3a4160;
    --og-res: #3a2616; --og-res-h: #8a5426;
    --og-price: #15301f; --og-price-h: #2d6c44;
    --og-rv: #2a1f3d; --og-rv-h: #6a4fa0;
    --og-neg: #ff8a80; --og-ok: #6fdc9b; --og-below: #f3c969;
    --og-v-loss: #5a1f24; --og-v-below: #4a3c12; --og-v-ok: #1d4a2e;
  }
}

.og { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.og-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.og-h { margin: 0; font-size: 20px; }
.og-top p { margin: 2px 0 0; }
.og-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.og-file { cursor: pointer; }
.og-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.og-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.og-seg button { border: 0; background: transparent; color: var(--text); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.og-seg button.on { background: var(--accent); color: #fff; }
.og-dates { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--text-muted); }
.og-dates input, .og-search { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.og-search { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.og-msg { padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--surface2); }
.og-msg-ok { background: var(--og-v-ok); }
.og-msg-err { background: var(--og-v-loss); }
.og-skel { padding: 40px; text-align: center; color: var(--text-muted); }

.og-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.og-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.og-card small { color: var(--text-muted); font-size: 12px; }
.og-card b { font-size: 22px; font-variant-numeric: tabular-nums; }
.og-card span { color: var(--text-muted); font-size: 12px; }
.og-card-main { background: var(--og-res); border-color: var(--og-res-h); }
.og-card-main.is-neg b { color: var(--og-neg); }
.og-items, .og-fill { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; }
.og-items summary, .og-fill summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.og-items ul { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }
.og-items li { display: grid; grid-template-columns: 1fr auto 60px; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.og-items li i { color: var(--text-muted); font-style: normal; text-align: right; }
.og-items p { font-size: 12px; margin: 6px 0; }
.og-fill ul { margin: 8px 0; padding-left: 18px; columns: 2 320px; font-size: 13px; }
.og-warn { color: var(--og-below); }

.og-scroll { overflow: auto; max-height: calc(100vh - 220px); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.og-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.og-table th, .og-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; }
.og-table thead th { position: sticky; z-index: 2; font-weight: 600; font-size: 11.5px; line-height: 1.2; white-space: normal; min-width: 72px; vertical-align: bottom; cursor: pointer; user-select: none; }
.og-table thead tr:first-child th { top: 0; height: 24px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: center; cursor: default; }
.og-table thead tr:nth-child(2) th { top: 25px; }
.og-sticky { position: sticky; z-index: 1; background: var(--surface); }
.og-table thead th.og-sticky { z-index: 4; }
.og-s1 { left: 0; min-width: 220px; max-width: 260px; text-align: left !important; }
.og-s2 { left: 220px; min-width: 96px; text-align: left !important; box-shadow: 2px 0 0 var(--border); }
.og-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-name small { display: block; color: var(--text-muted); font-size: 11px; }
.og-sku { color: var(--text-muted); font-size: 11.5px; }
.og-g-in, .og-c-in { background: var(--og-in); }
.og-g-oz, .og-c-oz { background: var(--og-oz); }
.og-g-calc, .og-c-calc { background: var(--og-calc); }
.og-g-res, .og-c-res { background: var(--og-res); }
.og-g-price, .og-c-price { background: var(--og-price); }
.og-g-rv, .og-c-rv { background: var(--og-rv); }
.og-g-in { box-shadow: inset 0 -3px 0 var(--og-in-h); }
.og-g-oz { box-shadow: inset 0 -3px 0 var(--og-oz-h); }
.og-g-calc { box-shadow: inset 0 -3px 0 var(--og-calc-h); }
.og-g-res { box-shadow: inset 0 -3px 0 var(--og-res-h); }
.og-g-price { box-shadow: inset 0 -3px 0 var(--og-price-h); }
.og-g-rv { box-shadow: inset 0 -3px 0 var(--og-rv-h); }
.og-table tbody tr:hover td { filter: brightness(.97); }
.og-b { font-weight: 700; }
.og-neg { color: var(--og-neg); }
.og-edit { padding: 2px 4px !important; }
.og-table .og-edit input { width: 84px; height: 28px; min-height: 0; box-shadow: none; font-size: 12.5px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: rgba(255,255,255,.55); color: var(--text); font: inherit; text-align: right; }
[data-theme="dark"] .og-edit input { background: rgba(0,0,0,.25); }
.og-edit input:hover { border-color: var(--og-in-h); }
.og-edit input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.og-edit input.is-saving { opacity: .5; }
.og-edit input.is-err { border-color: var(--og-neg); }
tr.is-miss .og-edit input:placeholder-shown { border-color: var(--og-in-h); border-style: dashed; }
.og-v { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 11.5px; }
.og-v-loss { background: var(--og-v-loss); color: var(--og-neg); }
.og-v-below { background: var(--og-v-below); color: var(--og-below); }
.og-v-ok { background: var(--og-v-ok); color: var(--og-ok); }
.og-v-miss { background: var(--surface2); color: var(--text-muted); font-weight: 500; }
.og-flag { font-size: 10px; padding: 1px 5px; border-radius: 6px; background: var(--og-v-below); color: var(--og-below); }
.og-empty { text-align: center !important; color: var(--text-muted); padding: 24px !important; }
.og-foot { font-size: 12px; margin: 0; }

.og-modal { position: fixed; inset: 0; background: rgba(10, 14, 25, .45); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.og-modal-panel { background: var(--surface); color: var(--text); border-radius: 16px; padding: 18px 20px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.og-modal-head { display: flex; justify-content: space-between; align-items: center; }
.og-modal-head h3 { margin: 0; }
.og-modal h4 { margin: 16px 0 8px; font-size: 14px; }
.og-fx { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.og-fx label, .og-rates label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
.og-fx input, .og-rates input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--og-in); color: var(--text); font: inherit; width: 120px; }
.og-fx-hist { margin-top: 8px; font-size: 13px; }
.og-fx-hist td { padding: 3px 10px 3px 0; }
.og-rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; }
.og-rates span { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }

@media (max-width: 720px) {
  .og-s1 { min-width: 150px; max-width: 150px; }
  .og-s2 { left: 150px; min-width: 80px; }
  .og-scroll { max-height: none; }
  .og-search { max-width: none; }
}

/* Соинвест и сигналы (шаг 6) */
.og-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.og-up { color: var(--og-neg); }
.og-down { color: var(--og-ok); }
.og-alerts { background: var(--og-v-below); border: 1px solid var(--og-in-h); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.og-alerts ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; }
.og-alerts li span { font-weight: 600; }
.og-alerts li.og-a-margin-negative span, .og-alerts li.og-a-site-below-be span { color: var(--og-neg); }
.og-chart { width: 100%; height: auto; margin-top: 8px; }
.og-chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.og-chart-dot { fill: var(--accent); }
.og-chart-exp { stroke: var(--text-muted); stroke-dasharray: 4 4; }
.og-chart-t { fill: var(--text-muted); font-size: 11px; }
.og-check span { display: inline-flex; gap: 6px; align-items: center; }
.og-check input { width: auto !important; }

/* Конкуренты (шаг 7) */
.og-flag-neg { background: var(--og-v-loss); color: var(--og-neg); }
.og-token { display: inline-block; margin: 6px 0; padding: 4px 8px; border-radius: 6px; background: var(--surface); word-break: break-all; font-size: 12px; }
.og-rivals { width: 100%; }
.og-rivals td { vertical-align: top; border-bottom: 1px solid var(--border); padding: 6px 10px 6px 0; }
.og-rivals a { color: var(--accent); word-break: break-all; }
.og-rivals td:nth-child(3), .og-rivals td:nth-child(4) { white-space: nowrap; }
