/* =====================================================
   BASE & RESET
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #080c14;
  --surface:      rgba(255, 255, 255, 0.04);
  --surface-hover:rgba(255, 255, 255, 0.07);
  --border:       rgba(255, 255, 255, 0.08);
  --border-focus: rgba(248, 113, 113, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary:rgba(241, 245, 249, 0.55);
  --text-muted:   rgba(241, 245, 249, 0.35);
  --accent-blue:  #f87171;
  --accent-cyan:  #ef4444;
  --accent-grad:  linear-gradient(135deg, #f87171, #ef4444);
  --error:        #f87171;
  --radius-sm:    10px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --blur:         blur(24px);
  --blur-heavy:   blur(60px);
  --shadow:       0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.6);
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =====================================================
   ANIMATED BACKGROUND
   ===================================================== */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: var(--blur-heavy);
  opacity: 0;
  animation: blobFloat 14s ease-in-out infinite;
}

.blob--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(185, 28, 28, 0.35), transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
  animation-duration: 16s;
  opacity: 0.7;
}

.blob--2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25), transparent 70%);
  bottom: -10%;
  right: -8%;
  animation-delay: -5s;
  animation-duration: 18s;
  opacity: 0.6;
}

.blob--3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  top: 40%;
  left: 40%;
  animation-delay: -9s;
  animation-duration: 20s;
  opacity: 0.5;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(30px, -30px) scale(1.05); }
  50%       { transform: translate(-20px, 20px) scale(0.97); }
  75%       { transform: translate(20px, 30px) scale(1.03); }
}

/* Noise texture overlay */
.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* =====================================================
   GLASSMORPHISM PRIMITIVES
   ===================================================== */
.glass-card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.glass-bar {
  background: rgba(8, 12, 20, 0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}

.glass-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

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

/* =====================================================
   LOGIN PAGE — SINGLE (used by admin login)
   ===================================================== */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  animation: fadeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.login-card {
  padding: 48px 40px;
}

/* =====================================================
   USER SELECTION GRID (main login page)
   ===================================================== */
.user-select-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  animation: fadeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.user-select-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.user-select-header svg {
  animation: iconPulse 3s ease-in-out infinite;
}

.user-select-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-select-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px 20px;
  cursor: pointer;
  border: none;
  text-align: center;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition);
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.user-card:nth-child(1) { animation-delay: 0.05s; }
.user-card:nth-child(2) { animation-delay: 0.10s; }
.user-card:nth-child(3) { animation-delay: 0.15s; }
.user-card:nth-child(4) { animation-delay: 0.20s; }
.user-card:nth-child(5) { animation-delay: 0.25s; }
.user-card:nth-child(6) { animation-delay: 0.30s; }

.user-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.user-card:active { transform: translateY(-1px); }

.user-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

.user-card:hover .user-avatar {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.user-avatar-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.user-card:hover .user-avatar-glow { opacity: 0.6; }

.user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.user-cta {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.user-card:hover .user-cta { color: var(--accent-blue); }

/* Password modal (user-specific) */
.pw-modal-card {
  max-width: 380px;
  width: 100%;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.pw-modal-card .login-form { width: 100%; }
.pw-modal-card .field-wrapper { text-align: left; }

.pw-modal-avatar { margin-bottom: 16px; }

.pw-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.pw-modal-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.pw-modal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Header user avatar on calendar page */
.header-user-avatar {
  flex-shrink: 0;
}

/* Admin corner button */
.admin-corner-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  font-size: 12px;
  padding: 7px 12px;
  opacity: 0.5;
  transition: opacity var(--transition), background var(--transition),
    color var(--transition), transform var(--transition);
  text-decoration: none;
}

.admin-corner-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .user-grid { grid-template-columns: repeat(2, 1fr); }
  .user-select-wrapper { padding: 32px 16px 24px; }
}

.login-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.3)); }
  50%       { filter: drop-shadow(0 0 18px rgba(248, 113, 113, 0.6)); }
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.field-wrapper {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.field-wrapper:focus-within .field-icon {
  color: var(--accent-blue);
}

.glass-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  padding: 12px 16px 12px 42px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  letter-spacing: 0.05em;
}

.glass-input::placeholder { color: var(--text-muted); letter-spacing: 0.05em; }

.glass-input:focus {
  border-color: var(--border-focus);
  background: rgba(248, 113, 113, 0.05);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.error-msg {
  font-size: 13px;
  color: var(--error);
  min-height: 18px;
  text-align: center;
  animation: shake 0.35s ease both;
}

.error-msg:empty { animation: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* Login button */
.login-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 20px rgba(185, 28, 28, 0.35);
  margin-top: 4px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(185, 28, 28, 0.5);
}

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

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Shimmer effect on button */
.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0s;
}

.login-btn:hover .btn-shimmer {
  transform: translateX(100%);
  transition: transform 0.6s ease;
}

/* Spinner */
.btn-spinner {
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn-spinner.active { display: block; }
.btn-label.hidden { display: none; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =====================================================
   CALENDAR PAGE — HEADER
   ===================================================== */
.page-calendar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions { display: flex; gap: 8px; }

.refresh-btn svg { transition: transform 0.5s ease; }
.refresh-btn:hover svg { transform: rotate(180deg); }

.logout-btn:hover { color: var(--error) !important; border-color: rgba(248, 113, 113, 0.3) !important; }

/* =====================================================
   CALENDAR WRAPPER
   ===================================================== */
.cal-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.cal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 60vh;
  animation: fadeIn 0.4s ease;
}

.loading-spinner svg {
  animation: spin 1s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.cal-error,
.cal-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 40vh;
  text-align: center;
  padding: 48px;
  animation: fadeSlideUp 0.5s ease both;
}

.cal-error p,
.cal-notice p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 380px;
  line-height: 1.7;
}

.cal-notice h2 {
  font-size: 20px;
  font-weight: 600;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cal-notice code {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  color: var(--accent-blue);
  -webkit-text-fill-color: var(--accent-blue);
}

.cal-card {
  padding: 28px;
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* =====================================================
   FULLCALENDAR DARK THEME
   ===================================================== */
:root {
  --fc-border-color:              rgba(255, 255, 255, 0.08);
  --fc-button-bg-color:           rgba(255, 255, 255, 0.06);
  --fc-button-border-color:       rgba(255, 255, 255, 0.1);
  --fc-button-text-color:         rgba(241, 245, 249, 0.8);
  --fc-button-hover-bg-color:     rgba(185, 28, 28, 0.2);
  --fc-button-hover-border-color: rgba(248, 113, 113, 0.4);
  --fc-button-hover-text-color:   #f1f5f9;
  --fc-button-active-bg-color:    rgba(185, 28, 28, 0.35);
  --fc-button-active-border-color:rgba(248, 113, 113, 0.6);
  --fc-button-active-text-color:  #f1f5f9;
  --fc-today-bg-color:            rgba(248, 113, 113, 0.07);
  --fc-event-bg-color:            rgba(185, 28, 28, 0.75);
  --fc-event-border-color:        transparent;
  --fc-event-text-color:          #ffffff;
  --fc-event-selected-overlay-color: rgba(0,0,0,0.2);
  --fc-page-bg-color:             transparent;
  --fc-neutral-bg-color:          rgba(255, 255, 255, 0.03);
  --fc-neutral-text-color:        rgba(241, 245, 249, 0.55);
  --fc-highlight-color:           rgba(248, 113, 113, 0.08);
  --fc-list-event-hover-bg-color: rgba(255, 255, 255, 0.05);
  --fc-non-business-color:        rgba(255, 255, 255, 0.02);
}

/* Text colors */
.fc {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13.5px;
}

.fc-col-header-cell-cushion,
.fc-daygrid-day-number,
.fc-list-day-text,
.fc-list-day-side-text {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
}

.fc-col-header-cell-cushion {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted) !important;
  padding: 10px 0 !important;
}

.fc-daygrid-day-number {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px !important;
  transition: color var(--transition);
}

.fc-daygrid-day:hover .fc-daygrid-day-number {
  color: var(--text-primary) !important;
}

.fc-day-today .fc-daygrid-day-number {
  color: var(--accent-blue) !important;
  font-weight: 700;
}

/* Toolbar buttons */
.fc-button {
  border-radius: 8px !important;
  font-family: var(--font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 7px 14px !important;
  transition: all var(--transition) !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}

.fc-button:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important; }

.fc-toolbar-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  background: var(--accent-grad) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Events */
.fc-event {
  border-radius: 6px !important;
  border: none !important;
  padding: 2px 6px !important;
  font-weight: 500 !important;
  font-size: 12.5px !important;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition) !important;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25) !important;
}

.fc-event:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.45) !important;
  filter: brightness(1.1) !important;
}

/* List view */
.fc-list {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
}

.fc-list-day-cushion {
  background: rgba(255, 255, 255, 0.04) !important;
  padding: 10px 16px !important;
}

.fc-list-event td {
  border-color: var(--border) !important;
}

.fc-list-event-title a {
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.fc-list-empty {
  background: transparent !important;
  color: var(--text-muted) !important;
}

/* Week/Day header */
.fc-timegrid-slot-label {
  color: var(--text-muted) !important;
  font-size: 12px !important;
}

/* =====================================================
   EVENT MODAL
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 32px;
  animation: fadeSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-grad);
  flex-shrink: 0;
  margin-top: 6px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-row svg { flex-shrink: 0; margin-top: 1px; color: var(--accent-blue); }
.modal-row span { line-height: 1.5; }

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =====================================================
   CINEMATIC PAGE TRANSITION
   ===================================================== */

/* Step 1 — login card exits */
@keyframes exitCard {
  0%   { opacity: 1; transform: scale(1)    translateY(0);   filter: blur(0); }
  100% { opacity: 0; transform: scale(0.94) translateY(10px); filter: blur(8px); }
}

/* Step 2 — sweep panel slides IN (covers screen) */
@keyframes panelSweepIn {
  from { clip-path: polygon(-8% 0, 2%  0, 2%  100%, -8% 100%); }
  to   { clip-path: polygon(-8% 0, 108% 0, 108% 100%, -8% 100%); }
}

/* Step 3 — sweep panel slides OUT (reveals calendar) */
@keyframes panelSweepOut {
  from { clip-path: polygon(-8% 0, 108% 0, 108% 100%, -8% 100%); }
  to   { clip-path: polygon(108% 0, 118% 0, 118% 100%, 108% 100%); }
}

/* Thin light edge that travels with the panel */
@keyframes edgeSweepIn {
  from { clip-path: polygon(0%   0, 4%   0, 4%   100%, 0%   100%); }
  to   { clip-path: polygon(100% 0, 104% 0, 104% 100%, 100% 100%); }
}
@keyframes edgeSweepOut {
  from { clip-path: polygon(0%   0, 4%   0, 4%   100%, 0%   100%); }
  to   { clip-path: polygon(100% 0, 104% 0, 104% 100%, 100% 100%); }
}

/* Calendar content entrance (staggered) */
@keyframes calHeaderIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes calContentIn {
  from { opacity: 0; transform: translateY(24px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* Classes applied by JS */
.exit-card   { animation: exitCard 0.35s cubic-bezier(0.4, 0, 1, 1) forwards !important; }

.cal-entering .app-header { animation: calHeaderIn  0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both; }
.cal-entering .cal-wrapper { animation: calContentIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both; }

/* =====================================================
   READER LOGIN SECTION (index.html)
   ===================================================== */
.reader-login-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.reader-toggle-btn {
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.reader-form-wrapper {
  width: 100%;
  max-width: 340px;
  animation: fadeInUp 0.3s ease both;
}

.reader-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reader-submit-btn {
  background: var(--accent-grad);
  margin-top: 4px;
}

/* =====================================================
   READER SELECTOR BAR (calendar.html)
   ===================================================== */
.reader-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.reader-selector-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.reader-user-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.reader-user-btn.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.reader-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reader-week-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0 4px;
  letter-spacing: 0.02em;
}

/* =====================================================
   REQUESTS BUTTON + BADGE
   ===================================================== */
.requests-btn {
  position: relative;
  gap: 6px;
}

.requests-badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 2px;
}

/* =====================================================
   REQUESTS PANEL (Owner)
   ===================================================== */
.requests-panel-card {
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.requests-empty {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

.request-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.request-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.request-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.request-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.request-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.approve-btn {
  font-size: 12px;
  padding: 6px 12px;
}

.reject-btn {
  font-size: 12px;
  padding: 6px 12px;
  color: var(--error);
  border-color: rgba(248,113,113,0.3);
}

/* =====================================================
   BOOKING MODAL (Reader)
   ===================================================== */
.booking-modal-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
}

.booking-time-hint {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 12px;
}

/* =====================================================
   OWNER EVENT FORM MODAL
   ===================================================== */
.owner-form-card {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}

.glass-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='rgba(241,245,249,0.4)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.glass-select option {
  background: #1a2035;
  color: var(--text-primary);
}

.toggle-row {
  margin: 12px 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: var(--transition);
}

.toggle-thumb::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-thumb {
  background: var(--accent-grad);
  border-color: transparent;
}

.toggle-switch input:checked + .toggle-thumb::after {
  left: calc(100% - 15px);
  background: #fff;
}

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

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

/* =====================================================
   BOOKING SUCCESS TOAST
   ===================================================== */
.booking-success-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.booking-success-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   TICKER
   ===================================================== */
.ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 38px;
  display: flex;
  align-items: center;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(248, 113, 113, 0.2);
  overflow: hidden;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f87171;
  border-right: 1px solid rgba(248, 113, 113, 0.2);
  height: 100%;
  white-space: nowrap;
}

.ticker-track-wrapper {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll linear infinite;
  will-change: transform;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 32px;
}

.ticker-item::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.5);
  flex-shrink: 0;
}

.ticker-item:last-child::after {
  display: none;
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Push calendar content above ticker */
.cal-wrapper { padding-bottom: 54px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
  .login-card { padding: 36px 24px; }
  .cal-card { padding: 16px; }
  .header-inner { padding: 12px 16px; }
  .cal-wrapper { padding: 16px; }
  .glass-btn span { display: none; }
  .glass-btn { padding: 8px 10px; }
  .fc-toolbar-title { font-size: 14px !important; }
  .fc-button { padding: 6px 10px !important; font-size: 12px !important; }
}
