/*
 * animations.css  —  Glassmorphism Motion System
 * Auth screen, dashboard transitions, card stagger, micro-interactions.
 */

/* ════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════ */

#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 1.1s;
}

#auth-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


#auth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Subtle noise texture */
.auth-scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Auth content block ────────────────── */
.auth-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  animation: auth-enter 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 48px rgba(4,5,18,0.6));
}

@keyframes auth-enter {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Logo + title ──────────────────────── */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.auth-icon {
  animation: auth-float 8s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(56,189,248,0.4)) drop-shadow(0 0 60px rgba(167,139,250,0.2));
  transition: filter 0.3s;
}

/* Torus wordmark — rendered as text using the Press Start 2P pixel font
   (loaded from Google Fonts). Used on the login hero. The ™ superscript
   sits at the right with reduced size + raised baseline. */
.torus-wordmark {
  font-family: 'Press Start 2P', monospace;
  font-size: 40px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 4px;
  line-height: 1;
  user-select: none;
  display: inline-block;
}
.torus-wordmark sup {
  font-size: 0.45em;
  vertical-align: super;
  margin-left: 2px;
}

/* Round black-disc badge with the wordmark centred inside. Used in the
   top nav (~30 px) and dept-shell brand mark (~34 px). The wordmark
   shrinks dramatically inside the disc — at 30 px it's nearly a dot,
   which is intentional: at small sizes a simple round logo reads better
   than illegible micro-type. */
.torus-mark-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: #000;
  border: 2px solid #fff;
  border-radius: 50%;
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
  transition: filter var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out);
}
.nav-logo:hover .torus-mark-badge {
  filter: drop-shadow(0 0 12px rgba(56,189,248,0.55));
  transform: rotate(8deg) scale(1.08);
}
/* Slightly bigger in the dept-shell header */
.dept-shell-brand-mark.torus-mark-badge { width: 36px; height: 36px; font-size: 6px; }

/* More organic 3-step float */
@keyframes auth-float {
  0%   { transform: translateY(0)     rotate(0deg);   }
  25%  { transform: translateY(-12px) rotate(2deg);   }
  55%  { transform: translateY(-5px)  rotate(-1.5deg);}
  80%  { transform: translateY(-9px)  rotate(1deg);   }
  100% { transform: translateY(0)     rotate(0deg);   }
}

.auth-title {
  font-family: var(--font-display);
  font-size: clamp(60px, 10vw, 120px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(4,5,18,0.9), 0 2px 20px rgba(4,5,18,0.8);
}

.auth-title span {
  display: block;
  background: linear-gradient(
    135deg,
    var(--accent-cyan)   0%,
    var(--accent-violet) 40%,
    var(--accent-teal)   70%,
    var(--accent-cyan)   100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 250% 250%;
  animation: gradient-flow 5s ease-in-out infinite;
}

@keyframes gradient-flow {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.auth-subtitle {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  animation: auth-enter 1.1s 0.25s both;
  text-shadow: 0 0 20px rgba(4,5,18,0.95), 0 1px 8px rgba(4,5,18,0.95);
}

/* ── User / Role selector (legacy, kept for compat) ──────── */
.role-selector,
.user-selector {
  display: flex;
  gap: 8px;
  width: 100%;
}

.role-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--r-md);
  color: rgba(240,244,255,0.55);
  cursor: pointer;
  outline: none;
  transition: all var(--t-base) var(--ease-out);
}

.role-card:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: rgba(240,244,255,0.85);
  transform: translateY(-2px);
}

.role-card.active[data-role="admin"] {
  background: rgba(56,189,248,0.10);
  border-color: rgba(56,189,248,0.55);
  color: var(--accent-cyan);
  box-shadow: 0 0 24px rgba(56,189,248,0.18), inset 0 0 14px rgba(56,189,248,0.06);
}

.role-card.active[data-role="employee"] {
  background: rgba(45,212,191,0.10);
  border-color: rgba(45,212,191,0.55);
  color: var(--accent-teal);
  box-shadow: 0 0 24px rgba(45,212,191,0.18), inset 0 0 14px rgba(45,212,191,0.06);
}

.role-card-name {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.role-card-desc {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
}

.user-card-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: inherit;
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}

.user-card-role {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid transparent;
}

.user-card-role.admin    { color: var(--accent-cyan); background: rgba(56,189,248,0.14); border-color: rgba(56,189,248,0.32); }
.user-card-role.employee { color: var(--accent-teal); background: rgba(45,212,191,0.14); border-color: rgba(45,212,191,0.32); }

/* ── Save login row ────────────────────── */
.save-login-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  width: 100%;
  user-select: none;
}

.save-login-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.save-login-indicator {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.22);
  position: relative;
  transition: all var(--t-base) var(--ease-out);
}

.save-login-row:has(input:checked) .save-login-indicator {
  background: rgba(56,189,248,0.22);
  border-color: rgba(56,189,248,0.70);
}

.save-login-row:has(input:checked) .save-login-indicator::after {
  content: '';
  position: absolute;
  left: 3px; top: 1px;
  width: 5px; height: 8px;
  border-right: 2px solid var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  transform: rotate(40deg);
}

.auth-role-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  margin-top: -4px;
  transition: color var(--t-base) var(--ease-smooth);
}

/* Light mode role cards */
html[data-theme="light"] .role-card { background: rgba(255,255,255,0.40); border-color: rgba(130,100,200,0.15); color: var(--text-muted); }
html[data-theme="light"] .role-card:hover { background: rgba(255,255,255,0.60); border-color: rgba(130,100,200,0.30); }
html[data-theme="light"] .role-card.active[data-role="admin"]    { background: rgba(2,132,199,0.08);  border-color: rgba(2,132,199,0.50);  color: var(--accent-cyan); box-shadow: 0 0 20px rgba(2,132,199,0.12); }
html[data-theme="light"] .role-card.active[data-role="employee"] { background: rgba(13,148,136,0.08); border-color: rgba(13,148,136,0.50); color: var(--accent-teal); box-shadow: 0 0 20px rgba(13,148,136,0.12); }

/* ── Light mode auth overrides ─────────── */
html[data-theme="light"] .auth-content {
  filter: drop-shadow(0 4px 32px rgba(80,90,160,0.14));
}

html[data-theme="light"] .auth-title {
  text-shadow: 0 2px 16px rgba(200,210,255,0.6);
}

html[data-theme="light"] .auth-subtitle {
  text-shadow: none;
}

html[data-theme="light"] #auth-canvas {
  opacity: 0.30;
}

/* ── Glass card around form ────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  padding: 32px 32px 28px;
  background: rgba(4,5,18,0.88);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border: 1px solid rgba(56,189,248,0.22);
  border-radius: var(--r-xl);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 60px rgba(56,189,248,0.08);
  animation: auth-enter 1.1s 0.18s both;
  position: relative;
  overflow: hidden;
}

/* Inner shimmer line */
.auth-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.6), rgba(167,139,250,0.6), transparent);
  animation: shine 3.5s ease-in-out infinite;
}

@keyframes shine {
  0%   { opacity: 0.4; transform: scaleX(0.4); }
  50%  { opacity: 1.0; transform: scaleX(1.0); }
  100% { opacity: 0.4; transform: scaleX(0.4); }
}

html[data-theme="light"] .auth-form {
  background: rgba(255,255,255,0.80);
  border-color: rgba(79,70,229,0.30);
  box-shadow:
    0 24px 64px rgba(80,90,160,0.18),
    0 0 0 1px rgba(255,255,255,0.90) inset,
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 0 40px rgba(79,70,229,0.06);
}

html[data-theme="light"] .auth-form::before {
  background: linear-gradient(90deg, transparent, rgba(79,70,229,0.45), rgba(45,212,191,0.45), transparent);
}

.input-wrapper {
  position: relative;
  width: 100%;
}

/* Leading field icon (user / lock) — accent-tinted, brightens on focus */
.auth-input-ic {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: inline-flex; color: rgba(56,189,248,0.6);
  pointer-events: none; transition: color 0.28s var(--ease-smooth);
}
.input-wrapper:focus-within .auth-input-ic { color: var(--accent-cyan); }
html[data-theme="light"] .auth-input-ic { color: rgba(2,132,199,0.6); }

#username-input,
#password-input {
  width: 100%;
  background: rgba(4, 5, 15, 0.85);
  border: 1.5px solid rgba(56,189,248,0.6);
  border-radius: var(--r-md);
  color: #f0f4ff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  padding: 14px 18px 14px 44px;
  text-align: left;
  outline: none;
  box-shadow:
    0 0 0 1px rgba(56,189,248,0.15) inset,
    0 0 20px rgba(56,189,248,0.1);
  transition:
    border-color 0.28s var(--ease-smooth),
    background   0.28s var(--ease-smooth),
    box-shadow   0.28s var(--ease-smooth);
  caret-color: var(--accent-cyan);
}

#username-input { letter-spacing: 0.08em; }
#password-input { letter-spacing: 0.22em; }

#username-input::placeholder,
#password-input::placeholder {
  color: rgba(240,244,255,0.45);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
}

#username-input:focus,
#password-input:focus {
  border-color: rgba(56,189,248,0.95);
  background: rgba(4, 5, 15, 0.94);
  box-shadow:
    0 0 0 3px rgba(56,189,248,0.20),
    0 0 32px rgba(56,189,248,0.28);
}

html[data-theme="light"] #username-input,
html[data-theme="light"] #password-input {
  background: rgba(255,255,255,0.88);
  border-color: rgba(79,70,229,0.45);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(79,70,229,0.08) inset;
}

html[data-theme="light"] #username-input::placeholder,
html[data-theme="light"] #password-input::placeholder {
  color: rgba(19,16,58,0.38);
}

html[data-theme="light"] #username-input:focus,
html[data-theme="light"] #password-input:focus {
  border-color: rgba(2,132,199,0.80);
  background: rgba(255,255,255,0.96);
  box-shadow:
    0 0 0 3px rgba(2,132,199,0.14),
    0 0 20px rgba(2,132,199,0.10);
}

html[data-theme="light"] .save-login-indicator {
  background: rgba(255,255,255,0.60);
  border-color: rgba(130,100,200,0.35);
}

/* Animated underline — replaced with border glow */
.input-underline { display: none; }

/* ── Auth CTA — premium gradient pill with sliding arrow + shimmer sweep ── */
.auth-hint {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 2px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #051018;
  background: linear-gradient(100deg, #7dd3fc 0%, #38bdf8 35%, #818cf8 75%, #2dd4bf 100%);
  background-size: 180% 100%;
  background-position: 0% 50%;
  border: none;
  cursor: pointer;
  padding: 14px 22px;
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(56,189,248,0.30), 0 0 0 1px rgba(255,255,255,0.12) inset;
  transition:
    background-position 0.5s var(--ease-smooth),
    box-shadow  var(--t-base) var(--ease-smooth),
    transform   var(--t-fast) var(--ease-spring);
}
.auth-hint-label { position: relative; z-index: 1; }
.auth-hint-arrow { position: relative; z-index: 1; transition: transform 0.28s var(--ease-spring); }

.auth-hint::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-smooth);
  pointer-events: none;
}

.auth-hint:hover {
  background-position: 100% 50%;
  box-shadow: 0 14px 40px rgba(56,189,248,0.42), 0 0 0 1px rgba(255,255,255,0.18) inset;
  transform: translateY(-2px);
}
.auth-hint:hover .auth-hint-arrow { transform: translateX(4px); }
.auth-hint:hover::after { transform: translateX(120%); }
.auth-hint:active { transform: translateY(0) scale(0.985); }
.auth-hint:focus-visible { outline: 2px solid rgba(56,189,248,0.7); outline-offset: 3px; }

/* Microcopy under the CTA */
.auth-help {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em;
  color: rgba(186,211,232,0.5);
  margin-top: -2px;
}
.auth-help kbd {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em;
  color: rgba(224,242,254,0.85);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px; padding: 1px 6px;
}
html[data-theme="light"] .auth-help { color: rgba(71,85,105,0.7); }
html[data-theme="light"] .auth-help kbd { color: #0f172a; background: rgba(15,23,42,0.06); border-color: rgba(15,23,42,0.16); }
html[data-theme="light"] .auth-hint { color: #fff; box-shadow: 0 10px 30px rgba(2,132,199,0.28), 0 0 0 1px rgba(255,255,255,0.25) inset; }

/* ── Auth error ────────────────────────── */
.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent-rose);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
  padding: 8px 14px;
  background: rgba(251,113,133,0.08);
  border: 1px solid rgba(251,113,133,0.2);
  border-radius: var(--r-sm);
  width: 100%;
  justify-content: center;
}

.auth-error.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Shake animation ───────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%       { transform: translateX(-11px); }
  20%       { transform: translateX(10px); }
  30%       { transform: translateX(-8px); }
  40%       { transform: translateX(7px); }
  50%       { transform: translateX(-5px); }
  60%       { transform: translateX(4px); }
  70%       { transform: translateX(-3px); }
  80%       { transform: translateX(2px); }
}

.input-wrapper.shake {
  animation: shake 0.52s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.input-wrapper.shake #username-input,
.input-wrapper.shake #password-input {
  border-color: rgba(251,113,133,0.55);
  background: rgba(251,113,133,0.06);
  box-shadow: 0 0 0 3px rgba(251,113,133,0.12);
}

/* ── Auth screen theme toggle ───────────── */
.auth-theme-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  transition: all var(--t-base) var(--ease-out);
}

.auth-theme-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: var(--text-primary);
}

html[data-theme="light"] .auth-theme-btn {
  background: rgba(255,255,255,0.50);
  border-color: rgba(130,100,200,0.26);
  color: var(--text-muted);
}

html[data-theme="light"] .auth-theme-btn:hover {
  background: rgba(255,255,255,0.78);
  border-color: rgba(130,100,200,0.46);
  color: var(--text-primary);
}

/* Auth footer */
.auth-footer {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  text-align: center;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  text-transform: uppercase;
  z-index: 2;
  animation: auth-enter 1.2s 0.4s both;
}


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

#dashboard {
  opacity: 0;
  transition: opacity 1s ease;
}

#dashboard.visible {
  opacity: 1;
}

/* ── Dashboard header drops in from nav ── */
.dashboard-header {
  animation: header-drop 0.7s var(--ease-out) 0.1s both;
}

@keyframes header-drop {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Eyebrow accent line pulses ────────── */
@keyframes eyebrow-line-pulse {
  0%, 100% { width: 20px; box-shadow: 0 0 6px var(--accent-cyan); }
  50%       { width: 30px; box-shadow: 0 0 16px var(--accent-cyan), 0 0 32px rgba(56,189,248,0.45); }
}

.page-eyebrow::before {
  animation: eyebrow-line-pulse 3.5s ease-in-out infinite;
}

/* ── Tab panel reveal — spring easing ─── */
.tab-panel.active {
  animation: tab-reveal 0.48s var(--ease-spring) forwards;
}

@keyframes tab-reveal {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Overview sections stagger in ──────── */
.overview-section {
  animation: card-rise 0.55s var(--ease-out) 0.08s both;
}

.alerts-sidebar {
  animation: card-rise 0.55s var(--ease-out) 0.16s both;
}

/* ── Stat card stagger ─────────────────── */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.stat-card {
  animation: card-rise 0.52s var(--ease-spring) both;
}

.stat-card:nth-child(1)  { animation-delay: 0.04s; }
.stat-card:nth-child(2)  { animation-delay: 0.08s; }
.stat-card:nth-child(3)  { animation-delay: 0.12s; }
.stat-card:nth-child(4)  { animation-delay: 0.16s; }
.stat-card:nth-child(5)  { animation-delay: 0.20s; }
.stat-card:nth-child(6)  { animation-delay: 0.24s; }
.stat-card:nth-child(7)  { animation-delay: 0.28s; }
.stat-card:nth-child(8)  { animation-delay: 0.32s; }
.stat-card:nth-child(9)  { animation-delay: 0.36s; }
.stat-card:nth-child(10) { animation-delay: 0.40s; }
.stat-card:nth-child(11) { animation-delay: 0.44s; }
.stat-card:nth-child(12) { animation-delay: 0.48s; }
.stat-card:nth-child(13) { animation-delay: 0.52s; }
.stat-card:nth-child(14) { animation-delay: 0.56s; }
.stat-card:nth-child(15) { animation-delay: 0.60s; }
.stat-card:nth-child(16) { animation-delay: 0.64s; }
.stat-card:nth-child(17) { animation-delay: 0.68s; }
.stat-card:nth-child(18) { animation-delay: 0.72s; }
.stat-card:nth-child(19) { animation-delay: 0.76s; }
.stat-card:nth-child(20) { animation-delay: 0.80s; }

/* Room indicator dot — subtle glow pulse */
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent-cyan); }
  50%       { box-shadow: 0 0 16px var(--accent-cyan), 0 0 32px rgba(56,189,248,0.5); }
}

.stat-room::before {
  animation: dot-pulse 3s ease-in-out infinite;
}

/* ── Loading dots ──────────────────────── */
@keyframes loading-blink {
  0%, 100% { opacity: 1;    color: var(--accent-cyan); }
  50%       { opacity: 0.12; color: var(--text-dim); }
}

.loading-dots::after {
  content: '...';
  display: inline-block;
  animation: loading-blink 1.6s ease-in-out infinite;
}

/* ── Alert group entrance ──────────────── */
@keyframes alert-slide-in {
  from { opacity: 0; transform: translateX(-14px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0)      scale(1); }
}

.alert-item {
  animation: alert-slide-in 0.38s var(--ease-spring) both;
}

.alert-item:nth-child(1)  { animation-delay: 0.04s; }
.alert-item:nth-child(2)  { animation-delay: 0.09s; }
.alert-item:nth-child(3)  { animation-delay: 0.14s; }
.alert-item:nth-child(4)  { animation-delay: 0.19s; }
.alert-item:nth-child(5)  { animation-delay: 0.24s; }
.alert-item:nth-child(6)  { animation-delay: 0.29s; }
.alert-item:nth-child(7)  { animation-delay: 0.34s; }
.alert-item:nth-child(8)  { animation-delay: 0.39s; }
.alert-item:nth-child(9)  { animation-delay: 0.44s; }
.alert-item:nth-child(10) { animation-delay: 0.49s; }

/* Alert group hover nudge */
.alert-group {
  transition:
    background   var(--t-base) var(--ease-smooth),
    box-shadow   var(--t-base) var(--ease-smooth),
    transform    var(--t-fast) var(--ease-out);
}

.alert-group:hover {
  transform: translateX(3px);
}

/* ── Section label ─────────────────────── */
@keyframes label-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.section-label {
  animation: label-in 0.45s var(--ease-out) both;
}

/* ── Summary pills stagger ─────────────── */
.summary-pill {
  animation: card-rise 0.42s var(--ease-spring) both;
}

.summary-pill:nth-child(1) { animation-delay: 0.06s; }
.summary-pill:nth-child(2) { animation-delay: 0.12s; }
.summary-pill:nth-child(3) { animation-delay: 0.18s; }
.summary-pill:nth-child(4) { animation-delay: 0.24s; }
.summary-pill:nth-child(5) { animation-delay: 0.30s; }
.summary-pill:nth-child(6) { animation-delay: 0.36s; }

/* ── Table row flash ───────────────────── */
@keyframes row-new {
  0%   { background: rgba(56,189,248,0.25); box-shadow: inset 0 0 16px rgba(56,189,248,0.15); }
  30%  { background: rgba(56,189,248,0.14); box-shadow: inset 0 0 8px  rgba(56,189,248,0.08); }
  100% { background: transparent;           box-shadow: none; }
}

.data-table tbody tr.flash-row {
  animation: row-new 2.5s ease-out forwards;
}

/* ── WIP card float ────────────────────── */
@keyframes wip-float {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-10px); }
  70%  { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.wip-card {
  animation: wip-float 7s ease-in-out infinite;
}

/* ── WIP icon ring glow pulse ──────────── */
@keyframes ring-glow {
  0%, 100% {
    box-shadow: 0 0 0  0   rgba(56,189,248,0),
                0 0 12px   rgba(56,189,248,0.08);
  }
  50% {
    box-shadow: 0 0 0  10px rgba(56,189,248,0.04),
                0 0 36px   rgba(56,189,248,0.20);
  }
}

.wip-icon-ring {
  animation: ring-glow 4.5s ease-in-out infinite;
}

/* ── Background watermark breathe ─────── */
@keyframes bg-breathe {
  0%, 100% { opacity: 0.025; transform: scale(1.000); }
  50%       { opacity: 0.060; transform: scale(1.020); }
}

.overview-bg-text {
  animation: bg-breathe 10s ease-in-out infinite;
  transform-origin: center center;
}

/* wip-bg-text uses translate(-50%,-50%) for centering — don't override transform */

@keyframes bg-breathe-room {
  0%, 100% { opacity: 0.025; transform: scale(1.000); }
  50%       { opacity: 0.055; transform: scale(1.018); }
}

.room-bg-text {
  animation: bg-breathe-room 12s ease-in-out infinite;
  transform-origin: right top;
}

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

/* ════════════════════════════════════════════════════════════════════════
   WORK-IN-PROGRESS BANNER
   Sticky strip at the top of the viewport. Lives above every modal,
   drawer, and toast (z-index 999999). Other fixed chrome (nav, sidebar,
   toasts) offsets itself by --banner-h so nothing overlaps it.

   To deactivate site-wide: remove the #wip-banner <div> from index.html
   and set --banner-h to 0px below — every other surface picks up the
   change automatically through the variable.
════════════════════════════════════════════════════════════════════════ */
:root { --banner-h: 0px; }   /* BETA banner removed 2026-06-16 — no top offset */
body { padding-top: var(--banner-h); }

#wip-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  height: var(--banner-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg,
    rgba(251, 191, 36, 0.96) 0%,
    rgba(251, 146, 60, 0.96) 100%);
  color: #1a0f00;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.30);
  pointer-events: none;            /* never blocks clicks on what's behind */
  user-select: none;
}
.wip-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a0f00;
  box-shadow: 0 0 0 0 rgba(26, 15, 0, 0.55);
  animation: wip-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
.wip-banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wip-banner-sub {
  margin-left: 6px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.85;
}
/* Inline bug icon inside the banner copy — illustrative only (the banner is
   pointer-events:none), so it just shows users which top-bar button to use. */
.wip-banner-bug {
  vertical-align: -3px;
  margin: 0 2px;
  opacity: 0.9;
}
@keyframes wip-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(26, 15, 0, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(26, 15, 0, 0);    }
}
@media (max-width: 640px) {
  #wip-banner .wip-banner-sub { display: none; }
}
@media (max-width: 480px) {
  /* keep just WIP label + deadline chip on phones */
  #wip-banner .wip-banner-date { margin-left: 8px; padding: 2px 7px; font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .wip-banner-dot { animation: none; }
}

/* ── Rooms-tab migration notice ─────────────────────────────────────────
   Per-room callout sitting just under the rooms header — surfaces the
   "this isn't the final spreadsheet" warning so submissions during the
   migration window don't catch users by surprise. */
.rooms-migration-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.40);
  border-left: 3px solid rgba(251, 191, 36, 0.95);
  border-radius: 8px;
  color: var(--text-primary, #fff);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.rooms-migration-notice strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 1);
  margin-bottom: 2px;
}
.rooms-migration-notice svg { flex-shrink: 0; margin-top: 1px; }

html[data-theme="light"] .rooms-migration-notice {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(202, 138, 4, 0.45);
  border-left-color: rgba(202, 138, 4, 0.95);
  color: #422006;
}
html[data-theme="light"] .rooms-migration-notice strong { color: #92400e; }

/* ── Light-mode gap fixes (appended) ─────────────────────────────────────
   The login hero wordmark is hardcoded #fff and sits over the lavender auth
   background (the Three.js canvas is dimmed to 0.30 in light), so white text
   washes out. Re-anchor it to the deep-navy text token for contrast. */
html[data-theme="light"] .torus-wordmark { color: var(--text-primary); }
