/* ═══════════════════════════════════════════════════════════════
   PUBSAFE — Design System
   Palette: Volcanic Glass + RAG status
   Fonts: Bricolage Grotesque + Outfit
═══════════════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg:        #111111;
  --surface:   #1C1C1C;
  --surface2:  #252525;
  --surface3:  #2E2E2E;
  --border:    #333333;
  --border2:   #3D3D3D;

  /* Brand */
  --orange:    #FF6B2B;
  --orange-lt: #FF8C55;
  --orange-dim:#3D2010;

  /* RAG */
  --green:     #22C55E;
  --green-bg:  #0D2818;
  --green-bd:  #166534;
  --amber:     #F59E0B;
  --amber-bg:  #2A1F08;
  --amber-bd:  #92400E;
  --red:       #EF4444;
  --red-bg:    #2A0D0D;
  --red-bd:    #991B1B;

  /* Text */
  --text:      #F0EDE8;
  --text-2:    #A8A29E;
  --text-3:    #6B6560;

  /* Spacing */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Radius */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.7);

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── SPLASH ── */
#splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
#splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo { margin-bottom: 16px; animation: splashPop .6s var(--ease) both; }
.splash-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2rem; font-weight: 800;
  letter-spacing: -.02em;
  animation: splashFade .6s .15s var(--ease) both;
}
.splash-sub {
  font-size: .9rem; color: var(--text-2); margin-top: 4px;
  animation: splashFade .6s .25s var(--ease) both;
}
.splash-loader {
  width: 120px; height: 3px;
  background: var(--surface3);
  border-radius: 99px;
  margin: 28px auto 0;
  overflow: hidden;
  animation: splashFade .4s .3s var(--ease) both;
}
.splash-bar {
  height: 100%; width: 0;
  background: var(--orange);
  border-radius: 99px;
  animation: splashLoad 1.2s .4s var(--ease) forwards;
}
@keyframes splashPop  { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes splashFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes splashLoad { from { width: 0; } to { width: 100%; } }

/* ── APP SHELL ── */
#app { display: flex; flex-direction: column; height: 100dvh; }
#app.hidden { display: none; }

/* ── TOPBAR ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { display: flex; }
.topbar-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: -.02em;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: .78rem; color: var(--text-2); }
.topbar-settings {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: all .15s;
}
.topbar-settings:hover { background: var(--surface3); color: var(--text); }

/* ── SCREENS ── */
.screens { flex: 1; overflow: hidden; position: relative; }
.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }
.screen-scroll {
  flex: 1; overflow-y: auto;
  padding: 16px 16px calc(var(--safe-bottom) + 80px);
  -webkit-overflow-scrolling: touch;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
  z-index: 10;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  color: var(--text-3);
  font-size: .68rem; font-weight: 500;
  letter-spacing: .02em;
  position: relative;
  transition: color .15s;
}
.nav-btn svg { transition: transform .2s var(--ease); }
.nav-btn.active { color: var(--orange); }
.nav-btn.active svg { transform: scale(1.1); }
.nav-btn:active svg { transform: scale(.92); }
.nav-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  min-width: 18px; height: 18px;
  background: var(--red);
  border-radius: 99px;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}
.nav-badge.hidden { display: none; }

/* ── SECTION HEADERS ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: -.01em;
}
.section-badge {
  background: var(--orange-dim);
  color: var(--orange);
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.add-btn {
  background: var(--orange);
  color: white;
  font-size: .8rem; font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  transition: all .15s;
}
.add-btn:active { transform: scale(.95); }
.icon-btn {
  width: 34px; height: 34px;
  background: var(--surface2);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════════ */

/* Compliance Hero */
.compliance-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 20px;
}
.compliance-ring-wrap { position: relative; flex-shrink: 0; }
.compliance-ring { display: block; }
.ring-track { fill: none; stroke: var(--surface3); stroke-width: 10; }
.ring-progress {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
  transition: stroke-dashoffset 1.2s var(--ease), stroke .4s;
}
.compliance-ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.compliance-pct {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.8rem; font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.compliance-label { font-size: .7rem; color: var(--text-2); margin-top: 2px; }

.compliance-stats { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cstat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid;
}
.cstat.green { background: var(--green-bg); border-color: var(--green-bd); }
.cstat.amber { background: var(--amber-bg); border-color: var(--amber-bd); }
.cstat.red   { background: var(--red-bg);   border-color: var(--red-bd); }
.cstat-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.5rem; font-weight: 800;
}
.cstat.green .cstat-num { color: var(--green); }
.cstat.amber .cstat-num { color: var(--amber); }
.cstat.red   .cstat-num { color: var(--red); }
.cstat-lbl { font-size: .75rem; color: var(--text-2); font-weight: 500; }

/* Alert Banner */
.alert-banner {
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .85rem;
  color: var(--red);
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-banner.hidden { display: none; }
.alert-banner svg { flex-shrink: 0; margin-top: 1px; }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all .15s var(--ease);
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 99px 99px 0 0;
}
.cat-card.rag-green::before { background: var(--green); }
.cat-card.rag-amber::before { background: var(--amber); }
.cat-card.rag-red::before   { background: var(--red); }
.cat-card:active { transform: scale(.97); }
.cat-icon { font-size: 1.6rem; margin-bottom: 8px; }
.cat-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: .9rem; font-weight: 700;
  margin-bottom: 4px;
}
.cat-progress {
  font-size: .75rem; color: var(--text-2);
  margin-bottom: 8px;
}
.cat-bar-track {
  height: 4px; background: var(--surface3);
  border-radius: 99px; overflow: hidden;
}
.cat-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .6s var(--ease);
}
.cat-card.rag-green .cat-bar-fill { background: var(--green); }
.cat-card.rag-amber .cat-bar-fill { background: var(--amber); }
.cat-card.rag-red   .cat-bar-fill { background: var(--red); }
.cat-rag-dot {
  position: absolute; top: 12px; right: 12px;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.cat-card.rag-green .cat-rag-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.cat-card.rag-amber .cat-rag-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); animation: pulse-amber 2s infinite; }
.cat-card.rag-red   .cat-rag-dot { background: var(--red);   box-shadow: 0 0 6px var(--red);   animation: pulse-red 1.5s infinite; }
@keyframes pulse-amber {
  0%,100% { box-shadow: 0 0 4px var(--amber); }
  50%      { box-shadow: 0 0 12px var(--amber); }
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 4px var(--red); }
  50%      { box-shadow: 0 0 14px var(--red); }
}

/* ═══════════════════════════════════════════════════════════════
   CHECK LIST ITEMS
═══════════════════════════════════════════════════════════════ */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  cursor: pointer;
  transition: all .15s var(--ease);
  position: relative;
  overflow: hidden;
}
.check-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
}
.check-item.rag-green::before { background: var(--green); }
.check-item.rag-amber::before { background: var(--amber); }
.check-item.rag-red::before   { background: var(--red); }
.check-item.rag-done::before  { background: var(--surface3); }
.check-item:active { transform: scale(.99); }

.check-rag {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.check-item.rag-green .check-rag { background: var(--green-bg); color: var(--green); }
.check-item.rag-amber .check-rag { background: var(--amber-bg); color: var(--amber); }
.check-item.rag-red   .check-rag { background: var(--red-bg);   color: var(--red); }
.check-item.rag-done  .check-rag { background: var(--surface2); color: var(--text-3); }

.check-body { flex: 1; min-width: 0; }
.check-name {
  font-size: .9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.check-item.rag-done .check-name { color: var(--text-3); text-decoration: line-through; }
.check-meta { font-size: .75rem; color: var(--text-2); }
.check-item.rag-red .check-meta { color: var(--red); }
.check-item.rag-amber .check-meta { color: var(--amber); }

.check-arrow {
  color: var(--text-3);
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state-sub { font-size: .85rem; }

/* ═══════════════════════════════════════════════════════════════
   CHECKLISTS SCREEN
═══════════════════════════════════════════════════════════════ */
.freq-tabs {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px;
}
.freq-tab {
  flex: 1;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
  text-align: center;
}
.freq-tab.active {
  background: var(--orange);
  color: white;
}

.checklist-content { display: flex; flex-direction: column; gap: 16px; }
.checklist-group {}
.checklist-group-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.checklist-group-icon { font-size: 1rem; }
.checklist-group-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: .85rem; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.checklist-group-count {
  margin-left: auto;
  font-size: .72rem; color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════════════
   SCHEDULE SCREEN
═══════════════════════════════════════════════════════════════ */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative;
  overflow: hidden;
}
.schedule-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
}
.schedule-item.rag-green::before { background: var(--green); }
.schedule-item.rag-amber::before { background: var(--amber); }
.schedule-item.rag-red::before   { background: var(--red); }
.schedule-item.rag-future::before { background: var(--surface3); }

.schedule-date-block {
  background: var(--surface2);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  text-align: center;
  min-width: 48px;
  flex-shrink: 0;
}
.schedule-day {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem; font-weight: 800;
  line-height: 1;
}
.schedule-month { font-size: .65rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.schedule-body { flex: 1; }
.schedule-type {
  font-size: .9rem; font-weight: 600;
  margin-bottom: 4px;
}
.schedule-inspector { font-size: .78rem; color: var(--text-2); margin-bottom: 6px; }
.schedule-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}
.schedule-badge.green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); }
.schedule-badge.amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.schedule-badge.red   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-bd); }
.schedule-badge.future { background: var(--surface2); color: var(--text-2); border: 1px solid var(--border); }

.schedule-delete {
  color: var(--text-3);
  padding: 4px;
  border-radius: var(--r-sm);
  transition: all .15s;
}
.schedule-delete:hover { color: var(--red); background: var(--red-bg); }

/* ═══════════════════════════════════════════════════════════════
   HISTORY SCREEN
═══════════════════════════════════════════════════════════════ */
.history-filters {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.history-filters::-webkit-scrollbar { display: none; }
.hfilter {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .78rem; font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all .15s;
}
.hfilter.active {
  background: var(--orange-dim);
  color: var(--orange);
  border-color: var(--orange);
}

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex; align-items: flex-start; gap: 12px;
}
.history-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.history-icon.complete { background: var(--green-bg); }
.history-icon.issue    { background: var(--amber-bg); }
.history-body { flex: 1; }
.history-name { font-size: .88rem; font-weight: 600; margin-bottom: 3px; }
.history-detail { font-size: .75rem; color: var(--text-2); }
.history-time { font-size: .72rem; color: var(--text-3); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  transition: opacity .25s var(--ease);
}
.modal-overlay.hidden { display: none; }
.modal-overlay.closing { opacity: 0; }
.modal-overlay.closing .modal-sheet { transform: translateY(100%); }

.modal-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 20px calc(var(--safe-bottom) + 24px);
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(0);
  transition: transform .3s var(--ease);
}
.modal-sheet::-webkit-scrollbar { display: none; }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.modal-cat-badge {
  font-size: .78rem; font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-2);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.modal-meta {
  font-size: .82rem; color: var(--text-2);
  margin-bottom: 10px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.modal-meta span { display: flex; align-items: center; gap: 4px; }
.modal-legislation {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: .8rem; color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.modal-last {
  font-size: .82rem; color: var(--text-2);
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--r-sm);
}
.modal-notes-wrap { margin-bottom: 20px; }
.modal-notes-label {
  display: block;
  font-size: .78rem; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.modal-notes {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: 12px;
  font-size: .9rem;
  resize: none;
  transition: border-color .15s;
}
.modal-notes:focus { outline: none; border-color: var(--orange); }

.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-complete {
  width: 100%;
  background: var(--green);
  color: #0A1F0A;
  font-size: 1rem; font-weight: 700;
  padding: 16px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s;
}
.btn-complete:active { transform: scale(.98); filter: brightness(.9); }
.btn-issue {
  width: 100%;
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-bd);
  font-size: .95rem; font-weight: 600;
  padding: 14px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s;
}
.btn-issue:active { transform: scale(.98); }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .78rem; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.form-input, .form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: 12px 14px;
  font-size: .95rem;
  transition: border-color .15s;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--orange);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A8A29E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea.form-input { resize: none; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 80px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: .88rem; font-weight: 500;
  padding: 10px 20px;
  border-radius: 99px;
  white-space: nowrap;
  opacity: 0;
  transition: all .25s var(--ease);
  z-index: 200;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.hidden { display: none; }

/* ── UTILITIES ── */
.hidden { display: none !important; }
.rag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
}
.rag-pill.green { background: var(--green-bg); color: var(--green); }
.rag-pill.amber { background: var(--amber-bg); color: var(--amber); }
.rag-pill.red   { background: var(--red-bg);   color: var(--red); }

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn .3s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.slide-up { animation: slideUp .35s var(--ease) both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Stagger children */
.check-list .check-item:nth-child(1) { animation-delay: .04s; }
.check-list .check-item:nth-child(2) { animation-delay: .08s; }
.check-list .check-item:nth-child(3) { animation-delay: .12s; }
.check-list .check-item:nth-child(4) { animation-delay: .16s; }
.check-list .check-item:nth-child(5) { animation-delay: .20s; }
.check-list .check-item:nth-child(6) { animation-delay: .24s; }

/* ═══════════════════════════════════════════════════════════════
   TRAINING PHOTOS
═══════════════════════════════════════════════════════════════ */

.training-toggle-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 16px;
  color: var(--text-2);
  font-size: .9rem; font-weight: 600;
  transition: all .2s var(--ease);
  cursor: pointer;
}
.training-toggle-btn:hover,
.training-toggle-btn.active {
  background: #1A2A3A;
  border-color: #3B82F6;
  color: #60A5FA;
}
.training-toggle-icon { font-size: 1.1rem; }
.training-toggle-text { flex: 1; text-align: left; }
.training-toggle-arrow {
  font-size: .75rem;
  color: var(--text-3);
  transition: transform .2s;
}
.training-toggle-btn.active .training-toggle-arrow { transform: rotate(180deg); }

.training-photos {
  margin-top: 10px;
  border: 1px solid #1E3A5F;
  border-radius: var(--r);
  background: #0D1F33;
  overflow: hidden;
  animation: fadeIn .25s var(--ease);
}
.training-photos.hidden { display: none; }

.training-intro {
  padding: 10px 14px 8px;
  font-size: .75rem;
  color: #60A5FA;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid #1E3A5F;
}

.training-photo-card {
  cursor: pointer;
  border-bottom: 1px solid #1E3A5F;
  transition: background .15s;
}
.training-photo-card:last-child { border-bottom: none; }
.training-photo-card:hover { background: #112233; }
.training-photo-card:active { background: #0A1A2A; }

.training-photo-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--surface3);
}
.training-photo-img[src=""] { display: none; }

.training-photo-caption {
  padding: 10px 14px 12px;
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.45;
}

/* ── LIGHTBOX ── */
#lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s var(--ease);
}
.lb-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(8px);
}
.lb-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 600px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.lb-close {
  position: absolute; top: 0; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: white;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-close:hover { background: rgba(255,255,255,.25); }
.lb-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.lb-img {
  width: 100%;
  max-height: 65dvh;
  object-fit: contain;
  display: block;
  background: #111;
  border-radius: var(--r-lg);
}
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-prev:hover, .lb-next:hover { background: rgba(0,0,0,.85); }
.lb-caption {
  color: var(--text);
  font-size: .9rem;
  text-align: center;
  line-height: 1.5;
  max-width: 480px;
  padding: 0 8px;
}
.lb-counter {
  color: var(--text-3);
  font-size: .78rem;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════════════════ */

.admin-sheet {
  max-height: 95dvh;
}

.admin-section {
  margin-bottom: 24px;
}
.admin-section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: .85rem; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-filter-row {
  display: flex; gap: 8px;
  margin-bottom: 12px;
}

.admin-check-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 50dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-check-list::-webkit-scrollbar { display: none; }

.admin-check-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  transition: all .15s;
}
.admin-check-item.disabled {
  opacity: .45;
  border-style: dashed;
}
.admin-check-icon {
  font-size: 1.1rem;
  width: 32px; text-align: center;
  flex-shrink: 0;
}
.admin-check-body { flex: 1; min-width: 0; }
.admin-check-name {
  font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.admin-check-meta {
  font-size: .72rem; color: var(--text-3);
}
.admin-check-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.admin-toggle-btn,
.admin-delete-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--surface3);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  border: 1px solid var(--border);
}
.admin-toggle-btn:hover { background: var(--amber-bg); border-color: var(--amber-bd); }
.admin-delete-btn:hover { background: var(--red-bg); border-color: var(--red-bd); }

/* ═══════════════════════════════════════════════════════════════
   HISTORY DATE GROUPS
═══════════════════════════════════════════════════════════════ */
.history-date-group { margin-bottom: 20px; }
.history-date-label {
  font-size: .78rem; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  padding-left: 4px;
}