/* =========================================================================
 * Arch Dialer — app design system (JustCall-inspired: dark sidebar, light
 * content, blue actions). Team colors are driven by the CSS variables below —
 * change --brand / --sidebar to re-skin the whole app.
 * ========================================================================= */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-ink: #cbd5e1;
  --sidebar-ink-active: #ffffff;

  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;

  --ok: #16a34a;
  --warn-bg: #fef3c7;
  --warn-border: #f59e0b;
  --warn-ink: #92400e;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }

/* ---- App shell: sidebar + main ---- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.sidebar .logo {
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .3px;
  padding: 8px 10px 16px; display: flex; align-items: center; gap: 9px;
}
.sidebar .logo .dot {
  width: 22px; height: 22px; border-radius: 6px; background: var(--brand);
  display: inline-block;
}
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; color: var(--sidebar-ink);
  font-size: 14.5px; font-weight: 500;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a .ic { width: 18px; text-align: center; opacity: .95; }
.sidebar .spacer { flex: 1; }
.sidebar .side-card {
  background: rgba(255,255,255,.06); border-radius: 10px; padding: 12px;
  font-size: 12.5px; color: var(--sidebar-ink);
}
.sidebar .side-card b { color: #fff; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: var(--muted);
  font-weight: 600;
}
.pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* ---- Content ---- */
.content { padding: 24px 26px; }
.page-intro { color: var(--muted); margin: -4px 0 20px; }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---- Metric cards ---- */
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.metric .val { font-size: 30px; font-weight: 800; line-height: 1.1; }
.metric .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.metric .sub { color: var(--ok); font-size: 12px; margin-top: 6px; font-weight: 600; }
@media (max-width: 1100px){ .metrics { grid-template-columns: repeat(2,1fr);} }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px){ .grid-2 { grid-template-columns: 1fr; } .app { grid-template-columns: 64px 1fr; } .nav a span.txt { display:none; } }

/* ---- Simple bar chart (CSS only) ---- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { background: #eef2f7; border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; min-width: 2px; }
.bar-row .num { text-align: right; font-weight: 700; color: var(--muted); }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.spark .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.spark .colbar { width: 100%; background: var(--brand); border-radius: 5px 5px 0 0; min-height: 2px; }
.spark .collbl { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ---- Buttons ---- */
.btn { font: inherit; border: none; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Banners ---- */
.banner { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-ink); }
.banner.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ---- Tables ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }

/* ---- Dialer (Sales-Dialer-style) ---- */
.dialer { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.lead-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.lead-hero .big-avatar {
  width: 56px; height: 56px; border-radius: 14px; background: #e0ecff; color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
}
.lead-hero .biz { font-size: 20px; font-weight: 800; }
.lead-hero .meta { color: var(--muted); font-size: 14px; }
.leadgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 16px 0; }
.leadgrid .k { color: var(--muted); font-size: 12px; }
.leadgrid .v { font-weight: 600; }
.callbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0 16px;
}
.callbar .state { font-weight: 700; color: var(--brand); }
.dispo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dispo button { padding: 14px; font-size: 14.5px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font-weight: 600; color: var(--ink); }
.dispo button:hover { border-color: var(--brand); color: var(--brand); }
.dispo button[data-outcome="Connected-Interested"] { background: var(--ok); color: #fff; border-color: var(--ok); }
.dispo button[data-outcome="DNC Request"] { background: var(--danger); color: #fff; border-color: var(--danger); }
.dispo button:disabled { opacity: .45; cursor: not-allowed; }
textarea, input[type=text] {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font: inherit; background: #fff;
}
.script-box { line-height: 1.65; white-space: pre-wrap; font-size: 15px; }
.ident { background: #eff6ff; border-left: 3px solid var(--brand); padding: 9px 13px; border-radius: 8px;
  font-size: 13px; color: #1e40af; margin-bottom: 14px; }
.session-counts { display: flex; gap: 14px; margin-bottom: 16px; }
.session-counts .c { flex: 1; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.session-counts .c b { display: block; font-size: 26px; }
.session-counts .c span { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
code { background: #eef2f7; padding: 2px 6px; border-radius: 5px; }
