/**
 * Dead North — POLARIS app shell.
 * "Color is an event": monochrome at rest, red only on state. Dark ground is
 * the broadcast; light is the printed poster. Georgia carries the identity.
 */

/* ---- Tokens: light ("printed poster") is the bare :root. ---- */
:root {
  --bg: #f0ece3;
  --panel: #faf8f2;
  --panel-2: #f4f0e7;
  --line: #ddd7ca;
  --line-2: #cfc8b8;
  --ink: #1a1917;
  --ink-2: #57544d;
  --ink-3: #8a867c;
  --red: #d21f1f;
  --red-deep: #a81717;
  --red-glow: rgba(210, 31, 31, 0.14);
  --track: #e7ddd6;
  --good: #3f8a5c;
  --warn: #b2791f;
  --grain-opacity: 0.5;

  --rail-w: 250px;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: ui-sans-serif, -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --r: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* System dark unless an explicit light choice wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0d0f;
    --panel: #16161a;
    --panel-2: #1d1d22;
    --line: #2b2b33;
    --line-2: #3a3a44;
    --ink: #ece8e1;
    --ink-2: #9d9a93;
    --ink-3: #64625c;
    --red: #e02424;
    --red-deep: #b01a1a;
    --red-glow: rgba(224, 36, 36, 0.2);
    --track: #2a1a1c;
    --good: #57a06e;
    --warn: #c6902f;
    --grain-opacity: 0.35;
  }
}

/* Explicit dark choice wins in the other direction. */
:root[data-theme='dark'] {
  --bg: #0d0d0f;
  --panel: #16161a;
  --panel-2: #1d1d22;
  --line: #2b2b33;
  --line-2: #3a3a44;
  --ink: #ece8e1;
  --ink-2: #9d9a93;
  --ink-3: #64625c;
  --red: #e02424;
  --red-deep: #b01a1a;
  --red-glow: rgba(224, 36, 36, 0.2);
  --track: #2a1a1c;
  --good: #57a06e;
  --warn: #c6902f;
  --grain-opacity: 0.35;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  /* The resting halftone grain — the monochrome texture the brand rests on. */
  background-image: radial-gradient(var(--line) 0.6px, transparent 0.7px);
  background-size: 4px 4px;
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- Custom scrollbars: thin, on-brand, red thumb on hover ---- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 99px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--red); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Drupal's admin toolbar / D11 navigation sidebar are replaced by our own
   rail — gone on the app front end. */
#toolbar-administration,
.toolbar-oriented,
.admin-toolbar,
#admin-toolbar,
[data-drupal-admin-toolbar],
.admin-toolbar-wrapper { display: none !important; }
body.toolbar-fixed,
body.admin-toolbar--collapsed,
body.admin-toolbar--expanded,
body { padding-top: 0 !important; padding-inline-start: 0 !important; }

/* ============================ APP SHELL ============================ */

.dn-app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
}

/* Mobile-only overlay — must not occupy a grid cell on desktop, or it
   shunts the rail and main column out of place. */
.dn-scrim { display: none; }

/* ---- Console rail ---- */
.dn-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
}

.dn-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 8px 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 14px;
}
.dn-brand .star { color: var(--red); font-size: 15px; }
.dn-brand small {
  display: block;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 600;
  margin-top: 3px;
}

.dn-nav-group { margin-bottom: 6px; }
.dn-nav-group > .label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 12px 10px 5px;
}

.dn-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.dn-nav-item .ico {
  width: 16px;
  text-align: center;
  opacity: 0.75;
  font-size: 13px;
}
/* Red-wipe underline on hover — the event. */
.dn-nav-item::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 5px;
  height: 1.5px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease);
}
.dn-nav-item:hover { color: var(--ink); background: var(--panel-2); }
.dn-nav-item:hover::after { transform: scaleX(1); }
.dn-nav-item.is-active {
  color: var(--ink);
  background: var(--panel-2);
}
.dn-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.dn-rail-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
}
.dn-rail-foot .pos {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.7;
}
.dn-rail-foot .pos b { color: var(--ink); }
.dn-rail-who { font-size: 11px; color: var(--ink-3); padding: 2px 8px 8px; }
.dn-rail-who b { color: var(--ink-2); font-weight: 600; }
.dn-rail-account { display: grid; gap: 2px; margin-bottom: 6px; }
.dn-rail-account .dn-nav-item { font-size: 13px; }
.dn-theme-toggle {
  margin-top: 10px;
  width: 100%;
  padding: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.18s;
}
.dn-theme-toggle:hover { border-color: var(--red); color: var(--ink); }

/* ---- Main column ---- */
.dn-main { min-width: 0; display: flex; flex-direction: column; }

.dn-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dn-hamburger {
  display: none;
  background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--ink); cursor: pointer;
  font-size: 15px;
}
.dn-topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.01em;
}
.dn-ticker {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.dn-ticker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.dn-ticker b { color: var(--ink); }

.dn-content { padding: 26px; max-width: 1200px; width: 100%; }

/* ============================ REVEAL MOTION ============================ */
.js .dn-reveal { opacity: 0; transform: translateY(10px); }
.js .dn-reveal.in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }

/* ============================ DASHBOARD ============================ */

h2 {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 36px 0 14px;
}

/* Hero */
.polaris-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.polaris-big {
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.polaris-of { color: var(--ink-3); font-size: 17px; }
.polaris-of:last-child { margin-left: auto; font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; }

.polaris-meter {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: var(--track);
  margin: 16px 0 7px;
  overflow: visible;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}
.polaris-meter > i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  box-shadow: 0 0 14px var(--red-glow);
  width: 0;
  transition: width 1.1s var(--ease);
}
.polaris-meter .tick {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px; border-radius: 1px; background: var(--ink-3); opacity: 0.5;
}
.polaris-cap { color: var(--ink-3); font-size: 12.5px; }
.polaris-cap .lat { color: var(--ink); font-weight: 600; font-family: var(--mono); }
.polaris-cap strong { color: var(--ink-2); }
.polaris-pace { margin-top: 5px; font-family: var(--mono); font-size: 11.5px; }
.polaris-pace strong { color: var(--ink); }
.polaris-pace-behind strong { color: var(--red); }
.polaris-pace-on strong { color: var(--good); }

/* Stat tiles */
.polaris-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0 6px;
}
.polaris-tile {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.polaris-tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
a.polaris-tile { display: block; color: inherit; }
/* Color is the event: a tile with something waiting glows red. */
.polaris-tile.alert { border-color: var(--red); }
.polaris-tile.alert .value { color: var(--red); }
.polaris-tile .label { font-size: 11px; letter-spacing: 0.04em; color: var(--ink-3); text-transform: uppercase; }
.polaris-tile .value { font-family: var(--serif); font-size: 27px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.polaris-tile .note { color: var(--ink-3); font-size: 11.5px; }

/* Instruments (charts) */
.dn-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dn-chart-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 16px 18px;
}
.dn-chart-card h3 {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--ink-3); font-weight: 700;
}
.dn-chart-card canvas { max-height: 220px; }
@media (max-width: 760px) { .dn-charts { grid-template-columns: 1fr; } }

/* Cards + tables (dashboard sections) */
.cardlist { display: grid; gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--r);
  padding: 14px 16px;
}
.card.approved { border-left-color: var(--good); }
.card .meta { color: var(--ink-2); font-size: 12.5px; margin-bottom: 4px; }
.card .subject { font-weight: 600; }
.card summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; margin-top: 6px; }
.card pre.body {
  white-space: pre-wrap; margin: 8px 0 0;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; font: 12.5px/1.5 var(--mono); overflow-x: auto;
}
.card .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Wide tables scroll inside their own box instead of shoving the page
   sideways. Long text wraps so tables fit the container in the first place. */
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.scroller table { margin: 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
th, td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  color: var(--ink-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  white-space: nowrap;
  background: var(--panel);
  border-bottom: 1px solid var(--line-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
tbody tr:hover td, tr:hover td { background: color-mix(in srgb, var(--red-glow) 40%, transparent); }
/* Money and dates never wrap; numbers align. */
td.num, .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td:has(> time), td.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); }
.due-over { color: var(--red); font-weight: 600; }
.empty { color: var(--ink-3); font-size: 13.5px; border: 1px dashed var(--line); border-radius: var(--r); padding: 16px; }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 11px; min-height: 60px; }
.col h3 { margin: 0 0 9px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); display: flex; justify-content: space-between; }
.lead { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; font-size: 13px; }
.lead .t { font-weight: 600; font-size: 13.5px; }
.lead .m { color: var(--ink-2); margin-top: 2px; }
.pill { display: inline-block; border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 8px; font-size: 10.5px; color: var(--ink-2); }

/* Forms / buttons (shared across dashboard + login) */
button, .button, select, input[type='text'], input[type='date'], input[type='password'], input[type='email'] {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 13px;
  font: inherit;
  font-size: 13.5px;
}
button, .button { cursor: pointer; transition: border-color 0.18s, background 0.18s; }
button:hover, .button:hover { border-color: var(--ink-3); }
.button--primary, button.primary {
  background: var(--red); border-color: var(--red); color: #fff; font-weight: 600;
}
.button--primary:hover, button.primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.inlineform { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ===================== ADMIN CRUD, IN THE SHELL ===================== */
/* Primary actions ("+ Add lead"). */
.action-links { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.action-links a, a.button-action {
  display: inline-block;
  background: var(--red); border: 1px solid var(--red); color: #fff;
  border-radius: 8px; padding: 9px 15px; font-weight: 600; font-size: 13.5px;
}
.action-links a:hover, a.button-action:hover { background: var(--red-deep); border-color: var(--red-deep); }
/* Local actions can render as a bare <nav> with direct <li> children and no
   ul.action-links wrapper — strip the default bullets and lay them in a row.
   A direct-child <li> of a <nav> is unique to this; tabs nest their <li> in a
   <ul>, so they're untouched. */
.dn-content nav > li { list-style: none; display: inline-block; margin: 0 8px 12px 0; }

/* Entity edit/delete tabs. */
nav.tabs { margin: 0 0 22px; }
ul.tabs, .tabs.primary {
  list-style: none; display: flex; gap: 2px; padding: 0; margin: 0 0 22px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
ul.tabs > li > a, .tabs.primary > li > a {
  display: block; padding: 9px 15px; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
ul.tabs > li > a:hover { color: var(--ink); }
ul.tabs > li > a.is-active, .tabs.primary > li > a.is-active {
  color: var(--ink); border-bottom-color: var(--red);
}

/* Dropbutton operations column. */
.dropbutton-wrapper { display: inline-block; position: relative; }
.dropbutton-widget { border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: var(--panel-2); }
.dropbutton .dropbutton-action a { padding: 6px 12px; font-size: 13px; }
.dropbutton-toggle button { border: none; border-left: 1px solid var(--line-2); background: transparent; padding: 6px 8px; }

/* Forms inside the app (login styles its own card separately). */
.dn-content .form-item { margin-bottom: 15px; }
.dn-content .form-item > label,
.dn-content .form-item > .form-item__label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 700; margin-bottom: 6px;
}
.dn-content .form-item .description { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.dn-content textarea { width: 100%; min-height: 90px; font: inherit; }
.dn-content input[type='text'], .dn-content input[type='email'], .dn-content input[type='number'],
.dn-content input[type='url'], .dn-content input[type='date'], .dn-content input[type='tel'],
.dn-content select { max-width: 100%; }
.dn-content .form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.dn-content .form-actions .button { padding: 10px 18px; }
/* Views/entity list wrapper breathing room. */
.dn-content .views-element-container, .dn-content .region-content { min-width: 0; }

/* ============================ FORECAST STUDIO ============================ */
#dn-forecast { display: grid; gap: 18px; }

.fc-readout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1.4fr;
  gap: 16px;
  align-items: stretch;
}
.fc-verdict {
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--r);
  background: var(--panel);
  padding: 18px 20px;
}
.fc-verdict .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.13em; color: var(--ink-3); font-weight: 700; }
.fc-date {
  font-family: var(--serif);
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 600; line-height: 1.05; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.fc-sub { color: var(--ink-2); font-family: var(--mono); font-size: 12px; margin-top: 6px; }

.fc-now {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.fc-now > div {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 12px 14px;
}
.fc-now .label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.fc-now b { font-family: var(--serif); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-now #fc-vs-deadline.on { color: var(--good); }
.fc-now #fc-vs-deadline.off { color: var(--red); }

.fc-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-presets button { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.fc-presets button.on { background: var(--red); border-color: var(--red); color: #fff; }

.fc-levers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 18px 20px;
}
.fc-levers label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 700;
}
.fc-levers input[type='range'] {
  grid-column: 1 / -1;
  width: 100%; padding: 0; margin: 0; border: none; background: transparent;
  accent-color: var(--red);
  cursor: pointer;
}
.fc-levers output {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  text-transform: none; letter-spacing: 0; font-weight: 500;
}
.fc-levers .lever-hint {
  text-transform: none; letter-spacing: 0; font-weight: 400;
  color: var(--ink-3); font-size: 10.5px;
}
#fc-chart { max-height: 260px; }
.fc-note { color: var(--ink-3); font-size: 12px; margin: 0; }

/* ============================ REPORTS ============================ */
/* Survival-tile value states — color is the event: red = not covered. */
.polaris-tile .value.fc-state-on { color: var(--good); }
.polaris-tile .value.fc-state-off { color: var(--red); }
.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rpt-grid .full { grid-column: 1 / -1; }
.rpt-grid canvas { max-height: 260px; }
@media (max-width: 820px) {
  .rpt-grid { grid-template-columns: 1fr; }
  .fc-readout { grid-template-columns: 1fr; }
  .fc-levers { grid-template-columns: 1fr; }
}

/* ============================ LEAD WORKSPACE ============================ */
.lead-ws { display: grid; gap: 18px; }

.lead-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.lead-head-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-head-actions { display: flex; gap: 8px; }
.lead-head-actions .button { font-size: 13px; }

/* Stage badge — color is the event: red only on the hot stages. */
.lead-stage {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--panel-2);
}
.lead-stage--replied, .lead-stage--call, .lead-stage--proposal {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 0 14px var(--red-glow);
}
.lead-stage--won { background: var(--good); border-color: var(--good); color: #fff; }
.lead-stage--lost { opacity: 0.6; }
.lead-service {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.lead-evidence { margin: 0; font-size: 13px; }
.lead-evidence a { color: var(--red); overflow-wrap: anywhere; }

.lead-cols { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.lead-col-main, .lead-col-side { display: grid; gap: 16px; min-width: 0; }

.lead-block {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); padding: 16px 18px;
}
.lead-block h2 { margin: 0 0 12px; }
.lead-notes { font-size: 14px; line-height: 1.6; }

/* Details definition list */
.lead-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; }
.lead-meta dt { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.lead-meta dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }

/* Inline note form */
.lead-note-form { margin-bottom: 16px; }
.lead-note-form textarea { width: 100%; min-height: 58px; }
.lead-note-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.lead-note-row .form-item { margin: 0; }
.lead-note-row select { padding: 7px 10px; }
.lead-note-row .form-actions { margin: 0; margin-left: auto; }

/* Timeline */
.lead-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lead-timeline li { position: relative; display: flex; gap: 12px; padding: 12px 0 12px 4px; border-top: 1px solid var(--line); }
.lead-timeline li:first-child { border-top: none; }
.lt-mark {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.lt-dir-out .lt-mark { border-color: var(--red); color: var(--red); }
.lt-dir-in .lt-mark { border-color: var(--good); color: var(--good); }
.lt-body { min-width: 0; flex: 1; }
.lt-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lt-head b { font-size: 13px; }
.lt-head time { color: var(--ink-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.lt-text { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }

/* Documents */
.lead-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lead-file {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  transition: border-color 0.18s;
}
.lead-file:hover { border-color: var(--red); }
.lf-name { flex: 1; font-size: 13px; overflow-wrap: anywhere; }
.lf-size { color: var(--ink-3); font-size: 11px; font-family: var(--mono); }

/* Image gallery */
.lead-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.lg-item { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.lg-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease); }
.lg-item:hover img { transform: scale(1.06); }

/* Link list */
.lead-linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lead-linklist a { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.lead-linklist a:hover { color: var(--red); }

@media (max-width: 900px) {
  .lead-cols { grid-template-columns: 1fr; }
}

/* ============================ INFRASTRUCTURE ============================ */
.dn-infra { display: grid; gap: 16px; }
.infra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.infra-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.infra-card.infra-retired { opacity: 0.55; }
.ic-top { display: flex; align-items: center; justify-content: space-between; }
.ic-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 700; }
.ic-name { margin: 2px 0 0; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.ic-provider { color: var(--ink-2); font-size: 13px; }
.ic-cost { font-family: var(--mono); font-size: 13px; color: var(--ink); margin-top: 2px; }
.ic-notes { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; margin: 6px 0 0; }
.ic-links { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; }
.ic-links a { color: var(--ink-2); }
.ic-links a:hover { color: var(--red); }
.ic-links .ic-edit { margin-left: auto; color: var(--ink-3); }

/* ============================ CALENDAR ============================ */
.dn-cal { display: grid; gap: 14px; }
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-title { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); min-width: 180px; }
.cal-head .button { padding: 7px 12px; }
.cal-today { margin-left: 4px; }
.cal-legend { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal-dow { background: var(--panel); color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; padding: 8px 10px; text-align: left; }
.cal-cell { background: var(--panel); min-height: 96px; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.blank { background: var(--panel-2); opacity: 0.5; }
.cal-cell.today { background: color-mix(in srgb, var(--red-glow) 30%, var(--panel)); box-shadow: inset 0 0 0 2px var(--red); }
.cal-daynum { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.cal-cell.today .cal-daynum { color: var(--red); font-weight: 700; }

.cal-ev {
  display: block; font-size: 11px; line-height: 1.3; padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid var(--ink-3); background: var(--panel-2); color: var(--ink-2);
}
.cal-legend .cal-ev { padding: 1px 8px; }
.cal-ev.cal-task { border-left-color: var(--red); }
.cal-ev.cal-milestone { border-left-color: var(--good); }
.cal-ev.cal-invoice { border-left-color: var(--warn); }
.cal-ev:hover { color: var(--ink); border-left-width: 3px; }

@media (max-width: 760px) {
  .cal-cell { min-height: 64px; }
  .cal-ev { font-size: 10px; }
}

/* ============================ PROJECT WORKSPACE ============================ */
.proj-ws { display: grid; gap: 16px; }
.proj-collect { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px; }
.proj-collect .pc-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.proj-collect .pc-head b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Milestone timeline */
.proj-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.proj-timeline li { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 0; border-left: 2px solid var(--line); margin-left: 13px; padding-left: 18px; }
.proj-timeline li::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: transparent; }
.pm-dot {
  position: absolute; left: -13px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; background: var(--panel);
  border: 1px solid var(--line-2); color: var(--ink-3); text-decoration: none;
}
.pm-dot:hover { border-color: var(--red); color: var(--red); }
.proj-timeline li.done .pm-dot { background: var(--good); border-color: var(--good); color: #fff; }
.proj-timeline li.over .pm-dot { border-color: var(--red); color: var(--red); }
.pm-body { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex: 1; }
.pm-title { font-size: 14px; }
.proj-timeline li.done .pm-title { color: var(--ink-3); text-decoration: line-through; }
.pm-body time { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.proj-timeline li.over .pm-body time { color: var(--red); }

/* Inline milestone add form */
.milestone-form { margin-bottom: 16px; }
.milestone-form input[type='text'] { width: 100%; }
.milestone-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.milestone-row .form-item { margin: 0; }
.milestone-row .form-actions { margin: 0; margin-left: auto; }

/* Task counts */
.proj-taskcounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.proj-taskcounts li { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid var(--line); }
.proj-taskcounts li:last-child { border-bottom: none; }
.proj-taskcounts b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================ KANBAN BOARD ============================ */
.dn-board-wrap { display: grid; gap: 14px; }
.board-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.board-filter label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.board-filter .button { margin-left: auto; }

.dn-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start;
}
.board-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 120px; }
.board-col h3 {
  margin: 0 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); font-weight: 700; display: flex; justify-content: space-between; align-items: center;
}
.board-count { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; font-family: var(--mono); color: var(--ink-2); }
.board-drop { display: grid; gap: 8px; min-height: 40px; border-radius: 8px; transition: background 0.15s; }
.board-drop.drop-hover { background: color-mix(in srgb, var(--red-glow) 40%, transparent); outline: 1px dashed var(--red); }

.board-card {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: 8px; padding: 10px 12px; cursor: grab; transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.board-card:hover { border-color: var(--line-2); box-shadow: 0 4px 14px -8px rgba(0,0,0,0.4); }
.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: 0.5; transform: rotate(1deg); }
.board-card.pri-high { border-left-color: var(--warn); }
.board-card.pri-urgent { border-left-color: var(--red); }
.bc-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-bottom: 8px; }
.bc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-pri { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--ink-3); }
.bc-pri--high { color: var(--warn); }
.bc-pri--urgent { color: var(--red); }
.bc-proj { font-size: 11px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.bc-due { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.bc-due.over { color: var(--red); font-weight: 600; }
.bc-edit { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.bc-edit:hover { color: var(--red); }

/* ============================ QUOTE WORKSPACE ============================ */
.quote-ws { display: grid; gap: 16px; }
.quote-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quote-head-actions { margin-left: auto; display: flex; gap: 8px; }
.quote-cols { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.quote-side { display: grid; gap: 16px; }
.quote-total {
  border: 1.5px solid var(--ink); border-radius: var(--r);
  background: var(--panel); padding: 18px 20px;
}
.quote-total .qt-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 700; }
.quote-total .qt-figure {
  font-family: var(--serif); font-size: 34px; font-weight: 600; margin-top: 4px;
  font-variant-numeric: tabular-nums; border-bottom: 3px solid var(--red); display: inline-block; padding-bottom: 3px;
}
@media (max-width: 900px) { .quote-cols { grid-template-columns: 1fr; } }

/* ============================ SUPPORT DESK ============================ */
/* Status + priority badges — color is the event: red = needs triage / urgent. */
.tk-status, .tk-pri {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--panel-2); white-space: nowrap;
}
.tk-status--new { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 12px var(--red-glow); }
.tk-status--open { border-color: var(--ink-3); color: var(--ink); }
.tk-status--pending { border-color: var(--warn); color: var(--warn); }
.tk-status--solved { border-color: var(--good); color: var(--good); }
.tk-status--closed { opacity: 0.6; }
.tk-pri--low { color: var(--ink-3); }
.tk-pri--normal { color: var(--ink-2); }
.tk-pri--high { border-color: var(--warn); color: var(--warn); }
.tk-pri--urgent { background: var(--red); border-color: var(--red); color: #fff; }

.desk-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.desk-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.desk-tab:hover { color: var(--ink); }
.desk-tab.on { color: var(--ink); border-bottom-color: var(--red); }
.desk-count {
  font-size: 11px; font-family: var(--mono); color: var(--ink-3);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px;
}
.desk-tab.on .desk-count { color: var(--red); border-color: var(--red); }
.desk-table td { vertical-align: middle; }
.desk-subj a { font-weight: 600; }
.desk-table tbody tr:hover td { background: color-mix(in srgb, var(--red-glow) 40%, transparent); }

/* ===== Ticket thread (portal + agent share the bubble styles) ===== */
.ticket-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ticket-head .button { margin-left: auto; }
.ticket-subject { font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); font-weight: 600; margin: 4px 0 20px; }

.ticket-thread { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.tk-msg {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); padding: 13px 16px; max-width: 90%;
}
.tk-msg-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tk-msg-head b { font-size: 13px; }
.tk-msg-head time { margin-left: auto; color: var(--ink-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.tk-msg-body { font-size: 14px; line-height: 1.6; }
/* Client on the left, staff answer offset + red-edged, internal note amber. */
.tk-client { justify-self: start; border-left: 3px solid var(--line-2); }
.tk-staff { justify-self: end; border-left: 3px solid var(--red); background: var(--panel-2); }
.tk-internal {
  justify-self: end; border: 1px dashed var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, var(--panel));
}
.tk-note-badge {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 99px; padding: 1px 7px;
}

/* Screenshot strip on a ticket */
.tk-shots { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tk-shot { display: block; width: 108px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.tk-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease); }
.tk-shot:hover img { transform: scale(1.06); }

/* Reply / work forms */
.ticket-reply-form textarea, .ticket-work-form textarea { width: 100%; min-height: 76px; }
.ticket-reply-form .form-actions, .ticket-work-form .form-actions { margin-top: 10px; }
.ticket-work-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.ticket-work-controls .form-item { margin: 0; }

/* Agent layout: thread + a sidebar of ticket facts */
.ticket-agent-cols { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .ticket-agent-cols { grid-template-columns: 1fr; } }

/* ============================ CLIENT PORTAL ============================ */
.cp-dash { display: grid; gap: 8px; }

.cp-hero {
  display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 18px;
  align-items: stretch; margin-bottom: 10px;
}
.cp-hi .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); font-weight: 700; }
.cp-hi h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 46px); font-weight: 600; margin: 6px 0 10px; line-height: 1.05; }
.cp-tag { color: var(--ink-2); font-size: 14.5px; max-width: 52ch; margin: 0; }

.cp-balance {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.cp-balance.due { border-left: 3px solid var(--red); }
.cp-balance.clear { border-left: 3px solid var(--good); }
.cp-balance .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 700; }
.cp-balance .amt { font-family: var(--serif); font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.05; }
.cp-balance.due .amt { color: var(--red); }
.cp-balance.clear .amt { color: var(--good); font-size: 26px; }
.cp-balance .button { margin-top: 10px; text-align: center; }
.cp-clear-note { color: var(--ink-3); font-size: 12.5px; }

/* Invoice row states */
.cp-paid { color: var(--good); font-size: 13px; white-space: nowrap; }
.cp-open { color: var(--warn); font-size: 13px; }
.cp-pay { padding: 6px 13px; font-size: 12.5px; white-space: nowrap; }

/* Support / messages */
.cp-support { display: grid; gap: 12px; }
.cp-tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cp-tickets a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  transition: border-color 0.18s;
}
.cp-tickets a:hover { border-color: var(--line-2); }
.cp-tk-subj { flex: 1; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.cp-tk-when { color: var(--ink-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; }

@media (max-width: 760px) { .cp-hero { grid-template-columns: 1fr; } }

/* ============================ LOGIN ============================ */
/* The cinematic broadcast: always the arctic night regardless of theme, an
   animated crimson aurora over a starfield, the lone red horizon line. */
.dn-login {
  --lg-ground: #07070a;
  --lg-panel: rgba(20, 20, 26, 0.62);
  --lg-line: rgba(255, 255, 255, 0.09);
  --lg-ink: #ece8e1; --lg-ink-2: #a7a39b; --lg-ink-3: #6f6c65;
  --lg-red: #e02424; --lg-red-glow: rgba(224, 36, 36, 0.3);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--lg-ground);
  color: var(--lg-ink);
}

/* Animated sky: aurora ribbons + a canvas starfield. */
.dn-login-sky { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.dn-login-stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dn-aurora {
  position: absolute; border-radius: 50%; filter: blur(72px);
  mix-blend-mode: screen; opacity: 0.5; will-change: transform, opacity;
}
.dn-aurora--1 {
  width: 62vw; height: 42vh; left: -8vw; top: -14vh;
  background: radial-gradient(closest-side, rgba(224, 36, 36, 0.6), transparent 72%);
  animation: dn-aur1 19s ease-in-out infinite alternate;
}
.dn-aurora--2 {
  width: 58vw; height: 46vh; right: -10vw; top: -8vh;
  background: radial-gradient(closest-side, rgba(58, 116, 150, 0.42), transparent 72%);
  animation: dn-aur2 24s ease-in-out infinite alternate;
}
.dn-aurora--3 {
  width: 74vw; height: 34vh; left: 12vw; top: 3vh;
  background: radial-gradient(closest-side, rgba(150, 26, 44, 0.45), transparent 72%);
  animation: dn-aur3 28s ease-in-out infinite alternate;
}
@keyframes dn-aur1 { from { transform: translate3d(-4vw, -2vh, 0) scale(1); opacity: 0.35; } to { transform: translate3d(8vw, 5vh, 0) scale(1.25); opacity: 0.62; } }
@keyframes dn-aur2 { from { transform: translate3d(4vw, 0, 0) scale(1.1); opacity: 0.24; } to { transform: translate3d(-6vw, 6vh, 0) scale(0.95); opacity: 0.48; } }
@keyframes dn-aur3 { from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.28; } to { transform: translate3d(-8vw, 4vh, 0) scale(1.2); opacity: 0.5; } }

/* Vignette + lone red horizon, above the sky, below the card. */
.dn-login::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(125% 90% at 50% -10%, transparent 45%, rgba(0, 0, 0, 0.6) 100%);
}
.dn-login::after {
  content: ''; position: absolute; left: 0; right: 0; top: 46%; z-index: 1;
  height: 1px; background: var(--lg-red);
  box-shadow: 0 0 26px 3px var(--lg-red-glow); opacity: 0.65;
}

.dn-login-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 392px;
  background: var(--lg-panel);
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  padding: 36px 34px 30px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px) saturate(1.1);
}
.dn-login-brand { font-weight: 800; letter-spacing: 0.26em; font-size: 15px; text-align: center; }
.dn-login-brand .star { color: var(--lg-red); }
.dn-login-brand small {
  display: block; letter-spacing: 0.2em; color: var(--lg-ink-3);
  font-size: 9.5px; font-weight: 600; margin-top: 6px;
}
.dn-login-tag {
  text-align: center; font-family: var(--serif); font-style: italic;
  color: var(--lg-ink-2); font-size: 14.5px; margin: 16px 0 24px;
}

/* Hide Drupal's raw local-task tabs leaking into the card. */
.dn-login .tabs,
.dn-login nav.tabs,
.dn-login ul.tabs,
.dn-login .block-local-tasks-block { display: none !important; }

.dn-login-card form { display: flex; flex-direction: column; gap: 14px; }
.dn-login-card .form-item { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.dn-login-card label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--lg-ink-3); font-weight: 700; }
.dn-login-card input,
.dn-login-card input[type='text'],
.dn-login-card input[type='password'] {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--lg-line); border-radius: 9px; color: var(--lg-ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.dn-login-card input:focus {
  border-color: var(--lg-red); outline: none;
  box-shadow: 0 0 0 3px var(--lg-red-glow);
}
.dn-login-card .form-actions { margin-top: 6px; }
.dn-login-card .form-actions .button,
.dn-login-card .button--primary,
.dn-login-card [type='submit'] {
  width: 100%; padding: 13px; letter-spacing: 0.04em; font-weight: 600; font-size: 14px;
  background: var(--lg-red); border: 1px solid var(--lg-red); color: #fff;
  border-radius: 9px; cursor: pointer; transition: background 0.18s, transform 0.12s;
}
.dn-login-card [type='submit']:hover { background: #c31c1c; border-color: #c31c1c; }
.dn-login-card [type='submit']:active { transform: translateY(1px); }
.dn-login-card .description { font-size: 12px; color: var(--lg-ink-3); }
.dn-login-card .messages { font-size: 12.5px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); border-color: var(--lg-line); }
.dn-login-links { text-align: center; margin-top: 18px; font-size: 12px; }
.dn-login-links a { color: var(--lg-ink-3); }
.dn-login-links a:hover { color: var(--lg-red); }

@media (prefers-reduced-motion: reduce) {
  .dn-aurora { animation: none; }
}

/* Messages */
.messages { border-radius: 8px; padding: 11px 14px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; }
.messages--status { border-left: 3px solid var(--good); }
.messages--warning { border-left: 3px solid var(--warn); }
.messages--error { border-left: 3px solid var(--red); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .dn-app { grid-template-columns: 1fr; }
  .dn-rail {
    position: fixed; z-index: 60; left: 0; top: 0; width: 270px;
    transform: translateX(-100%); transition: transform 0.28s var(--ease);
    box-shadow: 12px 0 40px -20px rgba(0, 0, 0, 0.6);
  }
  body.dn-rail-open .dn-rail { transform: none; }
  .dn-hamburger { display: inline-flex; }
  .dn-scrim {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(0, 0, 0, 0.5);
  }
  body.dn-rail-open .dn-scrim { display: block; }
  .dn-charts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  .js .dn-reveal { opacity: 1; transform: none; }
}
