/*
 * web.css — Manager web app layout + skin (ADR-0007).
 * Consumes the theme.css tokens (var(--…)); almost no raw hex here. The look
 * matches the Rep side panel: dark-navy chrome, orange = primary action.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  min-height: 100vh;
}

/* Shared bits ------------------------------------------------------------- */

.wordmark {
  font-weight: var(--weight-heading);
  font-size: var(--text-size-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

/* Uppercase eyebrow label — the mock's section-header treatment. */
.eyebrow {
  margin: 0 0 6px;
  font-size: var(--text-size-label);
  font-weight: var(--weight-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }

/* Inline server-set error message (bad credentials, duplicate email). */
.error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: var(--radius-input);
  background: rgba(201, 58, 58, 0.12);
  border: 1px solid var(--outcome-not-fit);
  color: var(--outcome-not-fit);
  font-size: var(--text-size-body);
}

/* Fields + forms ---------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: var(--text-size-label);
  font-weight: var(--weight-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-label);
}
.field input {
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus {
  outline: none;
  border-color: var(--brand-accent);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--weight-action);
  cursor: pointer;
}
/* Primary action → brand orange gradient + glow. */
.btn-primary {
  background: var(--brand-gradient);
  color: var(--on-brand);
  box-shadow: var(--brand-glow);
}
/* Low-emphasis text link (Log out). */
.btn-link {
  background: none;
  padding: 6px 4px;
  border-radius: 0;
  color: var(--brand-accent);
  font-weight: 500;
  text-decoration: underline;
}
/* Neutral low-emphasis button (e.g. modal "Cancel"). Inset, quiet. */
.btn-subtle {
  background: var(--surface-inset);
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
}
.btn-subtle:hover { color: var(--text-primary); border-color: var(--text-muted); }
/* Destructive action button (e.g. modal "Remove") — red, so its weight matches
   the consequence. Reuses the "not fit" red already used for errors. */
.btn-danger {
  background: var(--outcome-not-fit);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.06); }

.inline { display: inline; margin: 0; }

/* Auth pages (login / signup): a centred card ----------------------------- */

.authwrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-title { margin: 2px 0 18px; font-size: 22px; font-weight: var(--weight-heading); }
.auth-alt {
  margin: 18px 0 0;
  font-size: var(--text-size-body);
  color: var(--text-muted);
}
.auth-alt a { color: var(--brand-accent); }

/* =========================================================================
 * Dashboard — sidebar shell (matches the approved dashboard mock)
 * =========================================================================
 * Layout: a fixed 248px left rail (brand + nav + user) beside a scrolling
 * main column. The main column holds four *views* (Knowledge Base, Source
 * Material, Sales Methodology, Reps); exactly one is visible at a time, swapped
 * client-side by the little script in dashboard.html (no build step, no router
 * — the whole dashboard is one server-rendered page). See ADR-0007.
 */

/* The two-column shell. Fills the viewport; each column scrolls on its own. */
.shell { display: flex; min-height: 100vh; }

/* ---- Left rail ---------------------------------------------------------- */

.sidebar {
  width: 248px;
  flex: none; /* never shrink the rail; the main column absorbs width changes */
  background: var(--surface-sidebar);
  border-right: 1px solid var(--border-panel);
  display: flex;
  flex-direction: column;
  position: sticky; /* rail stays put while the main column scrolls */
  top: 0;
  height: 100vh;
}

/* Brand block: logo mark + wordmark + the Team name (from the Team row). */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-panel);
}
.sidebar-brand .brand-mark { flex: none; }
.brand-name {
  font-size: 14px;
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
}
.brand-team { font-size: 11.5px; color: var(--text-muted); }

/* Nav list. Fills the space between brand and user footer, scrolls if long. */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  overflow-y: auto;
}

/* A nav item is a <button> (it toggles a view via JS, so not an <a href>).
 * Reset the button chrome and lay out icon + label in a row. Icons inherit
 * `currentColor` via stroke, so colouring the item colours its glyph too. */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-label);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: var(--weight-eyebrow);
  text-align: left;
  cursor: pointer;
}
.nav-item svg { flex: none; stroke: currentColor; }
.nav-item:hover { color: var(--text-secondary); }
/* Active item: raised pill + full-strength ink (and glyph). */
.nav-item.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
}

/* "Coming soon" group label + its disabled, non-interactive rows. */
.nav-group-label {
  margin: 18px 0 8px;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}
.nav-item.is-disabled {
  color: var(--text-faint);
  font-weight: 500;
  cursor: default;
}
.nav-item.is-disabled:hover { color: var(--text-faint); }
.nav-item .nav-spacer { flex: 1; } /* pushes the "Soon" chip to the right */
.nav-soon {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  font-size: 9.5px;
  font-weight: var(--weight-action);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* User footer: avatar (Manager initials) + name/role + a logout icon button. */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-panel);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-white);
  font-size: 12.5px;
  font-weight: var(--weight-action);
}
.sidebar-user-meta { flex: 1; min-width: 0; } /* min-width:0 lets text ellipsize */
.sidebar-user-name,
.sidebar-user-role {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }
/* Icon-only button (logout). It submits the POST /logout form. */
.icon-btn {
  display: flex;
  padding: 4px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text-secondary); }

/* ---- Main column + views ------------------------------------------------ */

.main { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }

/* A view is a centred, padded column. Hidden by default; the active one is
 * revealed by `.is-active` (toggled from the sidebar). */
.view {
  display: none;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 48px;
  flex-direction: column;
  gap: 26px;
}
.view.is-active { display: flex; }

/* View header: title + sub, with room for a right-aligned action/search. */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.view-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
}
.view-sub { margin: 0; font-size: 13.5px; color: var(--text-label); }

/* ---- Shared dashboard widgets ------------------------------------------- */

/* Secondary pill button (e.g. "Re-run Gap-Filling Session"): raised, outlined,
 * with an accent glyph. Distinct from the orange .btn-primary. */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 11px 20px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: var(--weight-eyebrow);
  cursor: pointer;
}
.pill-btn svg { stroke: var(--brand-accent); }

/* A rounded panel card (the mock's #1b1f28 blocks). */
.card-block {
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 16px;
  padding: 20px;
}

/* Status / attention badges. */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: var(--weight-action);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-good {
  background: rgba(22, 163, 74, 0.12);
  color: #5fce8a;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.badge-warn {
  background: rgba(201, 58, 58, 0.12);
  color: #e07272;
  border: 1px solid rgba(201, 58, 58, 0.3);
}

/* Muted empty-state block shown where a future slice will render real data. */
.empty-state {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 32px;
  border: 1.5px dashed var(--border-panel);
  border-radius: 16px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state strong { color: var(--text-secondary); font-weight: 600; }

/* ---- Knowledge Base view ------------------------------------------------ */

.kb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kb-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 16px;
  padding: 20px;
}
.kb-card-head { display: flex; align-items: center; justify-content: space-between; }
.kb-card-title { font-size: 14.5px; font-weight: 700; }
.kb-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.kb-bullet {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--text-muted);
}

/* ---- Sales Methodology view --------------------------------------------- */

/* Highlighted "currently active" banner card. */
.methodology-active {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.methodology-icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 16px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--brand-glow);
}
.methodology-eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-label);
}
.methodology-name { font-size: 19px; font-weight: var(--weight-heading); }
.methodology-desc { margin-top: 2px; font-size: 13px; color: var(--text-label); }

.methodology-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.methodology-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
}
/* The framework the Team is currently on gets a brand outline + glow. */
.methodology-card.is-selected {
  border-color: var(--brand-accent);
  box-shadow: var(--brand-glow);
}
.methodology-card-head { display: flex; align-items: center; justify-content: space-between; }
.methodology-card-name { font-size: 16px; font-weight: var(--weight-heading); }
.methodology-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}
.methodology-acronym {
  font-size: 11px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-label);
}
.methodology-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-label); }

/* ---- Reps view (the one wired to live data) ----------------------------- */

/* Search box with a leading magnifier icon. */
.search {
  position: relative;
  flex: none;
  max-width: 260px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--text-muted);
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--brand-accent); }

/* The Reps table: a bordered block with a header row, one row per Rep, and a
 * trailing "add rep" row. Columns are a fixed grid so rows align. */
.rep-table {
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 16px;
  overflow: hidden;
}
.rep-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 100px auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-panel);
}
.rep-row:last-child { border-bottom: none; }
/* Column headings. */
.rep-row.rep-head { padding: 12px 20px; }
.rep-row.rep-head span {
  font-size: 10.5px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.rep-cell-name { font-size: 14px; font-weight: 600; }
.rep-cell-email { font-size: 13.5px; color: var(--text-label); }
/* Status pill (Reps we've created have a password set → they can log in). */
.status-pill {
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--weight-action);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(22, 163, 74, 0.12);
  color: #5fce8a;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.rep-remove {
  justify-self: end;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.rep-remove:hover { color: var(--outcome-not-fit); }

/* The add-Rep row reuses the table grid. Its inputs are inset fields; the
 * backend still requires a temporary password, so unlike the mock's invite
 * flow we keep a password field before the submit button. */
.rep-add {
  display: grid;
  /* Password column was a fixed 100px, too narrow to read its "Temp password"
     placeholder (and now it also holds the show/hide eye). Give it a flexible
     column with a sensible floor so the placeholder always fits. */
  grid-template-columns: 1.3fr 1.5fr minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}
.rep-add input {
  padding: 9px 11px;
  background: var(--surface-inset);
  border: 1px solid var(--border-panel);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
}
.rep-add input::placeholder { color: var(--text-muted); }
.rep-add input:focus { outline: none; border-color: var(--brand-accent); }
.rep-add .btn { padding: 9px 18px; white-space: nowrap; }

/* Password cell: the input fills the grid column and the eye toggle sits inside
   it on the right (absolute), so it doesn't consume its own grid track. */
.rep-pw { position: relative; display: flex; }
.rep-pw input {
  width: 100%;
  /* Room on the right so the typed text never slides under the eye button. */
  padding-right: 38px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--text-primary); }
/* Focus-visible ring so the toggle is keyboard-reachable, matching input focus. */
.pw-toggle:focus-visible { outline: none; color: var(--brand-accent); }
/* Show exactly one eye at a time. The global `[hidden]` UA rule is overridden by
   an earlier `svg { … }` rule, so respect `hidden` explicitly here (JS toggles
   the .hidden property, which reflects to this attribute). */
.pw-toggle svg { display: block; }
.pw-toggle svg[hidden] { display: none; }

.rep-note { margin: 0; font-size: 12.5px; color: var(--text-muted); }

/* ---- Source Material view (issue #9, ADR-0006) -------------------------- */
/* Three input methods (paste / file / URL) converge to text; items are listed
 * (never previewed) as a card grid; a capacity meter bounds the total text —
 * the upstream lever on KB → cached-prompt size. A derived-KB status panel sits
 * above the uploaded files (the KB is derived from them, ADR-0006). */

/* Derived Knowledge Base panel — above the uploaded files. */
.sm-kb-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 16px;
}
.sm-kb-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--brand-glow);
}
.sm-kb-body { flex: 1; min-width: 0; }
.sm-kb-eyebrow {
  font-size: 11px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-label);
}
.sm-kb-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.sm-kb-sub { margin: 0; font-size: 12.5px; color: var(--text-muted); }

/* Add-source panel: segmented tabs + one visible mini-form. */
.sm-add { padding: 0; overflow: hidden; }
.sm-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border-panel);
}
.sm-tab {
  padding: 9px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--weight-eyebrow);
  cursor: pointer;
}
.sm-tab:hover { color: var(--text-secondary); }
/* Active tab: brand underline + full-strength ink. */
.sm-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--brand-accent);
}

/* Each mini-form is hidden until its tab is active. */
.sm-panel { display: none; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.sm-panel.is-active { display: flex; }

/* Shared inset text inputs for the add forms. */
.sm-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
}
.sm-input::placeholder { color: var(--text-muted); }
.sm-input:focus { outline: none; border-color: var(--brand-accent); }
.sm-textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.sm-hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.sm-actions { display: flex; justify-content: flex-end; }

/* File "drop zone" — a dashed label wrapping the (hidden-ish) file input. */
.sm-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px;
  border: 1.5px dashed var(--border-input);
  border-radius: var(--radius-field);
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
}
.sm-drop:hover { border-color: var(--brand-accent); color: var(--text-secondary); }
.sm-drop svg { stroke: var(--brand-accent); }
.sm-drop-label { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.sm-drop-hint { font-size: 11.5px; }
/* Native file input stays in the form (so its file submits) but is hidden — the
   .sm-file-btn pill below is the visible control that proxies a click to it. */
.sm-drop input[type="file"] { display: none; }

/* While a file is dragged over the drop zone: brand-orange dashed border + a
   faint orange wash so it reads as "release to drop". Toggled by JS (.is-dragover). */
.sm-drop.is-dragover {
  border-color: var(--brand-accent);
  color: var(--text-secondary);
  background: rgba(255, 138, 61, 0.08); /* faint tint of --c-orange-accent */
}

/* Modern rounded "Add files" picker button (paperclip). Neutral inset pill so it
   doesn't compete with the primary orange submit buttons on the other panels. */
.sm-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  background: var(--surface-inset);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: var(--weight-action);
  cursor: pointer;
}
.sm-file-btn:hover { border-color: var(--brand-accent); color: var(--text-primary); }
/* The paperclip inherits the button ink (not the drop zone's orange svg rule). */
.sm-file-btn svg { stroke: currentColor; }

/* Inline guardrail message shown when an add is blocked (allowance already met). */
.sm-guard { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: #e07272; }

/* List header: "Uploaded files" title on the left, capacity meter on the right. */
.sm-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

/* Capacity meter (the "data allowance bar"). */
.sm-meter { width: 260px; flex: none; }
.sm-meter-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sm-meter-label {
  font-size: 10.5px;
  font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.sm-meter-value { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.sm-meter-value.is-warn { color: #e07272; }
.sm-meter-track {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-inset);
  border: 1px solid var(--border-panel);
  overflow: hidden;
}
/* The fill's width is set inline from used_percent, so it animates as the Team
 * adds/removes material. Orange normally, red as it nears the cap. */
.sm-meter-fill {
  height: 100%;
  /* Width is data-driven: the template feeds the used-percent through the
     --fill custom property (see dashboard.html), and it defaults to 0% when
     unset. Living here (rather than in an inline `width`) keeps the bar's
     whole appearance in one place and avoids the editor CSS linter choking on
     Jinja `{{ }}` inside an inline style value. */
  width: var(--fill, 0%);
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  transition: width 0.25s ease;
}
.sm-meter-fill.is-warn { background: linear-gradient(135deg, #e07272, var(--outcome-not-fit)); }

/* Uploaded-files card grid. Each card: kind icon, name + meta, remove button. */
.sm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.sm-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: 14px;
  /* Smoothly pick up the hover glow below rather than snapping. */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Hover: brand-orange edge + soft glow (same tokens as the primary buttons), so
   an uploaded-file card reads as interactive and on-brand. */
.sm-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--brand-glow);
}

/* Delete confirmation modal (native <dialog>). Small and discrete: a compact
   centred card on a dimmed backdrop, styled with the same surface/border tokens
   as the rest of the app. `<dialog>` centres itself and traps focus for us. */
.confirm-modal {
  width: min(320px, calc(100vw - 40px));
  padding: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-field);
  color: var(--text-primary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
/* The dimmed page behind the modal. */
.confirm-modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.confirm-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.confirm-text { margin: 0 0 16px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
/* Right-aligned Cancel / Remove row. */
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Slightly tighter buttons than the page default — this is a compact dialog. */
.confirm-actions .btn { padding: 8px 14px; font-size: 13px; }
.sm-card-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-inset);
  border: 1px solid var(--border-panel);
  color: var(--text-secondary);
}
/* Tint the icon by kind so the three input types read at a glance. */
.sm-card-icon.sm-kind-file { color: var(--brand-accent); }
.sm-card-icon.sm-kind-url { color: var(--ai-accent); }
.sm-card-icon.sm-kind-paste { color: var(--text-secondary); }
.sm-card-body { flex: 1; min-width: 0; }
.sm-card-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-card-meta { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.sm-remove {
  flex: none;
  padding: 4px;
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.sm-remove:hover { color: var(--outcome-not-fit); }
