/* Cui Vinzi ? — dark professional theme on top of Pico.css (data-theme="dark").
   Design tokens live on :root; Pico is re-skinned via its CSS variables so all
   form controls / tables inherit the palette for free. */

/* ---- Inter (bundled locally, latin + latin-ext for Romanian diacritics) --- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- design tokens -------------------------------------------------------- */
:root {
  --bg: #0b1220;             /* page */
  --surface: #121b2e;        /* cards */
  --surface-2: #0e1626;      /* inset (inputs) */
  --elevated: #1a2740;       /* raised / hover surface */
  --row-hover: #1d2b47;      /* OPAQUE table-row hover (works over stripes) */
  --border: #24334e;
  --border-strong: #31445f;
  --text: #e7edf7;
  --muted: #8fa3bf;
  --accent: #4da8ff;
  --accent-strong: #2a7fe8;
  --accent-glow: rgba(77, 168, 255, 0.22);
  --ok: #34d07c;
  --warn: #e8b445;
  --bad: #e06c75;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Pico re-skin ---------------------------------------------------------- */
[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --pico-font-family-sans-serif: var(--font);
  --pico-font-family: var(--font);
  --pico-background-color: var(--bg);
  --pico-color: var(--text);
  --pico-h1-color: var(--text);
  --pico-h2-color: var(--text);
  --pico-h3-color: var(--text);
  --pico-muted-color: var(--muted);
  --pico-muted-border-color: var(--border);
  --pico-border-color: var(--border-strong);
  --pico-card-background-color: var(--surface);
  --pico-card-border-color: var(--border);
  --pico-card-sectioning-background-color: var(--surface-2);
  /* accent drives links, buttons, focus */
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent-strong);
  --pico-primary-border: var(--accent-strong);
  --pico-primary-hover: #7cc0ff;
  --pico-primary-hover-background: #3d94f5;
  --pico-primary-hover-border: #3d94f5;
  --pico-primary-underline: rgba(77, 168, 255, 0.5);
  --pico-primary-focus: var(--accent-glow);
  --pico-primary-inverse: #071018;
  /* form controls */
  --pico-form-element-background-color: var(--surface-2);
  --pico-form-element-border-color: var(--border-strong);
  --pico-form-element-active-background-color: var(--surface-2);
  --pico-form-element-active-border-color: var(--accent);
  --pico-form-element-focus-color: var(--accent);
  --pico-form-element-placeholder-color: #5f7392;
  --pico-form-element-color: var(--text);
  /* tables */
  --pico-table-border-color: #1c293f;
  --pico-table-row-stripped-background-color: rgba(255, 255, 255, 0.025);
}

::selection { background: rgba(77, 168, 255, 0.35); }

/* slim dark scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3e547a; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: transparent; }

body { letter-spacing: 0.01em; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ---- top navbar (brand + mode tabs) ---------------------------------------- */
.topnav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0 -1rem;               /* stretch across container-fluid's padding */
  padding: 0 1rem;
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* .topnav is a Pico `nav` (display:flex), which makes this a shrink-to-fit
     flex item — force it to fill so space-between actually separates
     the brand from the tabs */
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.65rem 0;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand .brand-accent { color: var(--accent); }

/* the brand question mark (inline SVG, same drawing as the favicon):
   sized to the surrounding text's cap height, sitting on the baseline */
.qmark {
  height: 0.74em;
  width: 0.51em;              /* 32:47 viewBox ratio */
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0.06em;
}

.tabs {
  display: flex;
  gap: 0.9rem;
}
.tabs .tab {
  padding: 0.4rem 1rem;
  border-radius: 5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.tabs .tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.tabs .tab.active {
  background: rgba(77, 168, 255, 0.14);
  color: var(--accent);
}

/* ---- hero (headline + search) ---------------------------------------------- */
.hero {
  position: relative;
  padding: 0 0 2.25rem;
  margin-bottom: 1.75rem;
}
/* soft accent glow behind the headline/search area. Fixed height (NOT
   `bottom: 0`) so it stays anchored there regardless of .hero's total height
   -- .hero also contains the advanced-filters panel, and if this box
   stretched to .hero's bottom edge, opening/closing that panel would resize
   the box and shift the radial-gradient's percentage-based center with it,
   making the glow visibly jump. No horizontal bleed either, since a radial
   gradient this size already fades out well before reaching the hero's own
   edges, and any negative horizontal inset here widens the whole page and
   forces a horizontal scrollbar (unlike .topnav's -1rem bleed below, which
   is exactly cancelled by the container's own padding). */
.hero::before {
  content: "";
  position: absolute;
  top: -3rem;
  left: 0;
  right: 0;
  height: 420px;
  background: radial-gradient(620px 320px at 50% 30%,
              rgba(77, 168, 255, 0.10), transparent 70%);
  pointer-events: none;
}
/* hairline separating hero from results, fading at the edges */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%,
              var(--border) 80%, transparent);
}
.hero > * { position: relative; }   /* content above the glow */

.app-header {
  text-align: center;
  margin: 2.25rem 0 1.6rem;
}
.app-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  /* white -> pale blue gradient headline (looks washed out under Dark Reader
     and similar page-filter extensions — that's the extension, not the CSS) */
  background: linear-gradient(180deg, #ffffff 30%, #a8c8ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.app-header .tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- primary search bar ----------------------------------------------------- */
.searchbar {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.searchbar input[type="search"] {
  width: 100%;
  margin: 0;
  font-size: 1.05rem;
  background-color: var(--surface-2);
  /* room for the magnifying glass (left) and the advanced icon (right) */
  padding: 0.75rem 3rem 0.75rem 2.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.searchbar input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 28px rgba(77, 168, 255, 0.15);
}
/* the advanced-filters icon button, blended onto the input's right edge */
.flt-icon {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
  transition: color 0.15s;
}
.flt-icon:hover,
.flt-icon.active { color: var(--accent); }
/* no rounded-square focus ring — it wouldn't align with the input's border */
.flt-icon:focus { box-shadow: none; outline: none; }
.flt-icon:focus-visible { color: var(--accent); }

/* one-shot completion flash: an accent border glow that fades on results update */
.searchbar.flashing::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 3;
  /* the search input is a pill ([type=search] sets --pico-border-radius:5rem) */
  border-radius: 5rem;
  border: 2px solid rgba(77, 168, 255, 0.95);
  box-shadow: 0 0 14px rgba(77, 168, 255, 0.8);
  pointer-events: none;
  animation: searchbar-flash 0.55s ease-out forwards;
}
@keyframes searchbar-flash {
  0%   { opacity: 0.95; }
  100% { opacity: 0; }
}

.searchbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  max-width: 680px;
  margin: 0.5rem auto 0;
}
.searchbar-actions #export { margin: 0; padding: 0.25rem 0.75rem; font-size: 0.85rem; }

/* ---- advanced filter panel --------------------------------------------------- */
/* grid-rows accordion: animates open/close (incl. height) without JS measuring
   the content's height. The row track is what actually animates; .flt-panel
   clips to it so nothing pokes out mid-transition. */
.advanced {
  display: grid;
  grid-template-rows: 0fr;
  max-width: 1180px;
  margin: 0 auto;
  opacity: 0;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              margin-top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}
.advanced.open {
  grid-template-rows: 1fr;
  margin-top: 1.25rem;
  opacity: 1;
}
.flt-panel {
  overflow: hidden;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem 1.25rem;
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
/* every control in the panel shares one shape & size — overrides Pico's
   per-type styling (pill search inputs, tall selects, tiny numbers) */
.flt-panel input,
.flt-panel select {
  --pico-border-radius: 8px;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  height: 2.5rem;
  font-size: 0.9rem;
  text-transform: none;      /* labels are uppercased; inputs must not inherit */
}
.flt-panel select { padding-right: 2rem; }   /* room for the dropdown arrow */

/* a labeled field: small uppercase label above a full-width control */
.flt-field { min-width: 0; }
.flt-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* min–max / from–to pairs */
.range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.range input { flex: 1 1 0; min-width: 0; }
.range-sep { color: var(--muted); flex: 0 0 auto; }

/* top row of discrete filters (Județ, Localitate, CAEN, Stare, dates) */
.flt-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem 1.4rem;
  align-items: end;
}
/* the date range spans two tracks so both inputs breathe */
.flt-dates { grid-column: span 2; }
@media (max-width: 560px) {
  .flt-dates { grid-column: span 1; }
  .flt-dates .range { flex-wrap: wrap; }
}

/* financial min/max block, separated from the discrete filters above */
.flt-financial {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.flt-subhead {
  display: block;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.fin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem 1.4rem;
}

.flt-actions { text-align: center; margin-top: 1.5rem; }
.flt-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.5rem 1.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s, transform 0.1s;
}
.flt-reset svg { transition: transform 0.35s ease; }
.flt-reset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.flt-reset:hover svg { transform: rotate(-70deg); }
.flt-reset:focus { box-shadow: none; outline: none; }
.flt-reset:focus-visible { border-color: var(--accent); color: var(--accent); }
.flt-reset:active { transform: scale(0.96); }

/* ---- results ----------------------------------------------------------------- */
/* keep the results column off the screen edges — centered, but still wide */
#results {
  margin: 2rem auto 0;
  max-width: 1280px;   /* aligned with the topnav width */
}
/* the lista table sits in a dark card */
figure {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.25rem 1rem;
}
table {
  white-space: nowrap;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}
thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
/* numeric cells: right-aligned, lining tabular figures */
td.num, th.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; }

/* company-name cells: cap very long names with an ellipsis so the table never
   needs a horizontal scrollbar; the full name is in the title tooltip */
td.co-name {
  max-width: min(28rem, 45vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* clickable result rows -> company details page.
   Use an OPAQUE hover colour: the table is striped, so a translucent tint would
   render differently over the shaded vs. plain rows and look like only every
   other row highlights. */
.result-row { cursor: pointer; }
/* the row carries role="link" for a11y; stop Pico from styling it like an
   anchor (underline + link colour) on hover/focus */
.result-row,
.result-row:hover,
.result-row:focus,
.result-row:focus-visible { text-decoration: none; color: inherit; }
/* must out-specify Pico's `table.striped tbody tr:nth-child(odd) td` (0,2,4),
   otherwise the shaded rows keep their stripe on hover */
table.striped tbody tr.result-row:hover td,
table.striped tbody tr.result-row:focus-visible td,
.result-row:hover td,
.result-row:focus-visible td { background-color: var(--row-hover); }
.result-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* status badge inside the STARE cell */
.st {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1rem;
  white-space: nowrap;
}
.st-ok   { background: rgba(52, 208, 124, 0.14); color: #5fe39c; }
.st-warn { background: rgba(232, 180, 69, 0.14); color: #f0c765; }
.st-off  { background: rgba(224, 108, 117, 0.13); color: #ea8b93; }

.results-meta {
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- pager -------------------------------------------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}
.pager button {
  margin: 0;
  min-width: 2.4rem;
  padding: 0.4rem 0.6rem;
  line-height: 1;
  /* non-selected pages: ghost buttons so the current one stands out */
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
}
.pager button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
/* selected page: filled accent */
.pager-num.current,
.pager-num.current:disabled {
  background: var(--accent);
  color: #071018;
  border-color: var(--accent);
  opacity: 1;
  font-weight: 700;
}
.pager-gap {
  padding: 0 0.25rem;
  color: var(--muted);
}

.empty { text-align: center; color: var(--muted); background: transparent; border: 0; box-shadow: none; }

/* ---- loading spinner (AI search in flight; htmx toggles .htmx-request) -------- */
.ai-spinner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 3rem auto 0;
  color: var(--muted);
}
.ai-spinner.htmx-request { display: flex; }
/* while a search is in flight, show only the spinner -- hide the previous
   results / the "Descrie un produs..." empty note below it */
#ai-spinner.htmx-request ~ #results { display: none; }
/* visually hidden but announced to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 18px rgba(77, 168, 255, 0.15);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- prospecting: CAEN sectors as collapsible cards --------------------------- */
.sector-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sector {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sector:hover { border-color: var(--border-strong); }
.sector[open] {
  border-color: var(--border-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.sector > summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  list-style: none;
  margin: 0;
  transition: background 0.15s;
}
.sector > summary::-webkit-details-marker,
.sector > summary::after { display: none; }
.sector > summary:hover { background: var(--elevated); }
.sect-caret {
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 0.8rem;
}
.sector[open] > summary .sect-caret {
  transform: rotate(90deg);
  color: var(--accent);
}
.sect-caen {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--accent);
}
.sect-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 0.92rem;
}
/* match-score: thin accent bar + value */
.sect-score {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.sect-score-bar {
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.sect-score-bar > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}
.sect-score-val {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.2rem;
  text-align: right;
}
/* company count chip */
.sect-count {
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 5rem;
  padding: 0.15rem 0.65rem;
}
.sector-body {
  padding: 0 0.75rem 0.6rem;
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
.sector-body .sub-table { margin: 0; }
.sub-table { white-space: nowrap; font-size: 0.85rem; }
.sub-table th { font-weight: 600; }
.sector-loading,
.sector-empty {
  padding: 0.75rem 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---- company details page ------------------------------------------------------ */
/* centered content column shared by the hero and each section. */
.details-inner {
  max-width: 1536px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .details-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .details-inner { padding-left: 2rem; padding-right: 2rem; }
}
.details-hero { padding-top: 1.5rem; }
.details-hero h1 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.5rem;          /* text-h2 */
  line-height: 2rem;
  color: var(--text);
}
@media (min-width: 1024px) {
  .details-hero h1 { font-size: 2.25rem; line-height: 2.75rem; }  /* lg:text-h1 */
}
.details-hero .subtitle {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted);
}
.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}
.back-link:hover { text-decoration: none; color: var(--accent); }

.details-hero .idline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.details-hero .idline .k { font-weight: 600; color: var(--text); }
.details-hero .idline .sep { color: var(--border-strong); }
.mono { font-family: var(--pico-font-family-monospace, monospace); }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
}
.badge-ok    { background: rgba(52, 208, 124, 0.14); color: #5fe39c; }
.badge-warn  { background: rgba(232, 180, 69, 0.14); color: #f0c765; }
.badge-off   { background: rgba(224, 108, 117, 0.13); color: #ea8b93; }
.badge-info  { background: rgba(77, 168, 255, 0.14); color: #7cc0ff; }
.badge-muted { background: rgba(143, 163, 191, 0.13); color: #a9bad2; }

.details-section {
  margin-top: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem 1.25rem;
}
.details-section h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 0.75rem;
  margin-bottom: 1rem;
}
.idgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
  margin: 0;
}
.idrow {
  display: grid;
  grid-template-columns: minmax(0, 11rem) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.idrow dt { margin: 0; color: var(--muted); }
.idrow dd { margin: 0; }
@media (max-width: 720px) {
  .idgrid { grid-template-columns: 1fr; }
}

/* ---- login page -------------------------------------------------------------- */
.login-wrap {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand .brand { font-size: 1.3rem; }
.login-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.login-card input {
  margin-top: 0.4rem;
  margin-bottom: 0;
}
.login-card button[type="submit"] {
  width: 100%;
  margin: 0.25rem 0 0;
}
.login-error {
  background: rgba(224, 108, 117, 0.12);
  color: #ea8b93;
  border: 1px solid rgba(224, 108, 117, 0.3);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* logout control blended into the navbar tabs */
.logout-form { margin: 0; }
.logout-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 1rem;
  margin: 0;
  border-radius: 5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
