/* ── SignalX dashboard — StrmrX gold/black design language ─────────── */
:root {
  --sx-accent:        #C8A96E;
  --sx-accent-2:      #E8732A;
  --sx-glow:          #FFB347;
  --sx-bg:            #080808;
  --sx-bg-2:          #111111;
  --sx-surface:       #1A1A1A;
  --sx-surface-2:     #222222;
  --sx-text:          #F0E6D3;
  --sx-muted:         #8A7A6A;
  --sx-border:        rgba(200,169,110,0.18);
  --sx-border-active: rgba(200,169,110,0.7);
  --sx-radius:        14px;
  --sx-mono:          ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sx-danger:        #e05252;
  --sx-ok:            #4CAF7D;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: var(--sx-bg); color: var(--sx-text); min-height: 100vh; }
a { color: var(--sx-accent); }
h1, h2, h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.hidden { display: none !important; }

/* ── Login gate ── */
#login { min-height: 100vh; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 24px; }
#login h1 { font-size: 44px; }
#login h1 span, .brand span { color: var(--sx-accent-2); }
#login p { color: var(--sx-muted); max-width: 480px; line-height: 1.65; font-size: 15.5px; }
#login p strong { color: var(--sx-text); }
.login-foot { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }

/* ── App shell ── */
#app { display: none; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: var(--sx-bg-2); border-right: 1px solid var(--sx-border); padding: 22px 18px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: 'Oswald', sans-serif; font-size: 24px; text-transform: uppercase; letter-spacing: 1px; }

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  text-align: left; padding: 11px 13px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--sx-text);
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; transition: all .13s;
}
.nav-item:hover { background: var(--sx-surface); }
.nav-item.active { background: var(--sx-surface-2); border-color: var(--sx-border-active); }

.crew-link-box { margin-top: auto; background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: 12px; padding: 12px; }
.clb-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sx-muted); }
.clb-url { font-family: var(--sx-mono); font-size: 12.5px; color: var(--sx-accent); margin: 6px 0 10px; word-break: break-all; }
.clb-actions { display: flex; gap: 6px; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--sx-surface); border-radius: 10px; border: 1px solid var(--sx-border); }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--sx-surface-2); }
.u-name { font-weight: 800; font-size: 14px; }
.link-btn { background: none; border: none; color: var(--sx-muted); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; font-family: 'Nunito', sans-serif; }

.main { padding: 28px 34px; overflow-y: auto; }
.view h2 { font-size: 24px; margin-bottom: 6px; }
.view-sub { color: var(--sx-muted); font-size: 14px; margin-bottom: 18px; max-width: 640px; line-height: 1.5; }

/* ── Cards / stats ── */
.card { background: var(--sx-bg-2); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; color: var(--sx-accent); margin-bottom: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 18px; }
.stat { background: var(--sx-bg-2); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 16px; }
.stat .num { font-family: 'Oswald', sans-serif; font-size: 30px; color: var(--sx-accent); }
.stat .lbl { color: var(--sx-muted); font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.stat .sub-ok { color: var(--sx-ok); font-size: 12px; font-weight: 800; }
.stat .sub-bad { color: var(--sx-danger); font-size: 12px; font-weight: 800; }

.growth-chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 6px; }
.growth-bar { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--sx-accent), var(--sx-accent-2)); border-radius: 3px 3px 0 0; opacity: .85; }
.growth-bar.zero { background: var(--sx-surface-2); height: 3px !important; }

/* ── Buttons / fields ── */
.btn {
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--sx-border); cursor: pointer;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 1px;
  text-transform: uppercase; background: var(--sx-surface); color: var(--sx-text); transition: all .15s;
}
.btn:hover { border-color: var(--sx-border-active); }
.btn.primary { background: linear-gradient(135deg, var(--sx-accent), var(--sx-accent-2)); color: #080808; border: none; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.danger { color: var(--sx-danger); border-color: rgba(224,82,82,0.4); }
.btn:disabled { opacity: .55; cursor: wait; }

.field { display: block; margin-bottom: 14px; font-weight: 800; font-size: 13.5px; color: var(--sx-muted); }
.field .input { margin-top: 6px; }
.input {
  display: block; width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--sx-border);
  background: var(--sx-surface); color: var(--sx-text); font-family: 'Nunito', sans-serif; font-size: 14.5px;
}
.input:focus { outline: none; border-color: var(--sx-border-active); }
.input.narrow { width: 110px; display: inline-block; }
.color-input { margin-top: 6px; width: 60px; height: 34px; border: 1px solid var(--sx-border); border-radius: 8px; background: var(--sx-surface); cursor: pointer; }
.hint { color: var(--sx-muted); font-size: 12.5px; font-weight: 400; display: block; margin-top: 5px; line-height: 1.45; }
.hint-inline { color: var(--sx-muted); font-size: 12px; font-weight: 400; text-transform: none; }
.field-row { display: flex; align-items: center; gap: 8px; }
.url-prefix { font-family: var(--sx-mono); color: var(--sx-muted); font-size: 13px; white-space: nowrap; }

/* ── Editor grid + live preview ── */
.editor-grid { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 20px; align-items: start; }
.preview-col { position: sticky; top: 28px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preview-head h3 { font-size: 15px; color: var(--sx-accent); }
.preview-frame-wrap {
  border: 1px solid var(--sx-border-active); border-radius: 18px; overflow: hidden;
  background: #000; box-shadow: 0 20px 70px rgba(0,0,0,0.5); aspect-ratio: 9 / 15; max-height: 720px;
}
#preview-frame { width: 100%; height: 100%; border: none; background: var(--sx-bg); }

.link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.link-row .input { flex: 1; }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--sx-border); }
.topic-row:last-child { border-bottom: none; }
.topic-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--sx-accent); }
.topic-row .input { flex: 1; }
.topic-row .t-emoji { font-size: 18px; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--sx-muted); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--sx-border); }
.table td { padding: 10px; border-bottom: 1px solid var(--sx-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.chan-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--sx-surface-2); border: 1px solid var(--sx-border); font-size: 11.5px; font-weight: 800; margin-right: 4px; }
.topic-tags { color: var(--sx-muted); font-size: 12.5px; }
.rate-good { color: var(--sx-ok); font-weight: 800; }
.rate-mid { color: var(--sx-glow); font-weight: 800; }

/* ── Drop ── */
.drop-card { max-width: 620px; }
.drop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* ── Integrations ── */
.integ-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--sx-border); font-size: 14.5px; }
.integ-row:last-child { border-bottom: none; }
.integ-status { font-weight: 800; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }
.integ-status.on { color: var(--sx-ok); background: rgba(76,175,125,0.12); }
.integ-status.off { color: var(--sx-muted); background: var(--sx-surface-2); }
.integ-status.pending { color: var(--sx-glow); background: rgba(255,179,71,0.1); }
.integ-sub { color: var(--sx-muted); font-size: 12.5px; margin-top: 2px; }

.qr-img { width: 200px; border-radius: 12px; border: 1px solid var(--sx-border); margin-top: 8px; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal-card { background: var(--sx-bg-2); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 26px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.modal-card h3 { color: var(--sx-accent); }
.modal-card .qr-img { width: 280px; }

@media (max-width: 1080px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview-col { position: static; }
}
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .main { padding: 20px 16px; }
}
