/* ============================================================================
   Safety operational pages — body chrome (Brand Guidelines Book 5.15.2025)

   Pair with css/standard-brand-banner.css for the dark top bar + white logo.
   Neue Haas Grotesk via Typekit (loaded by standard-brand-banner.css).

   See: subcontractor-management.html, .cursor/rules/standard-brand-banner.mdc
   ============================================================================ */

:root {
  --safety-banner-h: 67px;

  --red: #E92A2C;
  --red-dark: #A71F23;
  --red-gradient: linear-gradient(135deg, #E92A2C 0%, #A71F23 100%);
  --red-bg: rgba(233, 42, 44, 0.08);

  /* Light-first body (brand default) */
  --black: #E6E6E6;
  --charcoal: #ffffff;
  --steel: #F4F4F4;
  --mid: #E6E6E6;
  --border: #D9D9D9;
  --off-white: #202020;
  --muted: #666666;
  --muted2: #404040;
  --amber: #BA7517;
  --amber-bg: #f7eede;
  --green: #1F4D0F;
  --green-bg: #e7f0e3;
  --orange: #BA7517;
  /* Neutral chrome — no blue UI chrome (functional tier badges may still use blue) */
  --chrome: #404040;
  --chrome-bg: rgba(64, 64, 64, 0.06);
  --blue: #404040;
  --blue-bg: rgba(64, 64, 64, 0.06);
  --radius: 2px;
  --radius-sm: 2px;
  --font-head: "neue-haas-grotesk-display", "Arial Black", Arial, Helvetica, sans-serif;
  --font-body: "neue-haas-grotesk-text", Arial, Helvetica, sans-serif;
  --font-mono: "DM Mono", "Courier New", monospace;
  --surface-page: var(--black);
  --surface-card: var(--charcoal);
  --surface-raised: var(--steel);
  --surface-input: var(--steel);
  --text-primary: var(--off-white);
  --text-secondary: var(--muted);
  --icon-active: var(--red);
}

html[data-theme="dark"] {
  --black: #151515;
  --charcoal: #202020;
  --steel: #2a2a2a;
  --mid: #333333;
  --border: #404040;
  --off-white: #E6E6E6;
  --muted: #BFBFBF;
  --muted2: #999999;
  --amber: #E8A020;
  --amber-bg: rgba(232, 160, 32, 0.13);
  --green: #2ECC71;
  --green-bg: rgba(46, 204, 113, 0.13);
  --blue: #404040;
  --blue-bg: rgba(64, 64, 64, 0.12);
  --surface-page: #151515;
  --surface-card: #202020;
  --surface-raised: #2a2a2a;
  --surface-input: #2a2a2a;
  --text-primary: #E6E6E6;
  --text-secondary: #BFBFBF;
}

html[data-theme="light"] {
  --tier-blue: #1A64D2;
  --tier-blue-bg: rgba(30, 100, 210, 0.10);
}

html[data-theme="dark"] {
  --tier-blue: #4A9EFF;
  --tier-blue-bg: rgba(74, 158, 255, 0.13);
}

body {
  font-family: var(--font-body) !important;
  background: var(--surface-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Typography overrides (replace Bebas / Inter / DM Sans inline stacks) ── */
.top-bar-title,
.header-title,
.case-number,
.section-head,
.card-head,
.card-title,
.kpi-value,
.kpi-val,
.filter-label,
.tab-btn,
.view-tab,
.modal-title,
.admin-page-title,
.section-title,
.help-card-label,
.status-group-title,
.vc-name,
#adminPageTitle {
  font-family: var(--font-head) !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  text-transform: uppercase;
}

.header-job-name {
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

.kpi-label,
.kpi-lbl,
.data-table th,
.filter-bar .filter-label,
.header-job-sub,
.user-pill,
.fn-tag {
  font-family: var(--font-mono) !important;
}

/* ── Section stripe marker (brand book diagonal motif) ── */
.section-head,
.card-title,
.status-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head::before,
.card-title::before {
  content: "";
  flex-shrink: 0;
  width: 4px;
  height: 18px;
  background: var(--red-gradient);
  transform: skewX(-26deg);
}

/* ── Chrome: links, focus, hovers — red/gray not blue ── */
a:not(.btn-nav):not(.btn-view):not(.case-row):hover,
.back-btn:hover {
  color: var(--red) !important;
}

.filter-select:focus,
.filter-input:focus,
.hdr-select:focus,
.za-ctrl:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--red) !important;
  outline: none;
}

.view-tab.active,
.tab-btn.active,
.range-pill.active,
.chart-toggle.active {
  color: var(--red) !important;
  border-color: var(--red) !important;
}

.view-tab.active {
  border-bottom-color: var(--red) !important;
}

.btn-sm:hover,
.filter-clear:hover,
.top-btn-ghost:hover {
  color: var(--text-primary) !important;
  border-color: var(--red) !important;
}

.btn-primary,
.top-btn-primary,
.btn-submit {
  background: var(--red-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-family: var(--font-head) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  border-radius: var(--radius) !important;
}

/* Tier badges keep functional colors */
.tier-T1 { color: var(--tier-blue, #1A64D2) !important; border-color: var(--tier-blue, #1A64D2) !important; background: var(--tier-blue-bg, rgba(30,100,210,0.10)) !important; }

/* ── User pill in banner ── */
header .user-pill,
header .fn-tag.user-pill {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.3px;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Sticky filter bars below standard banner ── */
.filter-bar {
  top: var(--safety-banner-h) !important;
}

/* ── Legacy top-bar removal (replaced by <header> + standard-brand-banner) ── */
.top-bar,
.app-header.legacy-top-bar {
  display: none !important;
}

/* ── Mobile field inspection header (dark brand bar) ── */
.app-header {
  background: #202020 !important;
  border-bottom: 0 !important;
  position: relative;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #E92A2C, #A71F23);
  pointer-events: none;
}

.app-header .header-back {
  color: #E6E6E6 !important;
  border-radius: 0 !important;
}

.app-header .header-job-name {
  color: #E6E6E6 !important;
}

.app-header .header-job-sub {
  color: #BFBFBF !important;
}

.app-header .header-logo-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.app-header .header-logo {
  height: 28px !important;
  width: auto;
}

/* ── Help page body (light-first documentation) ── */
body.safety-help-page {
  background: #ffffff;
  color: #202020;
}

body.safety-help-page .container {
  max-width: 780px;
}

body.safety-help-page .section-title {
  font-family: var(--font-head) !important;
  letter-spacing: -0.03em !important;
}

body.safety-help-page code {
  color: var(--red);
}

body.safety-help-page .nav-pill:hover {
  border-color: var(--red) !important;
  color: var(--off-white);
}
