/* Bates Electric — Clean Professional Light Theme
   White backgrounds with navy blue (#1B2D5B) and silver accents
   Brand colors: Navy Blue, Silver, White
*/

:root {
  /* Light backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F7FA;
  --bg-tertiary: #EDF0F5;

  /* Card surfaces */
  --glass: rgba(27,45,91,0.04);
  --glass-border: rgba(27,45,91,0.08);
  --glass-hover: rgba(27,45,91,0.06);

  /* Text colors */
  --text-primary: #1B2D5B;
  --text-secondary: #5A6577;
  --text-tertiary: #8C939A;

  /* Accent & semantic */
  --accent: #1B2D5B;
  --accent-glow: rgba(27,45,91,0.12);
  --danger: #DC2626;
  --success: #16A34A;
  --info: #2563EB;

  /* Legacy compatibility */
  --navy-900: #F5F7FA;
  --navy-800: #EDF0F5;
  --navy-700: #E5EAEF;
  --surface: rgba(255,255,255,0.95);
  --ink-900: #1B2D5B;
  --ink-700: #5A6577;
  --ink-500: #8C939A;
  --line: rgba(27,45,91,0.08);
  --amber: #1B2D5B;
  --amber-dark: #152347;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(27,45,91,0.03) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(37,99,235,0.02) 0%, transparent 55%),
    var(--bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================================================
   GLASS CARD UTILITY
   ============================================================ */

.glass-card {
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.08);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-body,
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px
           max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(27,45,91,0.10), transparent 60%),
    radial-gradient(800px 600px at 110% 110%, rgba(37,99,235,0.07), transparent 55%),
    var(--bg-primary);
}

.auth-shell,
.login-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
}

.auth-card {
  position: relative;
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.06);
  border-radius: 24px;
  padding: 36px 32px 28px;
  box-shadow:
    0 1px 2px rgba(15,23,42,0.04),
    0 12px 32px -8px rgba(27,45,91,0.16),
    0 28px 60px -22px rgba(27,45,91,0.20);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(27,45,91,0.55) 30%,
    rgba(37,99,235,0.55) 70%,
    transparent 100%);
}

@media (max-width: 400px) {
  .auth-card {
    padding: 28px 20px 22px;
    border-radius: 20px;
  }
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: rgba(27,45,91,0.04);
  padding: 3px;
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.auth-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-tab.active {
  background: rgba(27,45,91,0.08);
  color: var(--text-primary);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 128px;
  height: 128px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 16px rgba(27,45,91,0.20));
}

.bolt {
  color: var(--accent);
  font-size: 40px;
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.tagline {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text-primary);
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.12);
  border-radius: 12px;
  outline: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* When an input follows a field-icon, add left padding to clear the icon */
.input-wrap input[type="email"],
.input-wrap input[type="password"],
.input-wrap input[type="text"],
.input-wrap input[type="tel"] {
  padding-left: 44px;
}

input::placeholder { color: var(--text-tertiary); }

input:focus-visible {
  background: #FFFFFF;
  border-color: rgba(27,45,91,0.2);
  box-shadow: 0 0 0 2px rgba(27,45,91,0.1);
}

.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -4px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.toggle-password:hover {
  background: rgba(27,45,91,0.04);
  color: var(--text-primary);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.remember input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

.forgot {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s;
}

.forgot:hover { color: rgba(27,45,91,0.8); }
.forgot:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }

.btn-primary {
  margin-top: 6px;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #243A6F 0%, #1B2D5B 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.15s, filter 0.15s;
  box-shadow:
    0 6px 16px -4px rgba(27,45,91,0.32),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 10px 22px -4px rgba(27,45,91,0.40),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary[disabled] {
  background: rgba(27,45,91,0.1);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.12);
  color: var(--text-primary);
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.16);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0.5px solid transparent;
}

.status::before {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.status.info {
  background: rgba(37,99,235,0.08);
  color: #2563EB;
  border-color: rgba(37,99,235,0.12);
}
.status.info::before { content: "i"; }

.status.error {
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  border-color: rgba(220,38,38,0.12);
}
.status.error::before { content: "!"; }

.status.success {
  background: rgba(22,163,74,0.08);
  color: #16A34A;
  border-color: rgba(22,163,74,0.12);
}
.status.success::before { content: "✓"; }

.status.warning {
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  border-color: rgba(220,38,38,0.12);
}
.status.warning::before { content: "⚠"; }

.legal {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 0.5px solid rgba(27,45,91,0.08);
  text-align: center;
}
.legal p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
}

@media (min-width: 900px) {
  .auth-shell,
  .login-card { max-width: 460px; }
  .auth-card { padding: 44px 40px 32px; }
  .brand h1 { font-size: 30px; }
}

/* ============================================================
   HOME HUB / DASHBOARD
   ============================================================ */

.hub-body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(96,165,250,0.28), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(59,130,246,0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 30% 100%, rgba(165,200,255,0.32), transparent 60%),
    linear-gradient(180deg, #EAF2FF 0%, #F5F8FF 50%, #EFF4FF 100%);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ============================================================
   ANIMATED AURORA BACKGROUND (liquid glass mesh)
   ============================================================ */
.hub-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hub-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.95;
  will-change: transform;
}

.hub-blob-1 {
  width: 520px;
  height: 520px;
  left: -140px;
  top: -120px;
  background: radial-gradient(circle, rgba(96,165,250,0.85) 0%, rgba(96,165,250,0) 70%);
  animation: blobDrift1 22s ease-in-out infinite alternate;
}

.hub-blob-2 {
  width: 580px;
  height: 580px;
  right: -180px;
  top: 80px;
  background: radial-gradient(circle, rgba(59,130,246,0.75) 0%, rgba(59,130,246,0) 70%);
  animation: blobDrift2 28s ease-in-out infinite alternate;
}

.hub-blob-3 {
  width: 460px;
  height: 460px;
  left: 25%;
  top: 50%;
  background: radial-gradient(circle, rgba(147,197,253,0.85) 0%, rgba(147,197,253,0) 70%);
  animation: blobDrift3 26s ease-in-out infinite alternate;
}

@keyframes blobDrift1 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px, 80px) scale(1.1); }
}
@keyframes blobDrift2 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-80px, 60px) scale(1.05); }
}
@keyframes blobDrift3 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px, -70px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-blob { animation: none; }
}

.hub-header {
  background: #FFFFFF;
  color: var(--text-primary);
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
  border-bottom: 0.5px solid rgba(27,45,91,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hub-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  background: rgba(27,45,91,0.08);
  border: 0.75px solid rgba(27,45,91,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
}

.hub-brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.hub-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hub-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-user-meta {
  text-align: right;
  line-height: 1.3;
  display: none;
}

.hub-user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.hub-user-role {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 6px;
}

.btn-signout {
  height: 40px;
  padding: 0 16px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.12);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-signout:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.16);
}

.btn-signout:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 600px) {
  .hub-user-meta { display: block; }
}

.hub-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 120px;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO GREETING
   ============================================================ */
.hub-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 22px;
  padding: 4px 2px;
  animation: heroFadeIn 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.hub-hero-text {
  min-width: 0;
  flex: 1;
}

.hub-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hub-hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: rgba(96,165,250,0.18);
  border: 0.5px solid rgba(96,165,250,0.32);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.hub-hero-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255,255,255,0.65);
  border: 0.5px solid rgba(96,165,250,0.32);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.16),
    0 4px 12px rgba(59,130,246,0.18),
    inset 0 1px 0 rgba(255,255,255,0.85);
  animation: chipFadeIn 0.5s ease both;
}

.hub-hero-weather[hidden] { display: none; }
.hub-hero-weather[role="button"] { cursor: pointer; }
.hub-hero-weather[role="button"]:focus-visible { outline: 2px solid rgba(59,130,246,0.6); outline-offset: 2px; }

.hub-hero-weather-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #fff;
  box-shadow: 0 2px 6px rgba(59,130,246,0.4);
}

.hub-hero-weather-temp {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.hub-hero-weather-loc {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-left: 1px solid rgba(27,45,91,0.18);
  padding-left: 6px;
  margin-left: 2px;
}

@keyframes chipFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-hero-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
}

.hub-hero-comma { color: var(--text-secondary); font-weight: 700; }

.hub-hero-name {
  background: linear-gradient(135deg, #1B2D5B 0%, #3b82f6 60%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-hero-sub {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hub-hero-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  border: 0.5px solid rgba(96,165,250,0.28);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.18),
    0 8px 24px rgba(59,130,246,0.18),
    inset 0 1px 0 rgba(255,255,255,0.8);
  flex-shrink: 0;
  margin-top: 22px;
}

.hub-hero-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  flex-shrink: 0;
}

.hub-hero-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.hub-hero-badge-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.hub-hero-badge-text span {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

@media (max-width: 380px) {
  .hub-hero-title { font-size: 24px; }
  .hub-hero-badge { display: none; }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-welcome { margin-bottom: 32px; }

.hub-welcome h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.hub-welcome p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.hub-error {
  padding: 12px 14px;
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  border: 0.5px solid rgba(220,38,38,0.12);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================
   TILES & CARDS
   ============================================================ */

.tile-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  min-height: 160px;
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.08);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  text-align: left;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.tile:hover {
  background: #FFFFFF;
  border-color: rgba(27,45,91,0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27,45,91,0.1);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile.featured {
  background: rgba(27,45,91,0.04);
  border-color: rgba(27,45,91,0.12);
}

.tile.featured:hover {
  background: rgba(27,45,91,0.06);
  border-color: rgba(27,45,91,0.16);
}

.tile.featured .tile-hint { color: var(--text-secondary); }

.tile.disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.tile.disabled:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  background: #FFFFFF;
  border-color: rgba(27,45,91,0.08);
}

.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(27,45,91,0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

.tile.featured .tile-icon {
  background: rgba(27,45,91,0.12);
  color: var(--accent);
}

.tile-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.tile-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.tile.featured .tile-desc { color: var(--text-secondary); }

.tile-hint {
  margin-top: auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

/* ============================================================
   DASHBOARD SEARCH & FILTERS
   ============================================================ */

.dashboard-search {
  margin-bottom: 24px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(255,255,255,0.7);
  border: 0.5px solid rgba(96,165,250,0.28);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.16),
    0 6px 20px rgba(59,130,246,0.14),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.search-input:focus {
  background: rgba(255,255,255,0.92);
  border-color: rgba(96,165,250,0.5);
  box-shadow:
    0 0 0 3px rgba(96,165,250,0.2),
    0 10px 28px rgba(59,130,246,0.22),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

/* Dashboard emergency banner */
.emergency-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(220,38,38,0.08);
  border: 0.5px solid rgba(220,38,38,0.16);
  border-radius: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.18),
    0 6px 20px rgba(59,130,246,0.12),
    0 1px 2px rgba(27,45,91,0.06),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.emergency-banner:hover {
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.22);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.28),
    0 10px 28px rgba(59,130,246,0.18),
    0 2px 4px rgba(27,45,91,0.08),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.emergency-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.emergency-title {
  font-weight: 700;
  color: #DC2626;
  font-size: 15px;
}

.emergency-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.emergency-arrow {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 18px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  margin-top: 24px;
}

.section-label::before {
  content: '';
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 8px rgba(59,130,246,0.5);
}

/* Quick cards grid */
.quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 20px;
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.55);
  border: 0.5px solid rgba(96,165,250,0.22);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.14),
    0 6px 18px rgba(59,130,246,0.14),
    0 1px 2px rgba(27,45,91,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.quick-card:hover {
  background: rgba(255,255,255,0.7);
  border-color: rgba(96,165,250,0.35);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.28),
    0 12px 28px rgba(59,130,246,0.22),
    0 2px 4px rgba(27,45,91,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.qc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(96,165,250,0.25));
  border: 0.5px solid rgba(96,165,250,0.32);
  color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 4px 10px rgba(59,130,246,0.18);
  margin-bottom: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover .qc-icon {
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 6px 14px rgba(59,130,246,0.28);
}

.qc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
  letter-spacing: -0.1px;
}

.qc-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Staggered entrance animation for quick cards */
.quick-card {
  animation: cardFadeUp 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.quick-card:nth-child(1) { animation-delay: 0.05s; }
.quick-card:nth-child(2) { animation-delay: 0.10s; }
.quick-card:nth-child(3) { animation-delay: 0.15s; }
.quick-card:nth-child(4) { animation-delay: 0.20s; }
.quick-card:nth-child(5) { animation-delay: 0.25s; }
.quick-card:nth-child(6) { animation-delay: 0.30s; }

.featured-action-card {
  animation: cardFadeUp 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.featured-action-card:nth-child(2) { animation-delay: 0.08s; }

.reference-card {
  animation: cardFadeUp 0.5s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .quick-card,
  .featured-action-card,
  .reference-card,
  .hub-hero { animation: none; }
}

/* Featured actions */
.featured-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.featured-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #1B2D5B 0%, #233a72 100%);
  border: 0.5px solid rgba(96,165,250,0.35);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #FFFFFF;
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.22),
    0 8px 24px rgba(59,130,246,0.28),
    0 2px 6px rgba(27,45,91,0.18),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.featured-action-card:hover {
  background: linear-gradient(135deg, #152347 0%, #1d3164 100%);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.4),
    0 14px 32px rgba(59,130,246,0.35),
    0 3px 8px rgba(27,45,91,0.25),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

.featured-action-card + .featured-action-card {
  background: rgba(255,255,255,0.55);
  color: var(--text-primary);
  border: 0.5px solid rgba(96,165,250,0.22);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.16),
    0 6px 20px rgba(59,130,246,0.14),
    0 1px 2px rgba(27,45,91,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.featured-action-card + .featured-action-card:hover {
  background: rgba(255,255,255,0.7);
  border-color: rgba(96,165,250,0.35);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.3),
    0 12px 28px rgba(59,130,246,0.2),
    0 2px 4px rgba(27,45,91,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.featured-action-card + .featured-action-card .fac-icon,
.featured-action-card + .featured-action-card .fac-title {
  color: var(--text-primary);
}

.featured-action-card + .featured-action-card .fac-sub {
  color: var(--text-secondary);
}

.fac-icon {
  font-size: 24px;
  color: #FFFFFF;
  flex-shrink: 0;
}

.fac-title {
  font-weight: 700;
  font-size: 16px;
  color: inherit;
  margin: 0;
}

.fac-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

/* Reference cards */
.reference-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,0.55);
  border: 0.5px solid rgba(96,165,250,0.22);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 12px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.14),
    0 6px 20px rgba(59,130,246,0.14),
    0 1px 2px rgba(27,45,91,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.reference-card:hover {
  background: rgba(255,255,255,0.7);
  border-color: rgba(96,165,250,0.35);
  border-left-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.28),
    0 12px 28px rgba(59,130,246,0.2),
    0 2px 4px rgba(27,45,91,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.reference-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reference-icon {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.reference-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.reference-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.reference-detail-btn {
  align-self: flex-start;
  padding: 6px 12px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.12);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.reference-detail-btn:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.16);
  color: var(--text-primary);
}

/* Steps indicator */
.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.step-number {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #FFFFFF;
}

.step-text {
  flex: 1;
  min-width: 0;
}

/* PPE Grid */
.ppe-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.ppe-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.08);
  border-radius: 12px;
  text-align: center;
}

.ppe-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ppe-items {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Emergency call button */
.emergency-call-button {
  display: flex;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.emergency-call-911,
.emergency-call-office {
  flex: 1;
  padding: 16px;
  border: 0.5px solid rgba(96,165,250,0.22);
  border-radius: 12px;
  background: rgba(245,247,250,0.7);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.14),
    0 6px 18px rgba(59,130,246,0.14),
    0 1px 2px rgba(27,45,91,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.emergency-call-911 {
  background: rgba(220,38,38,0.10);
  border-color: rgba(220,38,38,0.22);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.16),
    0 6px 18px rgba(59,130,246,0.14),
    0 1px 2px rgba(220,38,38,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.emergency-call-911:hover {
  background: rgba(220,38,38,0.16);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.28),
    0 12px 26px rgba(59,130,246,0.22),
    0 2px 4px rgba(220,38,38,0.12),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.emergency-call-office {
  background: rgba(37,99,235,0.10);
  border-color: rgba(96,165,250,0.32);
}

.emergency-call-office:hover {
  background: rgba(37,99,235,0.16);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(96,165,250,0.4),
    0 12px 26px rgba(59,130,246,0.28),
    0 2px 4px rgba(27,45,91,0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

.call-icon {
  font-size: 18px;
}

.call-label {
  font-size: 13px;
}

.call-number {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.call-type {
  font-size: 11px;
  opacity: 0.7;
}

.emergency-calls-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

/* ============================================================
   INSPECTION FORM
   ============================================================ */

.insp-body {
  background: var(--bg-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.08);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  margin-right: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.back-link:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.12);
}
.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.autosave-badge {
  margin-left: 8px;
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(22,163,74,0.1);
  color: #16A34A;
  border-radius: 6px;
  border: 0.5px solid rgba(22,163,74,0.2);
  opacity: 0;
  transition: opacity 0.4s;
}
.autosave-badge.visible { opacity: 1; }

.insp-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

.insp-section {
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.08);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.insp-section-hdr {
  background: rgba(27,45,91,0.04);
  color: var(--text-primary);
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  border-bottom: 0.5px solid rgba(27,45,91,0.08);
}
.insp-section-hdr span { display: inline; }
.insp-section-sub {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.2px;
  opacity: 0.7;
}

.insp-subhdr {
  background: rgba(27,45,91,0.02);
  color: var(--text-primary);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  border-top: 0.5px solid rgba(27,45,91,0.08);
  border-bottom: 0.5px solid rgba(27,45,91,0.08);
}

.insp-fields {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 18px;
}

.insp-field { display: flex; flex-direction: column; gap: 6px; }
.insp-field-full { grid-column: 1 / -1; padding: 0 18px 18px; }

.insp-field label,
.insp-row-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.insp-field input,
.insp-field select,
.insp-row-input,
.insp-section textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-primary);
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.12);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
}

.insp-section textarea {
  resize: vertical;
  min-height: 120px;
  margin: 18px;
  width: calc(100% - 36px);
}

.insp-field input:focus,
.insp-field select:focus,
.insp-row-input:focus,
.insp-section textarea:focus {
  background: #FFFFFF;
  border-color: rgba(27,45,91,0.2);
  box-shadow: 0 0 0 2px rgba(27,45,91,0.1);
}

.insp-rows { padding: 4px 0; }

.insp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 0.5px solid rgba(27,45,91,0.05);
  flex-wrap: wrap;
}
.insp-row:first-child { border-top: 0; }
.insp-row[hidden] { display: none; }

.insp-row-q {
  flex: 1 1 260px;
  min-width: 240px;
  line-height: 1.4;
}

.insp-row-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
}

.insp-row-ctrl {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.insp-row-input { max-width: 220px; }

/* Radio chip groups */
.radio-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 44px;
  padding: 0 14px;
  border: 0.5px solid rgba(27,45,91,0.12);
  background: #F5F7FA;
  color: var(--text-secondary);
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}

.radio-opt:hover .radio-chip {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.16);
}
.radio-opt input:focus-visible + .radio-chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selected states */
.radio-opt.r-y    input:checked + .radio-chip { background: #2563EB; border-color: #2563EB; color: #fff; }
.radio-opt.r-n    input:checked + .radio-chip { background: #FF6B35; border-color: #FF6B35; color: #fff; }
.radio-opt.r-na   input:checked + .radio-chip { background: #9E9E9E; border-color: #9E9E9E; color: #fff; }
.radio-opt.r-good input:checked + .radio-chip { background: #2563EB; border-color: #2563EB; color: #fff; }
.radio-opt.r-fair input:checked + .radio-chip { background: var(--accent); border-color: var(--accent); color: #fff; }
.radio-opt.r-poor input:checked + .radio-chip { background: #DC2626; border-color: #DC2626; color: #fff; }
.radio-opt.r-cu   input:checked + .radio-chip { background: #FF6B35; border-color: #FF6B35; color: #fff; }
.radio-opt.r-al   input:checked + .radio-chip { background: #EDF0F5; border-color: rgba(27,45,91,0.12); color: var(--text-secondary); }

/* Recommended services grid */
.insp-help {
  padding: 14px 18px 0;
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.upsell-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 14px 18px;
}

.upsell-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.08);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s;
}
.upsell-item:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.12);
}
.upsell-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.upsell-item .upsell-label { flex: 1; }
.upsell-item .auto-badge {
  display: none;
  margin-left: 6px;
  padding: 2px 7px;
  background: #F5B700;
  color: #0B2545;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 999px;
  flex-shrink: 0;
}
.upsell-item.auto-checked {
  background: rgba(245,183,0,0.10);
  border-color: rgba(245,183,0,0.35);
}
.upsell-item.auto-checked .auto-badge { display: inline-block; }

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px 18px 0;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 0.5px solid rgba(27,45,91,0.08);
  background: #F5F7FA;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 0;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}
.photo-remove:hover {
  background: rgba(0,0,0,0.8);
}

.photo-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 14px 18px 18px;
  padding: 14px 22px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.08);
  color: var(--text-primary);
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}
.photo-add:hover {
  background: #EDF0F5;
  border-color: rgba(27,45,91,0.12);
}

/* Per-section photo blocks (mp/sp/svc/gw/sm/ac/hv) */
.section-photos {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(27,45,91,0.08);
}
.section-photo-hdr {
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  text-transform: uppercase;
}
.section-photo-prompts {
  padding: 4px 18px 0;
  margin: 0;
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
}
.section-photo-prompts:empty { display: none; }
.photo-done {
  margin: 0 18px 18px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.photo-done:hover { color: var(--text-primary); }

/* Signatures */
.sig-pair {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  padding: 0 18px 18px;
}
@media (min-width: 720px) {
  .sig-pair { grid-template-columns: 1fr 1fr; }
}

.sig-block { display: flex; flex-direction: column; gap: 8px; }
.sig-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sig-canvas {
  width: 100%;
  height: 180px;
  background: #F5F7FA;
  border: 1px dashed rgba(27,45,91,0.12);
  border-radius: 10px;
  touch-action: none;
}

.btn-text {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.btn-text:hover {
  color: rgba(27,45,91,0.8);
}

/* Action buttons at the bottom of the form */
.insp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.insp-actions .btn-primary,
.insp-actions .btn-secondary {
  flex: 1 1 240px;
  min-height: 56px;
}
.insp-actions #reset-btn {
  flex: 0 1 auto;
  min-height: 44px;
  font-size: 13px;
  color: #b91c1c;
  border-color: rgba(185,28,28,0.25);
  background: rgba(185,28,28,0.06);
}

/* ============================================================
   TOP BAR WITH HAMBURGER
   ============================================================ */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(255,255,255,0.55);
  border-bottom: 0.5px solid rgba(96,165,250,0.22);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.hamburger-btn,
.topbar-hamburger {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  z-index: 10;
}

/* Ensure SVGs inside buttons don't eat touch events */
.topbar-hamburger svg,
.topbar-signout svg,
.shared-drawer-close svg {
  pointer-events: none;
}

.hamburger-btn:active,
.topbar-hamburger:active {
  background: rgba(27,45,91,0.08);
}

.topbar-signout {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  z-index: 10;
}

.topbar-signout:active {
  background: rgba(27,45,91,0.08);
  color: var(--text-primary);
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   DRAWER / SIDE NAVIGATION
   ============================================================ */

/* Drawer Overlay */
.shared-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.shared-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Drawer Container */
.shared-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  z-index: 501;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-right: 0.5px solid rgba(27,45,91,0.08);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.shared-drawer.open {
  transform: translateX(0);
}

.shared-drawer-header {
  position: relative;
  padding: calc(max(16px, env(safe-area-inset-top)) + 16px) 18px 14px;
  border-bottom: 0.5px solid rgba(27,45,91,0.08);
  flex-shrink: 0;
}

.shared-drawer-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.shared-drawer-subtitle {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.shared-drawer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #F5F7FA;
  border: 0.5px solid rgba(27,45,91,0.08);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.shared-drawer-close:active {
  background: #EDF0F5;
}

.shared-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.shared-drawer-section {
  margin-bottom: 8px;
}

.shared-drawer-section-label {
  margin: 0;
  padding: 12px 18px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.shared-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.shared-drawer-item:active {
  background: rgba(27,45,91,0.04);
}

.shared-drawer-item.active {
  color: var(--accent);
  font-weight: 700;
  background: rgba(27,45,91,0.08);
}

.shared-drawer-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(27,45,91,0.04);
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 16px;
  transition: all 0.12s;
}

.shared-drawer-item.active .shared-drawer-item-icon {
  background: rgba(27,45,91,0.12);
  color: var(--accent);
}

.shared-drawer-item-label {
  flex: 1;
  min-width: 0;
}

/* Hide bottom nav */
.shared-bottom-nav {
  display: none !important;
}

.shared-nav-item {
  display: none !important;
}

/* Page layout adjustments */
.hub-main,
.insp-main,
.main {
  padding-bottom: max(100px, calc(80px + env(safe-area-inset-bottom)));
}

/* ============================================================
   DOCUMENTS PAGE
   ============================================================ */

.docs-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.10);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
  cursor: pointer;
}

.doc-card:hover {
  border-color: rgba(27,45,91,0.16);
  box-shadow: 0 4px 12px rgba(27,45,91,0.10);
  transform: translateY(-1px);
}

.doc-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.doc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-card-icon--manual {
  background: rgba(27,45,91,0.08);
  color: var(--accent);
}

.doc-card-icon--sds {
  background: rgba(220,38,38,0.08);
  color: #DC2626;
}

.doc-card-body {
  flex: 1;
}

.doc-card-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.doc-card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.doc-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-card-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(27,45,91,0.05);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.doc-card-arrow {
  color: var(--text-tertiary);
}

.docs-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

/* ── Safety Manual TOC ──────────────────────── */

.manual-open-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 14px;
  text-decoration: none;
  margin-bottom: 20px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(27,45,91,0.25);
  touch-action: manipulation;
}
.manual-open-btn:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(27,45,91,0.20);
}
.manual-open-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.manual-open-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.manual-open-text strong {
  font-size: 16px;
  font-weight: 700;
}
.manual-open-text span {
  font-size: 13px;
  opacity: 0.8;
}
.manual-open-arrow {
  flex-shrink: 0;
  opacity: 0.7;
}

/* TOC search */
.toc-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.toc-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.toc-search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid rgba(27,45,91,0.10);
  border-radius: 10px;
  font-family: 'Exo 2', sans-serif;
  font-size: 15px;
  background: #FFFFFF;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.toc-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,45,91,0.08);
}
.toc-search-input::placeholder {
  color: var(--text-tertiary);
}

/* TOC sections */
.toc-section {
  margin-bottom: 20px;
}
.toc-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin: 0 0 8px 4px;
}
.toc-list {
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.10);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.toc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 0.5px solid rgba(27,45,91,0.06);
  transition: background 0.1s;
  touch-action: manipulation;
}
.toc-row:last-child {
  border-bottom: none;
}
.toc-row:active {
  background: rgba(27,45,91,0.04);
}
.toc-row-title {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  padding-right: 12px;
}
.toc-row-page {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ── SDS Sheets ─────────────────────────────── */

.sds-count {
  margin: 0 0 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.sds-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sds-card {
  background: #FFFFFF;
  border: 0.5px solid rgba(27,45,91,0.10);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sds-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.sds-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.sds-signal {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sds-signal--danger {
  background: rgba(220,38,38,0.10);
  color: #DC2626;
}
.sds-signal--warning {
  background: rgba(234,179,8,0.12);
  color: #A16207;
}
.sds-card-brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.sds-card-use {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.sds-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.sds-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.sds-tag svg {
  flex-shrink: 0;
}
.sds-tag--flame {
  background: rgba(239,68,68,0.10);
  color: #DC2626;
}
.sds-tag--irritant {
  background: rgba(234,179,8,0.10);
  color: #A16207;
}
.sds-tag--health {
  background: rgba(168,85,247,0.10);
  color: #7C3AED;
}
.sds-tag--toxic {
  background: rgba(220,38,38,0.12);
  color: #B91C1C;
}
.sds-tag--corrosive {
  background: rgba(234,88,12,0.10);
  color: #C2410C;
}
.sds-tag--gas {
  background: rgba(37,99,235,0.10);
  color: #2563EB;
}
.sds-tag--env {
  background: rgba(22,163,74,0.10);
  color: #16A34A;
}
.sds-tag--minimal {
  background: rgba(22,163,74,0.08);
  color: #16A34A;
}
.sds-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: rgba(27,45,91,0.05);
  color: var(--accent);
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
  touch-action: manipulation;
  cursor: pointer;
}
.sds-card-btn:active {
  background: rgba(27,45,91,0.10);
}

/* ============================================================
   VIEWER TOP BAR (shared by pdf-viewer, safety-manual, sds-sheets)
   ============================================================ */
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: #1B2D5B;
  color: #FFFFFF;
}
.viewer-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.viewer-back:active {
  background: rgba(255,255,255,0.25);
}
.viewer-back svg {
  pointer-events: none;
}
.viewer-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact back link for in-page sub-navigation */
.compact-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(27, 45, 91, 0.08);
  color: #1B2D5B;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'Exo 2', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 10px;
}
.compact-back:active {
  background: rgba(27, 45, 91, 0.16);
}
.compact-back svg {
  pointer-events: none;
}

/* ============================================================
   CONTACTS PAGE
   Theme-aware: colors come from CSS variables, so a future theme
   change to --accent / --bg-* / --text-* / --glass-border flows
   through here automatically. The only hard-coded colors are the
   semantic emergency-red and copied-success-green palettes.
   ============================================================ */

.contacts-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 18px;
}

.contacts-search-icon {
  position: absolute;
  left: 14px;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  color: var(--text-tertiary);
  z-index: 1;
}

.contacts-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  background: #FFFFFF;
  border: 0.5px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.contacts-search-input::placeholder { color: var(--text-tertiary); }
.contacts-search-input:focus-visible {
  border-color: rgba(27,45,91,0.22);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.contacts-empty {
  margin: 4px 2px 16px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 0.5px dashed var(--glass-border);
  border-radius: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.contacts-section {
  margin-bottom: 22px;
  animation: contactsFadeIn 0.45s cubic-bezier(.2,.8,.2,1) both;
}
.contacts-section[hidden] { display: none; }
.contacts-section:nth-of-type(1) { animation-delay: 0.02s; }
.contacts-section:nth-of-type(2) { animation-delay: 0.06s; }
.contacts-section:nth-of-type(3) { animation-delay: 0.10s; }
.contacts-section:nth-of-type(4) { animation-delay: 0.14s; }
.contacts-section:nth-of-type(5) { animation-delay: 0.18s; }

@keyframes contactsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.contacts-section-title {
  margin: 0 4px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #FFFFFF;
  border: 0.5px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 1px 2px rgba(15,23,42,0.04);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

a.contact-card { cursor: pointer; }

a.contact-card:hover,
a.contact-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(27,45,91,0.16);
  box-shadow: 0 6px 18px -4px rgba(27,45,91,0.16);
  outline: none;
}

.contact-card--detail {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.contact-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.contact-card--emergency {
  background: linear-gradient(180deg, rgba(220,38,38,0.06) 0%, rgba(220,38,38,0.02) 100%);
  border-color: rgba(220,38,38,0.20);
  box-shadow:
    0 1px 3px rgba(220,38,38,0.08),
    0 8px 22px -10px rgba(220,38,38,0.30);
}
.contact-card--emergency:hover,
.contact-card--emergency:focus-visible {
  border-color: rgba(220,38,38,0.32);
  box-shadow:
    0 1px 3px rgba(220,38,38,0.10),
    0 12px 28px -10px rgba(220,38,38,0.40);
}
.contact-card--emergency .contact-name { color: #B91C1C; }
.contact-card--emergency .contact-role { color: rgba(185,28,28,0.78); }

.contact-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(27,45,91,0.10), rgba(37,99,235,0.10));
  border: 0.5px solid var(--glass-border);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.contact-avatar--brand {
  background: #FFFFFF;
  padding: 4px;
}

.contact-avatar--emergency {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  border-color: rgba(185,28,28,0.32);
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px rgba(220,38,38,0.40);
}

.contact-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.contact-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.contact-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  word-break: break-word;
}
.contact-meta svg { flex-shrink: 0; opacity: 0.8; }

.contact-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(220,38,38,0.10);
  color: #B91C1C;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 0.5px solid var(--glass-border);
}

.contact-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.contact-action svg { color: var(--accent); }
.contact-action:hover {
  background: var(--bg-tertiary);
  border-color: rgba(27,45,91,0.16);
}
.contact-action:active { transform: scale(0.98); }
.contact-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.contact-action.copied {
  background: rgba(22,163,74,0.10);
  border-color: rgba(22,163,74,0.28);
  color: #16A34A;
}
.contact-action.copied svg { color: #16A34A; }

.contacts-toast {
  position: fixed;
  left: 50%;
  bottom: max(96px, calc(76px + env(safe-area-inset-bottom)));
  transform: translateX(-50%) translateY(8px);
  padding: 10px 16px;
  background: rgba(15,20,32,0.92);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(15,20,32,0.30);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.contacts-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 380px) {
  .contact-name { font-size: 15px; }
  .contact-actions { gap: 6px; }
  .contact-action { padding: 7px 10px; font-size: 12px; }
}

/* ============================================================
   DARK MODE (applied via `html.dark`)
   Overrides the core CSS variables so the rest of the app
   (which draws from these vars) flips automatically.
   ============================================================ */
html.dark {
  --bg-primary: #0F1420;
  --bg-secondary: #151B2C;
  --bg-tertiary: #1C2338;

  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.10);
  --glass-hover: rgba(255,255,255,0.08);

  --text-primary: #E6EAF2;
  --text-secondary: #A7B0C2;
  --text-tertiary: #6C7489;

  --accent: #7FA3FF;
  --accent-glow: rgba(127,163,255,0.18);

  --navy-900: #0F1420;
  --navy-800: #151B2C;
  --navy-700: #1C2338;
  --surface: rgba(21,27,44,0.95);
  --ink-900: #E6EAF2;
  --ink-700: #A7B0C2;
  --ink-500: #6C7489;
  --line: rgba(255,255,255,0.10);
  --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
}

html.dark body {
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(127,163,255,0.06) 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, rgba(127,163,255,0.04) 0%, transparent 55%),
    var(--bg-primary);
}

html.dark .auth-body {
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(127,163,255,0.12), transparent 60%),
    radial-gradient(800px 600px at 110% 110%, rgba(127,163,255,0.08), transparent 55%),
    var(--bg-primary);
}

/* ---- Hub body: replace bright blue gradient with a deep dark mesh ---- */
html.dark .hub-body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(127,163,255,0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(96,165,250,0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 30% 100%, rgba(127,163,255,0.10), transparent 60%),
    linear-gradient(180deg, #0B0F1A 0%, #0F1420 50%, #0B0F1A 100%);
  color: var(--text-primary);
}
html.dark .hub-blob { opacity: 0.45; filter: blur(85px); }

/* ---- Surfaces (cards, drawers, topbar) ---- */
html.dark .glass-card,
html.dark .app-topbar,
html.dark .shared-drawer,
html.dark .auth-card,
html.dark .login-card,
html.dark .hub-header,
html.dark .tile,
html.dark .tile:hover,
html.dark .tile.disabled:hover,
html.dark .insp-section,
html.dark .doc-card,
html.dark .toc-list,
html.dark .sds-card {
  background: var(--bg-secondary);
  border-color: var(--glass-border);
}
html.dark .auth-card::before {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(127,163,255,0.45) 30%,
    rgba(127,163,255,0.55) 70%,
    transparent 100%);
}
html.dark .app-topbar {
  background: rgba(15,20,32,0.7);
  border-bottom-color: rgba(127,163,255,0.18);
}
html.dark .shared-drawer-overlay { background: rgba(0,0,0,0.6); }
html.dark .shared-drawer-header { border-bottom-color: var(--glass-border); }

/* ---- Auth ---- */
html.dark .auth-tabs { background: rgba(255,255,255,0.04); }
html.dark .auth-tab.active { background: rgba(255,255,255,0.08); }
html.dark .brand-mark img {
  filter:
    drop-shadow(0 0 16px rgba(127,163,255,0.35))
    drop-shadow(0 4px 12px rgba(0,0,0,0.45));
}
html.dark .legal { border-top-color: var(--glass-border); }

/* ---- Contacts ---- */
html.dark .contact-card {
  background: var(--bg-secondary);
  border-color: var(--glass-border);
}
html.dark a.contact-card:hover,
html.dark a.contact-card:focus-visible {
  border-color: rgba(127,163,255,0.30);
  box-shadow: 0 6px 18px -4px rgba(0,0,0,0.45);
}
html.dark .contact-card--emergency {
  background: linear-gradient(180deg, rgba(248,113,113,0.10) 0%, rgba(248,113,113,0.04) 100%);
  border-color: rgba(248,113,113,0.30);
}
html.dark .contact-card--emergency:hover,
html.dark .contact-card--emergency:focus-visible {
  border-color: rgba(248,113,113,0.45);
  box-shadow: 0 12px 28px -10px rgba(220,38,38,0.45);
}
html.dark .contact-card--emergency .contact-name { color: #FCA5A5; }
html.dark .contact-card--emergency .contact-role { color: rgba(252,165,165,0.78); }
html.dark .contact-cta {
  background: rgba(248,113,113,0.16);
  color: #FCA5A5;
}
html.dark .contact-avatar {
  background: linear-gradient(135deg, rgba(127,163,255,0.18), rgba(127,163,255,0.08));
}
html.dark .contact-avatar--brand {
  background: var(--bg-tertiary);
}
html.dark .contact-action {
  background: rgba(255,255,255,0.04);
}
html.dark .contact-action:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(127,163,255,0.30);
}
html.dark .contact-action.copied {
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.34);
  color: #4ADE80;
}
html.dark .contact-action.copied svg { color: #4ADE80; }
html.dark .contacts-empty {
  background: rgba(255,255,255,0.03);
}
html.dark .contacts-toast {
  background: rgba(230,234,242,0.95);
  color: #0F1420;
}

/* ---- Inputs (universal) ---- */
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="text"],
html.dark input[type="tel"],
html.dark input[type="number"],
html.dark input[type="date"],
html.dark input[type="search"],
html.dark textarea,
html.dark select,
html.dark .toc-search-input,
html.dark .insp-field input,
html.dark .insp-field select,
html.dark .insp-row-input,
html.dark .insp-section textarea {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
html.dark input:focus,
html.dark input:focus-visible,
html.dark textarea:focus,
html.dark select:focus,
html.dark .toc-search-input:focus,
html.dark .insp-field input:focus,
html.dark .insp-field select:focus,
html.dark .insp-row-input:focus,
html.dark .insp-section textarea:focus {
  background: var(--bg-secondary);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
html.dark input::placeholder,
html.dark textarea::placeholder,
html.dark .search-input::placeholder,
html.dark .toc-search-input::placeholder { color: var(--text-tertiary); }
html.dark input:read-only,
html.dark input[readonly] { color: var(--text-secondary); }

/* Search bar (translucent glass) */
html.dark .search-input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(127,163,255,0.22);
  color: var(--text-primary);
}
html.dark .search-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(127,163,255,0.45);
}

/* ---- Buttons ---- */
html.dark .btn-primary {
  background: var(--accent);
  color: #0F1420;
  box-shadow: 0 2px 8px rgba(127,163,255,0.18);
}
html.dark .btn-primary:hover { box-shadow: 0 4px 12px rgba(127,163,255,0.28); }
html.dark .btn-primary[disabled] {
  background: rgba(255,255,255,0.08);
  color: var(--text-tertiary);
}

html.dark .btn-secondary,
html.dark .btn-signout,
html.dark .back-link,
html.dark .photo-add,
html.dark .reference-detail-btn,
html.dark .shared-drawer-close {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
html.dark .btn-secondary:hover,
html.dark .btn-signout:hover,
html.dark .back-link:hover,
html.dark .photo-add:hover,
html.dark .reference-detail-btn:hover,
html.dark .shared-drawer-close:active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

html.dark .toggle-password:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
html.dark .forgot:hover { color: rgba(127,163,255,0.85); }
html.dark .btn-text:hover { color: rgba(127,163,255,0.85); }

/* ---- Status / semantic colors ---- */
html.dark .status.info {
  background: rgba(127,163,255,0.12);
  color: #93B5FF;
  border-color: rgba(127,163,255,0.22);
}
html.dark .status.error,
html.dark .status.warning {
  background: rgba(248,113,113,0.12);
  color: #F87171;
  border-color: rgba(248,113,113,0.22);
}
html.dark .status.success {
  background: rgba(74,222,128,0.12);
  color: #4ADE80;
  border-color: rgba(74,222,128,0.22);
}
html.dark .hub-error {
  background: rgba(248,113,113,0.12);
  color: #F87171;
  border-color: rgba(248,113,113,0.22);
}

/* ---- Hero ---- */
html.dark .hub-hero-eyebrow {
  background: rgba(127,163,255,0.14);
  border-color: rgba(127,163,255,0.28);
  color: var(--accent);
}
html.dark .hub-hero-weather {
  background: rgba(255,255,255,0.06);
  border-color: rgba(127,163,255,0.28);
  box-shadow:
    0 0 0 1px rgba(127,163,255,0.16),
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
html.dark .hub-hero-weather-loc { border-left-color: rgba(255,255,255,0.18); }
html.dark .hub-hero-name {
  background: linear-gradient(135deg, #93B5FF 0%, #7FA3FF 60%, #B7C9FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.dark .hub-hero-badge {
  background: rgba(255,255,255,0.05);
  border-color: rgba(127,163,255,0.28);
  box-shadow:
    0 0 0 1px rgba(127,163,255,0.16),
    0 8px 20px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ---- Tiles ---- */
html.dark .tile.featured {
  background: rgba(127,163,255,0.08);
  border-color: rgba(127,163,255,0.18);
}
html.dark .tile.featured:hover {
  background: rgba(127,163,255,0.12);
  border-color: rgba(127,163,255,0.28);
}
html.dark .tile-icon { background: rgba(255,255,255,0.06); }
html.dark .tile.featured .tile-icon { background: rgba(127,163,255,0.18); }

/* ---- Emergency banner ---- */
html.dark .emergency-banner {
  background: rgba(248,113,113,0.10);
  border-color: rgba(248,113,113,0.24);
  box-shadow:
    0 0 0 1px rgba(248,113,113,0.14),
    0 6px 18px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
html.dark .emergency-banner:hover {
  background: rgba(248,113,113,0.16);
  border-color: rgba(248,113,113,0.32);
}
html.dark .emergency-title { color: #F87171; }

/* ---- Quick cards / featured / reference ---- */
html.dark .quick-card,
html.dark .reference-card,
html.dark .featured-action-card + .featured-action-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(127,163,255,0.18);
  box-shadow:
    0 0 0 1px rgba(127,163,255,0.12),
    0 6px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
html.dark .quick-card:hover,
html.dark .reference-card:hover,
html.dark .featured-action-card + .featured-action-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(127,163,255,0.32);
}
html.dark .qc-icon {
  background: linear-gradient(135deg, rgba(127,163,255,0.15), rgba(127,163,255,0.25));
  border-color: rgba(127,163,255,0.3);
}
html.dark .featured-action-card {
  background: linear-gradient(135deg, #1B2D5B 0%, #2A3D7A 100%);
  border-color: rgba(127,163,255,0.32);
}
html.dark .featured-action-card:hover {
  background: linear-gradient(135deg, #233a72 0%, #324893 100%);
}
html.dark .featured-action-card + .featured-action-card { color: var(--text-primary); }
html.dark .reference-card { border-left: 3px solid var(--accent); }

/* ---- Emergency call buttons ---- */
html.dark .emergency-call-911,
html.dark .emergency-call-office {
  background: rgba(255,255,255,0.04);
  border-color: rgba(127,163,255,0.18);
  color: var(--text-primary);
  box-shadow:
    0 0 0 1px rgba(127,163,255,0.12),
    0 6px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
html.dark .emergency-call-911 {
  background: rgba(248,113,113,0.10);
  border-color: rgba(248,113,113,0.24);
}
html.dark .emergency-call-911:hover { background: rgba(248,113,113,0.16); }
html.dark .emergency-call-office {
  background: rgba(127,163,255,0.10);
  border-color: rgba(127,163,255,0.32);
}
html.dark .emergency-call-office:hover { background: rgba(127,163,255,0.16); }

/* ---- PPE cells ---- */
html.dark .ppe-cell {
  background: rgba(255,255,255,0.04);
  border-color: var(--glass-border);
}

/* ---- Inspection form ---- */
html.dark .insp-body { background: var(--bg-primary); }
html.dark .insp-section-hdr {
  background: rgba(255,255,255,0.04);
  border-bottom-color: var(--glass-border);
}
html.dark .insp-subhdr {
  background: rgba(255,255,255,0.02);
  border-color: var(--glass-border);
}
html.dark .insp-row { border-top-color: rgba(255,255,255,0.05); }
html.dark .upsell-item {
  background: rgba(255,255,255,0.04);
  border-color: var(--glass-border);
}
html.dark .upsell-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
html.dark .upsell-item.auto-checked {
  background: rgba(245,183,0,0.14);
  border-color: rgba(245,183,0,0.45);
}
html.dark .photo-thumb,
html.dark .sig-canvas,
html.dark .files-photo {
  background: var(--bg-tertiary);
  border-color: var(--glass-border);
}
html.dark .section-photos {
  border-top-color: var(--glass-border);
}
html.dark .insp-actions #reset-btn {
  color: #F87171;
  border-color: rgba(248,113,113,0.30);
  background: rgba(248,113,113,0.08);
}

/* Radio chips */
html.dark .radio-chip {
  background: rgba(255,255,255,0.04);
  border-color: var(--glass-border);
  color: var(--text-secondary);
}
html.dark .radio-opt:hover .radio-chip {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
html.dark .radio-opt.r-na input:checked + .radio-chip {
  background: #9E9E9E;
  border-color: #9E9E9E;
  color: #0F1420;
}
html.dark .radio-opt.r-al input:checked + .radio-chip {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  color: var(--text-secondary);
}

/* Autosave badge */
html.dark .autosave-badge {
  background: rgba(74,222,128,0.14);
  color: #4ADE80;
  border-color: rgba(74,222,128,0.24);
}

/* ---- Drawer items ---- */
html.dark .shared-drawer-item:active { background: rgba(255,255,255,0.06); }
html.dark .shared-drawer-item.active {
  color: var(--accent);
  background: rgba(127,163,255,0.12);
}
html.dark .shared-drawer-item-icon { background: rgba(255,255,255,0.06); }
html.dark .shared-drawer-item.active .shared-drawer-item-icon {
  background: rgba(127,163,255,0.18);
}

/* ---- Topbar buttons ---- */
html.dark .topbar-hamburger:active,
html.dark .hamburger-btn:active,
html.dark .topbar-signout:active {
  background: rgba(255,255,255,0.08);
}

/* ---- Documents / TOC / SDS ---- */
html.dark .doc-card:hover { border-color: rgba(255,255,255,0.16); }
html.dark .doc-card-icon--manual { background: rgba(127,163,255,0.16); }
html.dark .doc-card-icon--sds {
  background: rgba(248,113,113,0.16);
  color: #F87171;
}
html.dark .doc-card-badge {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
html.dark .manual-open-btn {
  color: #0F1420;
  box-shadow: 0 2px 8px rgba(127,163,255,0.30);
}
html.dark .manual-open-icon { background: rgba(15,20,32,0.20); }
html.dark .toc-row {
  border-bottom-color: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
html.dark .toc-row:active { background: rgba(255,255,255,0.06); }
html.dark .sds-card-title { color: var(--text-primary); }
html.dark .sds-signal--danger,
html.dark .sds-tag--flame,
html.dark .sds-tag--toxic {
  background: rgba(248,113,113,0.14);
  color: #F87171;
}
html.dark .sds-signal--warning,
html.dark .sds-tag--irritant {
  background: rgba(250,204,21,0.14);
  color: #FACC15;
}
html.dark .sds-tag--health { background: rgba(192,132,252,0.14); color: #C084FC; }
html.dark .sds-tag--corrosive { background: rgba(251,146,60,0.14); color: #FB923C; }
html.dark .sds-tag--gas { background: rgba(96,165,250,0.14); color: #60A5FA; }
html.dark .sds-tag--env,
html.dark .sds-tag--minimal {
  background: rgba(74,222,128,0.14);
  color: #4ADE80;
}
html.dark .sds-card-btn {
  background: rgba(127,163,255,0.10);
  color: var(--accent);
}
html.dark .sds-card-btn:active { background: rgba(127,163,255,0.18); }

/* ---- Compact back link ---- */
html.dark .compact-back {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
html.dark .compact-back:active { background: rgba(255,255,255,0.12); }

/* ---- Office dashboard files ---- */
html.dark .files-loading,
html.dark .files-empty { color: var(--text-secondary); }
html.dark .files-error { color: #F87171; }

/* ---- Office dashboard (mostly unstyled — give modal/filter scaffolding sane defaults) ---- */
html.dark .modal-content,
html.dark .modal-body,
html.dark .dashboard-filters,
html.dark .filter-group,
html.dark .inspection-card,
html.dark .empty-state,
html.dark .loading-state {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
html.dark .modal-overlay { background: rgba(0,0,0,0.6); }
html.dark .btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}

/* ---- Step number / role pill / fac-icon: hardcoded white text ---- */
html.dark .step-number { color: #0F1420; }
html.dark .hub-user-role { color: #0F1420; }
/* fac-icon on the navy-gradient card stays white — fine */

/* ============================================================
   OFFICE DASHBOARD
   ============================================================ */

.dashboard-body {
  padding: 0;
}

.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.dashboard-main h1,
.dashboard-main h2 {
  color: var(--text-primary);
  margin: 0 0 8px;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: #fff;
  border: 0.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin: 8px 0 20px;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-group input {
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text-primary);
}
.filter-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dashboard-content { margin-top: 4px; }

.loading-state,
.empty-state,
.error-state {
  background: #fff;
  border: 0.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}
.error-state {
  border-color: rgba(220,38,38,0.25);
  color: #991B1B;
  background: #FEF2F2;
}

.inspections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.insp-card {
  background: #fff;
  border: 0.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insp-card:hover {
  transform: translateY(-1px);
  border-color: rgba(27,45,91,0.18);
  box-shadow: 0 4px 14px rgba(27,45,91,0.10);
}

.insp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.insp-card-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.insp-card-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(22,163,74,0.10);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.20);
}
.insp-card-status.draft {
  background: rgba(245,158,11,0.10);
  color: #B45309;
  border-color: rgba(245,158,11,0.25);
}

.insp-card-body h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.25;
}
.insp-card-meta p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.insp-card-meta strong { color: var(--text-primary); }

.insp-card-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.insp-card-footer button { flex: 1; }

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-sm.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
.btn-sm.btn-secondary:hover {
  background: var(--bg-tertiary);
}
.btn-sm.btn-danger,
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.30);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
.btn-sm.btn-danger:hover,
.btn-danger:hover {
  background: rgba(220,38,38,0.08);
}

/* ---------- Modal ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 760px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.20);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0 4px;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* ---------- Details content ---------- */
.details-content { font-size: 14px; }
.details-section-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
}
.details-section-title:first-child { margin-top: 0; }

.details-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 8px;
}
.details-table td {
  padding: 6px 8px;
  border: 1px solid var(--glass-border);
  vertical-align: top;
  font-size: 13px;
}
.details-table td:first-child {
  width: 40%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.sig-display-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0;
}
.sig-display-block { text-align: center; }
.sig-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

@media (max-width: 600px) {
  .modal-content { max-height: calc(100vh - 32px); }
  .sig-display-pair { grid-template-columns: 1fr; }
  .insp-card-footer { flex-direction: column; }
}

/* ---------- Office dashboard: report & photos ---------- */
.details-files { margin-top: 8px; }
.files-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.files-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.files-photo {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f1f1;
  border: 1px solid #ddd;
  text-decoration: none;
}
.files-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.files-loading,
.files-empty,
.files-error {
  font-size: 13px;
  color: #666;
  padding: 8px 0;
}
.files-error { color: #b91c1c; }

/* ==========================================================
   Site Visit Form
   ========================================================== */

/* Tab navigation */
.sv-tab-form {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.sv-tab-btn {
  flex: 1;
  max-width: 180px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.sv-tab-btn:hover {
  background: var(--glass-hover);
}

.sv-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(27,45,91,0.18);
}

/* Sections — glass card pattern */
.sv-section {
  background: #FFFFFF;
  border: 0.5px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.sv-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(135deg, rgba(27,45,91,0.92), rgba(15,31,61,0.96));
  letter-spacing: -0.2px;
}

.sv-section-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Photo count badge in section header */
.sv-photo-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

/* Form field grid */
.sv-field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}

@media (max-width: 600px) {
  .sv-field-group {
    grid-template-columns: 1fr;
  }
}

.sv-field {
  display: flex;
  flex-direction: column;
}

.sv-field--full {
  grid-column: 1 / -1;
}

.sv-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.sv-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.sv-input::placeholder {
  color: var(--text-tertiary);
}

.sv-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,45,91,0.08);
  background: #FFFFFF;
}

.sv-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.sv-textarea::placeholder {
  color: var(--text-tertiary);
}

.sv-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,45,91,0.08);
  background: #FFFFFF;
}

.sv-textarea--tall {
  min-height: 120px;
}

/* Chips (service type tags) */
.sv-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.sv-chip:hover {
  background: var(--glass-hover);
  border-color: rgba(27,45,91,0.16);
}

.sv-chip input {
  display: none;
}

.sv-chip.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(27,45,91,0.16);
}

.sv-chip.checked:hover {
  background: #152347;
}

/* Chip container */
.sv-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Photo prompt cards */
.sv-photo-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--glass-border);
  border-radius: 14px;
  transition: all 0.2s;
}

.sv-photo-prompt.has-file {
  background: rgba(22,163,74,0.05);
  border-color: rgba(22,163,74,0.2);
}

.sv-prompt-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(27,45,91,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sv-prompt-icon.done {
  background: rgba(22,163,74,0.1);
}

.sv-prompt-text {
  flex: 1;
  min-width: 0;
}

.sv-prompt-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.sv-prompt-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-top: 2px;
}

.sv-prompt-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  margin-top: 3px;
}

.sv-prompt-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.sv-prompt-btn {
  padding: 6px 14px;
  background: rgba(27,45,91,0.08);
  border: 0.5px solid rgba(27,45,91,0.15);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
}

.sv-prompt-btn:hover {
  background: rgba(27,45,91,0.14);
}

.sv-prompt-btn.done {
  background: rgba(22,163,74,0.08);
  border-color: rgba(22,163,74,0.2);
  color: #15803D;
}

.sv-prompt-btn.done:hover {
  background: rgba(22,163,74,0.14);
}

/* Upload progress */
.sv-upload-progress {
  width: 80px;
  height: 4px;
  background: rgba(27,45,91,0.1);
  border-radius: 4px;
  overflow: hidden;
  display: none;
}

.sv-upload-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Photo section info block */
.sv-photo-section-info {
  background: rgba(27,45,91,0.05);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px;
  font-size: 12px;
  color: rgba(15,31,61,0.6);
  line-height: 1.6;
}

/* Photo prompts container */
.sv-photo-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 14px;
}

/* Extra uploads area */
.sv-extra-section {
  margin: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(27,45,91,0.1);
}

.sv-extra-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(15,31,61,0.65);
  margin-bottom: 8px;
}

.sv-extra-uploads-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sv-extra-add-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px dashed rgba(27,45,91,0.25);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(15,31,61,0.55);
  cursor: pointer;
  transition: all 0.15s;
}

.sv-extra-add-btn:hover {
  background: rgba(27,45,91,0.04);
  border-color: rgba(27,45,91,0.35);
  color: var(--accent);
}

/* Dashboard cards */
.sv-dash-card {
  padding: 16px;
  background: #FFFFFF;
  border: 0.5px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 1px 2px rgba(15,23,42,0.04);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.sv-dash-card:hover {
  transform: translateY(-1px);
  border-color: rgba(27,45,91,0.16);
  box-shadow: 0 6px 18px -4px rgba(27,45,91,0.16);
}

.sv-dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sv-dash-customer {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.2px;
}

.sv-dash-address {
  font-size: 12px;
  color: rgba(15,31,61,0.55);
  margin-top: 1px;
}

.sv-dash-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}

.sv-dash-date {
  font-size: 12px;
  font-weight: 600;
  color: rgba(15,31,61,0.5);
}

.sv-dash-tech {
  font-size: 11px;
  color: rgba(15,31,61,0.4);
  margin-top: 1px;
}

.sv-dash-scopes {
  font-size: 12px;
  color: rgba(15,31,61,0.6);
  margin-bottom: 8px;
}

.sv-dash-thumbs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  align-items: center;
}

.sv-dash-thumb-img {
  width: 56px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.sv-dash-thumb-vid {
  width: 56px;
  height: 46px;
  background: var(--accent);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
}

.sv-dash-thumb-more {
  width: 56px;
  height: 46px;
  background: rgba(27,45,91,0.08);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(15,31,61,0.55);
  font-weight: 600;
}

.sv-dash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sv-dash-file-count {
  font-size: 11px;
  color: rgba(15,31,61,0.45);
}

.sv-dash-followup {
  background: rgba(202,138,4,0.12);
  border: 0.5px solid rgba(202,138,4,0.3);
  color: #92400E;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Dashboard tab container */
.sv-dash-tab {
  padding-bottom: 60px;
}

.sv-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sv-dash-count {
  font-size: 13px;
  color: rgba(15,31,61,0.55);
}

.sv-dash-refresh-btn {
  background: rgba(27,45,91,0.08);
  border: 0.5px solid rgba(27,45,91,0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: rgba(15,31,61,0.65);
  cursor: pointer;
  transition: all 0.15s;
}

.sv-dash-refresh-btn:hover {
  background: rgba(27,45,91,0.14);
}

.sv-dash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sv-dash-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(15,31,61,0.45);
  font-size: 14px;
}

/* Submit area */
.sv-footer-actions {
  padding: 0 14px 60px;
  margin-top: 8px;
}

.sv-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, rgba(27,45,91,0.92), rgba(15,31,61,0.96));
  border: none;
  border-radius: 14px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
}

.sv-submit-btn:hover {
  box-shadow: 0 4px 16px rgba(27,45,91,0.3);
  transform: translateY(-1px);
}

.sv-submit-btn:active {
  transform: translateY(0);
}

.sv-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Submit status messages */
.sv-submit-status {
  display: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sv-status--error {
  display: block;
  background: rgba(220,38,38,0.1);
  color: #991B1B;
  border: 0.5px solid rgba(220,38,38,0.25);
}

.sv-status--info {
  display: block;
  background: rgba(27,45,91,0.07);
  color: #1E3A6E;
  border: 0.5px solid rgba(27,45,91,0.15);
}

.sv-status--success {
  display: block;
  background: rgba(22,163,74,0.1);
  color: #15803D;
  border: 0.5px solid rgba(22,163,74,0.2);
}

/* Extra upload inline input override */
.sv-photo-prompt .sv-input--inline {
  margin-bottom: 0;
  font-size: 13px;
}

.sv-extra-status {
  font-size: 11px;
  color: rgba(15,31,61,0.5);
  margin-top: 4px;
}
