/* SMART intelligent Solutions — Unified Console UI
   Built on the SiS design system (sis-tokens.css). Dark-blue shell, warm-grey canvas,
   Rubik headings, Overpass body, orange CTAs, 4px radius, no emoji. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--fg-2);
  background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--fg-1); margin: 0; font-weight: 600; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button { font-family: var(--font-display); cursor: pointer; }

/* ---------- App shell ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sis-dark-blue);
  color: var(--fg-on-dark); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: var(--space-6) var(--space-5) var(--space-4); border-bottom: 1px solid var(--border-on-dark); }
.brand img { height: 30px; display: block; }
.brand .sub { font-family: var(--font-brand); font-size: 11px; letter-spacing: .22em; color: var(--sis-light-blue); margin-top: 8px; text-transform: uppercase; }
.nav { padding: var(--space-3) var(--space-2); flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 2px 6px;
  color: rgba(255,255,255,.74); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  letter-spacing: .01em; transition: background var(--dur-fast), color var(--dur-fast);
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--sis-orange); color: var(--sis-dark-blue); font-weight: 600; }
.nav a .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.nav .group-label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.36); padding: 14px 20px 6px; }
.sidebar .foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-on-dark); font-size: 12px; color: rgba(255,255,255,.5); }
.sidebar .foot button { background: none; border: 1px solid var(--border-on-dark); color: rgba(255,255,255,.7); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--white); border-bottom: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-8); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 22px; letter-spacing: .01em; }
.content { padding: var(--space-8); max-width: 1400px; width: 100%; }

/* ---------- Health strip ---------- */
.healthstrip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: var(--radius-pill); background: var(--gray-6); color: var(--gray-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-4); }
.pill.up .dot { background: #2Fae6b; } .pill.down { background: #fbe9e7; color: #b3261e; } .pill.down .dot { background: #d4351c; }

/* ---------- Cards / metrics ---------- */
.grid { display: grid; gap: var(--space-5); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--white); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.card .hd { padding: 16px 20px; border-bottom: 1px solid var(--border-default); display: flex; justify-content: space-between; align-items: center; }
.card .hd h3 { font-size: 16px; }
.card .bd { padding: 20px; }
.metric { background: var(--white); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 18px 20px; box-shadow: var(--shadow-xs); }
.metric .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); font-family: var(--font-display); font-weight: 500; }
.metric .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--fg-1); margin-top: 6px; line-height: 1; }
.metric .sub { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }
.metric.brand { background: linear-gradient(150deg, var(--sis-dark-blue), var(--sis-navy-mid)); color: #fff; border: none; }
.metric.brand .k { color: var(--sis-light-blue); } .metric.brand .v { color: #fff; }

.product-head { display: flex; align-items: center; gap: 10px; margin: var(--space-8) 0 var(--space-4); }
.product-head h2 { font-size: 20px; }
.product-head .tag { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-pill); }
.tag.funding { background: var(--sis-orange-20); color: #8a5a10; }
.tag.websites { background: var(--sis-light-blue-20); color: #1d6a85; }
.tag.dialringo { background: rgba(28,42,67,.1); color: var(--sis-dark-blue); }
.tag.cold { background: var(--sis-light-blue-20); color: #1d6a85; }
.tag.warm { background: var(--sis-orange-20); color: #8a5a10; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border-strong); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border-default); color: var(--fg-2); vertical-align: middle; }
tr:hover td { background: #fafafa; }
.status-badge { font-family: var(--font-display); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); text-transform: capitalize; }
.s-draft, .s-warming { background: var(--gray-6); color: var(--gray-2); }
.s-active, .s-ready, .s-ready_for_icebreaker, .s-sent, .s-paid, .s-accepted { background: #e6f5ec; color: #1c7a47; }
.s-paused, .s-pending, .s-pending_enrichment { background: var(--sis-orange-20); color: #8a5a10; }
.s-stopped, .s-low_signal, .s-bounced, .s-dead { background: #fbe9e7; color: #b3261e; }

/* ---------- Buttons / forms ---------- */
.btn { font-family: var(--font-display); font-weight: 600; font-size: 13px; border-radius: var(--radius-sm); padding: 9px 16px; border: 1px solid transparent; transition: all var(--dur-fast); }
.btn.primary { background: var(--sis-orange); color: var(--sis-dark-blue); }
.btn.primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn.dark { background: var(--sis-dark-blue); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--border-strong); color: var(--fg-1); }
.btn.ghost:hover { border-color: var(--sis-light-blue); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { background: #fff; border-color: #e7b4ad; color: #b3261e; }
input, select, textarea { font-family: var(--font-body); font-size: 14px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); width: 100%; background: #fff; color: var(--fg-1); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sis-light-blue); box-shadow: 0 0 0 3px var(--sis-light-blue-20); }
label { display: block; font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--fg-1); margin: 0 0 6px; letter-spacing: .02em; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; } .row > * { flex: 1; }

/* ---------- Login ---------- */
.login-wrap { position: fixed; inset: 0; background: var(--bg-hero-gradient); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px; width: 380px; }
.login-card img { height: 36px; margin-bottom: 8px; }
.login-card .eyebrow { font-family: var(--font-brand); font-size: 11px; letter-spacing: .26em; color: var(--sis-light-blue); text-transform: uppercase; margin-bottom: 24px; }
.login-card .err { color: #b3261e; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Misc ---------- */
.muted { color: var(--fg-muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.spacer { height: var(--space-6); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.between { justify-content: space-between; }
.gate-banner { background: var(--sis-orange-20); border: 1px solid var(--sis-orange); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; color: #8a5a10; font-family: var(--font-display); font-weight: 500; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--sis-dark-blue); color: #fff; padding: 14px 20px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; z-index: 200; opacity: 0; transform: translateY(8px); transition: all var(--dur-base); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #b3261e; }
.modal-bg { position: fixed; inset: 0; background: rgba(13,47,70,.5); display: flex; align-items: center; justify-content: center; z-index: 150; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 560px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal .hd { padding: 20px 24px; border-bottom: 1px solid var(--border-default); display: flex; justify-content: space-between; align-items: center; }
.modal .bd { padding: 24px; } .modal .ft { padding: 16px 24px; border-top: 1px solid var(--border-default); display: flex; justify-content: flex-end; gap: 10px; }
.loading { padding: 40px; text-align: center; color: var(--fg-muted); }
.bar { height: 7px; background: var(--gray-6); border-radius: var(--radius-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--sis-light-blue); }
