/*
  Grey Epoch brand tokens come from the shared stylesheet
  (/static/css/styles.css, linked in admin/index.html before this file) -
  the same real brand sheet Trade Checking uses, and the one the wizard
  now also links. This file only holds admin-specific layout on top of
  those --ge-* tokens and shared components (.ge-nav, .ge-btn, .ge-input,
  .ge-field__label, .ge-table, .ge-section__head, .ge-meta-line,
  .ge-empty-state all come from there - not redefined here).

  Brand rule: no red or green anywhere, even for errors - the status line's
  error state below uses bold navy text instead of red.

  DELIBERATE EXCEPTION (confirmed with Bea, 2026-07-28): the in-progress/
  done status badges below use real orange/green, not Navy/Sand - the one
  place in this app that overrides the brand's own no-red/no-green rule.
  Every colour was still checked against WCAG AA contrast before use.
  Kept as local variables here, not added to the shared brand stylesheet -
  this is this one screen's exception, not a new brand colour.
*/

:root {
  --ge-status-orange: #f0954a; /* "in progress" badge - 4.89:1 vs navy text */
  --ge-status-green: #2e7d4f; /* "done" badge - 5.05:1 vs white text */
}

/* Whole-list PDF export - bottom-right, and deliberately smaller than a
   normal .ge-btn (which is sized for primary actions like Search/Log in) -
   this is a page-level utility action, not the main point of the screen.
   Still the real brand button (white/navy .ge-btn--secondary, same border/
   radius/hover as everywhere else) - only the size is reduced, not the
   colours or shape. */
.ge-print-list-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
#ge-print-list-btn {
  padding: 8px 14px;
  font-size: 13px;
}

.ge-dev-banner {
  background: var(--ge-sand-30);
  border-left: 4px solid var(--ge-sand);
  color: var(--ge-navy);
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.ge-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.ge-search .ge-field__label { margin-bottom: 0; }
.ge-search .ge-input { flex: 1; min-width: 0; }

.ge-status-line {
  font-size: 14px;
  color: var(--ge-text-muted);
  margin: 0 0 12px;
}
/* Error state: bold navy text, not red - the brand rule bans red even for
   errors (Navy + Sand tints only). */
.ge-status-line[data-state="error"] {
  color: var(--ge-navy);
  font-weight: 700;
}

.ge-drafts-table {
  min-width: 640px;
}

.ge-legal-name-blank {
  color: var(--ge-text-muted);
  font-style: italic;
}

/* Status pill - orange for "in progress" (default), green for "done",
   sand for "waiting on a document replacement" - each colour checked
   against its text colour for WCAG AA contrast (4.89:1, 5.05:1, and the
   sand/navy pairing already in use elsewhere, respectively). The variant
   class comes from admin.mjs (ge-status-badge--<status>). */
.ge-status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 2px;
  line-height: 1.2;
  text-transform: uppercase;
  background: var(--ge-status-orange);
  color: var(--ge-navy);
}
.ge-status-badge--reupload_pending {
  background: var(--ge-sand);
  color: var(--ge-navy);
}
.ge-status-badge--done {
  background: var(--ge-status-green);
  color: var(--ge-text-light);
}

.ge-outstanding-caveat {
  font-size: 12px;
  color: var(--ge-text-muted);
  margin: 8px 0 0;
}

/* Per-row "show/hide details" toggle - reveals the full field checklist.
   Plain text button (not a pill) so it reads as an action, not a status. */
.ge-checklist-toggle {
  background: none;
  border: none;
  padding: 8px 4px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ge-navy);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.ge-checklist-toggle:focus-visible {
  outline: 2px solid var(--ge-navy);
  outline-offset: 2px;
}

/* The checklist itself - a grouped table (Company details / FCA
   classification / Signatories / Traders / Your details / Consent), each
   row showing the client's actual answer, not just done/not-done. Every
   row in one section shares that section's background; sections alternate
   between just 2 colours (Navy-10 / white) so consecutive sections are
   easy to tell apart without the table looking busy. */
.ge-checklist-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  border-radius: 2px;
  font-size: 14px;
}
.ge-checklist-table__col-status {
  width: 110px;
}
.ge-checklist-table td, .ge-checklist-table th {
  padding: 6px 16px;
  text-align: left;
}
.ge-checklist-table__group th {
  padding-top: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ge-navy);
  border-top: 1px solid var(--ge-navy-20);
}
.ge-checklist-table__group:first-child th {
  border-top: none;
}
.ge-checklist-table__status--done {
  color: var(--ge-navy-80);
}
.ge-checklist-table__status--missing {
  color: var(--ge-navy);
  font-weight: 700;
}

/* Qualified with ".ge-checklist-table tbody tr" (not just the section
   class alone) so this ties the shared stylesheet's zebra-striping rule
   (.ge-table tbody tr:nth-child(even), which otherwise leaks into this
   nested table and wins on specificity) and then beats it on source order
   - admin.css always loads after the shared stylesheet. */
.ge-checklist-table tbody tr.ge-checklist-table__section--a { background: var(--ge-navy-10); }
.ge-checklist-table tbody tr.ge-checklist-table__section--b { background: var(--ge-white); }

/* Per-company "Export" (print/save as PDF) - deliberately discreet, a plain
   text link matching .ge-checklist-toggle's treatment, not a bordered
   button - it's a minor, secondary action inside the expanded checklist,
   not the main thing this panel is for. The page-level "Print / save whole
   list as PDF" button stays a normal button; only this one is toned down. */
.ge-export-btn {
  display: block;
  background: none;
  border: none;
  padding: 4px;
  min-height: 44px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ge-navy);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.ge-export-btn:focus-visible {
  outline: 2px solid var(--ge-navy);
  outline-offset: 2px;
}

/* Printing (either this one button's single-company printout, or the
   "Print / save whole list as PDF" button up top) uses the browser's own
   print-to-PDF - no library, no server involvement. This just hides
   on-screen-only chrome (nav actions, search, the toggle/print buttons
   themselves) and forces the section/status background colours to
   actually print, since browsers strip background colours by default
   unless told not to. admin.mjs decides *which* rows are visible before
   calling window.print() - this stylesheet only handles what never
   belongs on paper regardless of which rows are showing. */
@media print {
  .ge-nav__right,
  .ge-dev-banner,
  .ge-search,
  #ge-search-hint,
  .ge-status-line,
  #ge-print-list-btn,
  .ge-checklist-toggle,
  .ge-export-btn {
    display: none !important;
  }

  .ge-status-badge,
  .ge-checklist-table tbody tr {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

#ge-login-btn:focus-visible, #ge-logout-btn:focus-visible {
  outline: 2px solid var(--ge-sand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
