/* ================================================================
   ZARA CALENDAR — Design System
   Bold editorial-noir with precise red pulse
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:ital,wght@0,300..800;1,300..800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root,
:root[data-theme="dark"] {
  /* Surfaces — warm-neutral black with depth */
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --bg-card: #161616;
  --bg-elevated: #1c1c1c;
  --bg-glass: rgba(20, 20, 20, 0.6);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-soft: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-red: rgba(233, 28, 36, 0.35);

  /* Text */
  --text: #fafafa;
  --text-dim: #a3a3a3;
  --text-muted: #737373;
  --text-faint: #525252;

  /* Brand reds */
  --red: #e91c24;
  --red-bright: #ff2730;
  --red-dark: #b31318;
  --red-deep: #7a0c10;

  /* Red glows */
  --red-glow: rgba(233, 28, 36, 0.45);
  --red-glow-soft: rgba(233, 28, 36, 0.18);
  --red-glow-faint: rgba(233, 28, 36, 0.08);
  --red-glow-strong: rgba(233, 28, 36, 0.65);

  /* Theme-aware atmospherics */
  --grid-line: rgba(255, 255, 255, 0.018);
  --noise-opacity: 0.035;
  --noise-blend: overlay;
  --nav-bg: rgba(10, 10, 10, 0.75);
  --modal-backdrop: rgba(5, 5, 5, 0.65);
  --weekend-tint: rgba(255, 255, 255, 0.005);
  --count-bg: rgba(255, 255, 255, 0.05);
  --title-fade-end: rgba(250, 250, 250, 0.65);
  --card-shadow: none;
  --card-shadow-hover: none;

  --color-scheme: dark;

  /* Event type colors */
  --c-birthday: #ec4899;
  --c-wedding: #f59e0b;
  --c-important: #e91c24;
  --c-other: #60a5fa;
  --c-custom: #a78bfa;

  /* Fonts */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Easing */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-swift: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   LIGHT THEME — warm cream + crisp black + red pulse
   Editorial paper-mode counterpart to the noir default
   ================================================================ */

:root[data-theme="light"] {
  /* Surfaces — cool near-white with subtle gray tint */
  --bg: #f5f6f8;           /* whitish-gray canvas */
  --bg-raised: #eaedf1;    /* subtle gray separators */
  --bg-card: #ffffff;      /* pure white cards */
  --bg-elevated: #eef1f4;  /* hover surfaces */
  --bg-glass: rgba(255, 255, 255, 0.78);

  /* Borders — cool slate-ish */
  --border: rgba(15, 23, 42, 0.08);
  --border-soft: rgba(15, 23, 42, 0.05);
  --border-strong: rgba(15, 23, 42, 0.15);
  --border-red: rgba(233, 28, 36, 0.32);

  /* Text */
  --text: #0a0c12;
  --text-dim: #3d4557;
  --text-muted: #64748b;
  --text-faint: #9ca3af;

  /* Brand reds keep their punch */
  --red: #e91c24;
  --red-bright: #ff2730;
  --red-dark: #b31318;
  --red-deep: #7a0c10;

  /* Red glows — softer in light but still visible */
  --red-glow: rgba(233, 28, 36, 0.28);
  --red-glow-soft: rgba(233, 28, 36, 0.10);
  --red-glow-faint: rgba(233, 28, 36, 0.045);
  --red-glow-strong: rgba(233, 28, 36, 0.42);

  /* Theme-aware atmospherics */
  --grid-line: rgba(15, 23, 42, 0.035);
  --noise-opacity: 0.03;
  --noise-blend: multiply;
  --nav-bg: rgba(245, 246, 248, 0.78);
  --modal-backdrop: rgba(15, 23, 42, 0.38);
  --weekend-tint: rgba(15, 23, 42, 0.02);
  --count-bg: rgba(15, 23, 42, 0.05);
  --title-fade-end: rgba(10, 12, 18, 0.38);
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -12px rgba(15, 23, 42, 0.09);
  --card-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 16px 32px -14px rgba(15, 23, 42, 0.14);

  --color-scheme: light;
}

html { color-scheme: var(--color-scheme); }

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--red); color: white; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; background: transparent; border: none; outline: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ================================================================
   Atmospheric background effects
   ================================================================ */

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 10%, transparent 80%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: var(--noise-blend);
}

.bg-glow-a {
  position: fixed;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 100vw);
  height: 700px;
  background: radial-gradient(ellipse at center, var(--red-glow-soft) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
  filter: blur(30px);
  animation: breathe 12s ease-in-out infinite;
}

.bg-glow-b {
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--red-glow-faint) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
  filter: blur(60px);
  animation: breathe 15s ease-in-out infinite reverse;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* ================================================================
   Layout containers
   ================================================================ */

.container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* ================================================================
   NAVIGATION
   ================================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
  padding: 18px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.3s var(--ease);
}
.nav-logo:hover { opacity: 0.8; }

.nav-logo img {
  height: 68px;
  width: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 18px var(--red-glow-soft));
  transition: filter 0.4s var(--ease);
}
.nav-logo:hover img {
  filter: drop-shadow(0 0 30px var(--red-glow)) drop-shadow(0 0 14px var(--red-glow-strong));
}

.nav-logo-badge {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--border-red);
  border-radius: 4px;
  background: var(--red-glow-faint);
}

.nav-links {
  display: flex;
  gap: 4px;
  justify-self: center;
}

.nav-link {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 99px;
  transition: all 0.3s var(--ease);
  position: relative;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: var(--bg-card);
}

.live-clock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: white;
  box-shadow: 0 0 0 0 var(--red-glow), 0 8px 24px -8px var(--red-glow);
}

.btn-red:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  box-shadow: 0 0 24px 0 var(--red-glow), 0 12px 32px -6px var(--red-glow-strong);
  transform: translateY(-1px);
}

.btn-red::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.btn-red:hover::before { opacity: 1; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ================================================================
   ALERT BANNER (próxima fecha dentro de 15 días)
   ================================================================ */

.alert-banner {
  position: relative;
  z-index: 2;
  overflow: hidden;
  animation: slideDown 0.6s var(--ease-out);
  background: linear-gradient(90deg,
    var(--red-dark) 0%,
    var(--red) 50%,
    var(--red-dark) 100%);
  border-bottom: 1px solid var(--red-dark);
  width: 100%;
}

.alert-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
  pointer-events: none;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.alert-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: bell 2.5s ease-in-out infinite;
}

@keyframes bell {
  0%, 100% { transform: rotate(0); }
  5%, 15% { transform: rotate(-12deg); }
  10%, 20% { transform: rotate(12deg); }
  25% { transform: rotate(0); }
}

.alert-icon svg { width: 18px; height: 18px; color: white; }

.alert-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: white;
}

.alert-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-weight: 600;
}

.alert-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.alert-meta {
  font-size: 13px;
  opacity: 0.85;
}

.alert-countdown {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: white;
  position: relative;
  z-index: 1;
}

.alert-countdown-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 2px;
}

.alert-countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.alert-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}
.alert-close:hover { background: rgba(0, 0, 0, 0.4); }
.alert-close svg { width: 14px; height: 14px; }

/* ================================================================
   TIPS BANNER (¿Sabías que?)
   ================================================================ */

.tips-banner {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-raised);
}

.tips-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 52px;
}

.tips-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--red);
  letter-spacing: -0.015em;
  flex-shrink: 0;
  position: relative;
}
.tips-label::after {
  content: '';
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.tips-track {
  flex: 1;
  position: relative;
  height: 22px;
  overflow: hidden;
}

.tips-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.5s var(--ease-out);
}

.tips-text.active {
  opacity: 1;
  transform: translateY(0);
}

.tips-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.tip-dot {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-strong);
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

.tip-dot.active {
  background: var(--red);
  width: 28px;
  box-shadow: 0 0 8px var(--red-glow);
}

/* ================================================================
   MASTHEAD (editorial calendar title)
   ================================================================ */

.masthead {
  position: relative;
  z-index: 1;
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

.masthead-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.masthead-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.masthead-meta-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.masthead-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

.masthead-title {
  font-family: var(--font-display);
  font-size: clamp(68px, 12vw, 180px);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.055em;
  color: var(--text);
  text-transform: lowercase;
  font-variation-settings: 'wdth' 80;
}

.masthead-title-month {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variation-settings: 'wdth' 100;
  display: inline-block;
  animation: fadeUp 0.8s var(--ease-out) 0.1s both;
}

.masthead-title-year {
  display: inline-block;
  background: linear-gradient(180deg, var(--text) 0%, var(--title-fade-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 0.12em;
  animation: fadeUp 0.8s var(--ease-out) 0.2s both;
}

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

.masthead-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 20px;
}

.nav-arrow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
  color: var(--text-dim);
  position: relative;
  overflow: hidden;
}

.nav-arrow:hover {
  color: white;
  border-color: var(--red);
  background: var(--bg-elevated);
  box-shadow: 0 0 24px -4px var(--red-glow);
}

.nav-arrow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--red-glow-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.nav-arrow:hover::before { opacity: 1; }

.nav-arrow svg {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease);
}

.nav-arrow:hover svg.arrow-left { transform: translateX(-3px); }
.nav-arrow:hover svg.arrow-right { transform: translateX(3px); }

.btn-today {
  height: 56px;
  padding: 0 28px;
  border-radius: 99px;
  background: var(--red);
  color: white;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s var(--ease);
  box-shadow: 0 8px 32px -8px var(--red-glow-strong);
  position: relative;
  overflow: hidden;
}
.btn-today:hover {
  background: var(--red-bright);
  box-shadow: 0 12px 40px -6px var(--red-glow-strong), 0 0 30px -4px var(--red-glow);
  transform: translateY(-2px);
}
.btn-today::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.btn-today:hover::before { opacity: 1; }

.btn-today svg { width: 16px; height: 16px; }

/* ================================================================
   MAIN CONTENT GRID
   ================================================================ */

.layout {
  position: relative;
  z-index: 1;
  padding: 48px 32px 80px;
  max-width: 1440px;
  margin: 0 auto;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: stretch;
}

@media (min-width: 1101px) {
  .calendar {
    display: flex;
    flex-direction: column;
  }
  .calendar .cal-grid {
    flex: 1 1 auto;
    grid-auto-rows: minmax(0, 1fr);
  }
  .calendar .cal-cell {
    min-height: 108px;
  }
  .sidebar {
    align-self: start;
  }
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   CALENDAR
   ================================================================ */

.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

.calendar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-glow), transparent);
  pointer-events: none;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.cal-header-day {
  padding: 18px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

.cal-header-day.weekend {
  color: var(--red);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
}

.cal-cell {
  padding: 14px 12px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 110px;
  overflow: hidden;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell:hover {
  background: var(--bg-elevated);
}

.cal-cell.out-of-month {
  opacity: 0.3;
}

.cal-cell.weekend {
  background: var(--weekend-tint);
}

.cal-cell-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variation-settings: 'wdth' 85;
  transition: color 0.25s var(--ease);
}

.cal-cell.out-of-month .cal-cell-num {
  color: var(--text-faint);
}

.cal-cell.today {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  box-shadow: inset 0 0 0 1px var(--red-bright), 0 0 40px -8px var(--red-glow-strong);
  position: relative;
  overflow: hidden;
}

.cal-cell.today::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.18), transparent 50%);
  pointer-events: none;
}

.cal-cell.today::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.cal-cell.today .cal-cell-num {
  color: white;
  font-size: 28px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.cal-cell.today .today-label {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: white;
  opacity: 0.85;
  font-weight: 600;
}

.cal-cell-num-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cal-cell-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--count-bg);
  padding: 2px 6px;
  border-radius: 99px;
  line-height: 1;
  border: 1px solid var(--border);
}

.cal-cell.today .cal-cell-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.cal-cell-events {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow: hidden;
}

.cal-event-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-elevated);
  border-radius: 4px;
  border-left: 2px solid var(--evt-color, var(--red));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.2s var(--ease);
  opacity: 0.95;
}

.cal-cell.today .cal-event-chip {
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border-left-color: white;
}

.cal-event-chip:hover {
  transform: translateX(2px);
  opacity: 1;
  box-shadow: 0 4px 12px -4px var(--evt-color, var(--red));
}

.cal-event-chip-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--evt-color, var(--red));
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--evt-color, var(--red));
}

.cal-cell.today .cal-event-chip-dot {
  background: white;
  box-shadow: 0 0 6px white;
}

.cal-event-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-more {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

/* Hover state cells */
.cal-cell.has-events:not(.today):hover {
  box-shadow: inset 0 0 0 1px var(--border-red);
}

.cal-cell:not(.today):not(.out-of-month):not(.is-premier):hover .cal-cell-num {
  color: var(--red-bright);
}

/* Cell animation entrance — `backwards` so the entrance fade-in
   plays without leaving an animated transform locked in afterwards
   (which was blocking the :hover scale on premier cells). */
.cal-cell {
  animation: cellIn 0.5s var(--ease-out) backwards;
}

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

/* ================================================================
   SIDEBAR
   ================================================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 100px;
}

@media (max-width: 1100px) {
  .sidebar { position: static; }
}

.side-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.side-block-header {
  padding: 20px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.side-block-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-block-title-icon {
  width: 18px;
  height: 18px;
  color: var(--red);
  flex-shrink: 0;
}

.side-block-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.side-block-body {
  padding: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.side-block-body::-webkit-scrollbar { width: 6px; }
.side-block-body::-webkit-scrollbar-track { background: transparent; }
.side-block-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Event list items */
.event-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  align-items: center;
}

.event-item:hover {
  background: var(--bg-elevated);
}

.event-item:hover .event-item-date {
  border-color: var(--evt-color, var(--red));
  box-shadow: 0 0 16px -4px var(--evt-color, var(--red));
}

.event-item-date {
  width: 52px;
  height: 58px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.event-item-date::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--evt-color, var(--red));
}

.event-item-day {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.04em;
}

.event-item-month {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.event-item-info { min-width: 0; }

.event-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.event-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.event-item-type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--evt-color, var(--red));
  font-weight: 500;
}

.event-item-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}

.event-item-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Type chips list */
.types-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px;
}

.type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: all 0.2s var(--ease);
  cursor: default;
}

.type-row:hover { background: var(--bg-elevated); }

.type-row-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--t-color);
  box-shadow: 0 0 10px var(--t-color);
  flex-shrink: 0;
}

.type-row-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  letter-spacing: -0.005em;
}

.type-row-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  font-family: var(--font-serif);
}

.empty-state-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  color: var(--text-faint);
  opacity: 0.5;
}

/* ================================================================
   STATS ROW (bottom)
   ================================================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.stat-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variation-settings: 'wdth' 85;
  margin-bottom: 6px;
}

.stat-card-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-meta-arrow {
  font-size: 10px;
  color: var(--red);
}

/* ================================================================
   MODAL
   ================================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.modal.open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(16px) saturate(110%);
  -webkit-backdrop-filter: blur(16px) saturate(110%);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.8), 0 0 48px -12px var(--red-glow-soft);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s var(--ease-spring);
}

.modal.open .modal-content { transform: scale(1) translateY(0); }

.modal-header {
  padding: 32px 32px 0;
  position: relative;
}

.modal-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--evt-color, var(--red));
  font-weight: 600;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--evt-color, var(--red));
  box-shadow: 0 0 8px var(--evt-color, var(--red));
}

.modal-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 8px;
  font-variation-settings: 'wdth' 95;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.modal-close:hover {
  color: var(--text);
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}

.modal-close svg { width: 14px; height: 14px; }

.modal-body {
  padding: 24px 32px 32px;
}

.modal-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-meta-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal-meta-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.015em;
}

.modal-meta-value.with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-meta-value svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.modal-description {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg-raised);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  border-left: 2px solid var(--evt-color, var(--red));
}

.modal-description-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-actions .btn { flex: 1; justify-content: center; }

.modal-info {
  padding: 14px 16px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
  display: flex;
  align-items: start;
  gap: 10px;
}

.modal-info svg {
  width: 14px;
  height: 14px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 900px) {
  .nav-inner {
    grid-template-columns: auto auto;
    gap: 16px;
    padding: 14px 20px;
  }
  .nav-links { display: none; }
  .live-clock { display: none; }

  .masthead { padding: 40px 0 32px; }
  .masthead-inner { grid-template-columns: 1fr; padding: 0 20px; }
  .masthead-title { font-size: clamp(56px, 16vw, 120px); }
  .masthead-nav { padding-bottom: 0; }

  .alert-inner {
    grid-template-columns: auto 1fr auto;
    padding: 14px 20px;
    gap: 14px;
  }
  .alert-title { font-size: 13px; }
  .alert-meta { display: none; }
  .alert-countdown { font-size: 24px; }

  .tips-inner {
    padding: 12px 20px;
    gap: 8px 14px;
    flex-wrap: wrap;
    min-height: 0;
  }
  .tips-label {
    font-size: 17px;
    order: 1;
    flex: 0 0 auto;
  }
  .tips-label::after { display: none; }
  .tips-nav {
    order: 2;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .tips-track {
    order: 3;
    flex: 1 1 100%;
    height: auto;
    min-height: 34px;
    overflow: visible;
  }
  .tips-text {
    position: static;
    white-space: normal;
    font-size: 13px;
    line-height: 1.45;
    transform: none;
    display: none;
    opacity: 1;
  }
  .tips-text.active {
    display: block;
  }

  .layout { padding: 32px 20px 60px; }
  .content-grid { gap: 20px; }

  .cal-grid { grid-auto-rows: minmax(64px, 1fr); }
  .cal-cell {
    padding: 8px 6px 6px;
    min-height: 64px;
  }
  .cal-cell-num { font-size: 14px; }
  .cal-cell.today .cal-cell-num { font-size: 18px; }
  .cal-cell-count { font-size: 9px; padding: 1px 5px; }
  .cal-cell-events { margin-top: 4px; gap: 2px; }
  .cal-event-chip {
    padding: 1px 4px;
    font-size: 9px;
  }
  .cal-event-chip-title { display: none; }
  .cal-event-chip {
    padding: 3px;
    justify-content: center;
  }
  .cal-cell.today .today-label { display: none; }

  .stats-row { gap: 10px; }
  .stat-card { padding: 16px 18px; }
  .stat-card-value { font-size: 32px; }
}

@media (max-width: 560px) {
  .nav-logo img { height: 26px; }
  .nav-logo-badge { display: none; }

  .alert-inner { padding: 12px 16px; }
  .alert-icon { width: 30px; height: 30px; }
  .alert-icon svg { width: 14px; height: 14px; }

  .tips-label::after { display: none; }
  .tips-inner { gap: 10px; }

  .masthead-title { font-size: clamp(44px, 14vw, 90px); }

  .nav-arrow { width: 44px; height: 44px; }
  .btn-today { height: 44px; padding: 0 18px; font-size: 13px; }

  .modal-content {
    border-radius: 20px;
  }
  .modal-header { padding: 24px 24px 0; }
  .modal-body { padding: 20px 24px 24px; }
  .modal-title { font-size: 24px; }
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }

  /* Show auth-side stacked below the form on mobile */
  .auth-side {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 36px 24px 18px;
    border-left: none;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
  }
  .auth-side-features {
    width: 100%;
  }

  /* Tighter scale for headlines on small screens */
  .auth-side-quote {
    font-size: clamp(32px, 9vw, 52px);
  }
  .auth-side-desc {
    font-size: 14px;
  }
  .auth-side-warning-text {
    font-size: 13px;
  }

  /* Badge → at the very bottom, centered, 200×60 sticker shape */
  .auth-side-badge {
    position: relative;
    bottom: auto;
    right: auto;
    left: auto;
    width: 200px;
    max-width: 200px;
    height: 60px;
    margin: 8px auto 0;
    align-self: center;
    justify-content: center;
    order: 99;
  }
  .auth-side-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.auth-logo img {
  height: 72px;
  width: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 22px var(--red-glow-soft));
  transition: filter 0.4s var(--ease);
}
.auth-logo:hover img {
  filter: drop-shadow(0 0 32px var(--red-glow)) drop-shadow(0 0 16px var(--red-glow-strong));
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.auth-back:hover { color: var(--red); }
.auth-back svg { width: 12px; height: 12px; }

.auth-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-eyebrow-line {
  width: 24px;
  height: 1px;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--text);
  font-variation-settings: 'wdth' 90;
}

.auth-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--red);
  font-variation-settings: 'wdth' 100;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: -0.005em;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.form-input {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: all 0.25s var(--ease);
  width: 100%;
}

.form-input:focus {
  border-color: var(--red);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--red-glow-faint), 0 0 20px -4px var(--red-glow-soft);
}

.form-input::placeholder { color: var(--text-faint); }

.form-input.password-input { padding-right: 48px; }

/* Date / time inputs — consistent across forms (admin event + request).
   Covers native picker (type=date|time) AND flatpickr-rendered inputs
   (which use class .flatpickr-input + .flatpickr-alt-input after init). */
.form-input[type="date"],
.form-input[type="time"],
.form-input.flatpickr-input,
.form-input.flatpickr-alt-input,
input.form-input.flatpickr-mobile {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-size: 14px;
  padding-right: 14px;
  cursor: pointer;
}

/* Subtle calendar icon on the right for the visible input (flatpickr-alt-input
   when altInput is on, native otherwise) */
.form-input.flatpickr-alt-input,
.form-input[type="date"]:not(.flatpickr-input) {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

[data-theme="light"] .form-input.flatpickr-alt-input,
[data-theme="light"] .form-input[type="date"]:not(.flatpickr-input) {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}

/* Hide spinner buttons on Webkit (cleaner look) */
.form-input[type="date"]::-webkit-inner-spin-button,
.form-input[type="time"]::-webkit-inner-spin-button,
.form-input[type="date"]::-webkit-clear-button,
.form-input[type="time"]::-webkit-clear-button {
  display: none;
  -webkit-appearance: none;
}

/* Custom-color the picker indicator (calendar / clock icon) */
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.78) sepia(0) saturate(0);
  opacity: 0.55;
  cursor: pointer;
  padding: 6px;
  margin-right: -6px;
  border-radius: 6px;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}

.form-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: var(--red-glow-faint);
}

[data-theme="light"] .form-input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .form-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.25) sepia(0) saturate(0);
  opacity: 0.6;
}

/* Firefox doesn't expose the picker indicator the same way; the input still
   uses the form-input base style which is consistent. */

/* ================================================================
   FLATPICKR — Zara editorial-grade picker theme
   Glass card with red accent line, oversized display typography,
   pulsing "today", glowing "selected" and micro-interactions on hover.
   ================================================================ */

.flatpickr-calendar {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg-card) 96%, var(--red) 4%) 0%,
      var(--bg-card) 100%);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--red);
  border-radius: 18px;
  box-shadow:
    0 32px 64px -16px rgba(0, 0, 0, 0.65),
    0 0 50px -10px var(--red-glow-soft),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  font-family: var(--font-body);
  width: 332px;
  padding: 14px 14px 12px;
  z-index: 1100;
  color: var(--text);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.flatpickr-calendar.open {
  animation: pickerIn 0.28s var(--ease-spring);
}

@keyframes pickerIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowBottom::before { display: none; }
.flatpickr-calendar.arrowTop::after  { border-bottom-color: var(--border-strong); }
.flatpickr-calendar.arrowBottom::after  { border-top-color: var(--border-strong); }

/* Header — month / year navigation */
.flatpickr-months {
  align-items: center;
  padding: 4px 4px 8px;
  background: transparent;
  position: relative;
}

.flatpickr-month {
  background: transparent;
  color: var(--text);
  height: auto;
  line-height: 1;
  overflow: visible;
}

.flatpickr-current-month {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 6px 0;
  height: auto;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: static;
  width: auto;
  left: auto;
  font-variation-settings: 'wdth' 90;
}

.flatpickr-current-month .cur-month {
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s var(--ease);
}
.flatpickr-current-month .cur-month:hover {
  background: var(--bg-elevated);
}

.flatpickr-monthDropdown-months {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 8px;
  padding: 4px 22px 4px 8px;
}

.flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: var(--bg-card);
  color: var(--text);
}

.flatpickr-current-month input.cur-year {
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 88;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s var(--ease);
}
.flatpickr-current-month input.cur-year:hover {
  background: var(--bg-elevated);
}

.flatpickr-current-month .numInputWrapper {
  width: 7.5ch;
}
.flatpickr-current-month .numInputWrapper span.arrowUp::after  { border-bottom-color: var(--text-muted); }
.flatpickr-current-month .numInputWrapper span.arrowDown::after { border-top-color: var(--text-muted); }
.flatpickr-current-month .numInputWrapper span.arrowUp:hover::after  { border-bottom-color: var(--red); }
.flatpickr-current-month .numInputWrapper span.arrowDown:hover::after { border-top-color: var(--red); }

/* Prev/next month arrows — circular ghost buttons */
.flatpickr-prev-month,
.flatpickr-next-month {
  color: var(--text-muted);
  fill: var(--text-muted);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
  position: static;
  top: auto;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  color: var(--red);
  fill: var(--red);
  background: var(--red-glow-faint);
  border-color: var(--border-red);
  box-shadow: 0 0 16px -4px var(--red-glow);
  transform: translateY(-1px);
}
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg { fill: var(--red); }

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  width: 12px;
  height: 12px;
}

/* Weekday labels */
.flatpickr-weekdays {
  background: transparent;
  height: auto;
  margin: 6px 0 4px;
  padding: 0 2px;
}

.flatpickr-weekdaycontainer {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

span.flatpickr-weekday {
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

/* Days grid */
.flatpickr-days {
  border: none;
  width: auto !important;
}

.dayContainer {
  width: 304px !important;
  min-width: 304px !important;
  max-width: none !important;
  padding: 4px 0 0;
  gap: 2px;
}

.flatpickr-day {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  border-radius: 10px;
  border: 1px solid transparent;
  height: 40px;
  line-height: 40px;
  margin: 0;
  max-width: 40px;
  flex-basis: 40px;
  background: transparent;
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.2s var(--ease-spring),
    box-shadow 0.18s var(--ease);
  font-variation-settings: 'wdth' 92;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
  transform: scale(1.06);
  z-index: 1;
}

/* Today — outlined red, gentle glow pulse */
.flatpickr-day.today {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
  font-weight: 700;
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pickerTodayPulse 2.4s ease-in-out infinite;
}
@keyframes pickerTodayPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow-soft); }
  50% { box-shadow: 0 0 0 4px var(--red-glow-faint); }
}
.flatpickr-day.today:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 0 22px -4px var(--red-glow), 0 8px 18px -6px var(--red-glow);
  animation: none;
  transform: scale(1.08);
}

/* Selected — solid red with strong glow */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-color: var(--red);
  color: white;
  box-shadow:
    0 0 22px -4px var(--red-glow-strong),
    0 6px 16px -4px var(--red-glow),
    inset 0 0 0 1px var(--red-bright);
  font-weight: 700;
  animation: none;
  transform: none;
}

.flatpickr-day.selected:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 28px -2px var(--red-glow-strong),
    0 10px 22px -4px var(--red-glow);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: var(--text-faint);
  background: transparent;
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
  text-decoration-thickness: 1px;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-faint);
  opacity: 0.5;
}
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
  color: var(--text);
  opacity: 1;
}

/* Time picker — chunky centered slots like a digital clock */
.flatpickr-time {
  background: transparent;
  border-top: 1px solid var(--border);
  margin: 6px 0 0;
  padding: 14px 12px 10px;
  height: auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-height: none;
}

.flatpickr-time .numInputWrapper {
  position: relative;
  width: 80px !important;
  height: 56px !important;
  max-height: none;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.flatpickr-time .numInputWrapper:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.18);
}

.flatpickr-time .numInputWrapper:focus-within {
  border-color: var(--red);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--red-glow-faint), 0 6px 16px -6px var(--red-glow-soft);
}

.flatpickr-time input.numInput {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text) !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  font-variation-settings: 'wdth' 88;
  text-align: center;
  letter-spacing: -0.025em;
  padding: 0 !important;
  caret-color: transparent;
  transition: color 0.2s var(--ease);
}

/* Override the global red ::selection for time inputs (was making "12" look like a red box) */
.flatpickr-time input.numInput::selection {
  background: transparent;
  color: var(--text);
}
.flatpickr-time input.numInput::-moz-selection {
  background: transparent;
  color: var(--text);
}

.flatpickr-time input.numInput:focus {
  color: var(--red) !important;
}

.flatpickr-time .flatpickr-time-separator {
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  width: 18px;
  height: auto;
  text-align: center;
  user-select: none;
  animation: timeSeparatorBlink 1.6s ease-in-out infinite;
}

@keyframes timeSeparatorBlink {
  0%, 50% { opacity: 1; }
  60%, 100% { opacity: 0.45; }
}

/* AM/PM toggle — same slot styling */
.flatpickr-time .flatpickr-am-pm {
  color: var(--text) !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  transition: all 0.2s var(--ease);
}
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
  border-color: var(--red);
  color: var(--red) !important;
  background: var(--bg-card);
}

/* Up/down arrows — visible on hover/focus, brand red on hover */
.flatpickr-time .numInputWrapper span {
  position: absolute;
  right: 6px;
  width: 14px;
  height: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
  padding: 0;
}
.flatpickr-time .numInputWrapper:hover span,
.flatpickr-time .numInputWrapper:focus-within span {
  opacity: 0.55;
}
.flatpickr-time .numInputWrapper span:hover {
  opacity: 1;
}
.flatpickr-time .numInputWrapper span.arrowUp { top: 6px; }
.flatpickr-time .numInputWrapper span.arrowDown { bottom: 6px; }

.flatpickr-time .numInputWrapper span::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 0;
  border-bottom: 0;
}
.flatpickr-time .numInputWrapper span.arrowUp::after {
  border-bottom: 5px solid var(--text);
}
.flatpickr-time .numInputWrapper span.arrowDown::after {
  border-top: 5px solid var(--text);
}
.flatpickr-time .numInputWrapper span.arrowUp:hover::after {
  border-bottom-color: var(--red);
}
.flatpickr-time .numInputWrapper span.arrowDown:hover::after {
  border-top-color: var(--red);
}

/* Use the input's own styling — flatpickr clones it */
.flatpickr-input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Light theme tweaks — soft shadow instead of dark glow */
:root[data-theme="light"] .flatpickr-calendar {
  box-shadow:
    0 28px 56px -12px rgba(15, 23, 42, 0.18),
    0 8px 16px -8px rgba(15, 23, 42, 0.08),
    0 0 28px -8px var(--red-glow-soft);
}

.form-toggle-visibility {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.form-toggle-visibility:hover { color: var(--red); background: var(--bg-elevated); }
.form-toggle-visibility svg { width: 16px; height: 16px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-card);
  position: relative;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.form-check-input:checked {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: 2px solid white;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.auth-submit {
  height: 56px;
  border-radius: 14px;
  background: var(--red);
  color: white;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s var(--ease);
  box-shadow: 0 12px 32px -8px var(--red-glow-strong);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.auth-submit:hover {
  background: var(--red-bright);
  box-shadow: 0 16px 48px -8px var(--red-glow-strong), 0 0 30px -4px var(--red-glow);
  transform: translateY(-2px);
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.auth-submit:hover::before { transform: translateX(100%); }

.auth-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}
.auth-submit:hover svg { transform: translateX(4px); }

.auth-hint {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  display: flex;
  gap: 12px;
  align-items: start;
}

.auth-hint svg {
  width: 16px;
  height: 16px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-hint code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--red);
  font-size: 11px;
  border: 1px solid var(--border);
}

.auth-error {
  padding: 12px 16px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  border-radius: 10px;
  color: var(--red-bright);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: shake 0.4s var(--ease);
}

.auth-error svg { width: 14px; height: 14px; flex-shrink: 0; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Auth side — editorial panel.
   Desktop uses CSS grid so features + badge can sit side-by-side at the bottom.
   Mobile reverts to flex column (overridden in @media). */
.auth-side {
  background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg) 100%);
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "top top"
    "warning warning"
    "features badge";
  row-gap: 36px;
  column-gap: 28px;
  padding: 56px 48px;
  align-items: start;
}

.auth-side-top { grid-area: top; }
.auth-side-warning { grid-area: warning; }
.auth-side-features { grid-area: features; }
.auth-side-badge { grid-area: badge; }

/* Inner spacing of the editorial top block */
.auth-side-top {
  gap: 18px;
}
.auth-side-top .auth-side-quote {
  margin-top: 4px;
}
.auth-side-top .auth-side-desc {
  margin-top: 6px;
}

.auth-side::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--red-glow-soft), transparent 65%);
  filter: blur(40px);
  animation: breathe 10s ease-in-out infinite;
}

.auth-side-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
}

.auth-side-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  width: fit-content;
}
.auth-side-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.auth-side-quote {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variation-settings: 'wdth' 90;
}
.auth-side-quote em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--red);
  font-variation-settings: 'wdth' 100;
  display: block;
}

.auth-side-desc {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 460px;
  line-height: 1.6;
}

.auth-side-small {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 8px;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 18px;
  max-width: 460px;
}

.auth-side-small::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 1px;
  background: var(--text-faint);
}

/* Humorous warning block */
.auth-side-warning {
  position: relative;
  z-index: 1;
  padding: 16px 18px;
  background: var(--red-glow-faint);
  border: 1px dashed var(--border-red);
  border-radius: 14px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-side-warning-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
}
.auth-side-warning-eyebrow svg {
  width: 14px;
  height: 14px;
}

.auth-side-warning-text {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  letter-spacing: -0.005em;
}

.auth-side-warning-text strong {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0;
}

/* Floating badge with link — placed in the right column of the bottom grid row,
   so it sits to the right of the features grid. */
.auth-side-badge {
  position: relative;
  align-self: end;
  width: 188px;
  height: 188px;
  z-index: 5;
  cursor: pointer;
  display: block;
  animation: badgeFloat 4.5s ease-in-out infinite;
  transition: transform 0.4s var(--ease-spring), filter 0.3s var(--ease);
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.3));
}

.auth-side-badge img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.auth-side-badge:hover {
  animation-play-state: paused;
  transform: scale(1.14) rotate(-8deg);
  filter: drop-shadow(0 18px 36px var(--red-glow-strong)) drop-shadow(0 0 18px var(--red-glow));
}

.auth-side-badge:active { transform: scale(1.06) rotate(-4deg); }

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  25% { transform: translateY(-6px) rotate(2deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
  75% { transform: translateY(-4px) rotate(-1deg); }
}

@media (max-width: 1100px) {
  .auth-side-badge {
    width: 156px;
    height: 156px;
  }
  .auth-side {
    column-gap: 20px;
  }
}

/* Auth-side bottom padding reserves space for the absolute badge,
   so features grid no longer needs its own padding-bottom. */

.auth-side-features {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 520px;
}

.auth-feature {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s var(--ease);
}

.auth-feature:hover {
  border-color: var(--border-red);
  box-shadow: 0 0 24px -8px var(--red-glow-soft);
}

.auth-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.auth-feature-icon svg { width: 16px; height: 16px; }

.auth-feature-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-feature-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ================================================================
   ADMIN PANEL
   ================================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
}

.admin-nav {
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .admin-nav { position: static; height: auto; }
}

/* ================================================================
   ADMIN NAV — hamburger toggle on mobile
   ================================================================ */

.admin-nav-toggle {
  display: none;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-nav-toggle:hover {
  border-color: var(--border-red);
  color: var(--red);
  box-shadow: 0 0 18px -4px var(--red-glow-soft);
}

.admin-nav-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease-spring);
}

.admin-nav-toggle .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.admin-nav.is-open .admin-nav-toggle {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow-faint);
}

.admin-nav.is-open .admin-nav-toggle .icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.admin-nav.is-open .admin-nav-toggle .icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

@media (max-width: 900px) {
  .admin-nav-toggle {
    display: inline-flex;
  }

  /* Collapse the menu by default on mobile */
  .admin-nav .admin-tab-list,
  .admin-nav .admin-nav-bottom {
    display: none;
  }

  /* Reveal on toggle */
  .admin-nav.is-open .admin-tab-list {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
    animation: adminMenuSlide 0.28s var(--ease-out);
  }

  .admin-nav.is-open .admin-nav-bottom {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
    padding-top: 14px;
    animation: adminMenuSlide 0.28s var(--ease-out) 0.05s both;
  }

  /* Hide the "Admin" badge on very small screens to give room */
  .admin-nav-top .nav-logo-badge {
    display: none;
  }
}

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

.admin-nav-top {
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand img {
  height: 28px;
  width: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px var(--red-glow-soft));
}

.admin-tab-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-tab-section {
  padding: 10px 12px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
  cursor: pointer;
  position: relative;
}

.admin-tab:hover { background: var(--bg-card); color: var(--text); }

.admin-tab.active {
  background: var(--bg-card);
  color: var(--text);
}

.admin-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px var(--red);
}

.admin-tab-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.admin-tab.active .admin-tab-icon { color: var(--red); }

.admin-tab-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}

.admin-nav-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 0 16px -4px var(--red-glow);
}

.admin-user-info { min-width: 0; flex: 1; }

.admin-user-settings {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
  padding: 0;
}
.admin-user-settings:hover {
  color: var(--red);
  border-color: var(--border-red);
  background: var(--red-glow-faint);
  transform: rotate(35deg);
}
.admin-user-settings:active { transform: rotate(35deg) scale(0.92); }
.admin-user-settings svg { width: 14px; height: 14px; }
.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.admin-user-role {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.admin-main {
  padding: 32px 40px 60px;
  background: var(--bg);
  min-height: 100vh;
}

@media (max-width: 768px) {
  .admin-main { padding: 24px 20px 40px; }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 0.95;
  font-variation-settings: 'wdth' 88;
}

.admin-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--red);
  font-variation-settings: 'wdth' 100;
}

.admin-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
  letter-spacing: -0.005em;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Admin data table/list */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.25s var(--ease);
}

.admin-row:hover {
  border-color: var(--border-strong);
  transform: translateX(2px);
}

.admin-row-date {
  width: 52px;
  height: 60px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.admin-row-date::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--evt-color, var(--red));
}

.admin-row-day {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.admin-row-month {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
}

.admin-row-info { min-width: 0; }

.admin-row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.admin-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--evt-color, var(--red));
}

.admin-row-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--evt-color, var(--red));
  box-shadow: 0 0 6px var(--evt-color, var(--red));
}

.admin-row-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.admin-row-actions {
  display: flex;
  gap: 6px;
}

.admin-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.admin-action-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.admin-action-btn.danger:hover {
  color: white;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 16px -4px var(--red-glow);
}

.admin-action-btn.edit:hover {
  color: var(--red);
  border-color: var(--border-red);
}

.admin-action-btn svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  .admin-row {
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    padding: 14px 16px;
  }
  .admin-row-date { width: 48px; height: 54px; }
  .admin-row-day { font-size: 18px; }
  .admin-row-chip, .admin-row-time { display: none; }
  .admin-row:not(:has(.admin-row-actions)) { grid-template-columns: 48px 1fr; }
}

/* Admin forms */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-textarea {
  min-height: 100px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.005em;
  resize: vertical;
  font-family: inherit;
  transition: all 0.25s var(--ease);
  width: 100%;
  line-height: 1.5;
}

.form-textarea:focus {
  border-color: var(--red);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--red-glow-faint);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 16px 42px 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-glow-faint);
}

.form-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s var(--ease);
  border: 2px solid transparent;
  box-shadow: 0 0 12px -2px var(--sw-color);
}

.color-swatch:hover { transform: scale(1.1); }

.color-swatch.selected {
  border-color: white;
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--sw-color), 0 0 20px -2px var(--sw-color);
}

.color-swatch.custom {
  background: var(--bg-elevated);
  border: 2px dashed var(--border-strong);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.color-picker-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.form-row-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.form-row-actions .btn { padding: 13px 22px; }

/* Tip rows */
.tip-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s var(--ease);
}

.tip-row:hover { border-color: var(--border-strong); }

.tip-row-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: -0.04em;
  line-height: 1;
  width: 40px;
  text-align: center;
  font-variation-settings: 'wdth' 85;
  opacity: 0.5;
}

.tip-row-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.tip-row-text em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--red);
}

/* Type cards grid */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.type-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.type-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
}

.type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--t-color);
  box-shadow: 0 0 10px var(--t-color);
}

.type-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.type-card-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--t-color);
  box-shadow: 0 0 16px -2px var(--t-color);
}

.type-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.type-card-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.type-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  animation: toastIn 0.4s var(--ease-spring) forwards;
  pointer-events: auto;
}

@keyframes toastIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.exiting { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastOut {
  to { transform: translateX(400px); opacity: 0; }
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
}

.toast-icon svg { width: 14px; height: 14px; }

/* Confirm dialog */
.confirm-box {
  text-align: center;
  padding: 8px 0;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.confirm-icon svg { width: 24px; height: 24px; }

.confirm-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.confirm-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto;
}

/* Utility classes */
.hidden { display: none !important; }

.scrollable::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
.scrollable::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Focus visibility */
*:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Transitions on page load */
.page-enter > * {
  animation: fadeUp 0.6s var(--ease-out) both;
}
.page-enter > *:nth-child(1) { animation-delay: 0.0s; }
.page-enter > *:nth-child(2) { animation-delay: 0.08s; }
.page-enter > *:nth-child(3) { animation-delay: 0.16s; }
.page-enter > *:nth-child(4) { animation-delay: 0.24s; }
.page-enter > *:nth-child(5) { animation-delay: 0.32s; }

/* ================================================================
   THEME TOGGLE
   ================================================================ */

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--red);
  border-color: var(--border-red);
  box-shadow: 0 0 24px -6px var(--red-glow);
  transform: translateY(-1px);
}

.theme-toggle:active { transform: translateY(0) scale(0.94); }

.theme-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--red-glow-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.theme-toggle:hover::before { opacity: 1; }

.theme-toggle svg {
  width: 17px;
  height: 17px;
  position: absolute;
  transition: transform 0.45s var(--ease-spring), opacity 0.3s var(--ease);
  z-index: 1;
}

/* Dark active → show sun (click to light) */
:root[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme]) .theme-icon-sun {
  transform: translateY(0) rotate(0);
  opacity: 1;
}
:root[data-theme="dark"] .theme-icon-moon,
:root:not([data-theme]) .theme-icon-moon {
  transform: translateY(24px) rotate(80deg);
  opacity: 0;
}

/* Light active → show moon (click to dark) */
:root[data-theme="light"] .theme-icon-sun {
  transform: translateY(-24px) rotate(-80deg);
  opacity: 0;
}
:root[data-theme="light"] .theme-icon-moon {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

/* ================================================================
   LIGHT-THEME SPECIFIC OVERRIDES
   Paper-mode shadows + inverted micro-details
   ================================================================ */

:root[data-theme="light"] .calendar,
:root[data-theme="light"] .side-block,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .admin-row,
:root[data-theme="light"] .type-card,
:root[data-theme="light"] .tip-row,
:root[data-theme="light"] .admin-user-card,
:root[data-theme="light"] .modal-content,
:root[data-theme="light"] .auth-feature,
:root[data-theme="light"] .live-clock {
  box-shadow: var(--card-shadow);
}

:root[data-theme="light"] .stat-card:hover {
  box-shadow: var(--card-shadow-hover);
}

:root[data-theme="light"] .type-card:hover {
  box-shadow: var(--card-shadow-hover);
}

:root[data-theme="light"] .admin-row:hover {
  box-shadow: var(--card-shadow);
}

:root[data-theme="light"] .toast {
  box-shadow: 0 2px 6px rgba(20, 18, 14, 0.06), 0 24px 48px -12px rgba(20, 18, 14, 0.18);
}

:root[data-theme="light"] .modal-content {
  box-shadow:
    0 4px 12px rgba(20, 18, 14, 0.08),
    0 32px 80px -20px rgba(20, 18, 14, 0.25),
    0 0 48px -12px var(--red-glow-soft);
}

:root[data-theme="light"] .cal-cell.today {
  box-shadow: inset 0 0 0 1px var(--red-bright), 0 0 48px -8px var(--red-glow-strong), 0 8px 24px -10px var(--red-glow);
}

:root[data-theme="light"] .btn-red {
  box-shadow: 0 4px 16px -6px var(--red-glow-strong);
}
:root[data-theme="light"] .btn-red:hover {
  box-shadow: 0 8px 24px -4px var(--red-glow-strong), 0 0 24px -4px var(--red-glow);
}

:root[data-theme="light"] .btn-today {
  box-shadow: 0 6px 20px -6px var(--red-glow-strong);
}
:root[data-theme="light"] .btn-today:hover {
  box-shadow: 0 10px 28px -6px var(--red-glow-strong), 0 0 24px -4px var(--red-glow);
}

/* Dropdown chevron color for light */
:root[data-theme="light"] .form-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin="round"><polyline points='6 9 12 15 18 9'/></svg>");
}

/* Type card hover shadow — dark used heavy shadow, light needs different */
:root[data-theme="light"] .type-card:hover {
  box-shadow: 0 12px 32px -10px rgba(20, 18, 14, 0.18);
}

/* Selected color swatch ring needs paper contrast in light */
:root[data-theme="light"] .color-swatch.selected {
  border-color: white;
  box-shadow:
    0 0 0 2px white,
    0 0 0 4px var(--sw-color),
    0 0 16px -2px var(--sw-color),
    0 2px 8px rgba(20, 18, 14, 0.15);
}

/* Admin sidebar in light gets a hint of warmth */
:root[data-theme="light"] .admin-nav {
  background: var(--bg-raised);
  box-shadow: inset -1px 0 0 var(--border);
}

/* Auth hint slightly more visible in light */
:root[data-theme="light"] .auth-hint {
  background: var(--bg-raised);
}

/* Calendar "today" label shadow for legibility */
:root[data-theme="light"] .cal-cell.today .cal-cell-num {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}

/* Tip number accent — less opaque in light (the red reads stronger) */
:root[data-theme="light"] .tip-row-num { opacity: 0.65; }

/* Today cell chips in light mode keep dark backing for contrast */
:root[data-theme="light"] .cal-cell.today .cal-event-chip {
  background: rgba(0, 0, 0, 0.22);
}

/* Alert-banner shimmer stays bright; no override needed */

/* Auth side gradient direction in light reads a bit different */
:root[data-theme="light"] .auth-side {
  background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg) 60%, var(--bg-raised) 100%);
}

/* ================================================================
   THEME-SWITCH ANIMATION
   Apply a brief transition layer when toggling, then remove
   ================================================================ */

html.is-switching-theme,
html.is-switching-theme body,
html.is-switching-theme *:not(svg):not(svg *) {
  transition:
    background-color 0.45s var(--ease),
    border-color 0.45s var(--ease),
    color 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    fill 0.45s var(--ease),
    stroke 0.45s var(--ease) !important;
}

/* ================================================================
   REQUEST DATE CTA — public "solicitar fecha" button + modal form
   ================================================================ */

.btn-request {
  height: 56px;
  padding: 0 22px;
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
}

.btn-request:hover {
  border-color: var(--red);
  background: var(--bg-elevated);
  box-shadow: 0 0 28px -8px var(--red-glow), 0 8px 24px -12px var(--red-glow-soft);
  transform: translateY(-1px);
}

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

.btn-request::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, var(--red-glow-faint), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.btn-request:hover::before { opacity: 1; }

.btn-request svg {
  width: 17px;
  height: 17px;
  color: var(--red);
  transition: transform 0.4s var(--ease-spring);
  position: relative;
  z-index: 1;
}

.btn-request:hover svg { transform: rotate(90deg) scale(1.1); }

.btn-request-label { position: relative; z-index: 1; }

.masthead-nav-divider {
  width: 1px;
  height: 28px;
  background: var(--border-strong);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Modal subtitle (for request modal) */
.modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 12px;
  max-width: 420px;
}

/* Send channels (WhatsApp / Email choice) */
.send-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .send-channels { grid-template-columns: 1fr; }
}

.send-channel {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.send-channel:hover {
  transform: translateY(-2px);
  border-color: var(--send-bg);
  box-shadow: 0 16px 36px -12px var(--send-shadow), 0 0 0 1px var(--send-bg);
}

.send-channel:active { transform: translateY(0) scale(0.99); }

.send-channel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--send-bg);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 8px 16px -4px var(--send-shadow);
  transition: transform 0.3s var(--ease);
}

.send-channel:hover .send-channel-icon {
  transform: scale(1.08) rotate(-4deg);
}

.send-channel-icon svg { width: 20px; height: 20px; }

.send-channel-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.send-channel-label {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.send-channel-value {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-channel-wa {
  --send-bg: #25D366;
  --send-shadow: rgba(37, 211, 102, 0.35);
}

.send-channel-email {
  --send-bg: var(--red);
  --send-shadow: var(--red-glow);
}

.send-channels-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Nav-bar variant — compact button in the top menu */
.btn-request-nav {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
}
.btn-request-nav svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 768px) {
  .btn-request-nav {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .btn-request-nav .btn-request-label { display: none; }
}

/* ================================================================
   TYPE ICON — color dot OR emoji badge
   ================================================================ */

.t-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  background: var(--t-color);
  box-shadow: 0 0 12px -2px var(--t-color);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.t-icon.t-icon-xs {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 10px;
}

.t-icon.t-icon-lg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 22px;
}

/* When no emoji is set, fall back to solid color "dot" shape.
   Markup uses .t-dot directly — .t-icon only wraps emoji variant. */
.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--t-color);
  box-shadow: 0 0 10px var(--t-color);
  flex-shrink: 0;
  display: inline-block;
}

/* Calendar event chip emoji */
.cal-event-chip-emoji {
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Admin row chip emoji */
.admin-row-chip-emoji {
  font-size: 12px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Modal label emoji */
.modal-label-emoji {
  font-size: 12px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Type-card swatch with optional emoji */
.type-card-swatch-emoji {
  font-size: 20px;
  line-height: 1;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Event item date overlay emoji (bottom-right badge, inside clipped cell) */
.event-item-emoji {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font-size: 11px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ================================================================
   EMOJI PICKER (admin form)
   ================================================================ */

.emoji-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emoji-picker-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* On narrower viewports (modal in mobile or tablet portrait), reorganize so
   the description gets its own row and the visual controls (preview + clear
   button) sit alone in the top row — much less cramped. */
@media (max-width: 700px) {
  .emoji-picker-head {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "preview clear"
      "hint hint";
    gap: 14px;
    align-items: center;
  }
  .emoji-picker-preview { grid-area: preview; }
  .emoji-picker-clear   { grid-area: clear; justify-self: end; }
  .emoji-picker-hint    {
    grid-area: hint;
    font-size: 13px;
    line-height: 1.5;
    max-width: none;
  }
}

.emoji-picker-preview {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
  position: relative;
}

.emoji-picker-preview.has-emoji {
  border-color: var(--red);
  box-shadow: 0 0 20px -4px var(--red-glow-soft);
}

.emoji-picker-preview-empty {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.emoji-picker-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.emoji-picker-clear {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.emoji-picker-clear:hover {
  color: var(--red);
  border-color: var(--border-red);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  padding: 12px;
  background: var(--bg-raised);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-height: 240px;
  overflow-y: auto;
}

.emoji-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease);
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.emoji-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  transform: scale(1.15);
}

.emoji-btn.selected {
  background: var(--red-glow-faint);
  border-color: var(--red);
  box-shadow: 0 0 14px -4px var(--red-glow);
  transform: scale(1.08);
}

.emoji-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* On mobile, stack label and input — prevents the "O ESCRIBE UNO:" label
   from breaking into 3 ugly lines. */
@media (max-width: 700px) {
  .emoji-custom-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .emoji-custom-label {
    flex-shrink: 0;
  }
}

.emoji-custom-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.005em;
  transition: all 0.2s var(--ease);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', var(--font-body);
}

.emoji-custom-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow-faint);
}

.emoji-custom-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ================================================================
   BULK TIPS PREVIEW
   ================================================================ */

.bulk-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.25s var(--ease);
}

.bulk-preview.has-items {
  border-color: var(--border-red);
  background: var(--red-glow-faint);
}

.bulk-preview-count {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--red);
  font-variation-settings: 'wdth' 85;
  min-width: 48px;
  text-align: center;
}

.bulk-preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.bulk-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

.bulk-preview-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.bulk-preview-divider {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
  flex-shrink: 0;
}

/* Disable state for submit when 0 */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ================================================================
   LOGO WRAPPER — red atmospheric glow + theme swap
   ================================================================ */

.logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.logo-wrap::before {
  content: '';
  position: absolute;
  inset: -35% -48%;
  background: radial-gradient(ellipse at center,
    var(--red-glow) 0%,
    var(--red-glow-soft) 35%,
    transparent 72%);
  filter: blur(26px);
  pointer-events: none;
  z-index: 0;
  animation: logoGlowPulse 5s ease-in-out infinite;
}

.logo-wrap::after {
  content: '';
  position: absolute;
  inset: -10% -20%;
  background: radial-gradient(ellipse at center,
    var(--red-glow-soft) 0%,
    transparent 60%);
  filter: blur(14px);
  pointer-events: none;
  z-index: 0;
  animation: logoGlowPulse 5s ease-in-out infinite 0.6s;
}

@keyframes logoGlowPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* Light mode — 50% glow intensity */
:root[data-theme="light"] .logo-wrap::before,
:root[data-theme="light"] .logo-wrap::after {
  animation-name: logoGlowPulseLight;
}

@keyframes logoGlowPulseLight {
  0%, 100% { opacity: 0.275; transform: scale(0.92); }
  50% { opacity: 0.5; transform: scale(1.12); }
}

.nav-logo:hover .logo-wrap::before,
.auth-logo:hover .logo-wrap::before {
  animation-duration: 2.4s;
}

/* Theme-aware logo swap — specificity bumped above .nav-logo img / .auth-logo img */
img.theme-logo-dark,
img.theme-logo-light {
  display: none !important;
}

:root[data-theme="dark"] img.theme-logo-dark {
  display: block !important;
}

:root[data-theme="light"] img.theme-logo-light {
  display: block !important;
}

/* Responsive — keep logo ~doubled across breakpoints */
@media (max-width: 900px) {
  .nav-logo img { height: 58px; }
  .auth-logo img { height: 64px; }
}

@media (max-width: 560px) {
  .nav-logo img { height: 48px; }
  .auth-logo img { height: 56px; }
  .logo-wrap::before { inset: -25% -35%; filter: blur(18px); }
}

/* Reduce nav padding so big logo doesn't push everything down */
.nav-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

@media (max-width: 900px) {
  .nav-inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* ================================================================
   EVENT MEDIA CTA — "¿Tienes contenido de este día?"
   ================================================================ */

.event-media-cta {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.event-media-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.6;
}

.event-media-cta-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-media-cta-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.event-media-cta-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, var(--red-glow), transparent 60%);
  animation: logoGlowPulse 3s ease-in-out infinite;
}

.event-media-cta-icon svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.event-media-cta-text { min-width: 0; }

.event-media-cta-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.2;
}

.event-media-cta-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.event-media-cta .send-channels {
  margin-top: 0;
}

.event-media-cta .send-channel {
  background: var(--bg-card);
}

/* ================================================================
   EVENT MEDIA GALLERY + UPLOAD
   ================================================================ */

.event-media-section {
  margin-top: 20px;
}

.event-media-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.event-media-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.event-media-section-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.15em;
}

.event-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.event-media-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.event-media-item:hover {
  transform: scale(1.04);
  border-color: var(--border-strong);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.event-media-item img,
.event-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-media-item-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 4px;
}
.event-media-item-badge svg { width: 10px; height: 10px; }

.event-media-item-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: all 0.2s var(--ease);
  border: none;
  cursor: pointer;
}
.event-media-item:hover .event-media-item-remove { opacity: 1; }
.event-media-item-remove:hover {
  background: var(--red);
  transform: scale(1.08);
}
.event-media-item-remove svg { width: 12px; height: 12px; }

.event-media-upload {
  margin-top: 10px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.event-media-upload:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow-faint);
  border-style: solid;
}

.event-media-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.event-media-upload svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-spring);
}
.event-media-upload:hover svg { transform: scale(1.15) rotate(-10deg); }

.event-media-upload.uploading {
  pointer-events: none;
  opacity: 0.6;
}

/* Lightbox overlay for full-size view */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.92);
  transition: transform 0.4s var(--ease-spring);
  position: relative;
}
.lightbox.open .lightbox-content { transform: scale(1); }

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
  backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 1;
}
.lightbox-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}
.lightbox-close svg { width: 18px; height: 18px; }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================================
   DAY INLINE CREATE (admin clicks a date)
   ================================================================ */

.day-inline-create {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.day-inline-create::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0.5;
}

.day-inline-create-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.day-inline-create-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.day-inline-create-icon svg { width: 16px; height: 16px; }

.day-inline-create-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.day-inline-create-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.day-inline-create-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-inline-create-form .form-input,
.day-inline-create-form .form-textarea,
.day-inline-create-form .form-select {
  background: var(--bg-card);
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 10px;
}

.day-inline-create-form .form-textarea {
  min-height: 72px;
  font-size: 13px;
}

.day-inline-create-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.day-inline-create-actions .btn { padding: 10px 16px; font-size: 13px; }

/* ================================================================
   DAY-EVENT-CARD — event row + media gallery inside day modal
   ================================================================ */

.day-event-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s var(--ease);
  position: relative;
}

.day-event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: var(--evt-color, var(--red));
  opacity: 0.8;
}

.day-event-card:hover {
  border-color: var(--border-strong);
}

.day-event-card .event-item {
  background: transparent !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  padding: 14px 16px;
}

.day-event-media {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}

.day-event-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.day-event-media-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-event-media-label-icon {
  width: 14px;
  height: 14px;
  color: var(--evt-color, var(--red));
}

.day-event-media-count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--text-faint);
}

.day-event-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}

.day-event-media-gallery .event-media-item {
  border-radius: 8px;
}

.day-event-media-gallery .event-media-item-badge {
  padding: 2px 5px;
  font-size: 8px;
  top: 4px;
  left: 4px;
  border-radius: 4px;
}
.day-event-media-gallery .event-media-item-badge svg { width: 8px; height: 8px; }

/* ================================================================
   SIDEBAR SEARCH
   ================================================================ */

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
  position: relative;
}

.sidebar-search:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-glow-faint), 0 0 24px -6px var(--red-glow-soft);
  background: var(--bg-elevated);
}

.sidebar-search > svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.25s var(--ease);
}

.sidebar-search:focus-within > svg { color: var(--red); }

.sidebar-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  letter-spacing: -0.005em;
  padding: 4px 0;
  outline: none;
  width: 100%;
  min-width: 0;
}

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

.sidebar-search input::-webkit-search-cancel-button { display: none; }

.sidebar-search-clear {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
  padding: 0;
}

.sidebar-search-clear:hover {
  color: white;
  background: var(--red);
  border-color: var(--red);
  transform: rotate(90deg);
}

.sidebar-search-clear svg { width: 12px; height: 12px; }

/* ================================================================
   MASTHEAD META — emphasize today / next event in red bold
   ================================================================ */

#todayMeta,
#nextEventMeta {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* ================================================================
   EVENT COUNTDOWN — "Faltan N días" inside event modal
   ================================================================ */

.event-countdown {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}

.event-countdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-muted);
}

.event-countdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.event-countdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.event-countdown-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variation-settings: 'wdth' 88;
}

.event-countdown-unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.event-countdown-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease);
}
.event-countdown-icon svg { width: 20px; height: 20px; }

/* Soon — within 7 days */
.event-countdown-soon {
  background: var(--red-glow-faint);
  border-color: var(--border-red);
}
.event-countdown-soon::before { background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.event-countdown-soon .event-countdown-value { color: var(--red); }
.event-countdown-soon .event-countdown-icon {
  background: var(--red);
  border-color: var(--red);
  color: white;
  box-shadow: 0 0 18px -2px var(--red-glow);
}

/* Today */
.event-countdown-today {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-color: var(--red-bright);
  box-shadow: 0 0 24px -4px var(--red-glow-strong);
}
.event-countdown-today::before { background: rgba(255,255,255,0.4); }
.event-countdown-today .event-countdown-label,
.event-countdown-today .event-countdown-unit { color: rgba(255,255,255,0.85); }
.event-countdown-today .event-countdown-value {
  color: white;
  text-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.event-countdown-today .event-countdown-icon {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.3);
  color: white;
}

/* Past */
.event-countdown-past .event-countdown-value {
  color: var(--text-muted);
}
.event-countdown-past::before { background: var(--text-faint); }

/* Future (>7 days) — neutral default already covered */

/* ================================================================
   TYPE EVENTS MODAL — list of events for one category, sortable
   ================================================================ */

.type-modal-toolbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}

.type-modal-sort-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.type-modal-sort-btn:hover { color: var(--text); }

.type-modal-sort-btn.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.type-modal-sort-btn svg { width: 12px; height: 12px; }

.type-modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow-y: auto;
}

.type-modal-list .event-item.past { opacity: 0.5; }

/* ================================================================
   RECURRENCE OPTIONS — segmented control inside event forms
   ================================================================ */

.recurrence-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .recurrence-options { grid-template-columns: 1fr; }
}

.recurrence-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.recurrence-option:hover {
  border-color: var(--border-red);
  background: var(--bg-elevated);
}

.recurrence-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  margin: 1px 0 0;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
  position: relative;
}

.recurrence-option input[type="radio"]:checked {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow), inset 0 0 0 4px var(--bg-card);
}

.recurrence-option:has(input:checked) {
  border-color: var(--red);
  background: var(--red-glow-faint);
  box-shadow: 0 0 0 1px var(--red), 0 0 24px -8px var(--red-glow-soft);
}

.recurrence-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.recurrence-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recurrence-title-icon {
  width: 14px;
  height: 14px;
  color: var(--red);
  flex-shrink: 0;
}

.recurrence-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Recurring badge shown next to event titles when applicable */
.recurring-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--red-glow-faint);
  border: 1px solid var(--border-red);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  vertical-align: middle;
  line-height: 1;
}
.recurring-badge svg {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

.recurring-badge-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  color: var(--evt-color, var(--red));
  flex-shrink: 0;
  margin-left: 4px;
  vertical-align: -1px;
}
.recurring-badge-mini svg { width: 11px; height: 11px; }

/* ================================================================
   PRESENCE INDICATOR — "Hay N personas viendo" with glow dot
   ================================================================ */

.presence-wrap {
  position: relative;
}

.presence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-family: var(--font-mono);
}

.presence-indicator:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

.presence-indicator.is-open {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, #4ade80);
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 0 4px var(--dot-color, #4ade80),
    0 0 10px var(--dot-color, #4ade80);
}

.presence-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--dot-color, #4ade80);
  opacity: 0.45;
  animation: presence-pulse-ring 2s ease-in-out infinite;
  pointer-events: none;
}

.presence-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--dot-color, #4ade80);
  filter: blur(6px);
  opacity: 0.7;
  animation: presence-pulse-glow 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes presence-pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

@keyframes presence-pulse-glow {
  0%, 100% { opacity: 0.55; filter: blur(6px); }
  50% { opacity: 1; filter: blur(10px); }
}

.presence-count {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.presence-label {
  color: var(--text-muted);
}

/* Popover */
.presence-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 304px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.55), 0 0 28px -8px var(--red-glow-soft);
  z-index: 200;
  animation: popoverIn 0.28s var(--ease-spring);
}

.presence-popover.hidden { display: none; }

@keyframes popoverIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.presence-popover-arrow {
  position: absolute;
  top: -7px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

.presence-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.presence-popover-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.presence-popover-close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.presence-popover-close:hover {
  color: var(--red);
  background: var(--red-glow-faint);
  transform: rotate(90deg);
}
.presence-popover-close svg { width: 14px; height: 14px; }

.presence-popover-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presence-popover-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.presence-popover-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.presence-popover-form {
  display: flex;
  gap: 6px;
}

.presence-popover-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s var(--ease);
  min-width: 0;
}
.presence-popover-form input::placeholder { color: var(--text-faint); }
.presence-popover-form input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow-faint);
}

.presence-popover-form button {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}
.presence-popover-form button:hover {
  background: var(--red-bright);
  box-shadow: 0 6px 20px -6px var(--red-glow-strong);
}

.presence-clear {
  align-self: flex-start;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}
.presence-clear:hover { color: var(--red); }

.presence-popover-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
}

.presence-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.005em;
  transition: all 0.2s var(--ease);
}

.presence-list-item.is-me {
  border-color: var(--border-red);
  background: var(--red-glow-faint);
}

.presence-list-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.presence-list-item.anon .presence-list-item-name {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

.presence-list-item-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

.presence-dot-small {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-color, #4ade80);
  flex-shrink: 0;
  animation: presence-glow-pulse 1.5s ease-in-out infinite;
}

@keyframes presence-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 3px var(--dot-color, #4ade80),
      0 0 8px var(--dot-color, #4ade80);
  }
  50% {
    box-shadow:
      0 0 6px var(--dot-color, #4ade80),
      0 0 16px var(--dot-color, #4ade80),
      0 0 26px var(--dot-color, #4ade80);
  }
}

/* Mobile responsive — float the indicator at bottom-center,
   popover opens upward with backdrop blur */
@media (max-width: 900px) {
  .presence-wrap {
    position: fixed !important;
    bottom: 18px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    z-index: 50;
  }

  .presence-indicator {
    padding: 10px 18px;
    font-size: 12.5px;
    background: var(--bg-glass, var(--bg-card));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-color: var(--border-strong);
    box-shadow:
      0 10px 28px -8px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(255, 255, 255, 0.04);
  }

  .presence-label { display: inline; }

  /* Popover opens upward, centered horizontally */
  .presence-popover {
    position: absolute;
    bottom: calc(100% + 14px);
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 28px);
    max-width: 360px;
    animation: popoverInUp 0.28s var(--ease-spring);
  }

  /* Hide the up-pointing arrow since popover is now above the indicator */
  .presence-popover-arrow { display: none; }
}

@keyframes popoverInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .presence-wrap { bottom: 14px; }
}

/* ================================================================
   PREMIER — special category that paints entire cell with admin's
   chosen color + animated sparkles + radiant glow.
   Overrides .today styling because admin's choice is intentional.
   ================================================================ */

.cal-cell.is-premier {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--premier-color, var(--red)) 78%, #000) 0%,
    var(--premier-color, var(--red)) 50%,
    color-mix(in srgb, var(--premier-color, var(--red)) 65%, #000) 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--premier-color, var(--red)) 70%, white),
    inset 0 0 32px rgba(0, 0, 0, 0.14),
    0 0 36px -6px var(--premier-color, var(--red)),
    0 0 80px -14px var(--premier-color, var(--red)),
    0 0 120px -20px var(--premier-color, var(--red));
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Embers — small crisp pinpoints scattered, twinkling and drifting upward
   like campfire sparks (without the fire). */
.cal-cell.is-premier::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 1.5px at 14% 78%, rgba(255,255,255,1), rgba(255,255,255,0.55) 40%, transparent 100%),
    radial-gradient(circle 2.5px at 28% 45%, rgba(255,255,255,0.9), rgba(255,255,255,0.4) 32%, transparent 100%),
    radial-gradient(circle 1.5px at 47% 70%, rgba(255,255,255,1), rgba(255,255,255,0.5) 40%, transparent 100%),
    radial-gradient(circle 3px at 64% 30%, rgba(255,255,255,0.92), rgba(255,255,255,0.4) 28%, transparent 100%),
    radial-gradient(circle 1.5px at 78% 60%, rgba(255,255,255,1), rgba(255,255,255,0.55) 40%, transparent 100%),
    radial-gradient(circle 2px at 9% 30%, rgba(255,255,255,0.85), rgba(255,255,255,0.35) 35%, transparent 100%),
    radial-gradient(circle 1.5px at 92% 22%, rgba(255,255,255,0.95), rgba(255,255,255,0.5) 40%, transparent 100%),
    radial-gradient(circle 2.5px at 38% 92%, rgba(255,255,255,0.88), rgba(255,255,255,0.4) 32%, transparent 100%),
    radial-gradient(circle 1.5px at 70% 88%, rgba(255,255,255,1), rgba(255,255,255,0.55) 40%, transparent 100%),
    radial-gradient(circle 2px at 55% 18%, rgba(255,255,255,0.9), rgba(255,255,255,0.4) 35%, transparent 100%),
    radial-gradient(circle 1.5px at 22% 18%, rgba(255,255,255,0.95), rgba(255,255,255,0.5) 40%, transparent 100%),
    radial-gradient(circle 2px at 84% 80%, rgba(255,255,255,0.85), rgba(255,255,255,0.4) 35%, transparent 100%);
  animation:
    premier-ember-twinkle 2.6s ease-in-out infinite,
    premier-ember-drift 5.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* Shimmer band sliding diagonally */
.cal-cell.is-premier::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 62%,
    transparent 100%);
  background-size: 240% 100%;
  animation: premier-shimmer 3.8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes premier-ember-twinkle {
  0%, 100% { opacity: 0.5; }
  25% { opacity: 0.85; }
  50% { opacity: 1; }
  75% { opacity: 0.7; }
}

@keyframes premier-ember-drift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(0.5px, -2px); }
  50% { transform: translate(-0.5px, -4px); }
  75% { transform: translate(0.5px, -2px); }
  100% { transform: translate(0, 0); }
}

@keyframes premier-shimmer {
  0% { background-position: -120% 0; }
  100% { background-position: 220% 0; }
}

/* Premier overrides today's red gradient (admin's choice wins) */
.cal-cell.is-premier.today {
  /* inherits .is-premier styling — explicitly clear .today shadows */
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--premier-color, var(--red)) 75%, white),
    inset 0 0 32px rgba(0, 0, 0, 0.18),
    0 0 44px -6px var(--premier-color, var(--red)),
    0 0 90px -14px var(--premier-color, var(--red)),
    0 0 140px -22px var(--premier-color, var(--red));
}

.cal-cell.is-premier .cal-cell-num {
  color: white;
  font-size: 26px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
}

.cal-cell.is-premier .cal-cell-num-wrap,
.cal-cell.is-premier .cal-cell-events,
.cal-cell.is-premier .today-label {
  position: relative;
  z-index: 2;
}

.cal-cell.is-premier .today-label {
  color: white;
  opacity: 0.9;
}

.cal-cell.is-premier .cal-cell-count {
  background: rgba(0, 0, 0, 0.42);
  color: white;
  border-color: rgba(255, 255, 255, 0.32);
}

.cal-cell.is-premier .cal-event-chip {
  background: rgba(0, 0, 0, 0.42);
  color: white;
  border-left-color: white;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cal-cell.is-premier .cal-event-chip-emoji,
.cal-cell.is-premier .cal-event-chip-dot {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}

.cal-cell.is-premier .cal-event-more {
  color: rgba(255, 255, 255, 0.85);
}

/* Hover — pop 20% bigger (premier cells feel "alive") and keep number white */
.cal-cell.is-premier {
  transition:
    transform 0.4s var(--ease-spring),
    box-shadow 0.35s var(--ease),
    background-color 0.25s var(--ease);
  will-change: transform;
}

.cal-cell.is-premier:hover {
  transform: scale(1.2);
  z-index: 20;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--premier-color, var(--red)) 75%, white),
    inset 0 0 32px rgba(0, 0, 0, 0.16),
    0 0 50px -4px var(--premier-color, var(--red)),
    0 0 110px -14px var(--premier-color, var(--red)),
    0 0 160px -22px var(--premier-color, var(--red));
}

.cal-cell.is-premier:hover .cal-cell-num {
  color: white;
}

/* Modal premier styling — replace red with chosen color, add glow */
.modal-content.is-premier {
  border-color: color-mix(in srgb, var(--premier-color, var(--red)) 50%, transparent);
  box-shadow:
    0 32px 80px -20px rgba(0, 0, 0, 0.85),
    0 0 50px -10px var(--premier-color, var(--red)),
    0 0 110px -22px var(--premier-color, var(--red));
}

.modal-content.is-premier::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--premier-color, var(--red)), transparent);
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
}

/* Countdown box uses --evt-color (already set to premier color) */
.modal-content.is-premier .event-countdown {
  background: color-mix(in srgb, var(--evt-color, var(--red)) 12%, transparent);
  border-color: color-mix(in srgb, var(--evt-color, var(--red)) 35%, transparent);
}
.modal-content.is-premier .event-countdown::before {
  background: var(--evt-color, var(--red));
  box-shadow: 0 0 12px var(--evt-color, var(--red));
}
.modal-content.is-premier .event-countdown-value {
  color: var(--evt-color, var(--red));
}
.modal-content.is-premier .event-countdown-icon {
  background: var(--evt-color, var(--red));
  border-color: var(--evt-color, var(--red));
  color: white;
  box-shadow: 0 0 18px -2px var(--evt-color, var(--red));
}
.modal-content.is-premier .event-countdown-today {
  background: linear-gradient(135deg,
    var(--evt-color, var(--red)) 0%,
    color-mix(in srgb, var(--evt-color, var(--red)) 65%, #000) 100%);
  border-color: var(--evt-color, var(--red));
}

/* Description left-border + recurring badge accents */
.modal-content.is-premier .modal-description {
  border-left-color: var(--evt-color, var(--red));
}
.modal-content.is-premier .recurring-badge {
  background: color-mix(in srgb, var(--evt-color, var(--red)) 14%, transparent);
  border-color: color-mix(in srgb, var(--evt-color, var(--red)) 45%, transparent);
  color: var(--evt-color, var(--red));
}

/* ================================================================
   REQUEST FORM — brighter text in dark mode (~30% whiter)
   The request modal needs more legibility for first-time visitors.
   ================================================================ */

:root[data-theme="dark"] .modal-content.is-request .modal-title,
:root[data-theme="dark"] .modal-content.is-request .send-channel-label {
  color: #ffffff;
}

:root[data-theme="dark"] .modal-content.is-request .modal-subtitle,
:root[data-theme="dark"] .modal-content.is-request .form-label,
:root[data-theme="dark"] .modal-content.is-request .send-channels-label,
:root[data-theme="dark"] .modal-content.is-request .send-channel-value {
  /* #737373 -> #a3a3a3 — about 30% lighter towards white */
  color: #a3a3a3;
}

:root[data-theme="dark"] .modal-content.is-request .form-input,
:root[data-theme="dark"] .modal-content.is-request .form-textarea {
  color: #ffffff;
}

:root[data-theme="dark"] .modal-content.is-request .form-input::placeholder,
:root[data-theme="dark"] .modal-content.is-request .form-textarea::placeholder {
  /* #525252 -> #7a7a7a */
  color: #7a7a7a;
}

/* Premier badge chip — small visual cue near the title */
.premier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--evt-color, var(--red)) 25%, transparent),
    color-mix(in srgb, var(--evt-color, var(--red)) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--evt-color, var(--red)) 50%, transparent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--evt-color, var(--red));
  vertical-align: middle;
  line-height: 1;
  box-shadow: 0 0 16px -4px var(--evt-color, var(--red));
}
.premier-badge svg { width: 10px; height: 10px; }

/* ================================================================
   MOBILE OVERRIDES (placed last to win over desktop grid rules)
   ================================================================ */

@media (max-width: 900px) {
  .auth-side {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
    column-gap: 0;
    row-gap: 32px;
  }
  .auth-side-badge {
    grid-area: auto;
    position: relative;
    width: 200px;
    max-width: 200px;
    height: 60px;
    align-self: center;
    margin: 8px auto 0;
    order: 99;
    display: block;
  }
  .auth-side-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
