/* KHvito — стили. Цвета в :root — поменяйте здесь, и сайт перекрасится целиком. */
:root {
  --bg: #0F1115;
  --bar: #13161C;
  --card: #171A21;
  --input: #0F1115;
  --line: #262A33;
  --line2: #2F3440;
  --text: #E8EAED;
  --text2: #C9CDD4;
  --muted: #9AA0AA;
  --accent: #B8F24A;
  --accent-ink: #0F1115;
  --ok-bg: #1C2614; --ok: #C8F57A;
  --warn-bg: #2A2213; --warn: #FFC36B;
  --bad-bg: #2A1616; --bad: #FFB3B3; --bad-line: #5A2626;
  --info-bg: #14213A; --info: #8DB8FF;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
h1, .num { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; }
h1 { font-size: 32px; }
h2 { font-size: 19px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* шапка */
.top { background: var(--bar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1360px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 20px "Space Grotesk", Inter, sans-serif; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.tabs { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.on { background: #262A33; color: #fff; }
.tab .count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #262A33; color: var(--text2); }
.tab.on .count { background: var(--accent); color: var(--accent-ink); }
.tab.add { color: var(--accent); border: 1px dashed #3A404D; }
.status { display: flex; align-items: center; gap: 8px; color: var(--text2); font-size: 14px; text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok { background: var(--accent); } .dot.warn { background: var(--warn); } .dot.error { background: #FF6B6B; } .dot.paused { background: var(--muted); }

/* страница */
.page { max-width: 1360px; margin: 0 auto; padding: 26px 24px 64px; display: flex; flex-direction: column; gap: 22px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.head p { margin: 6px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.side-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .num { font-size: 28px; }
.kpi .num.acc { color: var(--accent); }
@media (max-width: 800px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } h1 { font-size: 26px; } .page { padding: 18px 14px 48px; } .top-in { padding: 10px 14px; } .status span { display: none; } }

/* кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line2); background: transparent; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #4A5160; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #CCFF66; }
.btn.danger { color: #FF9B9B; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.done { background: var(--ok-bg); border-color: #3A4A26; color: var(--ok); }
label.f { display: flex; flex-direction: column; gap: 6px; }
label.f > span { color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--input); color: var(--text); font: inherit; min-height: 44px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chip.stop { background: #2A1A1A; border-color: #3A2222; color: #FF9B9B; }
.chip.dashed { border-style: dashed; color: var(--muted); background: transparent; }

/* лента */
.item { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.item .body { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.item .title { font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none; }
.item .title:hover { text-decoration: underline; }
.item .price { font: 700 26px "Space Grotesk", Inter, sans-serif; }
.item .actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 220px; justify-content: flex-end; }
.diff { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 999px; }
.note { display: inline-flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 8px 12px; border-radius: 10px; align-self: flex-start; background: var(--ok-bg); color: var(--ok); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.plain { background: #1E222A; color: var(--text2); }
.write { flex: 1 1 100%; border-top: 1px solid var(--line); padding-top: 14px; display: none; flex-direction: column; gap: 12px; }
.write.open { display: flex; }
.empty { background: var(--card); border: 1px dashed #3A404D; border-radius: 18px; padding: 44px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { max-width: 480px; margin: 0; }

/* таблицы */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid #20242D; vertical-align: middle; }
.tbl input, .tbl select { min-height: 40px; padding: 8px 10px; }
.pill { padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.st-sold { background: var(--ok-bg); color: var(--ok); }
.pill.st-sale { background: var(--info-bg); color: var(--info); }
.pill.st-repair { background: var(--warn-bg); color: var(--warn); }
.pill.st-bought { background: #23262E; color: var(--text2); }
.profit { color: var(--accent); font-weight: 700; }

/* сообщения */
.flash { background: var(--info-bg); color: #CFE0FF; border: 1px solid #22375E; padding: 12px 16px; border-radius: 12px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); border: 1px solid #2E3D1F; }
.alert.danger { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #4A3A1A; }
.result-text { white-space: pre-line; line-height: 1.6; margin: 0; }
.hidden { display: none !important; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 380px; }
