/* SMF Sales Ops Board — phone-first + desktop, garage family */
:root {
  --bg: #0b0705;
  --panel: #16100c;
  --panel2: #1c140f;
  --ink: #fff7ee;
  --muted: #c9b09a;
  --accent: #f0a84a;
  --red: #c62828;
  --high: #e67e22;
  --line: #3a281c;
  --ok: #3d8b6e;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink); font-family: var(--font);
}
body {
  background:
    radial-gradient(900px 420px at 12% -8%, #2a1810 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #1a1010 0%, transparent 40%),
    var(--bg);
}
.hidden { display: none !important; }

/* Gate */
.gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(800px 400px at 50% 25%, #2a1610, #0a0604 70%);
  padding: 20px;
}
.gate-card {
  width: min(420px, 94vw); text-align: center; padding: 32px 26px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 18px;
}
.gate-mark { font-size: 40px; color: var(--accent); }
.gate-title {
  font-size: 22px; font-weight: 900; letter-spacing: .1em; margin: 10px 0 4px;
}
.gate-sub { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.gate-card input {
  width: 100%; font-size: 18px; padding: 12px; border-radius: 12px;
  border: 2px solid var(--line); background: #100a07; color: var(--ink);
  margin-bottom: 12px;
}
.gate-card button {
  width: 100%; font-size: 17px; font-weight: 800; padding: 12px; border: 0;
  border-radius: 12px; background: var(--accent); color: #1a0f0a; cursor: pointer;
}
.gate-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* Dash */
.dash {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}

.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 12px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { font-size: 28px; color: var(--accent); }
.brand-title { font-size: 18px; font-weight: 900; letter-spacing: .12em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.clock-block { text-align: right; }
.clock { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fresh {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #7dcea0;
}
.stale {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #ff8a80;
}

/* Banner */
.banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 2px solid #5a2020;
  background: linear-gradient(100deg, #5a1414 0%, #2a1210 55%, #1a100c 100%);
}
.banner.banner-ok {
  border-color: #2a4a3a;
  background: linear-gradient(100deg, #1a3a2c 0%, #141210 100%);
}
.banner.banner-high {
  border-color: #6a4020;
  background: linear-gradient(100deg, #4a2810 0%, #1a120c 100%);
}
.banner-tag {
  font-size: 11px; font-weight: 900; letter-spacing: .16em;
  padding: 6px 10px; border-radius: 8px;
  background: #fff; color: #7a1212; align-self: start;
}
.banner-ok .banner-tag { color: #0d3d2a; }
.banner-high .banner-tag { color: #5a3008; background: #ffd59a; }
.banner-title { font-size: 20px; font-weight: 850; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.banner-detail { font-size: 14px; color: #ffd0c8; margin-top: 4px; }
.banner-ok .banner-detail { color: var(--muted); }
.banner-meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 8px; font-size: 13px; color: #ffd59a; font-weight: 700;
}
.banner.is-link, .item.is-link, .pipe-cell.is-link, .chip.is-link,
.list-row.is-link, .src-cell.is-link, .src.is-link, span.is-link,
.date-chip.is-link, .count.is-link {
  cursor: pointer;
}
.banner.is-link:active, .item.is-link:active, .pipe-cell.is-link:active,
.chip.is-link:active, .list-row.is-link:active, .src-cell.is-link:active,
.date-chip.is-link:active, .count.is-link:active {
  transform: scale(0.99);
  opacity: 0.92;
}
.item.is-link:hover, .list-row.is-link:hover, .src-cell.is-link:hover,
.pipe-cell.is-link:hover, .chip.is-link:hover, .date-chip.is-link:hover,
.count.is-link:hover {
  border-color: #5a3a20;
}
.src-ico {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.src-ico.lg { margin-right: 8px; border-radius: 6px; }
.src-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1a0f0a;
  background: #f0a84a;
  border-radius: 999px;
  padding: 2px 8px;
}
.item-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-src {
  float: right;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .04em;
}

/* Counts */
.counts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.count {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.count .n {
  display: block; font-size: 26px; font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.count .l {
  display: block; margin-top: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted);
}
.count.crit .n { color: #ff8a80; }
.count.high .n { color: #ffb74d; }

.dates {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.date-chip {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 700;
}
.date-chip b { color: var(--accent); font-weight: 900; }
.date-chip.warn { border-color: #8a5030; color: #ffd59a; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}
.card.span-2 { grid-column: 1 / -1; }
.card-h {
  font-size: 12px; font-weight: 900; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 10px;
}
.card-h.sub {
  margin-top: 14px; color: var(--muted); letter-spacing: .08em;
}
.card-h .src {
  float: right; font-weight: 600; letter-spacing: 0; color: var(--muted);
  text-transform: none; font-size: 11px;
}

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack.compact { gap: 6px; }

.item {
  background: var(--panel2);
  border: 1px solid #2a1c14;
  border-left: 4px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.item.crit { border-left-color: #c62828; }
.item.high { border-left-color: #e67e22; }
.item.medium { border-left-color: #f0a84a; }
.item.info { border-left-color: #5a7a8a; }
.item-title { font-size: 14px; font-weight: 800; line-height: 1.25; }
.item-detail { font-size: 12px; color: var(--muted); margin-top: 3px; }
.item-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  margin-top: 6px; font-size: 11px; font-weight: 700; color: #e8c9a8;
}
.sev {
  display: inline-block; font-size: 10px; font-weight: 900;
  letter-spacing: .08em; padding: 2px 6px; border-radius: 4px;
  background: #333; color: #fff;
}
.sev.crit { background: #c62828; }
.sev.high { background: #e67e22; color: #1a0f0a; }
.sev.medium { background: #f0a84a; color: #1a0f0a; }
.sev.info { background: #456; }

.pipe {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 4px;
}
.pipe-cell {
  text-align: center;
  background: #120d0a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 4px;
}
.pipe-cell .pn {
  display: block; font-size: 22px; font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.pipe-cell .pl {
  display: block; font-size: 9px; font-weight: 800;
  letter-spacing: .04em; color: var(--muted); margin-top: 2px;
  line-height: 1.2;
}
.pipe-cell.crit .pn { color: #ff8a80; }
.pipe-cell.warn .pn { color: #ffb74d; }
.pipe-cell.ok .pn { color: #7dcea0; }
.pipe-cell .src-ico { display: block; margin: 0 auto 4px; }

.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 280px; overflow: auto;
}
.chip {
  font-size: 12px; font-weight: 700;
  background: #120d0a; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px;
  color: inherit;
  font-family: inherit;
}
button.chip { cursor: pointer; }

.list { display: flex; flex-direction: column; gap: 4px; }
.list-row {
  font-size: 13px; padding: 6px 8px;
  border-bottom: 1px solid #241810;
}
.list-row:last-child { border-bottom: 0; }
.list-row.is-link { border-radius: 8px; border: 1px solid transparent; border-bottom-color: #241810; }

.muted { font-size: 13px; color: var(--muted); line-height: 1.4; }
.hint {
  margin: 10px 0 0; font-size: 11px; color: var(--muted); line-height: 1.35;
}
.hint.foot { margin-top: 12px; }

.sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.src-cell {
  background: #120d0a; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px;
  color: inherit;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
button.src-cell { cursor: pointer; }
button.src-cell:disabled { opacity: .45; cursor: default; }
.src-name { font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.src-asof { font-size: 11px; color: var(--muted); margin-top: 4px; }
.card-h .src.is-link { text-decoration: underline; text-underline-offset: 2px; }

.foot {
  margin-top: 18px; text-align: center;
  font-size: 11px; color: var(--muted);
}
.foot .sep { margin: 0 6px; }

.empty {
  font-size: 13px; color: var(--muted); padding: 8px 0;
}

@media (max-width: 760px) {
  .counts { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .card.span-2 { grid-column: auto; }
  .banner { grid-template-columns: 1fr; }
  .banner-title { font-size: 18px; }
  .count .n { font-size: 22px; }
}
