/* =====================================================================
   V1.3 Design tokens & signature component ("safety tag")
   Industrial / control-room aesthetic: Inter for UI copy, IBM Plex Mono
   for anything that reads like instrument data (scaffold IDs, timestamps,
   stat numbers) — a deliberate echo of the physical tags clipped to a
   real scaffold on site.
   ===================================================================== */

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background-color: #f5f7fa;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

html.dark body {
  background-color: #0b1220;
  color: #e2e8f0;
}

.font-data {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.01em;
}

/* Surfaces */
.surface-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
html.dark .surface-card {
  background-color: #131b2c;
  border-color: #24304a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.4);
}

.surface-sidebar {
  background: linear-gradient(180deg, #0a2540 0%, #0d2f52 55%, #0a2540 100%);
}

/* Signature component: safety tag — a 4px colored edge + mono ID,
   echoing the physical inspection tags clipped to scaffolding on site.
   Now with a soft shadow + hover lift so stat tiles read as tappable
   surfaces instead of flat rectangles. */
.safety-tag {
  position: relative;
  border-radius: 0.85rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.95rem 1.1rem 0.95rem 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px -10px rgba(15, 23, 42, 0.12);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
html.dark .safety-tag {
  background: #131b2c;
  border-color: #24304a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 16px -10px rgba(0, 0, 0, 0.4);
}
a.safety-tag:hover, button.safety-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06), 0 14px 28px -12px rgba(15, 23, 42, 0.18);
}
html.dark a.safety-tag:hover, html.dark button.safety-tag:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 14px 28px -12px rgba(0, 0, 0, 0.5);
}
.safety-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.safety-tag--safe::before       { background: linear-gradient(180deg, #22c55e, #15803d); }
.safety-tag--unsafe::before     { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.safety-tag--fbh::before        { background: linear-gradient(180deg, #f59e0b, #b45309); }
.safety-tag--dismantled::before { background: linear-gradient(180deg, #94a3b8, #475569); }
.safety-tag--neutral::before    { background: linear-gradient(180deg, #22c3e6, #0891b2); }

.safety-tag .tag-id {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Stat tile icon chip — small gradient badge used on modernized dashboard
   stat cards (dashboard.php). Opt-in class, doesn't affect existing
   .safety-tag usage elsewhere that doesn't include it. */
.stat-icon-chip {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
}
.stat-icon-chip--safe       { background: linear-gradient(135deg, #22c55e, #15803d); }
.stat-icon-chip--unsafe     { background: linear-gradient(135deg, #f87171, #b91c1c); }
.stat-icon-chip--fbh        { background: linear-gradient(135deg, #fbbf24, #b45309); }
.stat-icon-chip--dismantled { background: linear-gradient(135deg, #94a3b8, #475569); }
.stat-icon-chip--neutral    { background: linear-gradient(135deg, #22c3e6, #0891b2); }

/* Subtle fade-up entrance for dashboard sections */
@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fadeUpIn 420ms ease both;
}

/* Scrollbars (webkit) — subtle, matches surface */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* Focus visibility (accessibility floor) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid #00aad2;
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Sidebar nav active/hover state */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.nav-link.active {
  background: linear-gradient(135deg, #22c3e6, #00aad2);
  color: #04202a;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(0, 170, 210, 0.55);
}
.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 0.9rem 0.25rem;
}
