/* Home Overview Dashboard v12 — spacing audit fixes */

/* Stats strip — clickable filter cards */
.stats-strip {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
}
.ss-item {
  flex: 1;
  text-align: center;
  padding: 20px 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: border-color .25s, box-shadow .25s, transform .2s, background .25s;
}
.ss-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0.5;
  transition: opacity .25s, height .25s;
}
.ss-item:hover { transform: translateY(-2px); }
.ss-item:hover::before { opacity: 0.8; }

/* Active (selected) filter state */
.ss-item.active::before { opacity: 1; height: 4px; }
.ss-item.active { border-color: rgba(124,92,252,0.25); }

.ss-item.total::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.ss-item.total:hover, .ss-item.total.active {
  border-color: rgba(168,85,247,0.3);
  box-shadow: 0 4px 20px rgba(168,85,247,0.12);
}
.ss-item.total.active { background: rgba(168,85,247,0.04); }

.ss-item.yt::before { background: var(--yt); }
.ss-item.yt:hover, .ss-item.yt.active {
  border-color: rgba(255,68,68,0.3);
  box-shadow: 0 4px 20px rgba(255,68,68,0.1);
}
.ss-item.yt.active { background: rgba(255,68,68,0.03); }

.ss-item.tw::before { background: var(--twitch); }
.ss-item.tw:hover, .ss-item.tw.active {
  border-color: rgba(145,70,255,0.3);
  box-shadow: 0 4px 20px rgba(145,70,255,0.1);
}
.ss-item.tw.active { background: rgba(145,70,255,0.03); }

.ss-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  margin: 0 auto 12px;
}
.ss-item.total .ss-icon { background: rgba(124,92,252,0.1); color: var(--accent2); }
.ss-item.yt .ss-icon { background: rgba(255,68,68,0.08); }
.ss-item.tw .ss-icon { background: rgba(145,70,255,0.08); }

.ss-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ss-value.purple {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ss-value.yt { color: var(--yt); }
.ss-value.twitch { color: var(--twitch); }
.ss-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 6px;
  font-weight: 500;
}

@media(max-width:600px) {
  .stats-strip { flex-direction: column; gap: 8px; }
  .ss-item { padding: 14px 12px; }
  .ss-value { font-size: 26px; }
  .ss-icon { width: 30px; height: 30px; margin-bottom: 8px; }
}

/* Two-column layout */
.home-cols {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.home-main { display: flex; flex-direction: column; gap: 16px; }
.home-main .section { margin-bottom: 0; }
.home-aside { display: flex; flex-direction: column; gap: 16px; }
@media(max-width:1000px) { .home-cols { grid-template-columns: 1fr; } }


/* Service cards */
.home-svc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.home-svc-card:hover { border-color: var(--border-hover); }
.home-svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.home-svc-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.home-svc-body { padding: 12px 16px 8px; }
.home-svc-stats { display: flex; gap: 24px; }
.home-svc-stat { display: flex; flex-direction: column; gap: 2px; }
.home-svc-stat .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.home-svc-stat .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}
.home-svc-stat .val.sml {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}

/* Split buttons */
.home-svc-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.btn-split {
  flex: 1;
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.btn-split-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all .2s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-split-cfg {
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
}
.btn-split.yt .btn-split-main { background: var(--yt); color: #fff; }
.btn-split.yt .btn-split-main:hover { background: #d93030; }
.btn-split.yt .btn-split-cfg {
  background: rgba(180,0,0,0.55);
  border-left: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65);
}
.btn-split.yt .btn-split-cfg:hover { background: rgba(180,0,0,0.8); color: #fff; }
.btn-split.yt:hover { box-shadow: 0 0 12px rgba(255,68,68,0.25); }
.btn-split.tw { border: 1px solid rgba(145,70,255,0.3); }
.btn-split.tw .btn-split-main { background: transparent; color: var(--twitch); }
.btn-split.tw .btn-split-main:hover { background: rgba(145,70,255,0.08); }
.btn-split.tw .btn-split-cfg {
  background: transparent;
  border-left: 1px solid rgba(145,70,255,0.2);
  color: rgba(145,70,255,0.45);
}
.btn-split.tw .btn-split-cfg:hover { background: rgba(145,70,255,0.1); color: var(--twitch); }
.btn-split.tw:hover { border-color: rgba(145,70,255,0.6); box-shadow: 0 0 10px rgba(145,70,255,0.15); }


/* ── Activity feed ─────────────────────────────────────────────── */

/* Section header with title + page link */
.af-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.af-page-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all .2s;
  white-space: nowrap;
}
.af-page-link:hover {
  color: var(--accent);
  background: rgba(124,92,252,0.08);
}

.af-list { display: flex; flex-direction: column; }
.af-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.af-row:last-child { border-bottom: none; }
.af-row:hover { background: rgba(255,255,255,0.02); }
.af-row.af-error { background: rgba(239,68,68,0.04); }
.af-row.af-error:hover { background: rgba(239,68,68,0.07); }
.af-row.af-active { background: rgba(34,197,94,0.03); }

.af-ico { flex-shrink: 0; line-height: 0; width: 16px; text-align: center; }
.af-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.af-dot.error { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.af-dot.user { background: var(--accent); }
.af-dot.parser { background: var(--green); }

.af-msg {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.af-detail {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.af-ago {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 65px;
  text-align: right;
  margin-left: auto;
}

/* Show more button */
.af-more-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 0;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.af-more-btn:hover {
  color: var(--accent);
  background: rgba(124,92,252,0.05);
}


/* Live indicator dot */
.home-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  opacity: 0.6;
  transition: opacity .3s, transform .3s;
}
.home-live-dot.flash {
  opacity: 1;
  transform: scale(1.5);
}


/* Monitor rows */
.home-mon-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  transition: opacity .2s;
}
.home-mon-row:not(:last-child) { border-bottom: 1px solid rgba(30,30,46,0.5); }
.home-mon-dot {
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}
.home-mon-dot.active {
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.home-mon-dot.idle { background: var(--text-muted); }
.home-mon-platform { font-size: 12px; font-weight: 600; color: var(--twitch); min-width: 52px; }
.home-mon-platform.yt { color: var(--yt); }
.home-mon-info { flex: 1; font-size: 11px; color: var(--text-sec); }
.home-link-sm {
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; padding: 2px 6px; border-radius: 4px; transition: all .2s;
}
.home-link-sm:hover { color: var(--accent); background: var(--accent-glow); }

/* Badges */
.home-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 600;
}
.home-badge.active {
  background: rgba(34,197,94,0.1); color: var(--green);
  animation: pulse 1.5s infinite;
}
.home-badge.idle {
  background: rgba(34,197,94,0.08);
  color: var(--green);
}

/* Quota mini bar */
.home-svc-footer { padding: 0 16px 12px; transition: opacity .2s; }
.home-quota { display: flex; align-items: center; gap: 8px; }
.home-quota-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.home-quota-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.home-quota-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .5s; }
.home-quota-fill.warning { background: var(--orange); }
.home-quota-fill.danger { background: var(--red); }

/* Quota widget — ring + details */
.quota-widget { display: flex; align-items: center; gap: 20px; padding: 4px 0; }
.quota-ring { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.quota-ring svg { display: block; }
.quota-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.quota-ring-pct { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.quota-details { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quota-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.quota-label { font-size: 12px; color: var(--text-muted); }
.quota-val { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.quota-val-sm { font-size: 13px; color: var(--text-sec); font-variant-numeric: tabular-nums; }
.quota-divider { height: 1px; background: var(--border); margin: 2px 0; }
/* Compact quota widget for settings */
.quota-widget-compact { display: flex; align-items: center; gap: 14px; padding: 2px 0; }
.quota-ring-sm { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.quota-ring-sm svg { display: block; }
.quota-ring-text-sm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.quota-stats-compact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quota-stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.quota-forecast { margin-top: 2px; font-size: 12px; font-weight: 600; }
/* Quota gauge (settings) */
.qgauge-card { padding: 12px 14px !important; }
.qgauge-wrap { display: flex; justify-content: center; margin: 2px 0 0; }
.qgauge-svg { display: block; width: 160px; }
.qgauge-pct { font-size: 18px; font-weight: 700; font-family: inherit; fill: var(--text); letter-spacing: -0.5px; }
.qgauge-sub { font-size: 9px; font-family: inherit; fill: var(--text-muted); letter-spacing: 0.3px; }
.qgauge-info { display: flex; justify-content: center; gap: 16px; margin-top: 2px; }
.qgauge-meta { color: var(--text-muted); font-size: 11px; }
.qgauge-forecast { text-align: center; margin-top: 4px; font-size: 12px; font-weight: 600; }
.qbar-ok { color: var(--green); }
.qbar-warn { color: var(--orange); }

/* Monitor start/stop buttons */
.home-mon-btn{border:none;cursor:pointer;border-radius:6px;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;transition:all .2s;margin-left:auto;flex-shrink:0}
.home-mon-btn.start{background:rgba(34,197,94,0.15);color:#22c55e}
.home-mon-btn.start:hover{background:rgba(34,197,94,0.3)}
.home-mon-btn.stop{background:rgba(239,68,68,0.15);color:#ef4444}
.home-mon-btn.stop:hover{background:rgba(239,68,68,0.3)}
