/* Axia Call Trainer — aligned to the Axia portal design system (app.axiagrowth.com):
   GitHub-Primer neutral surfaces + Axia blue (#0d7aff) accent, Inter, 6px radii,
   left-sidebar shell. Tokens mirror axia-platform's shell + globals. */
:root {
  --axia-blue: #0d7aff;
  --axia-blue-700: #0a62cc;
  --axia-blue-50: #eef6ff;
  --axia-blue-100: #d9ebff;
  --ink: #0a0a0a;
  --ink-700: #334155;
  --slate: #64748b;
  --muted: #656d76;
  --cream: #f8f6f3;
  --line: #ececec;
  --line-strong: #d1d9e0;
  --bg: #ffffff;
  --surface: #f6f8fa;
  --card: #ffffff;
  /* Primer badge palette */
  --green-bg: #dafbe1; --green-text: #1a7f37; --green-border: #aceebb;
  --blue-bg: #ddf4ff; --blue-text: #0969da; --blue-border: #b6e3ff;
  --yellow-bg: #fff8c5; --yellow-text: #9a6700; --yellow-border: #ebd481;
  --gray-bg: #e8ecf0; --gray-text: #656d76; --gray-border: #d1d9e0;
  --red-bg: #ffebe9; --red-text: #cf222e; --red-border: #ffcecb;
  --r-sm: 6px;
  --r: 10px;
  --shadow: 0 1px 0 rgba(27,31,36,0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-inter, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
a { color: var(--axia-blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell: sidebar + main ── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; padding: 16px 12px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.sidebar .logo { padding: 6px 10px 18px; }
.logo .dot { width: 22px; height: 22px; border-radius: 6px; background: var(--axia-blue); flex-shrink: 0; box-shadow: 0 1px 3px rgba(13,122,255,.35); }
.logo b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.logo small { display: block; font-size: 11px; color: var(--slate); font-weight: 500; letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .item {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border: 0; width: 100%;
  border-radius: var(--r-sm); background: transparent; color: var(--ink-700); font-size: 13.5px; font-weight: 500;
  position: relative; text-align: left; transition: all .12s;
}
.nav .item:hover { background: var(--cream); color: var(--ink); }
.nav .item.active { background: var(--axia-blue-50); color: var(--axia-blue-700); font-weight: 600; }
.nav .item.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--axia-blue); }
.nav .item .ic { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.sidebar .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar .foot .u { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .foot .r { font-size: 11px; color: var(--slate); text-transform: capitalize; margin-top: 1px; }
.sidebar .foot button { margin-top: 10px; width: 100%; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main .pagehead { padding: 22px 32px 0; }
.main .pagehead h2 { font-size: 22px; }
.main .pagehead p { color: var(--muted); margin: 4px 0 0; font-size: 13.5px; }
.content { padding: 22px 32px 40px; max-width: 1120px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-weight: 600; font-size: 13.5px; }
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--axia-blue); border-color: var(--axia-blue); color: #fff; }
.btn-primary:hover { background: var(--axia-blue-700); }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.link { background: none; border: none; color: var(--axia-blue-700); font-weight: 600; padding: 0; }

/* ── Cards & grid ── */
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-weight: 700; font-size: 32px; margin-top: 6px; line-height: 1; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ── Range filter ── */
.filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button { padding: 7px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.active { background: var(--axia-blue); color: #fff; }
.filter input[type=datetime-local] { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-family: inherit; font-size: 13px; color: var(--ink); }

/* ── Chart (trend) ── */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bar { flex: 1; background: var(--axia-blue); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; transition: opacity .15s; }
.bar:hover { opacity: .82; }
.bar .cap { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.bar .xl { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-wrap { padding-bottom: 24px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.rank { color: var(--muted); width: 28px; }

/* ── Stall histogram ── */
.hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hbar .name { width: 150px; font-size: 13px; font-weight: 500; text-transform: capitalize; }
.hbar .track { flex: 1; background: var(--surface); border-radius: var(--r-sm); height: 22px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--axia-blue); border-radius: var(--r-sm); }
.hbar .n { width: 36px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

/* ── Practice surface ── */
.practice { position: relative; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding-top: 68px; }
/* "Today" KPI — minimal stat pinned to the top-right of the practice area */
.today-stat { position: absolute; top: 0; right: 0; text-align: right; line-height: 1; z-index: 1; }
.today-stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.today-stat .value { font-weight: 700; font-size: 30px; margin-top: 6px; line-height: 1; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.today-stat .sub { color: var(--muted); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.rec-hint { color: var(--muted); font-size: 12.5px; margin-top: -4px; }
.persona-card { width: 100%; text-align: center; padding: 36px 32px; }
.persona-card .biz { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.persona-card .ind { color: var(--muted); margin-top: 4px; }
.persona-card .lead { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.persona-card .phone { font-size: 26px; font-weight: 700; letter-spacing: .01em; margin-top: 18px; color: var(--axia-blue-700); font-variant-numeric: tabular-nums; }
.persona-card .hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.role-pill { display: inline-block; background: var(--blue-bg); color: var(--blue-text); border: 1px solid var(--blue-border); padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.err { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin-bottom: 14px; }

/* ── Call history / review ── */
.history table { width: 100%; border-collapse: collapse; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.history th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); }
.history td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.history tbody tr.hrow:hover { background: var(--surface); }
.history .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; border: 1px solid var(--gray-border); background: var(--gray-bg); color: var(--gray-text); }
.pill.out-booked { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.pill.out-rejected, .pill.out-hung_up, .pill.out-gatekeeper_blocked { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.pill.out-none, .pill.out-completed, .pill.out-no_answer, .pill.out-voicemail { background: var(--gray-bg); color: var(--gray-text); border-color: var(--gray-border); }
.history .detail td { background: var(--surface); }
.cd { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.cd-meta { display: flex; gap: 20px; align-items: center; font-size: 13px; color: var(--muted); }
.cd-meta a { color: var(--axia-blue-700); font-weight: 600; }
.cd-fb { font-size: 14px; line-height: 1.55; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.cd-dims { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-dims .dim { font-size: 12px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 4px 10px; text-transform: capitalize; }
.cd-tx summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--axia-blue-700); }
.cd-tx pre { white-space: pre-wrap; font-family: var(--font-inter,'Inter'),system-ui,sans-serif; font-size: 13px; line-height: 1.55; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin-top: 8px; max-height: 320px; overflow: auto; }
.muted { color: var(--muted); }

/* ── Login ── */
.login-wrap { max-width: 380px; margin: 12vh auto; }
.login-wrap .card { padding: 28px; }
.login-wrap h2 { font-size: 20px; margin-bottom: 4px; }
.login-wrap p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.login-wrap label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin: 12px 0 5px; }
.login-wrap input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-family: inherit; font-size: 14px; }
.login-wrap input:focus { outline: none; border-color: var(--axia-blue); box-shadow: 0 0 0 3px var(--axia-blue-50); }
.login-wrap .btn { width: 100%; margin-top: 18px; }

/* ── Users (admin) ── */
.users { display: flex; flex-direction: column; gap: 16px; }
.add-user h3 { font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.add-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.field input, .field select {
  height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--bg); min-width: 180px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--axia-blue); box-shadow: 0 0 0 3px var(--axia-blue-50); }
.add-row .btn { flex-shrink: 0; }
.users-table { padding: 0; overflow: hidden; }
.users-table th, .users-table td { padding: 11px 16px; }
.users-table tbody tr:hover { background: var(--surface); }
.role-select {
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; color: var(--ink); background: var(--bg); text-transform: capitalize;
}
.role-select:focus { outline: none; border-color: var(--axia-blue); box-shadow: 0 0 0 3px var(--axia-blue-50); }
.actions-col { text-align: right; }
.row-actions { display: inline-flex; gap: 16px; justify-content: flex-end; }
.link.danger { color: var(--red-text); }
.link:disabled { color: var(--muted); opacity: .5; cursor: default; }
.link:disabled:hover { text-decoration: none; }
.field-label-row { display: flex; align-items: baseline; gap: 8px; }
.link.gen-pw { font-size: 11.5px; font-weight: 600; }
.invite-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--ink-700); cursor: pointer; }
.invite-check input { width: 15px; height: 15px; accent-color: var(--axia-blue); cursor: pointer; }
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border);
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.5px; word-break: break-word;
}
.notice .link { color: var(--green-text); }

/* ── Bug-report widget ─────────────────────────────────────────────────────── */
.bug-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--axia-blue); color: #fff; border: 1px solid var(--axia-blue-700);
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(13,122,255,.35);
}
.bug-fab:hover { background: var(--axia-blue-700); }
.bug-fab svg { width: 16px; height: 16px; }
.bug-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,10,.42); padding: 20px;
}
.bug-modal { width: 100%; max-width: 440px; padding: 22px; }
.bug-modal h3 { font-size: 17px; margin-bottom: 4px; }
.bug-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.bug-modal label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin: 12px 0 5px; }
.bug-modal textarea {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); font: inherit; font-size: 13.5px; resize: vertical; color: var(--ink);
}
.bug-modal textarea:focus { outline: none; border-color: var(--axia-blue); box-shadow: 0 0 0 3px var(--axia-blue-50); }
.bug-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.bug-done { text-align: center; padding: 8px 4px; }
.bug-done h3 { margin-bottom: 6px; }
.bug-done p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.bug-check {
  width: 46px; height: 46px; margin: 4px auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border);
  font-size: 24px; font-weight: 700;
}
