/* ==========================================================================
   SERVICEplus — design system
   SERVICEplus is the Service Desk module of the IMSplus ecosystem, so this
   shares IMSplus's own visual language rather than inventing a separate
   one: deep navy as the primary brand color (nav, buttons, headings), a
   violet/purple accent reserved for identity — avatars, the profile card,
   role badges — plus the same green/amber/red status vocabulary, small-caps
   eyebrow labels, pill badges, and rounded (12-16px) surfaces. Bootstrap's
   grid/utilities/components still do the layout work — this file restyles
   their look, not their structure, so every existing page inherits it
   without being rewritten.
   ========================================================================== */

:root {
  --sp-bg: #F1F3F8;
  --sp-surface: #FFFFFF;
  --sp-border: #E6E9F0;
  --sp-text: #1A2233;
  --sp-muted: #6B7280;

  /* Primary = IMSplus navy (nav, buttons, headings, links). */
  --sp-primary: #1B3868;
  --sp-primary-dark: #122A52;
  --sp-primary-tint: #E7ECF6;
  --sp-gradient-start: #3E62A6;
  --sp-gradient-end: #122A52;

  /* Accent = IMSplus violet (avatars, identity/profile, "admin" pills). */
  --sp-accent: #6D3FA8;
  --sp-accent-dark: #4B2680;
  --sp-accent-gradient-start: #7C4DBE;
  --sp-accent-gradient-end: #4B2680;

  --sp-radius-lg: 20px;
  --sp-radius-md: 14px;
  --sp-radius-sm: 10px;
  --sp-shadow-sm: 0 1px 2px rgba(26, 34, 51, 0.06), 0 1px 8px rgba(26, 34, 51, 0.04);
  --sp-shadow-md: 0 10px 30px rgba(26, 34, 51, 0.10);

  --sp-violet: #6D3FA8;    --sp-violet-bg: #EDE7F8;
  --sp-blue: #3B82F6;      --sp-blue-bg: #E7F1FF;
  --sp-green: #16A34A;     --sp-green-bg: #DCFCE7;
  --sp-amber: #D97706;     --sp-amber-bg: #FEF3C7;
  --sp-red: #DC2626;       --sp-red-bg: #FEE2E2;
  --sp-pink: #EC4899;      --sp-pink-bg: #FDEAF3;
  --sp-teal: #0EA5A5;      --sp-teal-bg: #E3FAF7;
}

/* ---- Base ---- */

body {
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }

a { color: var(--sp-primary-dark); }
a:hover { color: var(--sp-primary); }

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

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

.btn-primary {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--sp-primary-dark);
  border-color: var(--sp-primary-dark);
}
.btn-outline-primary {
  color: var(--sp-primary-dark);
  border-color: var(--sp-primary);
}
.btn-outline-primary:hover {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
}
.btn, .form-control, .form-select, .card, .alert, .badge {
  border-radius: var(--sp-radius-sm);
}
/* Bootstrap's nav-pills default to its own blue, independent of --sp-primary
   — override so the admin sub-nav stays on-brand. */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  background-color: var(--sp-primary);
  color: #fff;
}
.nav-pills .nav-link { color: var(--sp-primary-dark); }

/* A handful of other Bootstrap defaults key off its own blue rather than
   --sp-primary — bring them on-brand too so no control on the page reverts
   to a different "system" blue. */
.form-control:focus, .form-select:focus {
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 0.2rem rgba(27, 56, 104, 0.15);
}
.form-check-input:checked {
  background-color: var(--sp-primary);
  border-color: var(--sp-primary);
}
.form-check-input:focus {
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 0.2rem rgba(27, 56, 104, 0.15);
}
.page-link { color: var(--sp-primary-dark); }
.page-item.active .page-link { background-color: var(--sp-primary); border-color: var(--sp-primary); }
.spinner-border.text-primary { color: var(--sp-primary) !important; }

/* ---- Cards ---- */

.card {
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  box-shadow: var(--sp-shadow-sm);
}
.card-header {
  border-radius: var(--sp-radius-md) var(--sp-radius-md) 0 0 !important;
  border-bottom: 1px solid var(--sp-border);
}

/* ---- Tables ---- */

.table thead th {
  color: var(--sp-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom-width: 1px;
}

/* ---- Badges (status pills) ---- */

.badge { font-weight: 600; letter-spacing: 0.01em; }
.badge-tier-1 { background-color: var(--sp-blue-bg); color: var(--sp-blue); }
.badge-tier-2 { background-color: var(--sp-amber-bg); color: var(--sp-amber); }
.badge-tier-3 { background-color: var(--sp-pink-bg); color: var(--sp-pink); }

/* ---- App shell: sticky top nav + contextual sidebar ----
   Two levels, and they answer different questions. The TOP NAV says which part
   of DocPlus you are in; it is sticky, full width, and never scrolls away. The
   SIDEBAR says where you are inside that part, and carries nothing else — so a
   category with no sub-pages renders no sidebar and the content takes the whole
   width, which is what the Dashboard tiles and the workflow canvas want. */

:root { --sp-topnav-h: 56px; }

.sp-topnav {
  position: sticky;
  top: 0;
  z-index: 1060;
  background: var(--sp-surface);
  border-bottom: 1px solid var(--sp-border);
  transition: box-shadow 0.15s ease;
}
.sp-topnav.is-scrolled { box-shadow: var(--sp-shadow-sm); }
.sp-topnav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--sp-topnav-h);
  padding: 0 1.1rem;
}
.sp-topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--sp-primary-dark) !important;
  text-decoration: none;
  flex-shrink: 0;
}
.sp-topnav-brand .sp-icon { color: var(--sp-primary); }

.sp-topnav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sp-topnav-links::-webkit-scrollbar { display: none; }

.sp-topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  padding: 0.45rem 0.7rem;
  border-radius: var(--sp-radius-sm);
  color: var(--sp-muted);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  position: relative;
}
.sp-topnav-link .sp-icon { flex-shrink: 0; width: 17px; height: 17px; }
.sp-topnav-link:hover { background: var(--sp-bg); color: var(--sp-text); }
/* The active category is marked with a tint rather than an underline: the
   category strip scrolls sideways on a narrow screen, and anything drawn
   outside the link's own box gets clipped by that scroll container. */
.sp-topnav-link.active {
  color: var(--sp-primary-dark);
  background: var(--sp-primary-tint);
}
.sp-topnav-link.is-admin { color: var(--sp-violet); }
.sp-topnav-link.is-admin:hover { background: var(--sp-violet-bg); }
.sp-topnav-link.is-admin.active { color: var(--sp-violet); background: var(--sp-violet-bg); }
.sp-topnav-link .sp-notif-dot { top: 4px; right: 2px; }

.sp-topnav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  margin-left: auto;
}

.sp-shell { display: flex; align-items: flex-start; min-height: calc(100vh - var(--sp-topnav-h)); }

.sp-sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--sp-surface);
  border-right: 1px solid var(--sp-border);
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0.7rem;
  position: sticky;
  top: var(--sp-topnav-h);
  height: calc(100vh - var(--sp-topnav-h));
  overflow-y: auto;
}
.sp-sidebar-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sp-primary-dark);
  padding: 0.2rem 0.6rem 0.7rem;
}
.sp-sidebar-heading .sp-icon { width: 16px; height: 16px; color: var(--sp-primary); }
.sp-sidebar-section { margin-top: 0; }
.sp-sidebar-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sp-muted);
  font-weight: 700;
  padding: 0 0.6rem;
  margin: 0.9rem 0 0.3rem;
}
.sp-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--sp-radius-sm);
  color: var(--sp-text);
  font-weight: 500;
  font-size: 0.86rem;
  text-decoration: none;
  position: relative;
}
.sp-sidebar-link:hover { background: var(--sp-bg); color: var(--sp-text); }
.sp-sidebar-link.active {
  background: var(--sp-primary-tint);
  color: var(--sp-primary-dark);
  font-weight: 600;
}
.sp-sidebar-link .sp-icon { flex-shrink: 0; width: 17px; height: 17px; }
.sp-sidebar-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-sidebar-link .sp-notif-dot { top: 6px; right: 6px; }

.sp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-self: stretch; }

.sp-topbar-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--sp-text);
  padding: 0.3rem;
  border-radius: var(--sp-radius-sm);
}
.sp-admin-banner {
  background: var(--sp-violet-bg);
  color: var(--sp-violet);
  padding: 0.45rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sp-content { padding: 1.5rem; flex: 1; }
.sp-shell-wide .sp-content { padding: 1rem 1.1rem; }

/* Below ~992px the sub-nav becomes a drawer; the top nav stays, scrolling
   sideways, because knowing which part of DocPlus you are in matters more on a
   small screen than on a large one. */
@media (max-width: 991.98px) {
  .sp-topnav-link span { display: none; }
  .sp-topnav-link { padding: 0.45rem 0.55rem; }
  .sp-topnav-link .sp-icon { width: 19px; height: 19px; }
  .sp-sidebar {
    position: fixed;
    left: -240px;
    top: var(--sp-topnav-h);
    z-index: 1050;
    box-shadow: var(--sp-shadow-md);
    transition: left 0.18s ease;
  }
  body.sp-sidebar-open .sp-sidebar { left: 0; }
  body.sp-sidebar-open::after {
    content: "";
    position: fixed;
    inset: var(--sp-topnav-h) 0 0 0;
    background: rgba(33, 31, 46, 0.35);
    z-index: 1040;
  }
  .sp-topbar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sp-content { padding: 1.1rem; }
}

.sp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--sp-primary-dark) !important;
  letter-spacing: -0.01em;
}
/* IMSplus's own wordmark lockup — a small diamond glyph, no box — reused
   here rather than a boxed "S+" mark, so the two apps read as one suite. */
.sp-wordmark-glyph {
  color: var(--sp-primary);
  font-size: 1.1rem;
  line-height: 1;
}
.sp-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--sp-primary-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-primary);
  font-weight: 800;
  font-size: 0.95rem;
}
.sp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-text);
  background: var(--sp-bg);
  position: relative;
}
.sp-icon-btn:hover { background: var(--sp-primary-tint); color: var(--sp-primary-dark); }
.sp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sp-accent-gradient-start), var(--sp-accent-gradient-end));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
/* Small role/identity pill next to the avatar (mirrors IMSplus's "Entity
   Admin" tag in its top bar). */
.sp-role-pill {
  background: var(--sp-violet-bg);
  color: var(--sp-violet);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.sp-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid var(--sp-surface);
}

/* ---- Dashboard search (compact header) ---- */

.sp-dash-search {
  max-width: 480px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--sp-shadow-sm);
}
.sp-dash-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.95rem;
  background: transparent;
}
.sp-dash-search button {
  border: none;
  background: var(--sp-primary);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Profile card (dashboard) — mirrors IMSplus's own "Home" card:
   a violet gradient banner, avatar, name/role/dept, identity pill. ---- */

.sp-profile-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  overflow: hidden;
  box-shadow: var(--sp-shadow-sm);
}
.sp-profile-banner {
  height: 56px;
  background: linear-gradient(120deg, var(--sp-accent-gradient-start) 0%, var(--sp-accent-gradient-end) 100%);
}
.sp-profile-body { padding: 0 1.25rem 1.25rem; margin-top: -32px; }
.sp-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sp-accent-gradient-start), var(--sp-accent-gradient-end));
  color: #fff;
  border: 3px solid var(--sp-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}
.sp-profile-name { font-weight: 700; font-size: 1.05rem; }
.sp-profile-meta { color: var(--sp-muted); font-size: 0.85rem; }
.sp-identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--sp-green-bg);
  color: var(--sp-green);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

/* ---- Eyebrow labels + stat blocks (big-number KPI tiles, IMSplus style) ---- */

.sp-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sp-muted);
  font-weight: 700;
}
.sp-stat-block {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--sp-shadow-sm);
  height: 100%;
}
.sp-stat-block .sp-stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--sp-text);
  line-height: 1.15;
  margin-bottom: 0.25rem;
}
.sp-stat-block.is-danger .sp-stat-value { color: var(--sp-red); }
.sp-stat-block.is-warning .sp-stat-value { color: var(--sp-amber); }

/* ---- Upcoming Deadlines widget (dashboard) — same visual family as the
   full Calendar page's "engagements" list, so the two feel like one
   feature rather than two unrelated screens. ---- */

.sp-deadline-card {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-radius: var(--sp-radius-sm);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: var(--sp-text);
}
.sp-deadline-card:last-child { margin-bottom: 0; }
.sp-deadline-card:hover { filter: brightness(0.98); }
.sp-deadline-date {
  flex-shrink: 0;
  width: 46px;
  text-align: center;
}
.sp-deadline-date .d { font-size: 1.15rem; font-weight: 800; line-height: 1.1; display: block; }
.sp-deadline-date .m { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sp-deadline-card.is-breached { background: var(--sp-red-bg); }
.sp-deadline-card.is-breached .sp-deadline-date { color: var(--sp-red); }
.sp-deadline-card.is-soon { background: var(--sp-amber-bg); }
.sp-deadline-card.is-soon .sp-deadline-date { color: var(--sp-amber); }
.sp-deadline-card.is-upcoming { background: var(--sp-blue-bg); }
.sp-deadline-card.is-upcoming .sp-deadline-date { color: var(--sp-blue); }
.sp-deadline-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sp-deadline-card.is-breached .sp-deadline-tag { color: var(--sp-red); }
.sp-deadline-card.is-soon .sp-deadline-tag { color: var(--sp-amber); }
.sp-deadline-card.is-upcoming .sp-deadline-tag { color: var(--sp-blue); }
.sp-deadline-card > span:last-child { min-width: 0; flex: 1 1 auto; }
.sp-deadline-title { font-weight: 700; font-size: 0.9rem; color: var(--sp-text); overflow-wrap: break-word; }
.sp-deadline-sub { color: var(--sp-muted); font-size: 0.78rem; overflow-wrap: break-word; }

/* ---- Team Workload (dashboard, agent/admin) ---- */

.sp-workload-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.6rem 0; border-bottom: 1px solid var(--sp-border); }
.sp-workload-row:last-child { border-bottom: none; }
.sp-workload-row .flex-grow-1 { min-width: 0; }
.sp-workload-row .fw-semibold { overflow-wrap: break-word; }
.sp-workload-bar-track { flex: 1; height: 6px; border-radius: 999px; background: var(--sp-bg); overflow: hidden; }
.sp-workload-bar-fill { height: 100%; border-radius: 999px; }

/* ---- Service tiles (dashboard quick actions) ---- */

.sp-tile {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 1.1rem;
  text-decoration: none;
  color: var(--sp-text);
  height: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.sp-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sp-shadow-md);
  border-color: transparent;
  color: var(--sp-text);
}
.sp-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* The text column is a flex item too (its parent .sp-tile is a flex row) —
   without min-width:0 a flex item's floor is its content's natural width,
   so long titles/descriptions push past the card edge instead of wrapping.
   Matches whichever element is last (a div wrapping the title/desc, in
   practice), not just span, so a block-level text column still gets it. */
.sp-tile > *:last-child { min-width: 0; flex: 1 1 auto; }
.sp-tile-title { font-weight: 700; margin-bottom: 0.15rem; overflow-wrap: break-word; }
.sp-tile-desc { color: var(--sp-muted); font-size: 0.85rem; line-height: 1.35; overflow-wrap: break-word; }

.sp-accent-violet .sp-tile-icon { background: var(--sp-violet-bg); color: var(--sp-violet); }
.sp-accent-blue   .sp-tile-icon { background: var(--sp-blue-bg);   color: var(--sp-blue); }
.sp-accent-green  .sp-tile-icon { background: var(--sp-green-bg); color: var(--sp-green); }
.sp-accent-amber  .sp-tile-icon { background: var(--sp-amber-bg); color: var(--sp-amber); }
.sp-accent-pink   .sp-tile-icon { background: var(--sp-pink-bg);  color: var(--sp-pink); }
.sp-accent-teal   .sp-tile-icon { background: var(--sp-teal-bg);  color: var(--sp-teal); }

/* ---- Workflow-kind chooser (public/workflows/new.php) ---- */
.wfk-choice-card {
  display: block;
  height: 100%;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--sp-text);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.wfk-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sp-shadow-md);
  border-color: var(--sp-primary);
  color: var(--sp-text);
}
.wfk-choice-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.wfk-choice-icon-blue   { background: var(--sp-blue-bg);   color: var(--sp-blue); }
.wfk-choice-icon-violet { background: var(--sp-violet-bg); color: var(--sp-violet); }
.wfk-choice-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.wfk-choice-desc { color: var(--sp-muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 0.75rem; }
.wfk-choice-examples { color: var(--sp-muted); font-size: 0.78rem; font-style: italic; margin-bottom: 0; }

/* ---- Stat tiles ---- */

.sp-stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Misc ---- */

.sp-icon { display: inline-block; vertical-align: -4px; }
.sp-icon-flip { transform: scaleX(-1); }
.timeline-item { border-left: 2px solid var(--sp-border); padding-left: 1rem; margin-left: 0.25rem; padding-bottom: 1rem; }
.timeline-item:last-child { padding-bottom: 0; }
table.admin-table td { vertical-align: middle; }

.sp-section-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--sp-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---- Login / MFA — split screen, matching IMSplus's own sign-in page ---- */
.sp-login-shell {
  min-height: 100vh;
  display: flex;
}
.sp-login-side {
  flex: 1.1;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 10%, var(--sp-gradient-start), var(--sp-gradient-end) 65%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sp-login-side .sp-wordmark-glyph, .sp-login-side .sp-brand { color: #fff !important; }
.sp-login-side h1 { font-weight: 800; font-size: 2.2rem; line-height: 1.15; margin: 1.75rem 0 0.9rem; }
.sp-login-side p { color: rgba(255,255,255,0.78); max-width: 420px; font-size: 0.98rem; }
.sp-login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--sp-surface);
}
.sp-login-card { width: 100%; max-width: 400px; }
.sp-login-card .form-control {
  background: var(--sp-primary-tint);
  border: 1px solid transparent;
}
.sp-login-card .form-control:focus {
  background: var(--sp-surface);
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 0.2rem rgba(27, 56, 104, 0.12);
}
/* Narrow screens: stack the two halves instead of side-by-side. */
@media (max-width: 860px) {
  .sp-login-shell { flex-direction: column; }
  .sp-login-side { min-height: auto; padding: 2.5rem 1.75rem; }
  .sp-login-form-side { padding: 2.5rem 1.75rem; }
}

/* ---- Calendar page ---- */

.sp-cal-tabs {
  display: inline-flex;
  background: var(--sp-bg);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}
.sp-cal-tabs a {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sp-muted);
  text-decoration: none;
}
.sp-cal-tabs a.active { background: var(--sp-surface); color: var(--sp-text); box-shadow: var(--sp-shadow-sm); }

.sp-cal-month-label { font-weight: 700; font-size: 0.95rem; text-align: center; margin-bottom: 0.75rem; }
.sp-cal-grid { width: 100%; border-collapse: collapse; }
.sp-cal-grid th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sp-muted);
  font-weight: 700;
  padding-bottom: 0.4rem;
  text-align: center;
}
.sp-cal-grid td {
  text-align: center;
  vertical-align: top;
  padding: 0.35rem 0.15rem;
  font-size: 0.82rem;
  color: var(--sp-text);
  width: 14.28%;
}
.sp-cal-day { display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.sp-cal-day.is-today { background: var(--sp-primary-tint); border-radius: 8px; padding: 0.1rem 0.35rem; }
.sp-cal-dot-row { display: flex; align-items: center; gap: 0.2rem; font-size: 0.65rem; font-weight: 700; }
.sp-cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.sp-cal-dot.breached { background: var(--sp-red); color: var(--sp-red); }
.sp-cal-dot.soon { background: var(--sp-amber); color: var(--sp-amber); }
.sp-cal-dot.upcoming { background: var(--sp-blue); color: var(--sp-blue); }
.sp-cal-dot-row.breached { color: var(--sp-red); }
.sp-cal-dot-row.soon { color: var(--sp-amber); }
.sp-cal-dot-row.upcoming { color: var(--sp-blue); }
.sp-cal-dot.budget { background: var(--sp-violet); color: var(--sp-violet); }
.sp-cal-dot-row.budget { color: var(--sp-violet); }

.sp-status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 0.35rem; }

/* ==========================================================================
   DocPlus — import dropzone
   ========================================================================== */

.sp-dropzone {
  border: 2px dashed var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--sp-muted);
  background: var(--sp-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.sp-dropzone:hover, .sp-dropzone.is-dragover {
  border-color: var(--sp-primary);
  background: var(--sp-primary-tint);
}
.sp-dropzone-icon { color: var(--sp-primary); margin-bottom: 0.5rem; }
.sp-dropzone input[type="file"] { display: none; }
.sp-file-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--sp-primary-tint); color: var(--sp-primary-dark);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.8rem; font-weight: 600;
}

/* ==========================================================================
   DocPlus — Workflow Builder
   A fixed toolkit sidebar of draggable shapes on the left, a horizontally
   scrollable canvas on the right made of vertically-stacked swimlane rows.
   Each swimlane has a rotated vertical label on its left edge and a
   position:relative node-layer where nodes are placed with position:absolute
   (x/y persisted in canvas_state — see includes/workflow_engine.php).
   ========================================================================== */

.wfb-shell {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 520px;
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  background: var(--sp-surface);
  overflow: hidden;
}

.wfb-toolkit {
  flex: 0 0 168px;
  border-right: 1px solid var(--sp-border);
  padding: 0.9rem 0.7rem;
  overflow-y: auto;
  background: #FAFBFD;
}
.wfb-toolkit h6 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sp-muted); font-weight: 700; margin: 0.5rem 0.2rem 0.5rem; }
.wfb-palette-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem; margin-bottom: 0.4rem;
  border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm);
  background: var(--sp-surface); font-size: 0.8rem; font-weight: 600; color: var(--sp-text);
  cursor: grab; user-select: none;
}
.wfb-palette-item:active { cursor: grabbing; }
.wfb-palette-item:hover { border-color: var(--sp-primary); background: var(--sp-primary-tint); }
.wfb-palette-item .sp-icon { flex: 0 0 auto; color: var(--sp-primary); }

.wfb-canvas-wrap {
  flex: 1 1 auto;
  overflow: auto;
  position: relative;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px) 0 0 / 24px 24px;
}

.wfb-canvas {
  position: relative;
  min-width: 1600px;
  width: max-content;
}

.wfb-swimlane {
  display: flex;
  border-bottom: 1px solid var(--sp-border);
  min-height: 160px;
}
.wfb-swimlane:last-child { border-bottom: none; }

.wfb-swimlane-label {
  /* Wider than it used to be, and horizontal rather than sideways text: a lane
     now carries a role picked from the organisation chart, and a 40px vertical
     strip has nowhere to put a select. */
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px 22px;
  background: var(--sp-primary-tint);
  border-right: 1px solid var(--sp-border);
  position: sticky;
  left: 0;
  z-index: 2;
}
.wfb-swimlane-label span {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--sp-primary-dark);
  letter-spacing: 0.02em;
  line-height: 1.25;
  word-break: break-word;
}
.wfb-swimlane-role {
  font-size: 0.74rem !important;
  padding: 2px 6px !important;
}
/* A lane with no role yet routes to nobody — say so before it is saved. */
.wfb-lane-unassigned .wfb-swimlane-label {
  background: var(--sp-amber-bg);
}
.wfb-lane-unassigned .wfb-swimlane-label span {
  color: var(--sp-amber);
}
.wfb-swimlane-remove {
  position: absolute; bottom: 4px; left: 10px;
  background: none; border: none; color: var(--sp-red); font-size: 0.7rem; cursor: pointer; padding: 0;
}

.wfb-node-layer {
  position: relative;
  flex: 1 1 auto;
  min-width: 1500px;
}

.wfb-lane-resize {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  cursor: ns-resize; z-index: 5;
}
.wfb-lane-resize::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 44px; height: 4px;
  background: var(--sp-border); border-radius: 2px; transform: translateX(-50%);
}
.wfb-lane-resize:hover::after { background: var(--sp-primary); }
body.wfb-resizing { cursor: ns-resize; user-select: none; }
body.wfb-resizing .wfb-node-layer { cursor: ns-resize; }

.wfb-node {
  position: absolute;
  min-width: 130px;
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--sp-primary);
  border-radius: var(--sp-radius-sm);
  background: var(--sp-surface);
  box-shadow: var(--sp-shadow-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sp-text);
  cursor: move;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 3;
}
.wfb-node.is-selected { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
.wfb-node .sp-icon { flex: 0 0 auto; color: var(--sp-primary); }
.wfb-node-label { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; background: transparent; border: none; font: inherit; color: inherit; width: 100%; cursor: pointer; }
.wfb-node-label:read-only { cursor: pointer; }
.wfb-node-label:not(:read-only) { cursor: text; }
.wfb-node-label:focus { outline: none; background: var(--sp-primary-tint); border-radius: 4px; }
.wfb-node-delete {
  position: absolute; top: -9px; right: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sp-red); color: #fff; border: none;
  font-size: 0.65rem; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.wfb-node:hover .wfb-node-delete, .wfb-node.is-selected .wfb-node-delete { display: flex; }

/* Shape accents per node type — each is drawn as the actual flowchart
   symbol for that step (a diamond for a decision, a parallelogram for
   data, and so on) rather than a uniform box with a different icon, so the
   diagram reads correctly at a glance the way a hand-drawn flowchart would.
   jsPlumb's connector anchors (Top/Left/Right/Bottom) attach to the
   element's rectangular bounding box regardless of clip-path, which is why
   each polygon below is drawn to meet the box edges at those same
   midpoints — the connector still lands exactly on the shape's visible
   corner. */

/* Process: the default rectangle (.wfb-node's own base styling) — no override needed. */

/* Decision: a true diamond. Needs more room than a rectangle for the same
   text, so it gets a larger minimum footprint and generous padding to keep
   the label clear of the diamond's slanted edges. */
.wfb-node[data-node-type="decision"] {
  min-width: 170px;
  min-height: 108px;
  padding: 1.5rem 2.3rem;
  border-radius: 0;
  clip-path: polygon(50% 2%, 98% 50%, 50% 98%, 2% 50%);
  background: var(--sp-amber-bg);
  border-color: var(--sp-amber);
  justify-content: center;
  text-align: center;
}
.wfb-node[data-node-type="decision"] .sp-icon { color: var(--sp-amber); }

/* Start/End: the standard stadium/pill (terminator) shape. */
.wfb-node[data-node-type="start_end"] { border-radius: 999px; background: var(--sp-violet-bg); border-color: var(--sp-violet); justify-content: center; text-align: center; }
.wfb-node[data-node-type="start_end"] .sp-icon { color: var(--sp-violet); }

/* Document: a rectangle with the classic wavy/notched bottom edge. */
.wfb-node[data-node-type="document"] {
  border-radius: 0;
  padding-bottom: 0.9rem;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 86%,
    87% 95%, 75% 86%, 62% 95%, 50% 86%, 37% 95%, 25% 86%, 12% 95%, 0% 86%
  );
  background: var(--sp-teal-bg);
  border-color: var(--sp-teal);
}
.wfb-node[data-node-type="document"] .sp-icon { color: var(--sp-teal); }

/* Sub-Process: the "predefined process" symbol — a plain rectangle with an
   extra vertical bar just inside each side. */
.wfb-node[data-node-type="sub_process"] {
  border-color: var(--sp-primary-dark, var(--sp-primary));
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}
.wfb-node[data-node-type="sub_process"]::before,
.wfb-node[data-node-type="sub_process"]::after {
  content: ''; position: absolute; top: 4px; bottom: 4px; width: 3px;
  background: var(--sp-primary-dark, var(--sp-primary));
}
.wfb-node[data-node-type="sub_process"]::before { left: 6px; }
.wfb-node[data-node-type="sub_process"]::after { right: 6px; }

/* Data (input/output): the classic parallelogram. */
.wfb-node[data-node-type="data"] {
  border-radius: 0;
  padding-left: 1.3rem;
  padding-right: 1.3rem;
  clip-path: polygon(14% 0%, 100% 0%, 86% 100%, 0% 100%);
  background: var(--sp-blue-bg);
  border-color: var(--sp-blue);
}
.wfb-node[data-node-type="data"] .sp-icon { color: var(--sp-blue); }

/* jsPlumb connection points. All four work in both directions, so they all get
   the same treatment: quiet until the shape is approached, obvious once it is. */
.jtk-endpoint { cursor: crosshair; opacity: 0.45; transition: opacity 0.12s ease; }
.wfb-node:hover ~ .jtk-endpoint,
.jtk-endpoint:hover,
.jtk-endpoint.jtk-endpoint-connected,
.jtk-endpoint.jtk-drag-active { opacity: 1; }
.jtk-endpoint:hover { transform: scale(1.25); }
.jtk-connector path { stroke: var(--sp-muted); }
.jtk-connector.jtk-hover path { stroke: var(--sp-primary); }

/* A connection's label. On a Decision's branch it is also the control that
   swaps Yes and No over, so it has to look clickable; everywhere else it is
   just a caption, and an empty one is not drawn at all. */
.jtk-overlay {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  color: var(--sp-text);
}
.wfb-edge-label:empty { display: none !important; }
.wfb-edge-label.is-yes,
.wfb-edge-label.is-no {
  cursor: pointer;
  user-select: none;
}
.wfb-edge-label.is-yes {
  background: var(--sp-green-bg);
  border-color: var(--sp-green);
  color: var(--sp-green);
}
.wfb-edge-label.is-no {
  background: var(--sp-red-bg);
  border-color: var(--sp-red);
  color: var(--sp-red);
}
.wfb-edge-label.is-yes:hover,
.wfb-edge-label.is-no:hover {
  filter: brightness(0.94);
  box-shadow: 0 0 0 3px rgba(109, 63, 168, 0.18);
}

.wfb-toolbar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--sp-border); background: var(--sp-surface);
}
.wfb-toolbar .form-control, .wfb-toolbar .form-select { max-width: 240px; }
.wfb-save-indicator { font-size: 0.78rem; color: var(--sp-muted); }
.wfb-save-indicator.is-saving { color: var(--sp-blue); }
.wfb-save-indicator.is-saved { color: var(--sp-green); }
.wfb-save-indicator.is-error { color: var(--sp-red); }

/* Read-only diagram preview (workflow show/awaiting-routing pages) — same
   node/swimlane visuals, no drag handles or delete buttons. */
.wfb-node.is-readonly { cursor: default; }
.wfb-node.is-readonly .wfb-node-label { pointer-events: none; }

/* Workflow Apps: the small "Configure" gear on Start/Process/Decision nodes,
   and the slide-over panel it opens (public/assets/js/workflow_app_panel.js). */
.wfb-node-configure {
  position: absolute; top: -9px; left: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sp-primary); color: #fff; border: none;
  font-size: 0.68rem; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.wfb-node-configure svg { width: 11px; height: 11px; }
.wfb-node:hover .wfb-node-configure, .wfb-node.is-selected .wfb-node-configure { display: flex; }
.wfb-node.has-config .wfb-node-configure { background: var(--sp-green); }

/* A true centered modal — pops to the foreground over a dimmed backdrop,
   like a Gmail compose window coming forward, rather than a drawer that
   docks to the page edge and reads as "part of the page below." */
.wfa-overlay {
  position: fixed; inset: 0; background: rgba(26, 34, 51, 0.45); z-index: 1040;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.wfa-panel {
  position: relative; width: min(520px, 100%); max-height: min(680px, 90vh);
  background: var(--sp-surface); border-radius: var(--sp-radius-lg);
  box-shadow: 0 20px 60px rgba(26, 34, 51, 0.30); z-index: 1041;
  display: flex; flex-direction: column; overflow: hidden;
  animation: sp-dlg-pop 0.15s ease-out;
}
.wfa-panel-header {
  padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--sp-border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.wfa-panel-title { font-weight: 700; margin: 0; }
.wfa-panel-close { border: none; background: transparent; font-size: 1.3rem; line-height: 1; color: var(--sp-muted); cursor: pointer; }
.wfa-panel-body { padding: 1.1rem 1.2rem; overflow-y: auto; flex: 1 1 auto; }
.wfa-panel-footer { padding: 0.8rem 1.2rem; border-top: 1px solid var(--sp-border); display: flex; gap: 0.5rem; justify-content: flex-end; }
.wfa-icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; margin-top: 0.3rem; }
.wfa-icon-choice {
  border: 2px solid var(--sp-border); border-radius: var(--sp-radius-sm); background: var(--sp-surface);
  padding: 0.5rem; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.wfa-icon-choice:hover { border-color: var(--sp-primary); }
.wfa-icon-choice.is-active { border-color: var(--sp-accent); background: var(--sp-primary-tint); }
.wfa-rule-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.wfa-rule-row select, .wfa-rule-row input { flex: 1 1 0; min-width: 0; }
.wfa-rule-remove { flex: 0 0 auto; border: none; background: var(--sp-red-bg); color: var(--sp-red); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.wfa-field-list-empty { font-size: 0.82rem; color: var(--sp-muted); }
.wfa-status-pill { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; }
.wfa-status-pill.draft { background: var(--sp-amber-bg); color: var(--sp-amber); }
.wfa-status-pill.published { background: var(--sp-green-bg); color: var(--sp-green); }
.wfa-status-pill.archived { background: var(--sp-border); color: var(--sp-muted); }

/* ==========================================================================
   Workflow Apps runtime — the per-document review UI on
   public/workflows/apps/instance.php (see wia-doc-card etc below).
   ========================================================================== */
.sp-icon-sm { width: 14px !important; height: 14px !important; vertical-align: -2px; }
.wia-doc-card { border: 1px solid var(--sp-border); border-radius: var(--sp-radius-sm); padding: 0.8rem 1rem; }
.wia-note-thread { border-left: 2px solid var(--sp-border); padding-left: 0.6rem; }
.wia-note-form .form-check-input { margin-top: 0; }

/* ==========================================================================
   App-styled alert/confirm/prompt replacements — see assets/js/sp_dialog.js.
   A small centered card (icon, title, message, buttons), not the browser's
   own gray OS dialog chrome, which reads as the browser interrupting rather
   than the app asking something.
   ========================================================================== */
@keyframes sp-dlg-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.sp-dlg-overlay {
  position: fixed; inset: 0; background: rgba(26, 34, 51, 0.45); z-index: 1060;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.sp-dlg-card {
  background: var(--sp-surface); border-radius: var(--sp-radius-lg);
  box-shadow: 0 20px 60px rgba(26, 34, 51, 0.30);
  width: min(400px, 100%); padding: 1.75rem 1.75rem 1.5rem; text-align: center;
  animation: sp-dlg-pop 0.15s ease-out;
}
.sp-dlg-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.sp-dlg-icon-info { background: var(--sp-blue-bg); color: var(--sp-blue); }
.sp-dlg-icon-warning { background: var(--sp-amber-bg); color: var(--sp-amber); }
.sp-dlg-icon-question { background: var(--sp-primary-tint); color: var(--sp-primary); }
.sp-dlg-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.4rem; }
.sp-dlg-message { color: var(--sp-muted); font-size: 0.88rem; margin-bottom: 1.1rem; }
.sp-dlg-input { margin-bottom: 1.1rem; text-align: left; }
.sp-dlg-actions { display: flex; gap: 0.6rem; justify-content: center; }

/* ===========================================================================
   Charts (includes/charts.php)

   Everything here is layout and restraint. The marks colour themselves from
   the same --sp-* tokens as the badges, so a palette change reaches the
   reports without anybody remembering they exist.
   =========================================================================== */
.sp-chart { display: block; overflow: visible; }

/* A mark lifts slightly under the pointer, which is the only cue that it is
   worth hovering. The native <title> does the telling. */
.sp-chart-mark { cursor: default; }
.sp-chart-mark:hover path,
.sp-chart-mark:hover rect { filter: brightness(0.92); }
.sp-chart-mark:hover circle { r: 5; }

.sp-chart-panel {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 0.75rem 0.85rem 0.5rem;
  height: 100%;
}

.sp-chart-key {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sp-chart-legend {
  display: flex; flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 0.6rem;
}
.sp-chart-legend-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--sp-muted);
}

.sp-chart-hero { padding: 0.25rem 0; }
.sp-chart-hero-value {
  font-size: 2.6rem; line-height: 1.05; font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.sp-chart-empty {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 2.25rem 1rem;
  color: var(--sp-muted); font-size: 0.85rem;
}
.sp-chart-empty .sp-icon { opacity: 0.45; }

.sp-chart-spark-empty {
  font-size: 0.75rem; color: var(--sp-muted);
  padding: 1rem 0; text-align: center;
}

/* The numbers behind the picture. Closed by default, because most readers
   want the shape; open for anybody who wants to check it. */
.sp-chart-table { margin-top: 0.6rem; }
.sp-chart-table > summary {
  cursor: pointer; font-size: 0.78rem; color: var(--sp-muted);
  padding: 0.2rem 0; list-style: none;
}
.sp-chart-table > summary::-webkit-details-marker { display: none; }
.sp-chart-table > summary::before { content: '▸ '; }
.sp-chart-table[open] > summary::before { content: '▾ '; }
.sp-chart-table > summary:hover { color: var(--sp-primary); }
.sp-chart-table .table { margin-top: 0.4rem; }

.sp-meter-track {
  width: 100%; border-radius: 999px; overflow: hidden;
}
.sp-meter-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.25s ease;
}

/* The filter strip every report carries, in one row above the charts. */
.sp-report-filters {
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end;
}
.sp-report-filters .form-label { margin-bottom: 0.15rem; }
.sp-report-filters > div { min-width: 8.5rem; }

@media print {
  .sp-chart-table { display: none; }
  .sp-chart-mark:hover path { filter: none; }
}
