/* ═══════════════════════════════════════════════════════════════
   HSE MANAGEMENT SYSTEM — DESIGN SYSTEM
   ───────────────────────────────────────────────────────────────
   Grounded in mine-site safety signage: ANSI/ISO safety colors carry
   real meaning (amber=caution/open, red=hazard/overdue, green=
   compliant/complete, steel-blue=informational/in-progress) rather
   than generic UI red/green. Every stateful card or row carries a
   "status spine" — a 4px colored left edge, the one signature motif
   threaded through the whole system, borrowed from how physical
   safety permits and tags are colour-filed on site.

   Dark graphite is reserved for chrome (sidebar, topnav, login) —
   the working content area stays on warm paper, not dark-mode-
   everywhere, so dense tables and forms stay easy to read for a
   full shift.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette (named, from site signage) ── */
  --ink:            #15181B;   /* graphite — sidebar / header / dark chrome */
  --ink-raised:     #1E2226;   /* graphite, one step lighter — raised dark panels */
  --ink-line:       #2A2F34;   /* hairlines on dark chrome */
  --paper:          #FAF8F3;   /* warm bone-white — page background */
  --surface:        #FFFFFF;   /* card / table surface */
  --steel:          #5B6670;   /* slate — secondary text, quiet borders */
  --steel-100:      #EDEFF0;   /* steel tint — subtle fills, hovers */
  --steel-200:      #DCE0E3;   /* steel tint — borders */
  --line:           #E4E1D8;   /* hairline on paper (warm, not cold grey) */

  --caution:        #F2A900;   /* ANSI safety-amber — open / primary accent */
  --caution-tint:   #FDF1D8;
  --hazard:         #C8102E;   /* ANSI safety-red — overdue / critical */
  --hazard-tint:    #FBE2E6;
  --compliant:      #1B7A43;   /* ANSI safety-green — complete / compliant */
  --compliant-tint: #E1F0E7;
  --info-steel:     #2A6F97;   /* hi-vis blue — informational / in progress */
  --info-tint:      #E1EDF3;

  --ink-text:       #16191C;   /* body text on paper */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --shadow-card:    0 1px 2px rgba(21,24,27,.04), 0 8px 24px rgba(21,24,27,.06);
  --shadow-raised:  0 12px 32px rgba(21,24,27,.14);
}

/* ── Type system ──
   Display : Barlow Condensed 800 — headlines, stenciled eyebrows, ALL-CAPS labels
   Body    : Barlow 400/600        — prose, table cells, form labels
   Data    : IBM Plex Mono 500     — IDs, dates, stats, anything read like a gauge
*/
* , *::before, *::after { box-sizing: border-box; }
html, body {
  font-family: 'Barlow', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink-text);
}
.font-display {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
}
.font-data, .data {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--steel);
}

/* ── Hazard-stripe rule ──
   A restrained nod to hazard tape: one thin diagonal amber/graphite
   stripe used ONLY as the very top edge of the page. Not repeated
   elsewhere — the whole point is that it appears exactly once. */
.hazard-rule {
  height: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--caution) 0px, var(--caution) 14px,
    var(--ink) 14px, var(--ink) 28px
  );
}

/* ── Status spine (signature motif) ──
   Apply to any card/row that represents a stateful record. Colour
   communicates the record's state at a glance, same idiom whether
   it's an action, an incident, or an announcement. */
.spine            { position: relative; border-left: 4px solid var(--steel-200); padding-left: 16px; }
.spine-caution    { border-left-color: var(--caution); }
.spine-hazard     { border-left-color: var(--hazard); }
.spine-compliant  { border-left-color: var(--compliant); }
.spine-info       { border-left-color: var(--info-steel); }

/* ── Status tag (permit-tag styling) ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  line-height: 1.5;
}
.tag-caution   { background: var(--caution-tint); color: #8A5D00; }
.tag-hazard    { background: var(--hazard-tint);  color: var(--hazard); }
.tag-compliant { background: var(--compliant-tint); color: var(--compliant); }
.tag-info      { background: var(--info-tint); color: var(--info-steel); }
.tag-neutral   { background: var(--steel-100); color: var(--steel); }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 13.5px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--caution); color: var(--ink); }
.btn-primary:hover { background: #DE9800; }
.btn-outline { background: var(--surface); color: var(--ink-text); border-color: var(--steel-200); }
.btn-outline:hover { background: var(--steel-100); }
.btn-dark { background: var(--ink); color: var(--caution); }
.btn-dark:hover { background: var(--ink-raised); }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--steel);
}
.field input, .field select, .field textarea {
  padding: 10px 13px; border: 1.5px solid var(--steel-200); border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif; font-size: 14px; color: var(--ink-text);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--caution); box-shadow: 0 0 0 3px rgba(242,169,0,.16);
}

/* ── Scrollbar (webkit) — quiet, on-brand ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--steel-200); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--steel); }

/* ── Motion: quiet, respects reduced-motion ── */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeIn .4s ease both; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ── Visible keyboard focus everywhere ── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--caution);
  outline-offset: 2px;
}
