:root {
  --bg-page: #07080d;
  --bg-shell: rgba(13, 16, 24, 0.92);
  --bg-panel: rgba(20, 24, 35, 0.85);
  --bg-card: rgba(28, 32, 44, 0.7);
  --bg-card-strong: rgba(34, 38, 52, 0.88);
  --bg-input: rgba(15, 18, 26, 0.85);
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(255, 255, 255, 0.16);
  --text: #ecedf2;
  --text-dim: #9aa0b3;
  --text-muted: #5a6079;
  --accent: #ff5277;
  --accent-2: #6cffd0;
  --accent-3: #6c9bff;
  --gold: #ffb547;
  --positive: #6cffd0;
  --negative: #ff6577;
  --warn: #ffb547;
  --top: #6cffd0;
  --medium: #6c9bff;
  --potential: #b07cff;
  --weak: #ff6577;
  --newcomer: #9aa0b3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-page);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 82, 119, 0.10), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(108, 255, 208, 0.06), transparent);
  pointer-events: none; z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

a { color: var(--accent-3); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ HEADER ============ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.brand-block { display: flex; align-items: baseline; gap: 14px; }
.brand-block h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-2);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.brand-tag { font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }

.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.meta-pill strong { color: var(--text); margin-left: 4px; font-weight: 600; }

/* ============ TABS ============ */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { color: var(--text-dim); }
.tab-btn.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-btn .tab-badge {
  background: var(--negative);
  color: var(--bg-page);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ============ COMMON COMPONENTS ============ */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.3px; }
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar-row { display: flex; gap: 10px; flex: 1; min-width: 280px; }
.toolbar input[type="search"], .toolbar select, .toolbar input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  flex: 1;
  min-width: 200px;
}
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--line-bright); }
.chip.is-active { background: var(--text); color: var(--bg-page); border-color: var(--text); }
.chip.is-danger { background: var(--negative); color: var(--bg-page); border-color: var(--negative); }

/* ============ SUMMARY CARDS ============ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-3);
}
.summary-card.is-positive::before { background: var(--positive); }
.summary-card.is-negative::before { background: var(--negative); }
.summary-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.summary-card .value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.summary-card .note {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ============ INSIGHT BLOCKS ============ */
.insights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.insight-card-wide {
  grid-column: 1 / -1;
  min-width: 0;
}
.insight-card strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.insight-card span { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.geo-rank-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.geo-rank-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) repeat(3, minmax(90px, max-content));
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.geo-rank-row span,
.geo-rank-row strong {
  color: var(--text-dim);
  font-size: 12px;
}
.geo-rank-row span:not(.geo-rank-name) {
  text-align: right;
  white-space: nowrap;
}
.geo-rank-row .positive { color: var(--positive); }
.geo-rank-row .negative { color: var(--negative); }

.inhouse-empty {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.inhouse-empty > div,
.inhouse-warnings > div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.inhouse-empty strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.inhouse-empty span,
.inhouse-empty code {
  color: var(--text-dim);
  font-size: 12px;
}
.inhouse-empty code {
  font-family: 'JetBrains Mono', monospace;
}
.inhouse-warnings {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.inhouse-warnings > div {
  border-left: 3px solid var(--warn);
  color: var(--text-dim);
  font-size: 12px;
}

/* ============ BUYERS GRID ============ */
.buyers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.buyer-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.buyer-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cat-color, var(--medium));
}
.buyer-card:hover {
  transform: translateY(-2px);
  border-color: var(--cat-color, var(--line-bright));
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.buyer-card.is-selected {
  border-color: var(--cat-color, var(--accent));
  background: var(--bg-card-strong);
}
.buyer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}
.buyer-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buyer-card-id {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
}
.buyer-card-margin {
  font-size: 16px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.buyer-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.buyer-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-bottom: 10px;
  font-size: 11px;
}
.buyer-card-stats .stat {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.buyer-card-stats .stat strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.buyer-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
  color: var(--text-muted);
}
.spark { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.spark-bar { width: 3px; min-height: 2px; border-radius: 1px; background: var(--text-muted); }
.spark-bar.up { background: var(--positive); }
.spark-bar.down { background: var(--negative); }

/* ============ TAGS ============ */
.tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid transparent;
}
.tag.top { background: rgba(108,255,208,0.12); color: var(--top); border-color: rgba(108,255,208,0.4); }
.tag.medium { background: rgba(108,155,255,0.12); color: var(--medium); border-color: rgba(108,155,255,0.4); }
.tag.potential { background: rgba(176,124,255,0.12); color: var(--potential); border-color: rgba(176,124,255,0.4); }
.tag.weak { background: rgba(255,101,119,0.12); color: var(--weak); border-color: rgba(255,101,119,0.4); }
.tag.newcomer { background: rgba(154,160,179,0.12); color: var(--newcomer); border-color: rgba(154,160,179,0.4); }
.tag.profit { background: rgba(108,255,208,0.12); color: var(--positive); border-color: rgba(108,255,208,0.4); }
.tag.loss { background: rgba(255,101,119,0.12); color: var(--negative); border-color: rgba(255,101,119,0.4); }
.tag.warn { background: rgba(255,181,71,0.12); color: var(--warn); border-color: rgba(255,181,71,0.4); }
.tag.info { background: var(--bg-card); color: var(--text-dim); border-color: var(--line); }
.tag.source { background: var(--bg-card); color: var(--text-dim); border-color: var(--line); }

.positive { color: var(--positive); }
.negative { color: var(--negative); }
.subtle { color: var(--text-muted); }

/* ============ DETAIL PANEL (slide-over) ============ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
}
.detail-overlay.is-open { display: block; }
.detail-shell {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 720px;
  height: 100vh;
  background: var(--bg-shell);
  border-left: 1px solid var(--line-bright);
  z-index: 101;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 24px 28px;
}
.detail-shell.is-open { transform: translateX(0); }
.detail-close {
  position: absolute;
  top: 16px; right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  width: 36px; height: 36px;
  color: var(--text);
  border-radius: 6px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-close:hover { color: var(--accent); border-color: var(--accent); }

.detail-head { margin-bottom: 18px; padding-right: 60px; }
.detail-name { font-size: 24px; font-weight: 800; margin: 4px 0 8px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.detail-card-head h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.detail-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mini-kpi {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.mini-kpi span {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.mini-kpi strong {
  font-size: 16px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  display: block;
  margin-top: 2px;
}

.priority-callout {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-3);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.priority-callout.urgent { border-left-color: var(--negative); }
.priority-callout.scale { border-left-color: var(--positive); }
.priority-callout.attention { border-left-color: var(--warn); }
.priority-callout strong { display: block; font-size: 13px; margin-bottom: 4px; }
.priority-callout p { font-size: 12px; color: var(--text-dim); }

.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-row {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-left: 3px solid var(--negative);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
}
.alert-row strong { color: var(--negative); margin-right: 6px; }
.alert-row.warn { border-left-color: var(--warn); }
.alert-row.warn strong { color: var(--warn); }

.empty-callout {
  background: var(--bg-input);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.recommendation-list { display: flex; flex-direction: column; gap: 8px; }
.recommendation-item {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}
.recommendation-item strong { display: block; margin-bottom: 4px; }
.recommendation-item span { color: var(--text-dim); }

/* ============ FORM FIELDS ============ */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field.full { grid-column: 1 / -1; }
.field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}
.field input, .field select, .field textarea {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.action-btn {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg-page); }
.action-btn.primary:hover { background: transparent; color: var(--accent); }
.action-btn.secondary { background: transparent; }
.action-btn.danger:hover { border-color: var(--negative); color: var(--negative); }

.flash-message {
  background: rgba(108,255,208,0.1);
  border: 1px solid var(--positive);
  color: var(--positive);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  background: rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
}
td { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
td:first-child { font-family: inherit; font-size: 13px; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ============ TL RADAR ============ */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.queue-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid var(--accent-3);
}
.queue-item.urgent { border-left-color: var(--negative); }
.queue-item.scale { border-left-color: var(--positive); }
.queue-item.attention { border-left-color: var(--warn); }
.queue-item:hover { transform: translateY(-2px); }
.queue-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.queue-item-name { font-size: 13px; font-weight: 700; }
.queue-item-margin { font-size: 13px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.queue-item-action { font-size: 12px; margin-bottom: 4px; }
.queue-item-reason { font-size: 11px; color: var(--text-dim); }

/* ============ LEADERBOARD ============ */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
}
.lb-row:hover { border-color: var(--line-bright); transform: translateX(2px); }
.lb-rank {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}
.lb-rank.top1 { color: var(--gold); }
.lb-rank.top2 { color: #d0d0e0; }
.lb-rank.top3 { color: #cd7f32; }
.lb-name { font-size: 13px; font-weight: 600; }
.lb-name .meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; display: block; }
.lb-margin { font-size: 14px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.lb-spend { font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); min-width: 96px; text-align: right; }
.lb-spend::before {
  content: "Затраты ";
  color: var(--text-muted);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.lb-roi { font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); min-width: 60px; text-align: right; }
.lb-delta {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
  padding: 3px 8px;
  border-radius: 4px;
}
.lb-delta.up { background: rgba(108,255,208,0.12); color: var(--positive); }
.lb-delta.down { background: rgba(255,101,119,0.12); color: var(--negative); }
.lb-delta.flat { color: var(--text-muted); }

/* ============ TODAY DIGEST ============ */
.digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.digest-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.digest-card.heroes { border-left: 3px solid var(--positive); }
.digest-card.losers { border-left: 3px solid var(--negative); }
.digest-card.flips { border-left: 3px solid var(--warn); }
.digest-card.firsts { border-left: 3px solid var(--accent-3); }
.digest-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.digest-list { display: flex; flex-direction: column; gap: 6px; }
.digest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.digest-row:hover { background: var(--bg-card-strong); }
.digest-row .dr-name { font-weight: 600; }
.digest-row .dr-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* ============ COMMUNICATION LOG ============ */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.log-item {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-3);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}
.log-item.assessment { border-left-color: var(--accent-2); }
.log-item.work { border-left-color: var(--gold); }
.log-item.oneonone { border-left-color: var(--accent-3); }
.log-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.log-item-note { color: var(--text); line-height: 1.5; }
.log-item-note:empty::before { content: '— без комментария'; color: var(--text-muted); font-style: italic; }

/* ============ ARCHIVE ============ */
.archive-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

/* ============ FOOTER NOTES ============ */
.footer-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 0 0;
  line-height: 1.5;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  #app { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .detail-shell { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
