/* static/css/app.css
   Whole-app stylesheet — ported from the prototype's landing page (blue brand).
   Used by base.html for every page. */

:root {
  --navy: #0B0C2A;      /* sidebar bg, headings */
  --navy2: #2B35FF;     /* primary blue — buttons, active, accents */
  --red: #2B35FF;       /* repointed to blue */
  --teal: #2B35FF;      /* repointed to blue */
  --bg: #F5F6FA;
  --card: #fff;
  --text: #0B0C2A;
  --muted: #6B7280;
  --line: #E4E6EF;
  --shadow: 0 8px 28px rgba(11,12,42,.08);
  --alert: #ce0505;     /* map incident pins / alerts — stays red */
  --blue-light: #EEF0FF;
  --fact :#2512ed;
  --sectionLabel:#2B35FF;
  --lavendegrey:#49518524;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--navy);
  color: white; padding: 28px 18px 6px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; line-height: 1.15; }
.brand > span {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: #fff; overflow: hidden; padding: 4px;
}
.brand > span img { width: 100%; height: 100%; object-fit: contain; }
.brand small { display: block; font-weight: 400; color: #b9cad7; font-size: 12px; }
.sidebar nav { display: grid; gap: 7px; margin-top: 42px; }
.sidebar nav p {
  margin: 14px 0 2px; text-transform: uppercase; letter-spacing: .08em;
  font-size: 10px; color: #7d93a6;
}
.sidebar nav a {
  color: #c7d5e0; text-decoration: none; padding: 11px 13px;
  border-radius: 9px; font-size: 14px;
}
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #207ae27d; }
.environment {
  margin-top: auto; border-top: 1px solid rgba(255,255,255,.15);
  padding: 18px 8px 0; display: grid; gap: 4px;
}
.environment small { color: #b9cad7; }
.workspace { padding: 32px; max-width: 1500px; width: 100%; margin: auto; }
.topbar, .panelHead { display: flex; justify-content: space-between; align-items: center; gap: 18px; position: relative; }
.eyebrow {
  margin: 0 0 5px; text-transform: uppercase; letter-spacing: .09em;
  font-size: 11px; font-weight: 800; color: var(--teal);
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 0; }
h2 { font-size: 20px; margin-bottom: 0; }
.actions { display: flex; gap: 9px; align-items: center; }
button {
  border: 0; border-radius: 9px; background: var(--red); color: white;
  padding: 11px 15px; font-weight: 750; cursor: pointer;
}
.ghost { background: white; color: var(--navy); border: 1px solid var(--line); }
/* .ghost on an <a> (e.g. Export CSV) needs the same base look `button`
   gives it for free — mirrors button's own declarations, no new style. */
a.ghost { display: inline-flex; align-items: center; border-radius: 9px; padding: 11px 15px; font-weight: 750; cursor: pointer; text-decoration: none; }
.metrics { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; margin: 28px 0; }
.metrics article, .panel, .moduleGrid article {
  background:#ffff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.metrics article { padding: 18px; display: grid; gap: 7px; }
.metrics span { font-size: 13px; color: var(--muted); }
.metrics strong { font-size: 28px; }
.metrics small { color: var(--muted); }

/* Metric tile accents — one per module (see the `metrics` list in
   apps/dashboard/views.py). Kept pale/low-saturation as the fill, with the
   accent's full-strength colour carried only by the left border and the
   number — that's what keeps five tiles readable as "soft" while still
   being instantly tellable apart. Label (span) and context (small) stay
   the default muted colour so only the number reads as accented. */
.metrics article.metric-blue  { background: #eaf0fc; border-left: 3px solid #2B35FF; }
.metrics article.metric-teal  { background: #e5f4f3; border-left: 3px solid #0D9488; }
.metrics article.metric-red   { background: #fdecec; border-left: 3px solid #DC2626; }
.metrics article.metric-amber { background: #fbf1e0; border-left: 3px solid #D97706; }
.metrics article.metric-green { background: #e9f6ec; border-left: 3px solid #16A34A; }
.metrics article.metric-blue strong  { color: #2B35FF; }
.metrics article.metric-teal strong  { color: #0D9488; }
.metrics article.metric-red strong   { color: #DC2626; }
.metrics article.metric-amber strong { color: #D97706; }
.metrics article.metric-green strong { color: #16A34A; }

/* ===== Licensing list page — status/applicant-type metric cards =====
   Wider-than-tall pastel gradient cards, distinct from the dashboard's
   .metrics tiles above (different shape/palette, so kept as its own
   named component rather than reusing .metrics/.metric-*). */
.metricCardGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 28px; }
.metricCard {
  border-radius: 16px; padding: 20px 24px; display: flex; flex-direction: column;
  justify-content: space-between; min-height: 100px; position: relative; overflow: hidden;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.metricCard:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.metricCardActive { box-shadow: 0 0 0 3px #7578cf21, 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.metricCardLabel { font-size: 14px; font-weight: 600; color: #1a1a2e; letter-spacing: .01em; }
.metricCardCount { font-size: 32px; font-weight: 700; color: #1a1a2e; margin-top: 8px; }

/* Gradients — one per card, alternating warm/cool so no two adjacent
   cards (row 1: submitted..rectification, row 2: decision..partnership)
   feel similar. */
.gradient-submitted { background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #e8eaf6 100%); }
.gradient-vetting { background: linear-gradient(135deg, #e0f7fa 0%, #e0f2f1 50%, #e8f5e9 100%); }
.gradient-assessment { background: linear-gradient(135deg, #fff3e0 0%, #fff9c4 50%, #f1f8e9 100%); }
.gradient-inspection { background: linear-gradient(135deg, #e8eaf6 0%, #e1f5fe 50%, #e0f7fa 100%); }
.gradient-rectification { background: linear-gradient(135deg, #fce4ec 0%, #ffccbc 50%, #fff9c4 100%); }
.gradient-decision { background: linear-gradient(135deg, #f3e5f5 0%, #e8eaf6 50%, #e1f5fe 100%); }
.gradient-closed { background: linear-gradient(135deg, #e8f5e9 0%, #e0f2f1 50%, #e0f7fa 100%); }
.gradient-individual { background: linear-gradient(135deg, #fff9c4 0%, #fff3e0 50%, #ffccbc 100%); }
.gradient-company { background: linear-gradient(135deg, #e1f5fe 0%, #e8eaf6 50%, #f3e5f5 100%); }
.gradient-partnership { background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e9 50%, #f1f8e9 100%); }

@media (max-width: 1200px) { .metricCardGrid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .metricCardGrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .metricCardGrid { grid-template-columns: repeat(2, 1fr); } }

/* Licensing list page — filter row (search + status/type/licence-type
   dropdowns + reset), styled to match .filters input/select elsewhere
   (same padding/radius/font-size) without touching that shared rule,
   since other modules still use .filters for their own simpler row. */
.filterRow { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.searchForm { display: flex; flex: 1; min-width: 220px; }
.searchInput {
  flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-right: none;
  border-radius: 8px 0 0 8px; font: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.searchInput:focus { outline: none; border-color: var(--navy2); }
.searchBtn {
  display: flex; align-items: center; justify-content: center; padding: 0 14px;
  background: var(--navy2); border: 1px solid var(--navy2); border-radius: 0 8px 8px 0; cursor: pointer;
}
.searchClear {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  color: var(--muted); text-decoration: none; font-size: 13px; border-radius: 8px;
}
.searchClear:hover { background: var(--blue-light); color: var(--navy); }
.filterSelect {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.resetFiltersBtn {
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: none; background: #fff;
}
.resetFiltersBtn:hover { background: var(--blue-light); }

/* Filter indicator — shown above the licensing table when a metric card
   filter is active. */
.filterIndicator {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 16px;
  background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 6px; margin-bottom: 12px;
}
.filterIndicatorText { font-size: 13px; color: #065F46; font-weight: 500; }
.filterIndicatorText strong { font-weight: 700; }
.filterIndicatorClear {
  font-size: 12px; color: #065F46; font-weight: 600; text-decoration: none;
  padding: 2px 8px; border-radius: 4px; transition: background .1s;
}
.filterIndicatorClear:hover { background: #D1FAE5; }

.grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr); gap: 16px; }
.panel { padding: 20px; margin-bottom: 16px; }
.panelHead { margin-bottom: 18px; }
.panelHead a { color: var(--teal); font-size: 13px; font-weight: 700; text-decoration: none; }
.map {
  height: 335px; position: relative; overflow: hidden; border-radius: 11px;
  background-color: #dcecf0;
  background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 34px 34px;
}
.island { position: absolute; background: #b7cfb0; box-shadow: inset 0 0 0 2px rgba(55,96,61,.15); transform: rotate(-21deg); }
.malta { width: 120px; height: 245px; border-radius: 52% 44% 57% 46%; left: 46%; top: 55px; }
.gozo { width: 105px; height: 67px; border-radius: 48% 58% 45% 52%; left: 30%; top: 62px; }
.pin {
  position: absolute; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--navy2);
  color: white; font-style: normal; font-size: 11px; font-weight: 800; box-shadow: 0 5px 10px #0003;
}
.pin > span { transform: rotate(45deg); }
.p1 { left: 50%; top: 110px; } .p2 { left: 47%; top: 242px; }
.p3 { left: 34%; top: 72px; } .p4 { left: 56%; top: 188px; }
.pin.alert { background: var(--alert); }
.legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 1; background: white;
  padding: 9px 12px; border-radius: 8px; display: flex; gap: 12px; font-size: 11px;
}
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy2); }
.alertDot { background: var(--alert); }
.incidents { display: grid; gap: 4px; }
.incident { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.incident div { display: grid; gap: 3px; }
.incident small { color: var(--muted); }

/* ===== Status / severity badges (pills) ===== */
.severity, .status {
  display: inline-block;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800; background: #e5eef4; color: var(--navy);
  white-space: nowrap;
}
/* Incident priority — one canonical, escalating scale (also read by the
   Leaflet marker JS in overview.html, which must be kept in sync by hand
   since it can't read CSS classes). low uses a darkened lime (Tailwind
   lime-700, not the requested lime-600 #65A30D) because #65A30D only
   reaches ~3.1:1 contrast with white text at this pill size — below WCAG
   AA's 4.5:1 for small/normal text — while #4D7C0F reaches ~5:1. */
.severity.high { background: #F97316; color: #fff; }
.severity.medium { background: #3B82F6; color: #fff; }
.severity.low { background: #4D7C0F; color: #fff; }

/* Incident statuses (Destination Pulse) — previously had no rules of their
   own, so reported/acknowledged/assigned/resolved all fell back to the
   base .severity, .status rule above (background: #e5eef4; color: var(--navy))
   and looked uniformly blueish-grey. Distinct colours added here. */
.status.reported { background: #eef1f4; color: #596875; }
.status.acknowledged { background: #dbe7fb; color: #1d4ed8; }
.status.assigned { background: #e8ddfb; color: #6b21a8; }
.status.resolved { background: #d7efe2; color: #0f7a4f; }

.status.review { background: #fff1d6; color: #f37f07; }
.status.published, .status.active { background: #e4f4ef; color: #147153; }
.status.prototype { background: #e6efff; color: #2356a8; }
.status.planned { background: #eef1f4; color: #596875; }
.status.draft { background: #eef1f4; color: #596875; }
.status.retired { background: #fee7e9; color: #b42334; }

.wide { width: 100%; margin-top: 18px; }
.tableWrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.quality { display: inline-block; width: 70px; height: 5px; background: #e6edf2; border-radius: 9px; overflow: hidden; vertical-align: middle; }
.quality i { display: block; height: 100%; background: var(--teal); }


.modulePageTiltle {font-weight: 800; color: var(--teal);}
.moduleSection { padding: 18px 0 40px; }
.moduleGrid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.moduleGrid article { padding: 16px; box-shadow: none; }
.moduleGrid a { text-decoration: none; color: inherit; }
.moduleGrid h3 { font-size: 15px; margin: 13px 0 6px; }
.moduleGrid p { font-size: 12px; color: var(--muted); margin: 0; }
.moduleGrid strong { color: var(--teal); font-size: 13px; display: inline-block; margin-top: 10px; }
.addRecord {
  display: inline-flex; align-items: center; padding: 10px 15px; border-radius: 9px;
  background: var(--red); color: #fff; text-decoration: none; font-weight: 750;
}
.localeToggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.localeToggle a, .localeToggle button {
  border: 0; border-radius: 0; background: #fff; padding: 8px 12px; cursor: pointer;
  color: var(--muted); text-decoration: none; font: inherit; font-size: 14px;
}
.localeToggle a.on, .localeToggle button.on { background: var(--navy2); color: #fff; }

/* ===== Data Exchange workspace ===== */

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 20px 0 22px; }
.tabs .tab {
  padding: 8px 2px; text-decoration: none; color: var(--muted);
  font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab.active { color: var(--navy2); border-bottom-color: var(--navy2); }

.workspace-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,1fr); gap: 16px; align-items: start; }

/* Filters */
.filters { display: flex; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.filters .searchBox { flex: 1; }
.filters input, .filters select, .filtersPopover select, .pageSizeLabel select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; background: #fff; color: var(--text);
}
/* .filters input (above) is more specific than the plain .searchInput
   class (class+tag beats a single class) and was silently overriding its
   pill shape back to a plain 4-corner box — flat right edge + no right
   border, undone, which is what visually detached the search button from
   the input on every module page except Licensing (whose search field
   isn't nested inside .filters). Re-assert those two properties here,
   scoped specifically enough (two classes) to win. */
.filters .searchInput { border-radius: 8px 0 0 8px; border-right: none; }

/* Search box with an inline clear-X — used on every module list page's
   search field (wraps the existing .searchBox input, no changes to that
   class itself). */
.searchWrap { position: relative; flex: 1; display: flex; min-width: 180px; }
.searchWrap .searchBox, .searchWrap .searchInput { width: 100%; padding-right: 30px; }
.searchClearX {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); font-size: 13px; line-height: 1;
  cursor: pointer; padding: 4px 6px; border-radius: 4px;
}
.searchClearX:hover { background: var(--blue-light); color: var(--navy); }

/* Record table */
.recordTable { width: 100%; border-collapse: collapse; font-size: 13px; }
.recordTable th, .recordTable td {
  text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.recordTable th {
  color: #093da5; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.recordTable tbody tr { cursor: pointer; }
.recordTable tbody tr:hover { background: var(--blue-light); }
.recordTable tbody tr.selected { background: var(--blue-light); }
.recordTable td strong { font-weight: 600; }

/* Action column (e.g. licensing's "View" link to the case detail page) */
.actionCell { text-align: right; white-space: nowrap; }
.viewLink {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.viewLink:hover { color: #fff; background: #171949; }

/* Pagination — Overview's "Records requiring attention" table */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.pageNav { display: flex; align-items: center; justify-content: center; gap: 16px; flex: 1; }
.pagination a, .pagination .pageLinkDisabled {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; text-decoration: none;
}
.pagination a { color: var(--navy); background: #fff; }
.pagination a:hover { background: var(--blue-light); }
.pagination .pageLinkDisabled { color: var(--muted); background: var(--bg); cursor: default; }
.pagination .pageStatus { color: var(--muted); font-size: 13px; }
.pageSizeLabel { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Detail panel */
.detailPanel { position: sticky; top: 20px; }
.detailHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.detailHead h3 { font-size: 20px; }
.nameMt { color: var(--muted); font-size: 10px; margin: 2px 0 0; font-style: italic; }
.factGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fact); font-weight: 700;
}
.fact strong { font-size: 12px; font-weight: 00; }

.Casefact { display: flex; flex-direction: column; gap: 3px; }
.Casefact span{font-size: 11px; text-transform: uppercase; letter-spacing: .05em;color: black; font-weight: 700;}
.Casefact strong { font-size: 12px; font-weight: 400; }

/* Detail sections (workflow, audit) */
.detailSection { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.sectionLabel { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--sectionLabel); font-weight: 700; margin-bottom: 12px; }
.workflowButtons { display: flex; gap: 8px; flex-wrap: wrap; }
.workflowButtons button { padding: 9px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
.wf-primary { background: var(--navy2); color: #fff; border: 0; }
.wf-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.workflowButtons button:disabled { opacity: .5; cursor: not-allowed; }

.emptyState { color: var(--muted); font-size: 14px; padding: 20px 0; }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .grid { grid-template-columns: 1fr; }
  .moduleGrid { grid-template-columns: repeat(2,1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .detailPanel { position: static; }
  .staffDetailLayout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .mainCol { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; background: #F0F1F8; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .workspace { padding: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .moduleGrid { grid-template-columns: 1fr; }
  .map { height: 280px; }
  h1 { font-size: 23px; }
}

/* Leaflet map on the Data Exchange places tab */
.placesMap { height: 300px; border-radius: 11px; margin-bottom: 16px; overflow: hidden; }

/* Leaflet map on the Overview operational map (fills the existing .map box).
   z-index: 0 gives it its own stacking context so Leaflet's internal panes/
   controls (which use z-index up to 1000 in leaflet.css) stay contained
   inside it instead of leaking out over the .legend sibling below. */
.opMap { position: absolute; inset: 0; z-index: 0; }

/* Numbered circular incident-count marker — background colour is set inline
   per-marker in JS, reusing the existing .severity.* hex values (no new colours). */
.incidentPin {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 800;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(11,12,42,.35);
}

/* Popup list of incidents for a locality marker — each links to that
   incident's detail view, same link colour as .panelHead a elsewhere. */
.mapPopupList { margin: 6px 0 0; padding: 0 0 0 16px; font-size: 12px; }
.mapPopupList a { color: var(--teal); text-decoration: none; }
.mapPopupList a:hover { text-decoration: underline; }

/* Legend swatches on the Overview operational map double as a priority
   filter — reset button defaults so they keep looking like plain .severity
   pills, and ring the active one to match the current filter selection. */
.legend button.severity {
  border: none; font: inherit; cursor: pointer;
}
.legend .severity.active {
    box-shadow: 0 0 0 2px #67699ec4;
}

/* Filters popover on the Overview operational map */
.filtersPopover {
  display: none; position: absolute; top: 100%; right: 0; z-index: 10;
  margin-top: 8px; min-width: 200px; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 14px;
}
.filtersPopover.open { display: grid; }
.filtersPopover label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--navy); }

/* Data Exchange left column — override earlier flat-white listPanel */
.listPanel { background: transparent; padding: 0; display: flex; flex-direction: column;}

/* The table sits in its own white card with a count header */
.listCard { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.listCardHead { background: #f4f0ff; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: #03112c; font-weight: 600;}

/* Incident critical priority */
.severity.critical { background: #B91C1C; color: #fff; }

/* "All priorities" — the map legend's neutral default state, NOT one of the
   four priority colours above. Purple carries no severity meaning; it just
   means "showing every priority, count only". */
.severity.all { background: #7C3AED; color: #fff; }

/* Tighten severity badges in the Overview incidents panel */
.incident .severity {
  font-size: 10px; padding: 5px 8px; align-self: center;
  display: inline-flex; align-items: center; line-height: 1.4; justify-content: center;
}

/* Licensing case statuses */
.status.submitted { background: #eef1f4; color: #596875; }
.status.vetting { background: #fff1d6; color: #8a5800; }
.status.assessment { background: #e6efff; color: #2356a8; }
.status.inspection { background: #fff1d6; color: #8a5800; }
.status.rectification { background: #FEF3C7; color: #D97706; }
.status.decision { background: #e6efff; color: #2356a8; }
.status.closed { background: #e4f4ef; color: #147153; }

/* Licence case form — applicant-type tabs, attached to the top of the form
   panel like page-level navigation. Clean text tabs, not filled buttons —
   the active tab's border overlaps the tab bar's own bottom border via the
   -1px margin (the classic tab-attached-to-content technique). */
.applicantTabs { display: flex; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); }
.applicantTab {
  display: inline-block; padding: 12px 20px; background: none; border: 0; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; outline: none;
  font: inherit; font-size: inherit; font-weight: 400; color: var(--muted);
  cursor: pointer; transition: color .15s;
}
.applicantTab:hover { color: #374151; }
.applicantTab.active {
    color: var(--navy);
    font-weight: 600;
    border-bottom-color: #5256a6;
    background-color: #8383eb4f;
    border-radius: 4px;
}

/* Sub-heading inside a .formGrid — e.g. "Inspection" / "Decision" grouping
   labels in the licence case Processing section. Smaller and not uppercase,
   unlike .sectionLabel, since it's one step down in the hierarchy. */
.subLabel { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--navy); margin: 12px 0 4px; }

/* ===== Licence case detail — workflow progress stepper ===== */
.workflowStepper {
  display: flex; align-items: flex-start; padding: 28px 32px 20px;
  background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 20px;
}
.workflowStep { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.stepDot { position: relative; width: 28px; height: 28px; border-radius: 50%; }
.workflowStep.completed .stepDot { background: #2B35FF; border: 2px solid #2B35FF; }
.workflowStep.completed .stepDot::after {
  content: ''; display: block; width: 7px; height: 12px;
  border: solid white; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
  position: absolute; top: 50%; left: 50%; margin-top: -7px; margin-left: -4px;
}
.workflowStep.current .stepDot { background: #16A34A; border: 2px solid #16A34A; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2); }
.workflowStep.upcoming .stepDot { background: #fff; border: 2px solid #D1D5DB; }
/* Closed-with-decision stepper states — the final step reads as granted
   (green check) or refused (red dot) instead of the generic completed
   blue check, once a decision has actually been recorded. */
.workflowStep.granted .stepDot { background: #16A34A; border-color: #16A34A; }
.workflowStep.granted .stepDot::after {
  content: ''; display: block; width: 7px; height: 12px;
  border: solid white; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
  position: absolute; top: 50%; left: 50%; margin-top: -7px; margin-left: -4px;
}
.workflowStep.refused .stepDot { background: #DC2626; border-color: #DC2626; }
.workflowStep.refused .stepDot::after {
  content: ''; display: block; width: 5px; height: 5px; background: white;
  border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.stepLabel { display: block; margin-top: 8px; font-size: 11px; text-align: center; }
.workflowStep.completed .stepLabel { color: #2B35FF; font-weight: 500; }
.workflowStep.current .stepLabel { color: var(--navy); font-weight: 700; }
.workflowStep.upcoming .stepLabel { color: #9CA3AF; font-weight: 400; }
.workflowStep.granted .stepLabel { color: #16A34A; font-weight: 700; }
.workflowStep.refused .stepLabel { color: #DC2626; font-weight: 700; }
.stepConnector { flex: 1; height: 2px; align-self: flex-start; margin-top: 13px; }
.stepConnector.completed { background: #2B35FF; }
.stepConnector.upcoming { background: #D1D5DB; }
.stepSubLabel { display: block; font-size: 10px; color: #D97706; font-weight: 600; margin-top: 2px; text-align: center; }

/* Status banner — sits between the stepper and the detail panel on the
   licence case detail page, showing the full current status now that the
   header pill is gone. Reuses the existing .status.* colour classes. */
.statusBanner {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: #fff; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.statusBannerLabel { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.statusBannerValue { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 4px; }
.statusBannerNote { font-size: 12px; color: #D97706; font-weight: 500; margin-left: auto; }

/* Edit button, disabled state — case is past the editable stages */
.wf-disabled {
  display: inline-block; padding: 8px 20px; background: #D1D5DB; color: #9CA3AF;
  border-radius: 6px; font-size: 14px; font-weight: 500; cursor: not-allowed;
}

/* Licence case detail page — horizontal key/value rows, two per line, an
   alternative to .factGrid/.Casefact (left untouched — other modules still
   use those). Named .factDetailRow rather than .factRow — that name is
   already taken by Accessible Malta's three-across fact grid above, and
   reusing it here would let the two rules fight over the same class.
   Every row keeps its own border-bottom (none removed on the last one) so
   a row's pair always lines up evenly — dropping just one side's border
   for an odd trailing fact looked uneven against its row-mate. */
.factList { display: grid; grid-template-columns: 1fr 1fr; gap: 0 7em; }
.factDetailRow { display: flex; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.factLabel { width: 220px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.factValue { font-size: 14px; color: #0B0C2A; font-weight: 500; }

/* Licence case detail panel — scoped so the spacing rework doesn't touch
   .detailSection/.panel elsewhere (other modules' side panels reuse both). */
.caseDetailPanel { border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.caseDetailPanel .detailSection { border-top: none; border-bottom: 1px solid var(--line); margin-top: 0; padding: 20px 0; }
.caseDetailPanel .detailSection:first-child { padding-top: 0; }
.caseDetailPanel .detailSection:last-child { border-bottom: none; padding-bottom: 0; }

/* Module header: back link + subtitle (matches prototype pxTop) */
.back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; display: inline-block; margin-bottom: 6px; }
.back:hover { color: var(--navy2); }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ===== Accessible Malta ===== */

/* Status pills — bright, matches Data Exchange's vibrancy. .verified is
   shared with Sustainability Passport below (same colour requested for
   both, so one canonical rule serves both modules). */
.status.unverified { background: #e6eaef; color: #4b5563; }
.status.verified { background: #c8ecd6; color: #0d7a45; }
.status.expiring { background: #ffe6b8; color: #b45309; }
.status.expired { background: #fdd5da; color: #c2213a; }

/* Four attribute tiles: label left, value right, on one row */
.attrGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.attr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.attr span {
  font-size: 13px; color: var(--muted); font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.attr strong { font-size: 15px; font-weight: 800; white-space: nowrap; }
.attr.yes { background: #e4f4ef; border-color: #b8e6d5; }
.attr.yes strong { color: #147153; }
.attr.no { background: #fee7e9; border-color: #f5c6cd; }
.attr.no strong { color: #b42334; }
.attr.unknown { background: #f4f6f8; }
.attr.unknown strong { color: var(--muted); }

/* Surface notes strip */
.notes { font-size: 14px; color: var(--text); background: #f8fafc; padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }

/* Accessible Malta facts — three across, horizontal */
.factRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 4px; }
.factRow .fact { display: flex; flex-direction: column; gap: 3px; }
.factRow .fact span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.factRow .fact strong { font-size: 14px; font-weight: 600; }

/* ===== Sustainability Passport ===== */

/* Impact tiles (reuse metrics look) */
.impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.impact article { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 7px; }
.impact span { font-size: 13px; color: var(--muted); }
.impact strong { font-size: 26px; }

/* Claim statuses — bright, matches Data Exchange's vibrancy. .verified is
   defined once, above (Accessible Malta section) — same colour for both. */
.status.pending { background: #ffe6b8; color: #b45309; }
.status.reversed { background: #e6eaef; color: #4b5563; }
.status.rejected { background: #fdd5da; color: #c2213a; }

/* Programme action rows */
.actionRows { padding: 4px 0; }
.actionRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.actionRow:last-child { border-bottom: 0; }
.actionRow strong { font-size: 13px; display: block; }
.actionRow small { color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: #eef1f4; color: #596875; white-space: nowrap; }
.tag.on { background: #e4f4ef; color: #147153; }

/* ===== Login page ===== */
.loginBody { display: grid; place-items: center; min-height: 100vh; background: var(--navy); padding: 20px; }
.loginCard { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.loginBrand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.loginBrand > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--navy); padding: 5px; }
.loginBrand > span img { width: 100%; height: 100%; object-fit: contain; }
.loginBrand strong { display: block; font-size: 15px; color: var(--navy); }
.loginBrand small { color: var(--muted); font-size: 12px; }
.loginCard h1 { font-size: 22px; margin-bottom: 4px; }
.loginSub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.loginCard form label { display: block; margin-bottom: 16px; }
.loginCard form label span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.loginCard form input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; }
.loginCard form input:focus { outline: none; border-color: var(--navy2); }
.loginBtn { width: 100%; background: var(--navy2); color: #fff; border: 0; border-radius: 9px; padding: 12px; font-weight: 750; font-size: 15px; cursor: pointer; margin-top: 4px; }
.loginError { background: #fee7e9; color: #b42334; padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 18px; }
.loginNote { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; margin-bottom: 0; }

/* ===== User bar / avatar (top-right) ===== */
.userBar {
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
  position: sticky; top: 0; z-index: 50;
  background: #e8ecf3;
  border-bottom: 1px solid var(--line);
  padding: 5px 32px;
}
.userAvatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy2); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
/* Staff detail page shows a bigger avatar, and — new here — an actual
   uploaded photo instead of just initials. */
.userAvatar.large { width: 64px; height: 64px; font-size: 22px; }
.userAvatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.userMeta { display: flex; flex-direction: column; line-height: 1.2; }
.userMeta strong { font-size: 13px; color: var(--navy); }
.userMeta small { font-size: 11px; color: var(--muted); }
.logoutForm { margin: 0; }
.logoutBtn { background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.logoutBtn:hover { background: var(--blue-light); }

/* ===== Staff pages ===== */

/* Role pill — one bright colour per role (CustomUser.role_slug), defined
   once and reused everywhere a role shows: the staff table, the detail
   header, the detail page's image card. .rolePill itself is the base
   shape (white text); the role-<slug> modifier only sets the background. */
.rolePill {
  display: inline-block; padding: 5px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800; color: #fff; white-space: nowrap;
  background: var(--muted);
}
.rolePill.role-platform_admin { background: #F59E0B; }
.rolePill.role-organisation_admin { background: #DC2626; }
.rolePill.role-steward { background: #2563EB; }
.rolePill.role-inspector { background: #0D9488; }
.rolePill.role-operator { background: #16A34A; }
.rolePill.role-viewer { background: #6B7280; }
/* Detail page header only: same coloured background, black/near-black
   text instead of white (list page + image-card pill keep white text). */
.rolePill.rolePill--dark { color: var(--navy); }

/* Role-count cards on staff_list — a scoped modifier on .metrics (NOT a
   change to .metrics itself) so the 6 cards always stay on one row without
   affecting the Overview's 5-tile metrics, which keep .metrics' own grid
   and responsive breakpoints untouched. flex+shrink (not grid-template)
   is what makes "never wrap, may shrink on narrow screens" trivial: cards
   just compress instead of needing per-breakpoint column counts, and the
   compound selector (2 classes) outranks .metrics' own media-query rules
   regardless of viewport width. */
.metrics.roleCards { display: flex; flex-wrap: nowrap; }
.metrics.roleCards article { flex: 1 1 0; min-width: 0; }
.metrics.roleCards article span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* staff_detail: left profile-image card + right info card. */
.staffDetailLayout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.staffProfileCard { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.staffProfileCard h2 { font-size: 18px; margin: 4px 0 0; }
/* Scoped to staff_detail's info card only — .attr/.attrGrid is shared with
   Accessible Malta's yes/no boxes, which must keep their own weights.
   Label leads (bold), value follows (regular) — same sizes as before,
   just the two weights swapped. */
.staffInfoCard .attr span { font-weight: 800; }
.staffInfoCard .attr strong { font-weight: 400; }
/* position:relative so staff_form.html (which reuses this exact class —
   frame shape must match the detail page, not the circular userBar
   avatar) can anchor the red clear-X to this frame's top-right corner. */
.profileImageFrame { width: 100%; position: relative; }
.profileImageFrame img {
  width: 100%; height: 250px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line);
}
/* Placeholder shown when there's no profile_image — reused as-is by
   staff_form.html for the same "no image yet" state. */
.placeholder-box {
  width:230px; height: 250px; background: #eef1f4; border: 1px solid var(--line);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.placeholder-box svg { width: 72px; height: 72px; color: var(--muted); }

/* staff_form: the upload control sits below .profileImageFrame/.placeholder-box
   above (same rounded-rectangle frame as the detail page — the circle shape
   stays exclusive to the small userBar avatar in base.html). A labelled
   "Change" button opens the file picker; a red clear-X at the frame's
   top-right corner (shown once there's an image, existing or just picked)
   toggles Django's own clear-on-save checkbox. Both drive the real
   ClearableFileInput via JS — see the avatarRawWidget rule below and
   staff_form.html's script. */
.avatarUpload { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Red clear-X, top-right corner of the frame. */
.avatarClearBtn {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 26px;
  border-radius: 50%; background: #DC2626; border: 2px solid #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.avatarClearBtn svg { width: 13px; height: 13px; color: #fff; }
/* "Change" button below the frame — label text, then the pen icon. */
.avatarChangeBtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--navy); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.avatarChangeBtn svg { width: 14px; height: 14px; }
/* The real <input type="file"> + Django's own ClearableFileInput chrome
   ("Currently: / Clear / Change: / Choose File") render here but stay
   fully hidden — the custom controls above are the only visible UI, and
   drive this hidden widget via JS (see staff_form.html). */
.avatarRawWidget { display: none; }

/* Password field with an eye-toggle button (main password field only —
   confirm_password has no eye, per spec). */
.passwordFieldWrap { position: relative; }
.passwordFieldWrap input { padding-right: 38px; width: 100%; }
.passwordToggleBtn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; cursor: pointer; display: grid; place-items: center;
}
.passwordToggleBtn svg { width: 18px; height: 18px; color: var(--muted); }

/* Active checkbox — checkbox + label rendered as one inline row instead
   of .formField's default label-above-input stack. */
.formField.checkboxField label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.formField.checkboxField input[type="checkbox"] { margin: 0; }

/* ===== Login — 5:1 split screen ===== */
.loginSplit { display: grid; grid-template-columns: 5fr 1fr; min-height: 100vh; }
.loginBrandPanel {
  background: var(--navy);
  display: grid; place-items: center;
  background-image: radial-gradient(circle at 30% 40%, rgba(43,53,255,.35), transparent 55%);
}
.loginBrandInner { text-align: center; color: #fff; padding: 40px; }
.loginLogoTile {
  width: 140px; height: 140px; border-radius: 28px; background: #fff;
  display: grid; place-items: center; margin: 0 auto 28px; padding: 18px;
}
.loginLogoTile img { width: 100%; height: 100%; object-fit: contain; }
.loginBrandInner h2 { font-size: 40px; margin: 0 0 6px; color: #fff; }
.loginBrandInner p { font-size: 18px; color: #b9cad7; margin: 0; }

.loginFormPanel {
  background: #fff; padding: 56px 40px; display: flex; flex-direction: column;
  justify-content: center; min-width: 340px;
}
.loginFormPanel h1 { font-size: 24px; margin-bottom: 4px; }
.loginSub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.loginFormPanel form label { display: block; margin-bottom: 18px; }
.loginFormPanel form label span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.loginFormPanel form input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; }
.loginFormPanel form input:focus { outline: none; border-color: var(--navy2); }
.loginBtn { width: 100%; background: var(--navy2); color: #fff; border: 0; border-radius: 9px; padding: 13px; font-weight: 750; font-size: 15px; cursor: pointer; margin-top: 4px; }
.loginError { background: #fee7e9; color: #b42334; padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 18px; }
.loginNote { color: var(--muted); font-size: 12px; margin-top: 26px; margin-bottom: 0; }

@media (max-width: 900px) {
  .loginSplit { grid-template-columns: 1fr; }
  .loginBrandPanel { min-height: 200px; }
}

/* ===== Place create/edit form ===== */
.formCard {background: var(--lavendegrey); border: 1px solid var(--line);border-radius: 14px; box-shadow: var(--shadow);  padding: 20px;  margin-bottom: 16px; }
.formGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.formField { display: flex; flex-direction: column; gap: 6px; }
.formField.wide { grid-column: 1 / -1; }
.formField label { font-size: 13px; font-weight: 600; color: var(--navy); }
.formField input, .formField select, .formField textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
/* The staff form is the first one with checkbox (is_active) and file
   (profile_image) fields — the generic input padding above stretches a
   checkbox into a large square and cramps the browser's file-input chrome,
   so both get a reset back to their natural size. */
.formField input[type="checkbox"] { width: auto; padding: 0; border: none; }
.formField input[type="file"] { padding: 6px 4px; }
.formField textarea { resize: vertical; }
.formField input:focus, .formField select:focus, .formField textarea:focus { outline: none; border-color: var(--navy2); }
.fieldHelp { color: var(--muted); font-size: 12px; margin: 0; }
.fieldError { color: var(--red); font-size: 12px; margin: 0; }
/* Required-field marker on form labels, across every module + staff form.
   Literal #DC2626 (not var(--red), which is currently repointed to the
   app's action blue) so this always reads as unambiguously red. */
.req { color: #DC2626; margin-left: 2px; }

/* Document uploads (case_form.html) — plain doc_<type> file inputs, not
   Django form fields, so they get their own row markup instead of
   .formField. */
.sectionHint { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.documentChecklist { display: flex; flex-direction: column; gap: 0; }
.documentRow { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.documentRow:last-child { border-bottom: none; }
.documentRow label { width: 300px; flex-shrink: 0; font-size: 13px; font-weight: 500; color: var(--navy); }
.documentRow input[type="file"] { flex: 1; font-size: 13px; }
.docCurrent { font-size: 12px; color: var(--muted); }

/* Declarations checklist (case_form.html) */
.declarationList { display: flex; flex-direction: column; gap: 12px; }
.declarationItem { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--navy); cursor: pointer; line-height: 1.5; }
.declarationItem input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--navy2); }

/* Document links on the case detail page */
.docLink { color: var(--navy2); font-weight: 500; text-decoration: none; }
.docLink:hover { text-decoration: underline; }
.docMeta { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Cancel link styled like a workflow button */
.workflowButtons a.wf-ghost, .workflowButtons a.wf-primary {
  display: inline-flex; align-items: center; text-decoration: none;
  padding: 9px 14px; border-radius: 8px; font-weight: 700; font-size: 13px;
}
/* ===== Sidebar language footer ===== */
.sidebar { display: flex; flex-direction: column; }

.sidebarFooter { margin-top: auto; }          /* pins the whole footer to the bottom */

.sidebarFooterLabel {                          /* "Change language" label, above the divider */
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin: 0 0 8px;
  padding-top: 16px;
}

.langSwitch {                                  /* the two-half bar */
  display: flex;
  border-top: 1px solid rgba(255,255,255,.15); /* the divider ABOVE the bar */
  padding-top: 12px;
}

.langSwitch button {
  flex: 1;                                     /* equal halves */
  border: 0;
  border-radius: 0;                            /* NO pill/rounding */
  background: transparent;
  color: rgba(255,255,255,.7);
  padding: 10px 0;                             /* thicker rectangular bar */
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.langSwitch button:first-child {
  border-right: 1px solid rgba(255,255,255,.15); /* the middle divider between EN | MT */
}

.langSwitch button.on {
  background: #c4c6d633;               /* active half = lighter blue */
  color: var(--navy);                          /* dark text on the pale-blue active half */
  color: #fff;
  border-radius: 8px;
}
/* Staff role cards: bold, role-coloured LABEL text (card background unchanged) */
.roleCards .roleLabel { font-weight: 700; }
.roleCards .roleLabel.role-platform_admin { color: #F59E0B; }
.roleCards .roleLabel.role-organisation_admin { color: #DC2626; }
.roleCards .roleLabel.role-steward { color: #2563EB; }
.roleCards .roleLabel.role-inspector { color: #0D9488; }
.roleCards .roleLabel.role-operator { color: #16A34A; }
.roleCards .roleLabel.role-viewer { color: #6B7280; }

/* ===== Flash messages (base.html messages block) ===== */
.messagesContainer { margin-bottom: 20px; }
.messageAlert {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
    margin-bottom: 8px; animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.messageAlert.success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.messageAlert.warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.messageAlert.error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.messageAlert.info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.messageClose { background: none; border: none; font-size: 15px; cursor: pointer; opacity: 0.6; padding: 0 4px; }
.messageClose:hover { opacity: 1; }

/* ===== Transition modals (case detail approve/reject/rectification) ===== */
.transitionModal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; }
.modalOverlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modalContent { position: relative; background: white; border-radius: 12px; padding: 32px; max-width: 480px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); z-index: 1; }
.modalContent h3 { font-size: 18px; font-weight: 700; color: #0B0C2A; margin-bottom: 4px; }
.modalHint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modalContent .formField { margin-bottom: 14px; }
.modalActions { display: flex; gap: 12px; margin-top: 24px; }
/* Destructive workflow button (reject licence) — matches the .wf-* button
   family already used in .workflowButtons / .modalActions. */
.wf-danger { background: #DC2626; color: #fff; border: 0; padding: 9px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* ===== Place badge (case detail) + pill (case list) ===== */
.placeBadge { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 8px; margin-bottom: 16px; }
.placeBadgeLabel { font-size: 13px; font-weight: 600; color: #065F46; }
.placeBadgeLink { font-size: 13px; font-weight: 600; color: #2B35FF; text-decoration: none; }
.placeBadgeLink:hover { text-decoration: underline; }
.placePill { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600; color: #065F46; background: #D1FAE5; border-radius: 4px; text-decoration: none; margin-left: 8px; }
.placePill:hover { background: #A7F3D0; }

/* ===== Establishment location map picker (licence edit form) — matches
   the .placesMap radius/overflow convention used by the Data Exchange map. */
.mapPicker { width: 100%; height: 320px; border-radius: 11px; border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.mapCoordsDisplay { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Location search box above the map picker */
.mapSearchBox { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
#locationSearchInput { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px 0 0 6px; font-size: 14px; outline: none; }
#locationSearchInput:focus { border-color: #2B35FF; }
.mapSearchBtn { width: 40px; height: 37px; background: #0B0C2A; border: none; border-radius: 0 6px 6px 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mapSearchBtn:hover { background: #2B35FF; }
.mapSearchResults { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 200px; overflow-y: auto; z-index: 500; }
.mapSearchResultItem { padding: 10px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.mapSearchResultItem:last-child { border-bottom: none; }
.mapSearchResultItem:hover { background: #EEF0FF; }
.mapSearchLoading, .mapSearchEmpty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* Manual lat/lng entry row below the map */
.mapManualCoords { display: flex; gap: 16px; margin-top: 12px; }
.mapManualCoords .formField { flex: 1; }

/* Autofill feedback notice — spans the full establishment formGrid row */
.autofillNotice { grid-column: 1 / -1; background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; font-size: 12px; font-weight: 500; padding: 8px 14px; border-radius: 6px; margin-bottom: 16px; }
