/* ===================================================================================================================
   GRC Owl theme: navy / rust / cream, taken from the logo (public/assets/img/logo-mark.png, logo-stacked.png).
   Two accent roles, used consistently everywhere below:
     - NAVY (--ink)  = primary actions, headings, links, the sidebar.       (the owl's dominant colour)
     - RUST (--rust) = "this is active / selected / hovered" - a highlight, never a primary action.  (the owl's body)
   Bootstrap 5.3 is loaded from a CDN with no build step, so it is retinted here by overriding the CSS custom
   properties it already exposes on :root and on its own component classes - never by fighting its !important rules.
   =================================================================================================================== */
:root {
  /* brand palette, sampled from the logo */
  --ink: #0b2545;          /* navy: headings, primary buttons, links, sidebar */
  --ink-2: #1f2a3d;        /* a touch softer - body text */
  --ink-dark: #071a30;     /* hover/active shade of navy */
  --ink-soft: #4a6483;     /* a mid step of navy, for things that need to read as "brand" but lighter */
  --rust: #8a4627;         /* the owl's rust: hover links, active chips/tabs, the instance badge */
  --rust-dark: #6e3720;
  --rust-tint: #f7e9e0;    /* rust at ~12% - soft chip backgrounds */
  --rust-tint-strong: #f0d6c5;
  --cream: #ece9de;        /* the logo's paper - the navbar */
  --cream-deep: #d9d3c2;   /* a hairline border on cream */
  --cream-soft: #f7f5ef;   /* a barely-there paper tint for subtle panels/sticky headers */

  /* legacy names some rules below still read - point them at the new palette */
  --brand: var(--ink);
  --brand-dark: var(--ink-dark);
  --sidebar-bg: var(--ink);
  --sidebar-fg: #b9c3d4;

  /* Bootstrap's own tokens: these ARE consumed via var() throughout bootstrap.min.css, so overriding them
     here retints body text, links, borders, radii and focus rings everywhere without touching Bootstrap's file. */
  --bs-body-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bs-body-bg: #fbfaf7;
  --bs-body-color: var(--ink-2);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: #6b6259;
  --bs-link-color: var(--ink);
  --bs-link-color-rgb: 11, 37, 69;
  --bs-link-hover-color: var(--rust);
  --bs-link-hover-color-rgb: 138, 70, 39;
  --bs-border-color: #e3ded0;
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.4rem;
  --bs-border-radius-lg: 0.75rem;
  --bs-focus-ring-color: rgba(11, 37, 69, 0.22);
}

body {
  background: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); }

/* ---------- interactions: consistent, modest motion instead of instant snaps ---------- */
a, .btn, .nav-link, .dropdown-item, .cl-chip, .catalogue-table tbody tr, .card, .form-control, .form-select {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
::selection { background: rgba(138, 70, 39, 0.22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-deep); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c2b9a2; }

/* ---------- buttons, form controls, nav components: Bootstrap sets these as custom properties on the same
   selector rather than reading the :root ones above, so they are redeclared here (this file loads last and wins). ---------- */
.btn-primary {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--ink-dark); --bs-btn-hover-border-color: var(--ink-dark);
  --bs-btn-active-bg: var(--ink-dark); --bs-btn-active-border-color: var(--ink-dark);
  --bs-btn-disabled-bg: var(--ink); --bs-btn-disabled-border-color: var(--ink);
  --bs-btn-focus-shadow-rgb: 11, 37, 69;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-outline-primary {
  --bs-btn-color: var(--ink); --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-bg: var(--ink); --bs-btn-active-border-color: var(--ink);
  --bs-btn-focus-shadow-rgb: 11, 37, 69;
}
.btn-link { --bs-btn-color: var(--ink); --bs-btn-hover-color: var(--rust); }
.form-control:focus, .form-select:focus { border-color: var(--ink-soft); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { border-color: var(--ink-soft); }
.form-switch .form-check-input:checked { background-color: var(--ink); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--ink); }
.pagination { --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-color: var(--ink); --bs-pagination-hover-color: var(--ink-dark); --bs-pagination-focus-color: var(--ink); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--ink); box-shadow: 0 10px 30px rgba(11, 37, 69, 0.12); border-color: var(--bs-border-color); }
.card { border: none; box-shadow: 0 1px 3px rgba(11, 37, 69, 0.08); border-radius: 0.75rem; }
.card:hover { box-shadow: 0 6px 20px rgba(11, 37, 69, 0.1); }

/* ---------- top navigation bar: deep navy (same as the sidebar), the owl on a cream chip so its dark strokes stay readable ---------- */
.app-navbar {
  background: linear-gradient(90deg, var(--ink-dark), var(--ink));
  border-bottom: 3px solid var(--rust);
  box-shadow: 0 2px 6px rgba(7, 26, 48, 0.25);
  color: #fff;
  padding: 0.5rem 1rem;
  min-height: 72px;
}
.app-navbar .navbar-brand { color: #fff; font-size: 1.25rem; letter-spacing: 0.01em; }
.app-navbar .navbar-brand:hover { color: #fff; }
.app-navbar .navbar-toggler { border-color: rgba(255, 255, 255, 0.4); }
.app-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* the notification bell and the account menu button, on the navy bar */
.btn-navbar-icon {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.btn-navbar-icon:hover, .btn-navbar-icon:focus, .btn-navbar-icon.show { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.55); }

/* Brand mark: larger, sitting on a cream rounded chip (the logo was drawn on paper, not on navy). */
.brand-chip {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 56px; height: 56px; padding: 4px; background: var(--cream); border-radius: 14px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.brand-chip img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* the instance name: a soft rust tag rather than a solid loud badge */
.instance-badge {
  background: var(--rust-tint) !important;
  color: var(--rust-dark) !important;
  border: 1px solid var(--rust-tint-strong);
  border-radius: 999px !important;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Sign-in page: the full lockup (owl, name, tagline), or the owl and the instance's own name. */
.auth-logo { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto; }
.auth-mark { width: 72px; height: 72px; }

.app-shell {
  display: flex;
  min-height: calc(100vh - 75px);
}

/* ---------- sidebar: navy, the owl's dominant colour - rust marks the current page ---------- */
.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
}
.sidebar-inner { padding: 1rem 0; }
.sidebar-group { margin-bottom: 1rem; }
.sidebar-group-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #7688a3;
  padding: 0.25rem 1.25rem;
}
.app-sidebar .nav-link {
  color: var(--sidebar-fg);
  padding: 0.5rem 1.25rem;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.app-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: var(--rust);
  font-weight: 600;
}

.app-main { flex-grow: 1; min-width: 0; }

/* ---------- dashboard KPI tiles: navy / amber-rust / deep rust / teal - one brand family, four readable hues ---------- */
.kpi-card { border-radius: 0.75rem; color: #fff; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 700; }
.kpi-card .kpi-label { opacity: 0.88; font-size: 0.85rem; }
.kpi-bg-1 { background: linear-gradient(135deg, var(--ink), #274972); }
.kpi-bg-2 { background: linear-gradient(135deg, #a8632f, #c98c4c); }
.kpi-bg-3 { background: linear-gradient(135deg, var(--rust-dark), var(--rust)); }
.kpi-bg-4 { background: linear-gradient(135deg, #1f7a63, #2fa688); }

.heatmap-table { border-collapse: separate; border-spacing: 4px; }
.heatmap-cell {
  width: 64px; height: 44px; text-align: center; vertical-align: middle;
  border-radius: 6px; color: #fff; font-weight: 600; font-size: 0.85rem;
}

/* ---------- sign-in page: a deep navy field around the white card, like the logo's paper under studio light ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(135deg, #061422, var(--ink) 65%, var(--ink-soft));
}
.auth-card { max-width: 420px; width: 100%; border-radius: 0.85rem; border: 1px solid rgba(255, 255, 255, 0.5); }

.table-actions a, .table-actions button { margin-right: 0.25rem; }

.required-mark { color: #d5495a; }

/* Grouped, filterable checklist (e.g. Annex A mapping) */
.checklist-scroll { max-height: 300px; overflow-y: auto; }
.picker-group-label {
  position: sticky; top: 0; z-index: 1; background: #fff;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #6c757d; padding: 0.35rem 0 0.2rem; margin-top: 0.4rem;
}
.picker-item .form-check-label { font-size: 0.875rem; }

/* ===================================================================================================================
   Audit progress (External Audits): status pills, stat tiles, meters and stacked bars - plain HTML/CSS, no chart library.
   Colours: every control status has its own hue (Open gray-blue, In Progress blue, Pending Auditor Review amber,
   Clarification Requested red, Closed green, Not Applicable gray-cream = left out of progress). Colour never
   carries the meaning alone: every mark has a label, a legend entry and a table view.
   =================================================================================================================== */
:root {
  --cs-open: #8b98a9;
  --cs-in_progress: #2f7fd1;
  --cs-pending_auditor_review: #e0a100;
  --cs-clarification_requested: #d9534f;
  --cs-closed: #2e9e5b;
  --cs-not_applicable: #c3c2b7;
  --cs-overdue: #d9534f;
  --viz-track: #dce3ea;
  --viz-ink: var(--ink);
  --viz-ink-2: #52514e;
  --viz-muted: #898781;
  --viz-hairline: #e1e0d9;
}

/* status pill: swatch + label */
.cs-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.6rem;
  border: 1px solid var(--viz-hairline); border-radius: 999px; background: #fff;
  color: var(--viz-ink); font-size: 0.8rem; line-height: 1.3; white-space: nowrap;
}
.cs-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--viz-muted); flex: none; }
.cs-open .cs-dot { background: var(--cs-open); }
.cs-in_progress .cs-dot { background: var(--cs-in_progress); }
.cs-pending_auditor_review .cs-dot { background: var(--cs-pending_auditor_review); }
.cs-clarification_requested .cs-dot { background: var(--cs-clarification_requested); }
.cs-closed .cs-dot { background: var(--cs-closed); }
.cs-not_applicable .cs-dot { background: var(--cs-not_applicable); }
.cs-overdue .cs-dot { background: var(--cs-overdue); }

/* the panel */
.viz-title { font-size: 0.95rem; font-weight: 600; color: var(--viz-ink); margin: 0; }
.viz-caption { color: var(--viz-ink-2); font-size: 0.85rem; }
.viz-hero { font-size: 3rem; font-weight: 600; line-height: 1; color: var(--viz-ink); }
.viz-hero .viz-unit { font-size: 1.4rem; font-weight: 500; color: var(--viz-ink-2); margin-left: 0.1rem; }
.viz-tile { border: 1px solid var(--viz-hairline); border-radius: 0.6rem; padding: 0.65rem 0.85rem; background: #fff; height: 100%; }
.viz-tile-label { display: flex; align-items: center; gap: 0.4rem; color: var(--viz-ink-2); font-size: 0.8rem; }
.viz-tile-value { font-size: 1.6rem; font-weight: 600; line-height: 1.25; color: var(--viz-ink); }
.viz-swatch { width: 0.65rem; height: 0.65rem; border-radius: 2px; flex: none; display: inline-block; }
.viz-swatch.seg-na { background: transparent; border: 1.5px solid var(--cs-not_applicable); }

/* meter: one ratio against its limit */
.viz-meter { height: 12px; background: var(--viz-track); border-radius: 4px; overflow: hidden; }
.viz-meter-fill { height: 100%; background: var(--cs-closed); border-radius: 0 4px 4px 0; }
.viz-meter-fill.is-evidence { background: #7a5cc7; }

/* stacked bars: 14px thick, 2px gaps, a 4px round only on the data end, a tooltip on every segment */
.viz-stack { display: flex; gap: 2px; height: 14px; }
.viz-stack.viz-stack-sm { height: 8px; }
.viz-seg { position: relative; flex-basis: 0; min-width: 3px; outline: none; }
.viz-seg:last-child { border-radius: 0 4px 4px 0; }
.viz-seg::before { content: ""; position: absolute; inset: -7px 0; }      /* the hit area is bigger than the mark */
.viz-seg::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--viz-ink); color: #fff; padding: 0.25rem 0.55rem; border-radius: 4px; font-size: 0.75rem; font-weight: 500;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s; z-index: 30;
}
.viz-seg:hover::after, .viz-seg:focus-visible::after { opacity: 1; }
.viz-seg:hover, .viz-seg:focus-visible { filter: brightness(1.1); }
.viz-seg:focus-visible { outline: 2px solid var(--viz-ink); outline-offset: 2px; }
.seg-closed { background: var(--cs-closed); }
.seg-in_progress { background: var(--cs-in_progress); }
.seg-open { background: var(--cs-open); }
.seg-pending_auditor_review { background: var(--cs-pending_auditor_review); }
.seg-clarification_requested { background: var(--cs-clarification_requested); }
.seg-overdue { background: var(--cs-overdue); }
.viz-stack-none { height: 14px; border-radius: 4px; background: var(--viz-hairline); }
.viz-stack-sm.viz-stack-none { height: 8px; }

.viz-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0.65rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--viz-ink-2); }
.viz-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.viz-legend strong { color: var(--viz-ink); font-weight: 600; }

.viz-rows { display: grid; gap: 0.85rem; }
.viz-row { display: grid; grid-template-columns: minmax(6.5rem, 9rem) 1fr auto; align-items: center; gap: 0.75rem; }
.viz-row-label { color: var(--viz-ink-2); font-size: 0.85rem; }
.viz-row-value { color: var(--viz-ink); font-size: 0.85rem; white-space: nowrap; min-width: 8.5rem; text-align: right; }
@media (max-width: 575.98px) {
  .viz-row { grid-template-columns: 1fr auto; }
  .viz-row .viz-stack { grid-column: 1 / -1; order: 3; }
  .viz-row-value { min-width: 0; }
}

.viz-table-toggle > summary { cursor: pointer; color: var(--ink); font-size: 0.85rem; width: fit-content; }
.viz-table th, .viz-table td { font-size: 0.85rem; }

.viz-schedule { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--viz-ink); }
.viz-schedule .bi { font-size: 1rem; }
.viz-schedule.is-overdue .bi { color: #d03b3b; }
.viz-schedule.is-soon .bi { color: #c98500; }
.viz-schedule.is-done .bi { color: #0ca30c; }
.viz-schedule.is-ok .bi { color: var(--viz-muted); }

/* the list page's progress cell */
.progress-cell { min-width: 9rem; }
.progress-cell .progress-text { font-size: 0.78rem; color: var(--viz-ink-2); margin-top: 0.3rem; white-space: nowrap; }

@media (forced-colors: active) {
  .viz-seg, .viz-meter-fill { forced-color-adjust: none; border: 1px solid CanvasText; }
}

/* ---------- checklist filter chips and the catalogue picker: rust marks "selected", navy hover is neutral ---------- */
.cl-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.7rem; cursor: pointer;
  border: 1px solid var(--viz-hairline); border-radius: 999px; background: #fff; color: var(--viz-ink-2); font-size: 0.8rem;
}
.cl-chip:hover { background: var(--cream-soft); }
.cl-chip.is-active { background: var(--rust); border-color: var(--rust); color: #fff; }
.cl-chip .cl-chip-count { font-weight: 600; }

.catalogue-scroll { max-height: 26rem; overflow: auto; border: 1px solid var(--viz-hairline); border-radius: 0.4rem; background: #fff; }
.catalogue-table { margin: 0; }
.catalogue-table thead th { position: sticky; top: 0; z-index: 2; background: var(--cream-soft); box-shadow: 0 1px 0 var(--viz-hairline); font-size: 0.8rem; }
.catalogue-table tbody tr { cursor: pointer; }
.catalogue-table tbody tr:hover { background: var(--cream-soft); }
.catalogue-table tbody tr.is-selected { background: var(--rust-tint); }
.catalogue-table td { vertical-align: top; font-size: 0.875rem; }
.catalogue-table .cat-desc { color: var(--viz-ink-2); }

/* ---------- tag picker: "type @ then a name" (risk register access lists) ---------- */
.tagpicker { position: relative; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 0.4rem; background: #fff; }
.tagpicker-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.3rem; }
.tagpicker-chips:empty { margin-bottom: 0; }
.tagpicker-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.4rem 0.15rem 0.6rem;
  background: var(--rust-tint); color: var(--rust-dark); border-radius: 999px; font-size: 0.82rem; font-weight: 500;
}
.tagpicker-chip button {
  border: none; background: none; color: var(--rust-dark); opacity: 0.7; line-height: 1; padding: 0 0.1rem; font-size: 1rem; cursor: pointer;
}
.tagpicker-chip button:hover { opacity: 1; }
.tagpicker [data-tagpicker-input] { border: none; padding: 0.2rem 0.1rem; box-shadow: none !important; }
.tagpicker-menu, .richtext-mention-menu {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 0.2rem;
  background: #fff; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
  box-shadow: 0 10px 30px rgba(11, 37, 69, 0.14); max-height: 14rem; overflow-y: auto; padding: 0.25rem;
}
.richtext-mention-menu { left: auto; right: auto; top: auto; width: 15rem; }
.tagpicker-menu-item {
  display: block; width: 100%; text-align: left; border: none; background: none; padding: 0.35rem 0.6rem;
  border-radius: 0.35rem; font-size: 0.85rem; color: var(--ink-2);
}
.tagpicker-menu-item.is-active, .tagpicker-menu-item:hover { background: var(--cream-soft); color: var(--ink); }

/* ---------- rich text with @mentions (risk comments, treatment plan) ---------- */
.richtext { position: relative; }
.richtext-toolbar { display: flex; gap: 0.25rem; margin-bottom: 0.35rem; }
.richtext-toolbar .btn { padding: 0.15rem 0.5rem; line-height: 1.4; }
.richtext-editor {
  min-height: 5rem; padding: 0.5rem 0.75rem; overflow-y: auto;
}
.richtext-editor:empty::before { content: attr(data-placeholder); color: var(--bs-secondary-color); }
.richtext-editor p { margin: 0 0 0.5rem; }
.richtext-editor p:last-child { margin-bottom: 0; }
.richtext-editor ul, .richtext-editor ol { margin: 0 0 0.5rem 1.2rem; padding: 0; }
.mention {
  display: inline-block; background: var(--rust-tint); color: var(--rust-dark); border-radius: 0.3rem;
  padding: 0.05rem 0.35rem; font-weight: 600; font-size: 0.92em;
}
.richtext-view .mention { background: var(--rust-tint); color: var(--rust-dark); border-radius: 0.3rem; padding: 0.05rem 0.35rem; font-weight: 600; }
.richtext-view p { margin: 0 0 0.5rem; }
.richtext-view p:last-child, .richtext-view :last-child { margin-bottom: 0; }

/* ---------- risk list: sortable column headers, filter bar ---------- */
.risk-sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem; }
.risk-sort-link:hover { color: var(--ink); }
.risk-sort-link .bi { font-size: 0.75rem; color: var(--rust); }
.filter-bar { font-size: 0.85rem; }
.filter-bar label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--viz-ink-2); margin-bottom: 0.15rem; }

/* ---------- profile photo ---------- */
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--cream-soft); border: 1px solid var(--bs-border-color);
}
.profile-avatar-placeholder {
  display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 1.75rem;
}
.navbar-avatar {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-right: 0.25rem; vertical-align: -4px;
}

/* ---------- file drop (risk comment attachments) ---------- */
.filedrop-zone {
  border: 1px dashed var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 0.6rem 0.75rem;
  font-size: 0.85rem; color: var(--ink-2); cursor: pointer; text-align: center; background: var(--cream-soft);
}
.filedrop-zone:hover, .filedrop-zone:focus-visible { border-color: var(--rust); color: var(--ink); }
.filedrop-zone.is-dragover { border-color: var(--rust); background: var(--rust-tint); color: var(--ink); }
.filedrop-list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.filedrop-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; background: var(--cream-soft); border: 1px solid var(--bs-border-color);
  border-radius: 999px; padding: 0.15rem 0.35rem 0.15rem 0.6rem; font-size: 0.78rem;
}
.filedrop-chip button { border: none; background: none; line-height: 1; font-size: 1rem; color: var(--ink-2); padding: 0 0.2rem; }
.filedrop-chip button:hover { color: var(--rust-dark); }



/* ---------- profile photo cropper ---------- */
.cropper { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 1rem; background: var(--cream-soft); }
.cropper-stage {
  position: relative; width: 280px; height: 280px; max-width: 100%; overflow: hidden; cursor: grab; touch-action: none;
  background: #222; border-radius: 4px; outline: 2px solid var(--ink);
}
.cropper-stage:active { cursor: grabbing; }
.cropper-stage img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; transform-origin: 0 0; }
.cropper-stage::after { /* thirds grid, so the square reads as a selection box */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
}
.cropper-preview { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--bs-border-color); background-repeat: no-repeat; background-color: #ddd; }

/* the row an audit-page link jumps to (#control-N) flashes briefly */
tr:target > td { animation: targetflash 3s ease-out; }
@keyframes targetflash { from { background-color: var(--rust-tint-strong); } to { background-color: transparent; } }


/* ---------- lists: column chooser + draggable column edges (app.js: initGrid) ---------- */
.grid-col-hidden { display: none !important; }
table.grid-fixed { table-layout: fixed; max-width: none; }
table.grid-fixed th, table.grid-fixed td { overflow-wrap: anywhere; }
.grid-resizer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; user-select: none; touch-action: none; z-index: 3;
}
.grid-resizer::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px; background: var(--cream-deep); border-radius: 2px; }
th:hover > .grid-resizer::after, .grid-resizer.is-active::after { background: var(--rust); }
.grid-menu { min-width: 14rem; max-height: 22rem; overflow-y: auto; }
