/* Appointment Report Status — uses the Hub's own tokens so it ages with the rest
   of the console rather than drifting into its own look. */

/* ── Use the whole content area ───────────────────────────────────────────────
   `.module-view-body` is a two-column grid: minmax(0,1fr) plus a 320px right rail.
   This module has no rail, so its single child spans both tracks; otherwise a
   third of the content area sat empty. Found on the first live run, 2026-09-14. */
.ars-shell{grid-column:1 / -1;min-width:0;display:flex;flex-direction:column;gap:14px}
/* The Hub has no global [hidden] rule, and every flex container below would
   otherwise override the attribute. */
.ars-shell [hidden]{display:none !important}

.ars-field{display:flex;flex-direction:column;gap:4px}
.ars-field label{font-size:10.5px;font-weight:600;color:var(--text-3);
  text-transform:uppercase;letter-spacing:.04em}
.ars-shell input[type=date]{width:160px}
.ars-dates{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px}
.ars-chip-row{display:flex;flex-wrap:wrap;gap:6px}

.ars-chip{border:1px solid var(--border);background:#fff;border-radius:999px;
  padding:5px 12px;font-size:11px;color:var(--text-2);cursor:pointer;transition:.15s}
.ars-chip:hover{background:#eef5ff;border-color:#93c5fd;color:#1d4ed8}

/* A search box always has a button beside it — nobody should have to guess
   whether Enter works. Enter still works too. */
.ars-search-btn{border:0;border-radius:8px;padding:8px 16px;font-size:12px;font-weight:700;
  color:#fff;cursor:pointer;background:linear-gradient(135deg,var(--blue),var(--accent));
  box-shadow:0 2px 8px rgba(30,87,153,.25);transition:.15s;white-space:nowrap}
.ars-search-btn:hover{filter:brightness(1.06);box-shadow:0 4px 12px rgba(30,87,153,.32)}
.ars-search-btn.ars-pending{box-shadow:0 0 0 3px rgba(59,158,218,.35),0 2px 8px rgba(30,87,153,.25)}

/* ── What is stored (top) ─────────────────────────────────────────────────── */
.ars-databar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:9px 12px 9px 14px;
  border:1px solid var(--border);border-radius:10px;background:linear-gradient(180deg,#fbfdff,#f4f8fd)}
.ars-databar-icon{font-size:15px}
.ars-coverage{flex:1;min-width:220px;font-size:12px;color:var(--text-2)}
.ars-cov-strong{font-weight:700;color:var(--text-1)}
.ars-cov-sep{opacity:.4;margin:0 6px}
.ars-cov-empty{color:var(--text-3)}
.ars-pull-open{border:1px solid #93c5fd;background:#fff;color:#1d4ed8;border-radius:8px;
  padding:7px 14px;font-size:12px;font-weight:700;cursor:pointer;transition:.15s}
.ars-pull-open:hover{background:#eef5ff}
.ars-pull-status{border:0;border-radius:999px;padding:5px 12px;font-size:11px;font-weight:700;
  background:#e0f2fe;color:#075985;cursor:pointer}
.ars-pull-status.ars-pull-failed{background:#fee2e2;color:#991b1b}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.ars-tabs{display:flex;gap:6px;flex-wrap:wrap}
.ars-tab{border:1px solid var(--border);background:#fff;border-radius:9px;padding:9px 15px;
  font-size:12px;font-weight:600;color:var(--text-2);cursor:pointer;transition:.15s}
.ars-tab:hover{border-color:#93c5fd;background:#f6faff}
.ars-tab.active{background:linear-gradient(180deg,#1d4ed8,#1e40af);border-color:#1e40af;
  color:#fff;box-shadow:0 2px 8px rgba(29,78,216,.28)}
.ars-tab-icon{margin-right:5px}

/* ── What is shown (above the content) ────────────────────────────────────── */
.ars-viewbar{display:flex;flex-direction:column;gap:10px;padding:12px 16px;
  border:1px solid #bfdbfe;border-left:4px solid var(--accent);border-radius:10px;background:#fff;
  box-shadow:0 1px 3px rgba(16,32,64,.05)}
.ars-viewbar-now{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}
.ars-viewbar-label{font-size:10.5px;font-weight:700;color:var(--text-3);
  text-transform:uppercase;letter-spacing:.05em}
.ars-viewbar-range{font-size:16px;font-weight:700;color:#13315c}
.ars-viewbar-hint{font-size:11.5px;color:var(--text-3)}
.ars-viewbar-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.ars-viewbar-to{font-size:12px;color:var(--text-3)}
.ars-viewbar-pending{font-size:11px;font-weight:600;color:#1d4ed8}
.ars-viewbar-error{font-size:11px;font-weight:600;color:#b91c1c}
.ars-viewbar-controls .ars-chip-row{margin-left:auto}

/* ── Headline and panels ──────────────────────────────────────────────────── */
.ars-headline{display:flex;align-items:flex-start;gap:14px;padding:15px 18px;
  border:1px solid #bfdbfe;border-radius:10px;background:linear-gradient(135deg,#eff6ff,#f8fbff)}
.ars-headline-text{flex:1;font-size:15px;font-weight:650;color:#13315c;line-height:1.5}
.ars-guide-btn{flex:none;border:1px solid #bfdbfe;background:#fff;color:#1d4ed8;border-radius:999px;
  padding:5px 12px;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;transition:.15s}
.ars-guide-btn:hover{background:#eef5ff;border-color:#93c5fd}
.ars-sub-headline{font-size:12.5px;font-weight:600;color:var(--text-1);
  margin-bottom:10px;line-height:1.5}
.ars-warn{font-size:11.5px;line-height:1.55;padding:8px 12px;border-radius:7px;
  color:#92400e;background:#fffbeb;border:1px solid #fcd34d}

.ars-panel{border:1px solid var(--border);border-radius:10px;background:#fff;
  box-shadow:0 1px 3px rgba(16,32,64,.05);overflow:hidden}
.ars-panel-head{padding:12px 16px 10px;border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fcfdff,#f6f9fd)}
.ars-panel-title{font-size:13px;font-weight:700;color:var(--text-1)}
.ars-panel-sub{margin-top:3px;font-size:11px;color:var(--text-3);line-height:1.5}
.ars-panel-body{padding:14px 16px}
#arsViewBody{display:flex;flex-direction:column;gap:14px}

/* ── Tables ───────────────────────────────────────────────────────────────────
   The sticky <th> only functions inside .ars-drill-scroll. Measured 2026-09-14:
   overflow-x:auto promotes the other axis to a scroll container, so a sticky
   header anchors to the wrapper, not the page — and `clip` on the second axis
   computes to hidden, which does not help. Panel tables are 4 to 13 rows and fit
   on screen; the one long list has a real bounded scroll box and does stick. */
.ars-table-wrap{overflow-x:auto}
.ars-drill-scroll{max-height:min(62vh,600px);overflow-y:auto;border:1px solid var(--border);border-radius:8px}
.ars-table{width:100%;border-collapse:collapse;font-size:11.5px}
.ars-table th{text-align:left;padding:7px 10px;border-bottom:1.5px solid var(--border);
  color:var(--text-3);font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;
  position:sticky;top:0;z-index:2;background:#fff;box-shadow:0 1px 0 var(--border)}
.ars-table td{padding:8px 10px;border-bottom:1px solid #f1f5f9;vertical-align:top;color:var(--text-2)}
/* Zebra first, hover second — hover has to win, so it is declared after. */
.ars-table tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--bg-soft) 55%,transparent)}
.ars-table tbody tr:hover td{background:#f8fbff}
.ars-r,.ars-table th.ars-r{text-align:right}
.ars-r,.ars-pct,.ars-counts,.ars-stat-n{font-variant-numeric:tabular-nums}
.ars-table .ars-r,.ars-nw{white-space:nowrap}
/* max-width alone does not bind a table cell, so a long note ran past the edge. */
.ars-note{max-width:460px;font-size:11px;color:var(--text-3);line-height:1.5;
  overflow-wrap:anywhere;white-space:normal}
/* Clipped visually only, so Copy and Download CSV still carry the whole note. */
.ars-note-clip{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;
  overflow:hidden;cursor:pointer}
.ars-note-clip.open{display:block;-webkit-line-clamp:unset}
.ars-note-part + .ars-note-part{margin-top:4px}
.ars-note-part b{color:var(--text-2);font-weight:650}
.ars-table-tools,.ars-drill-tools{display:flex;gap:7px;align-items:center;margin-top:10px}
.ars-drill-tools{margin:0 0 12px;flex-wrap:wrap}
.ars-search-input{flex:0 1 340px;min-width:180px}

/* The rate leads, its raw counts sit under it in smaller type. Stacked rather than
   hidden: Copy and Download CSV read innerText, so hiding the counts would strip
   them from every export — and carrying the counts is the point of the floor rule. */
.ars-pct{font-weight:700;color:var(--text-1);font-size:13px}
.ars-big{font-size:19px}
.ars-counts{display:block;margin-top:1px;font-size:9.5px;font-weight:400;
  color:var(--text-3);white-space:nowrap}
.ars-dash{color:#94a3b8;font-weight:700}
.ars-owner{margin-top:2px;font-size:10.5px;color:var(--text-3);line-height:1.45;font-weight:400}

.ars-stage-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px}
.ars-stage-dot.pre{background:#f59e0b}
.ars-stage-dot.post{background:#2563eb}

.ars-verdict{display:inline-block;padding:2px 9px;border-radius:999px;font-size:10.5px;
  font-weight:700;white-space:nowrap}
.ars-verdict-source{background:#fef3c7;color:#92400e}
.ars-verdict-rep{background:#dbeafe;color:#1e40af}
.ars-verdict-mixed{background:#ede9fe;color:#5b21b6}
.ars-verdict-too_few{background:#f1f5f9;color:#64748b}
.ars-verdict-office{background:#dcfce7;color:#166534}

.ars-stat-row{display:flex;flex-wrap:wrap;gap:26px;margin-bottom:6px}
.ars-stat-n{font-size:20px;font-weight:700;color:var(--text-1);line-height:1.2}
.ars-stat-l{margin-top:3px;font-size:10.5px;color:var(--text-3)}
.ars-stat-open{margin-top:6px}
.ars-headline > .ars-open-btn{align-self:center;white-space:nowrap}

/* Opens a dialog, so it looks like a button rather than an underlined link. */
.ars-open-btn{border:1px solid #bfdbfe;background:#f5f9ff;color:#1d4ed8;border-radius:7px;
  padding:4px 10px;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;transition:.15s}
.ars-open-btn:hover{background:#e0edff;border-color:#93c5fd}
td > div > .ars-open-btn{margin-top:5px;padding:2px 8px;font-size:10px}

.ars-loading,.ars-empty{padding:26px;text-align:center;color:var(--text-3);font-size:12px}
.ars-toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);
  background:#13315c;color:#fff;padding:9px 18px;border-radius:999px;font-size:12px;
  box-shadow:0 6px 20px rgba(16,32,64,.25);z-index:9999}

/* ── Dialogs (native <dialog>, top layer) ─────────────────────────────────── */
/* Pinned near the top, not centred: a search that shrinks the list must not make the
   dialog jump to the middle. (The Hub's global reset zeroes the browser's own margin.) */
.ars-dialog{margin:6vh auto auto;border:0;padding:0;border-radius:16px;background:var(--card);color:var(--text-1);
  width:min(640px,calc(100vw - 32px));max-height:88vh;
  box-shadow:0 24px 70px rgba(10,22,40,.35);overflow:hidden}
.ars-dialog[open]{display:flex;flex-direction:column;animation:arsDialogIn .18s ease-out}
.ars-dialog-wide{width:min(1180px,calc(100vw - 32px))}
.ars-dialog-pull{width:min(760px,calc(100vw - 32px))}
.ars-dialog::backdrop{background:rgba(10,22,40,.45);backdrop-filter:blur(2px)}
@keyframes arsDialogIn{from{opacity:0}to{opacity:1}}
.ars-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:16px 20px 12px;border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fcfdff,#f4f8fd)}
.ars-dialog-title{font-size:15px;font-weight:700;color:var(--text-1)}
.ars-dialog-sub{margin-top:3px;font-size:11.5px;color:var(--text-3)}
.ars-dialog-sub:empty{display:none}
.ars-dialog-x{background:none;border:0;font-size:26px;line-height:1;color:var(--text-3);
  cursor:pointer;padding:0 4px;transition:color .15s}
.ars-dialog-x:hover{color:var(--text-1)}
.ars-dialog-body{padding:16px 20px 20px;overflow-y:auto;display:flex;flex-direction:column;gap:14px}

.ars-pull-facts{margin:0;padding-left:18px;font-size:12px;color:var(--text-2);line-height:1.7}
.ars-pull-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.ars-chrome-hint{font-size:11.5px;color:#92400e}
.ars-pull-log .log-body{height:260px}

.ars-guide-item{padding-bottom:12px;border-bottom:1px solid #f1f5f9}
.ars-guide-item:last-child{border-bottom:0;padding-bottom:0}
.ars-guide-title{font-size:12px;font-weight:700;color:var(--text-1);margin-bottom:4px}
.ars-guide-text{font-size:12px;color:var(--text-2);line-height:1.6;white-space:pre-line}

/* One lost lead, side by side (2026-09-15). */
.ars-cause-top{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start;justify-content:space-between;
  padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:#f8fbff;margin-bottom:12px}
.ars-cause-reason{flex:1 1 320px;min-width:0;font-size:13px;color:var(--text-1)}
.ars-cause-reason .ars-loading{padding:6px 0;text-align:left}
.ars-cause-lean{text-align:right}
.ars-cause-badge{font-size:13px;padding:4px 14px;margin-top:3px}
.ars-cause-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin-bottom:10px}
.ars-cause-side{border:1px solid var(--border);border-radius:10px;background:#fff}
.ars-cause-side-head{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;
  border-bottom:1px solid var(--border);font-size:12.5px;font-weight:700;color:var(--text-1)}
.ars-cause-total{font-size:11px;font-weight:600;color:var(--text-3)}
.ars-cause-lines{list-style:none;margin:0;padding:8px 14px 12px}
.ars-cause-line{display:flex;gap:10px;padding:6px 0;font-size:12px;line-height:1.5;color:var(--text-2)}
.ars-cause-line + .ars-cause-line{border-top:1px dashed #e2e8f0}
.ars-cause-pts{flex:0 0 28px;text-align:center;font-weight:700;color:#94a3b8;border-radius:6px;height:20px;line-height:20px}
.ars-cause-pts.on{background:#dbeafe;color:#1e40af}
.ars-cause-rule{margin-top:10px;font-size:11.5px;color:var(--text-3)}
.ars-cause-rule summary{cursor:pointer;font-weight:600}
.ars-cause-rule p{line-height:1.6;margin:6px 0 0}
.ars-reading{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:12.5px;color:var(--text-1)}
.ars-reading .ars-counts{flex-basis:100%;white-space:normal}
.ars-lean-btn{border:0;cursor:pointer;font:inherit;font-size:11px;font-weight:600;transition:box-shadow .15s}
.ars-lean-btn:hover{box-shadow:0 0 0 2px rgba(59,130,246,.35)}
.ars-cause-office{margin:0 0 12px;padding:9px 12px;border-radius:8px;background:#f0fdf4;color:#166534;font-size:12.5px;line-height:1.5}
.ars-reason{min-width:180px;max-width:260px}
.ars-verdict-call_center{background:#ede9fe;color:#5b21b6}
.ars-cause-call-center{background:#f5f3ff;color:#4c1d95}
.ars-seg{display:inline-flex;border:1px solid var(--border);border-radius:999px;overflow:hidden;margin-left:4px}
.ars-seg[hidden]{display:none}
.ars-seg-btn{border:0;background:#fff;padding:3px 10px;font-size:11.5px;color:var(--text-2);cursor:pointer}
.ars-seg-btn+.ars-seg-btn{border-left:1px solid var(--border)}
.ars-seg-btn:hover{background:#eef5ff;color:#1d4ed8}
.ars-seg-btn.active{background:#1d4ed8;color:#fff}
.ars-report-btn{border-color:#93c5fd;color:#1d4ed8;font-weight:600}
.ars-report-btn[disabled]{opacity:.6;cursor:default}
