:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e4e7ee;
  --text: #1b2030;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --sky: #0284c7;
  --sidebar: #171c2b;
  --sidebar-text: #aab2c8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
a { color: var(--accent); }

/* --- layout ------------------------------------------------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  color: #fff;
  font-weight: 600;
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 12px; letter-spacing: .5px;
}

.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav .nav-icon { width: 18px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}

.topbar h1 { font-size: 20px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

.view { padding: 22px 28px 40px; }

/* --- cards & grid ------------------------------------------------- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; }
.card-head .hint { color: var(--muted); font-size: 12px; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.kpi { padding: 16px; }
.kpi .kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.kpi .kpi-value { font-size: 26px; font-weight: 650; margin-top: 6px; }
.kpi .kpi-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* --- tables ------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); }

/* --- controls ----------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 9px; font-size: 12px; }

input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  width: auto;
}

/* Form fields fill their container; standalone controls size to content. */
.modal-body input, .modal-body select, .modal-body textarea,
.call-panel textarea { width: 100%; }
.modal-body input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 76px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.toolbar input, .toolbar select { min-width: 160px; }
.toolbar input[type="search"] { min-width: 280px; }
.toolbar .spacer { flex: 1; }

/* --- badges ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef1f6;
  color: #475069;
  white-space: nowrap;
}
.badge-new         { background:#eef2ff; color:#4338ca; }
.badge-contacted   { background:#e0f2fe; color:#0369a1; }
.badge-qualified   { background:#dcfce7; color:#15803d; }
.badge-unqualified { background:#f1f5f9; color:#64748b; }
.badge-converted   { background:#fae8ff; color:#a21caf; }

.badge-prospecting   { background:#f1f5f9; color:#475569; }
.badge-qualification { background:#e0f2fe; color:#0369a1; }
.badge-proposal      { background:#eef2ff; color:#4338ca; }
.badge-negotiation   { background:#fef3c7; color:#b45309; }
.badge-won           { background:#dcfce7; color:#15803d; }
.badge-lost          { background:#fee2e2; color:#b91c1c; }

.badge-draft     { background:#f1f5f9; color:#475569; }
.badge-submitted { background:#e0f2fe; color:#0369a1; }
.badge-in_review { background:#fef3c7; color:#b45309; }
.badge-approved  { background:#dcfce7; color:#15803d; }
.badge-rejected  { background:#fee2e2; color:#b91c1c; }
.badge-withdrawn { background:#f1f5f9; color:#64748b; }

.badge-connected    { background:#dcfce7; color:#15803d; }
.badge-no_answer    { background:#f1f5f9; color:#64748b; }
.badge-voicemail    { background:#e0f2fe; color:#0369a1; }
.badge-busy         { background:#fef3c7; color:#b45309; }
.badge-wrong_number { background:#fee2e2; color:#b91c1c; }
.badge-callback     { background:#eef2ff; color:#4338ca; }
.badge-failed       { background:#fee2e2; color:#b91c1c; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #eef1f6;
}
.tag-swatch { width: 8px; height: 8px; border-radius: 50%; }

/* --- bars / meters ------------------------------------------------ */

.bar-row { display: grid; grid-template-columns: 120px 1fr 62px; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.bar-track { background: #edf0f6; border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-value { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.spark-bar { flex: 1; background: var(--accent-soft); border-radius: 3px 3px 0 0; min-height: 2px; }
.spark-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }

/* --- pipeline board ----------------------------------------------- */

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { flex: 0 0 236px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.board-col-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.board-col-head .stage { font-weight: 600; font-size: 13px; text-transform: capitalize; }
.board-col-head .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.board-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; }
.deal-card:hover { border-color: var(--accent); }
.deal-card .t { font-weight: 600; font-size: 13px; }
.deal-card .m { color: var(--muted); font-size: 12px; margin-top: 3px; }
.deal-card .v { font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* --- dialer ------------------------------------------------------- */

.dialer { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 16px; align-items: start; }
.call-panel { text-align: center; padding: 22px 18px; }
.call-panel .who { font-size: 19px; font-weight: 650; }
.call-panel .where { color: var(--muted); margin-top: 3px; }
.call-panel .phone { font-size: 20px; font-variant-numeric: tabular-nums; margin: 14px 0 6px; letter-spacing: .5px; }
.call-timer { font-size: 30px; font-variant-numeric: tabular-nums; margin: 8px 0 14px; font-weight: 600; }
.outcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.queue-item:last-child { border-bottom: 0; }
.queue-item:hover { background: var(--surface-2); }
.queue-item.active { background: var(--accent-soft); }
.queue-item .qname { font-weight: 600; }
.queue-item .qmeta { color: var(--muted); font-size: 12px; }
.queue-item .qgrow { flex: 1; min-width: 0; }

/* --- modal & toast ------------------------------------------------ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 20, 34, .45);
  display: grid; place-items: center;
  padding: 20px; z-index: 50;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(16,24,40,.25);
}
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); padding: 5px 9px; border-radius: 999px; cursor: pointer; }
.check input { width: auto; }

.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: #111827; color: #fff;
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(16,24,40,.24);
  animation: toast-in .16s ease-out;
}
.toast.err { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.right { text-align: right; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- sign-in ------------------------------------------------------ */

.login-screen {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid; gap: 14px;
}

.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600;
}
.login-brand .brand-mark { background: var(--accent); color: #fff; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.login-card p.muted { margin: -6px 0 4px; font-size: 13px; }
.login-error {
  margin: 0; padding: 9px 11px; border-radius: 8px;
  background: #fee2e2; color: #b91c1c; font-size: 13px;
}
/* The same slot carries the good news after a password is changed. */
.login-error.login-ok { background: #dcfce7; color: #166534; }
.login-title { margin: -4px 0 0; font-size: 17px; font-weight: 600; }
.login-note {
  margin: 0; padding: 9px 11px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.login-foot { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-foot a { color: var(--accent); text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }
.btn-wide { width: 100%; justify-content: center; }

/* --- identity block in the sidebar -------------------------------- */

.identity {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: grid; gap: 4px;
}
.identity-name { color: #fff; font-weight: 600; font-size: 13px; }
.identity-role { font-size: 12px; opacity: .8; margin-bottom: 6px; }
.identity .btn { background: rgba(255,255,255,.08); color: var(--sidebar-text); border-color: transparent; }
.identity .btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* --- session bar -------------------------------------------------- */

.session-bar {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto; justify-content: flex-end;
  flex-wrap: wrap;
}

.session-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px; white-space: nowrap;
}
.session-label { font-weight: 600; }
.session-note { color: var(--muted); font-variant-numeric: tabular-nums; }
.session-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

.session-dialing   { background: #ecfdf5; border-color: #bbf7d0; }
.session-dialing .session-dot { background: var(--green); animation: pulse 1.8s infinite; }
.session-break     { background: #fff7ed; border-color: #fed7aa; }
.session-break .session-dot { background: var(--amber); }
.session-demo      { background: #eff6ff; border-color: #bfdbfe; }
.session-demo .session-dot { background: var(--sky); }
.session-ready     { background: var(--accent-soft); border-color: #c7d2fe; }
.session-ready .session-dot { background: var(--accent); }
.session-off-shift .session-dot { background: #94a3b8; }

@keyframes pulse { 50% { opacity: .35; } }

/* --- chips, meters, notices --------------------------------------- */

.chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.chip-ok   { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.chip-warn { background: #fef3c7; color: #b45309; border-color: #fde68a; }

.big { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.ok   { color: var(--green); }
.warn { color: var(--amber); }

.meter {
  height: 8px; border-radius: 999px;
  background: var(--border); overflow: hidden;
  margin: 10px 0;
}
.meter-fill { height: 100%; background: var(--amber); transition: width .3s ease; }
.meter-fill.ok { background: var(--green); }

.notice-stack .card-body { display: grid; gap: 8px; }
.notice {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); border-left: 3px solid var(--border);
  font-size: 13px;
}
.notice-warning { background: #fffbeb; border-left-color: var(--amber); }
.notice-when { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 96px; }

.gate {
  padding: 18px 20px;
  border-left: 3px solid var(--amber);
  display: grid; gap: 8px; justify-items: start;
}
.gate-title { font-weight: 600; font-size: 15px; }
.gate p { margin: 0; }

/* --- demo video placeholder --------------------------------------- */

.demo-frame {
  display: flex; align-items: center; gap: 14px;
  padding: 28px 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #e2e8f0;
}
.demo-play {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14); font-size: 18px;
}

/* --- dialpad ------------------------------------------------------ */

.dialpad-display {
  width: 100%;
  margin: 12px 0 14px;
  padding: 12px;
  text-align: center;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 260px;
  margin: 0 auto 14px;
}

.dialpad-key {
  aspect-ratio: 1 / 1;
  font-size: 20px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .1s ease, transform .06s ease;
}
.dialpad-key:hover:not(:disabled) { background: var(--accent-soft); }
.dialpad-key:active:not(:disabled) { transform: scale(.94); }
.dialpad-key:disabled { opacity: .4; cursor: not-allowed; }

.dialpad-actions {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.dialpad-back { min-width: 48px; font-size: 16px; }

.btn-call {
  background: var(--green); color: #fff; border-color: var(--green);
  padding-left: 30px; padding-right: 30px; font-weight: 600;
}
.btn-call:hover:not(:disabled) { filter: brightness(1.08); }

.call-timer.live { color: var(--green); }

/* --- follow-ups --------------------------------------------------- */

.follow-chip { margin-left: 8px; font-size: 11px; vertical-align: middle; }

.follow-banner {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border-left: 3px solid var(--amber);
  text-align: left;
  font-size: 13px;
}
.follow-banner .muted { font-size: 12px; }

.card-head .hint .chip { margin-right: 6px; }

/* --- career ladder ------------------------------------------------ */

.kpi-value.huge { font-size: 40px; letter-spacing: -.03em; }
.kpi.headline { border-left: 3px solid var(--accent); }

.level-link { display: block; text-decoration: none; color: inherit; }
.level-link:hover { border-color: var(--accent); }
.level-name { font-size: 19px; line-height: 1.25; }

.level {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
}
.level-badge {
  flex: 0 0 auto;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.level-main { flex: 1; min-width: 0; }
.level-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 21px; font-weight: 650; letter-spacing: -.01em;
}
.level-suffix { font-size: 12px; }
.level-terms {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 6px; color: var(--muted); font-size: 14px;
}
.level-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.level-main p { margin: 10px 0 0; font-size: 13px; }

.rung {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.rung:first-child { border-top: 0; padding-top: 0; }
.rung-mark {
  flex: 0 0 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--border); color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.rung.reached .rung-mark { background: #dcfce7; color: var(--green); }
.rung.current { background: var(--accent-soft); margin: 0 -16px; padding: 11px 16px; }
.rung.current + .rung { border-top-color: transparent; }
.rung-body { flex: 1; min-width: 0; }
.rung-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 13px;
}
.rung-meter { margin: 6px 0 0; height: 5px; }
.rung-note { font-size: 12px; margin-top: 4px; }

.bonus-now {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 14px;
}
.bonus-now .spacer { flex: 1; }
.bonus-now .kpi-value { font-size: 28px; }

/* --- dialer modes and the auto panel ------------------------------ */

.mode-switch { display: flex; gap: 0; }
.mode-switch .btn { border-radius: 0; }
.mode-switch .btn:first-child { border-radius: 8px 0 0 8px; }
.mode-switch .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }

.auto-idle { display: grid; gap: 12px; justify-items: stretch; text-align: left; }
.auto-idle .who { text-align: center; }
.auto-idle p { margin: 0; font-size: 13px; }

.auto-bar {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; text-align: left;
}
.auto-bar .spacer { flex: 1; }
.auto-bar .chip { white-space: nowrap; }

.auto-phone {
  margin: 10px 0 6px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}

.auto-wrap {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 14px 0 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 14px; font-weight: 500;
}
.wrap-count { font-variant-numeric: tabular-nums; font-weight: 700; }

.auto-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.auto-foot .spacer { flex: 1; }

/* --- leaderboard -------------------------------------------------- */

.scoreboard .card-body.flush { padding: 0; }
.scoreboard-tabs { display: flex; gap: 6px; }
.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.scoreboard-tabs .chip { cursor: pointer; font-weight: 500; }

.scoreboard-rows { display: grid; }
.scoreboard-row {
  display: grid;
  grid-template-columns: 34px 28px 1fr auto 72px 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  transition: background .2s;
}
.scoreboard-row:first-child { border-top: 0; }
.scoreboard-row.you { background: var(--accent-soft); }
.scoreboard-row.moved { animation: scoreboard-flash 1.2s ease-out; }
@keyframes scoreboard-flash { from { background: #fef9c3; } }

.scoreboard-rank {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.rank-1 { background: #fde68a; color: #92400e; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #fed7aa; color: #9a3412; }

.scoreboard-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.scoreboard-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); animation: pulse 1.8s infinite;
}
.scoreboard-when { font-size: 12px; }
.scoreboard-score {
  text-align: right; font-size: 17px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scoreboard-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.scoreboard-foot .muted:first-child { flex: 1; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); animation: pulse 1.8s infinite;
}

/* --- the gamified parts ------------------------------------------- */

/* Initials stand in for a photo nobody has uploaded. */
.scoreboard-avatar, .podium-avatar {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.scoreboard-avatar { width: 28px; height: 28px; }
.podium-avatar { width: 44px; height: 44px; font-size: 14px; }

/* A bar makes the gap between first and fourth visible at a glance, which a
   column of numbers does not. */
.scoreboard-bar {
  height: 6px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.scoreboard-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7c6cf5);
  transition: width .6s cubic-bezier(.22,1,.36,1);
}
.scoreboard-row.you .scoreboard-fill { background: linear-gradient(90deg, var(--green), #4ade80); }

.streak {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 7px 1px 5px; border-radius: 999px;
  background: #fff7ed; color: #c2410c;
  font-size: 11px; font-weight: 700;
}
.streak.hot { background: #fef3c7; color: #a16207; animation: streak-glow 2.2s ease-in-out infinite; }
@keyframes streak-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,179,8,0); }
  50%      { box-shadow: 0 0 0 4px rgba(234,179,8,.18); }
}

.badge-strip { display: inline-flex; align-items: center; gap: 2px; }
.earned-badge { font-size: 13px; line-height: 1; cursor: default; }
.earned-badge.dim { opacity: .45; filter: grayscale(1); }
.earned-more { font-size: 10px; font-weight: 700; color: var(--muted); }

.move { font-size: 10px; font-weight: 700; }
.move.up { color: var(--green); }
.move.down { color: var(--red); }

/* --- podium -------------------------------------------------------- */

.podium {
  display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: end; gap: 10px;
  padding: 16px 16px 0;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 85%);
  /* The ground the steps stand on. Without it they look cut off where the
     next section begins rather than resting on something. */
  border-bottom: 2px solid var(--border);
}
.podium-place {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; min-width: 0;
}
.podium-medal { font-size: 20px; line-height: 1; }
.podium-name {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium-score { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.podium-place.you .podium-score { color: var(--accent); }

/* The step is what makes it a podium rather than three cards. Height comes
   from the position so the middle is always the tallest, even on a tie;
   colour comes from the rank, so a tie for first is two gold steps. */
.podium-step {
  width: 76%; max-width: 132px; margin-top: 4px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #cbd5e1, #e2e8f0);
}
.pos-mid   .podium-step { height: 54px; }
.pos-left  .podium-step { height: 36px; }
.pos-right .podium-step { height: 24px; }
.place-1 .podium-step { background: linear-gradient(180deg, #fbbf24, #fde68a); }
.place-2 .podium-step { background: linear-gradient(180deg, #cbd5e1, #e2e8f0); }
.place-3 .podium-step { background: linear-gradient(180deg, #fdba74, #fed7aa); }
.pos-mid .podium-avatar { width: 50px; height: 50px; font-size: 15px; }
.pos-mid .podium-score { font-size: 26px; }

/* --- the floor's own goal ------------------------------------------ */

.floor-goal { padding: 12px 16px 14px; border-top: 1px solid var(--border); }
.floor-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.floor-count { font-variant-numeric: tabular-nums; color: var(--text); }
.floor-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.floor-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7c6cf5);
  transition: width .8s cubic-bezier(.22,1,.36,1);
}
.floor-fill.done { background: linear-gradient(90deg, var(--green), #4ade80); }

/* --- your own line ------------------------------------------------- */

.scoreboard-you {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 12.5px;
}
.you-line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.you-next { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 11.5px; }
.pb { color: var(--green); font-weight: 600; }

/* --- a lead landing ------------------------------------------------ */

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px;
  width: 8px; height: 13px; border-radius: 1px;
  animation: confetti-fall 2.2s linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(104vh) rotate(680deg); opacity: .15; }
}

@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .streak.hot { animation: none; }
  .scoreboard-fill, .floor-fill { transition: none; }
}

/* --- brokers ------------------------------------------------------ */

.broker-waiting {
  padding: 10px 16px;
  background: #fffbeb;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.broker-waiting .btn { margin-left: 6px; }

/* --- supervision -------------------------------------------------- */

/* What the agent sees. It lands above everything else on the dialer because
   they are listening to a merchant, not watching the screen. */
.coach-bar { display: grid; gap: 8px; }

.coach-watching {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 8px;
  background: #eff6ff; color: #1d4ed8;
  font-size: 12.5px; font-weight: 600;
}
.coach-watching.stepped_in { background: #fef2f2; color: #b91c1c; }
.coach-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; animation: pulse 1.6s infinite;
}

.coach-note {
  position: relative;
  padding: 14px 40px 14px 16px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 5px solid var(--amber);
  box-shadow: var(--shadow);
  animation: coach-in .28s cubic-bezier(.22,1,.36,1);
}
.coach-note.step-in { background: #fef2f2; border-color: #fca5a5; border-left-color: var(--red); }
@keyframes coach-in {
  from { opacity: 0; transform: translateY(-7px); }
}
.coach-meta {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 11px; margin-bottom: 4px;
}
.coach-kind {
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--amber);
}
.coach-note.step-in .coach-kind { color: var(--red); }
/* Big, because it is read at a glance mid-sentence. */
.coach-text { font-size: 16px; font-weight: 600; line-height: 1.35; }
.coach-dismiss {
  position: absolute; top: 9px; right: 9px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 13px; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
}
.coach-dismiss:hover { background: rgba(0,0,0,.05); color: var(--text); }

/* What the manager sees. */
.live-calls { display: grid; gap: 1px; background: var(--border); }
.live-call {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 16px; background: var(--surface);
}
.live-call.supervised { background: #eff6ff; }
.lc-main { min-width: 0; }
.lc-who { font-size: 13.5px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lc-arrow { font-size: 12px; }
.lc-meta { font-size: 12px; margin-top: 2px; }
.lc-timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.lc-flag { color: var(--accent); font-weight: 600; }
.lc-actions { display: flex; gap: 6px; flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .coach-note { animation: none; }
  .coach-dot { animation: none; }
}

/* --- hot shifts --------------------------------------------------- */

.hot-shift { padding: 16px 18px; border-left: 4px solid var(--amber); }
.hot-shift.live {
  border-left-color: var(--red);
  box-shadow: 0 0 0 1px rgba(220,38,38,.12), var(--shadow);
}
.hot-shift.waiting { border-left-color: var(--border); }
.hot-shift.done { border-left-color: var(--border); opacity: .72; padding: 11px 18px; }

.hot-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.hot-flag { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: .3px; }
.hot-flag.dim, .hot-pos.dim { color: var(--muted); }
.hot-pos {
  font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 9px; border-radius: 999px;
}
.hot-when { font-size: 17px; font-weight: 650; }
.hot-sub { font-size: 12.5px; margin-top: 2px; }
.hot-queue { font-size: 12.5px; margin-top: 9px; }

/* The clock is the whole point of the card, so it is the biggest thing on it. */
.hot-clock-wrap {
  display: flex; align-items: baseline; gap: 9px;
  margin: 13px 0 12px;
}
.hot-clock {
  font-size: 34px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hot-clock-note { font-size: 12px; }
.hot-shift.urgent .hot-clock { color: var(--red); animation: hot-pulse 1s ease-in-out infinite; }
@keyframes hot-pulse { 50% { opacity: .45; } }

.hot-actions { display: flex; gap: 8px; }
.hot-actions .btn-wide { flex: 2; }
.hot-actions .btn:not(.btn-wide) { flex: 1; justify-content: center; }

/* --- the manager's view of a waterfall ----------------------------- */

.waterfall { display: grid; gap: 1px; background: var(--border); }
.waterfall-row {
  display: grid; grid-template-columns: 32px 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--surface);
  font-size: 13px;
}
.waterfall-row .wf-pos {
  font-weight: 700; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.waterfall-row.offered { background: #fff7ed; }
.waterfall-row.offered .wf-pos { color: var(--red); }
.waterfall-row.claimed { background: #f0fdf4; }
.waterfall-row.expired, .waterfall-row.skipped,
.waterfall-row.missed, .waterfall-row.passed { opacity: .55; }
.wf-state { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.wf-leads { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .hot-shift.urgent .hot-clock { animation: none; }
}

/* --- shift slots -------------------------------------------------- */

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.slot-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.slot-name { font-weight: 600; font-size: 13px; }
.slot-time { margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.slot-card .muted { font-size: 12px; }

.gate-ok { border-left-color: var(--green); }

.badge-pending  { background:#fef3c7; color:#b45309; }
.badge-declined { background:#fee2e2; color:#b91c1c; }
.badge-demo     { background:#e0f2fe; color:#0369a1; }
.badge-dialing  { background:#dcfce7; color:#15803d; }
.badge-break    { background:#fef3c7; color:#b45309; }
.badge-ended    { background:#f1f5f9; color:#64748b; }

@media (max-width: 900px) {
  .sidebar { width: 64px; flex-basis: 64px; }
  .brand-name, .nav a span:not(.nav-icon) { display: none; }
  .dialer { grid-template-columns: 1fr; }
  .view, .topbar { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 900px) {
  .session-bar { order: 3; width: 100%; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .dialpad { max-width: none; }
  .scoreboard-row { grid-template-columns: 30px 1fr 46px; }
  .scoreboard-when, .scoreboard-avatar, .scoreboard-bar { display: none; }
  .podium { padding: 14px 10px 0; gap: 6px; }
}

/* The phone line inside a call panel, when calls are real. */
.phone-line { margin: -6px 0 12px; }
.phone-status { font-weight: 600; margin-bottom: 8px; }
.phone-connecting { color: var(--amber); }
.phone-connected { color: var(--green); }
.phone-ended { color: var(--muted); font-weight: 500; }
.phone-buttons { display: flex; gap: 8px; justify-content: center; }

/* Modal messages may carry line breaks (an import summary, for one). */
.modal-body > p { white-space: pre-line; }

/* A manager's audio on a live call: its own row under the call. */
.live-call:has(.lc-audio) { flex-wrap: wrap; }
.lc-audio { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lc-audio .phone-line { margin: 0 0 0 auto; display: flex; align-items: center; gap: 10px; }
.lc-audio .phone-status { margin: 0; }

/* The auto-dialer's "ring the next lead" switch sits among the run controls. */
.auto-ring { margin-left: 4px; }

/* Send application, and where that link stands, under the lead in a dialer. */
.send-app { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; }
.link-status { font-size: 12px; }

/* Live transcript and the playbook's rebuttals, in the dialer and on Team. */
.transcript-panel { text-align: left; margin: 4px 0 12px; }
.transcript-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 4px; }
.transcript-scroll {
  max-height: 220px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; background: var(--surface-2);
}
.tline { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; padding: 2px 0; }
.tline-who { flex: 0 0 64px; font-weight: 600; color: var(--muted); }
.tline-merchant .tline-who { color: var(--accent); }
.tline-partial { opacity: .6; font-style: italic; }
.rebuttals { display: flex; flex-direction: column; gap: 6px; }
.rebuttal {
  border: 1px solid var(--border); border-left: 4px solid var(--amber);
  border-radius: 8px; padding: 8px 10px; background: var(--surface);
}
.rebuttal.latest { border-left-color: var(--green); background: #f0fdf4; }
.rebuttal-objection { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rebuttal-say { font-size: 15px; font-weight: 600; margin-top: 2px; }
.modal.modal-wide { width: min(760px, calc(100vw - 32px)); }
.transcript-history { display: flex; flex-direction: column; gap: 8px; }
.transcript-call { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.transcript-call summary { cursor: pointer; }
.transcript-call .transcript-lines { margin: 8px 0; }

/* The in-call workspace beside the dialer. */
.workspace { padding: 0; overflow: hidden; }
.ws-tabs { display: flex; border-bottom: 1px solid var(--border); }
.ws-tab { flex: 1; background: none; border: 0; padding: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ws-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.ws-body { padding: 14px 16px; }
.ws-lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ws-name { font-size: 18px; font-weight: 650; }
.ws-facts { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; margin: 12px 0; font-size: 13px; }
.ws-facts dt { color: var(--muted); }
.ws-facts dd { margin: 0; overflow-wrap: anywhere; }
.ws-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }
.ws-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-tag { display: inline-flex; align-items: center; gap: 2px; }
.ws-tag-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.ws-tag-add { width: auto; font-size: 12px; padding: 4px 8px; }
.ws-form { display: grid; gap: 10px; }
.ws-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ws-field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.ws-field input, .ws-field select { font-weight: 400; }
.ws-app-status { margin-bottom: 10px; }
.ws-or { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ws-people { display: grid; gap: 6px; }
.ws-person { display: flex; align-items: center; gap: 8px; }
.ws-person-name { flex: 1; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-on { background: var(--green); }
.dot-busy { background: var(--amber); }
.ws-transfer { border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.ws-transfer-joined { border-color: var(--green); background: #f0fdf4; }
.ws-transfer-actions { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 520px) { .ws-row { grid-template-columns: 1fr; } }

/* Help requests at the top of Team, and the broker's desk. */
.help-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: #fef3c7; border: 1px solid #fde68a; }
.broker-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.broker-call { border-left: 4px solid var(--amber); }
.broker-call-joined { border-left-color: var(--green); }

/* Signed in as a rep by a super admin. Fixed across the top: never missable. */
.viewing-as {
  position: sticky; top: 0; z-index: 50; grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  padding: 8px 16px; background: #ea580c; color: #fff; font-weight: 600; font-size: 13px;
}
.viewing-as .btn { background: #fff; color: #9a3412; border-color: #fff; }

/* Monitor: reps on the left, the chosen rep's screen on the right. */
.monitor { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 16px; align-items: start; }
.monitor-list { display: grid; gap: 8px; }
.monitor-rep { text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 10px 12px; display: grid; gap: 4px; }
.monitor-rep.active { outline: 2px solid var(--accent); }
.monitor-rep.on-call { border-left: 4px solid var(--amber); }
.monitor-rep-head { display: flex; align-items: center; gap: 8px; }
.monitor-rep-line { font-size: 12px; }
.dot-off { background: var(--border); }
.monitor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.monitor-screen { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 16px; align-items: start; }
.monitor-run { text-align: left; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.monitor-pane.looking { outline: 2px solid var(--accent); }
@media (max-width: 900px) { .monitor, .monitor-screen { grid-template-columns: 1fr; } }

/* The super admin's badge under their name. */
.identity-role.god-mode { color: #fbbf24; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Ticked leads, and where to send them. */
.bulk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent);
}
.bulk-bar select { width: auto; }

/* Leads by rep: one row per rep — their book, then the moves. */
.rep-books { display: grid; }
.rep-book { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.card > .rep-book { border-top: 0; grid-template-columns: 1fr auto; }
.rep-name { display: flex; align-items: center; gap: 8px; }
.rep-stats { display: flex; flex-wrap: wrap; gap: 18px; }
.rep-stat { display: grid; line-height: 1.2; }
.rep-stat strong { font-size: 17px; }
.rep-stat span { font-size: 11px; color: var(--muted); }
.rep-stat.warn strong { color: var(--amber); }
.rep-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 900px) { .rep-book { grid-template-columns: 1fr; } .rep-actions { justify-content: flex-start; } }

/* The multi-file upload: one row per file, with where it goes. */
.upload-files { display: grid; gap: 6px; }
.upload-file { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.upload-file-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.upload-file select { width: auto; max-width: 240px; }
.error-text { color: var(--red); font-size: 13px; }
@media (max-width: 520px) { .upload-file { grid-template-columns: 1fr auto; } .upload-file select { grid-column: 1 / -1; max-width: none; } }
.upload-file-block { display: grid; gap: 6px; }
.upload-file { grid-template-columns: 1fr auto auto auto; }
.upload-map { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; background: var(--surface-2); }
.upload-map-head, .upload-map-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(100px, 1fr) minmax(180px, 1.2fr); gap: 10px; align-items: center; }
.upload-map-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.upload-map-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .upload-map-head { display: none; } .upload-map-row { grid-template-columns: 1fr; } }
