/* ============================================
   HEIDI EVENT APP — Shared Stylesheet
   Brand: heidihealth.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---- Custom Properties ---- */
:root {
  /* Brand Colors */
  --bark:           #28030f;
  --bark-light:     #3d1520;
  --bark-muted:     #5c3a44;
  --sand:           #f9f4f1;
  --sand-dark:      #f6ece4;
  --sand-darker:    #ecddd0;
  --forest:         #194b22;
  --forest-light:   #2a6b36;
  --sky:            #5b8df6;
  --sky-light:      #8bb2fa;
  --sky-dark:       #3a6de0;
  --sunlight:       #fbf582;
  --sunlight-dark:  #e8e06a;

  /* Functional Colors */
  --hot:            #10b981;
  --warm:           #f59e0b;
  --cold:           #ef4444;
  --success:        #194b22;
  --success-bg:     #d4edda;
  --warning:        #f59e0b;
  --warning-bg:     #fff8e1;
  --error:          #ef4444;
  --error-bg:       #fde8e8;
  --info:           #5b8df6;
  --info-bg:        #e8f0fe;

  /* Neutrals */
  --white:          #ffffff;
  --gray-50:        #fafafa;
  --gray-100:       #f0f0f0;
  --gray-200:       #e0e0e0;
  --gray-300:       #c0c0c0;
  --gray-400:       #999999;
  --gray-500:       #777777;
  --gray-600:       #555555;
  --gray-700:       #333333;

  /* Typography */
  --font-heading:   'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'IBM Plex Mono', 'Courier New', monospace;

  /* Sizing */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(40, 3, 15, 0.06);
  --shadow:         0 2px 8px rgba(40, 3, 15, 0.08);
  --shadow-md:      0 4px 16px rgba(40, 3, 15, 0.1);
  --shadow-lg:      0 8px 32px rgba(40, 3, 15, 0.12);
  --shadow-glow:    0 0 20px rgba(91, 141, 246, 0.15);

  /* Transitions */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --duration:       0.25s;
  --duration-slow:  0.5s;

  /* Layout */
  --header-h:       64px;
  --sidebar-w:      320px;
  --container-max:  1100px;
  --container-wide: 1400px;
}


/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--bark);
  background: var(--sand);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--sky-dark); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--sky); }

::selection { background: var(--sunlight); color: var(--bark); }


/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--bark);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--bark-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; }


/* ---- Layout Utilities ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap { gap: 1rem; }
.gap-md { gap: 1.5rem; }
.gap-lg { gap: 2rem; }
.grow { flex: 1; }
.shrink-0 { flex-shrink: 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .flex-col-mobile { flex-direction: column; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

.mt-xs { margin-top: 0.25rem; }
.mt-sm { margin-top: 0.5rem; }
.mt { margin-top: 1rem; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2rem; }
.mt-xl { margin-top: 3rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb { margin-bottom: 1rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2rem; }

.p-sm { padding: 0.5rem; }
.p { padding: 1rem; }
.p-md { padding: 1.5rem; }
.p-lg { padding: 2rem; }


/* ---- Page Wrapper & Centering ---- */
.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}

.page-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page-app-body {
  flex: 1;
  padding: 1.5rem 1.25rem 2rem;
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}


/* ---- App Header ---- */
.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--sand-darker);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header .logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--bark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header .logo-dot {
  width: 10px;
  height: 10px;
  background: var(--forest);
  border-radius: var(--radius-full);
  display: inline-block;
}

.app-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-role {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--bark);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}


/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid var(--sand-darker);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-flush {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sand-dark);
}

.card-section + .card-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sand-dark);
}


/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--sky);
  color: var(--white);
}
.btn-primary:hover { background: var(--sky-dark); color: var(--white); }

.btn-dark {
  background: var(--bark);
  color: var(--white);
}
.btn-dark:hover { background: var(--bark-light); color: var(--white); }

.btn-success {
  background: var(--forest);
  color: var(--white);
}
.btn-success:hover { background: var(--forest-light); color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--bark);
  border: 1.5px solid var(--sand-darker);
}
.btn-outline:hover { border-color: var(--bark-muted); background: var(--sand-dark); }

.btn-ghost {
  background: transparent;
  color: var(--bark-muted);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover { color: var(--bark); background: var(--sand-dark); }

.btn-danger {
  background: var(--error);
  color: var(--white);
}
.btn-danger:hover { background: #dc2626; color: var(--white); }

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius);
  font-size: 1.2rem;
}


/* ---- Forms ---- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bark-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--bark);
  background: var(--white);
  border: 1.5px solid var(--sand-darker);
  border-radius: var(--radius);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(91, 141, 246, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-300);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}


/* ---- Search Bar ---- */
.search-bar {
  position: relative;
  width: 100%;
}

.search-bar .form-input {
  padding-left: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--white);
}

.search-bar .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.95rem;
  pointer-events: none;
}


/* ---- Badges & Tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #92600a; }
.badge-error   { background: var(--error-bg); color: var(--error); }
.badge-info    { background: var(--info-bg); color: var(--sky-dark); }
.badge-neutral { background: var(--sand-dark); color: var(--bark-muted); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-dot-checked { background: var(--forest); }
.status-dot-pending { background: var(--gray-300); }


/* ---- Traffic Light Rating ---- */
.rating-group {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.rating-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-btn::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  transition: transform var(--duration) var(--ease);
}

.rating-btn:hover { transform: scale(1.1); }
.rating-btn.active { border-width: 3px; transform: scale(1.15); }

.rating-cold { border-color: var(--cold); }
.rating-cold::after { background: var(--cold); }
.rating-cold.active { box-shadow: 0 0 12px rgba(239, 68, 68, 0.3); }

.rating-warm { border-color: var(--warm); }
.rating-warm::after { background: var(--warm); }
.rating-warm.active { box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }

.rating-hot { border-color: var(--hot); }
.rating-hot::after { background: var(--hot); }
.rating-hot.active { box-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }

.rating-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bark-muted);
}


/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--sand-darker);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bark-muted);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  margin-bottom: -1.5px;
}

.tab:hover { color: var(--bark); }
.tab.active {
  color: var(--bark);
  border-bottom-color: var(--bark);
}


/* ---- Agenda Items ---- */
.agenda-item {
  background: var(--white);
  border: 1px solid var(--sand-darker);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--duration) var(--ease);
}

.agenda-item + .agenda-item { margin-top: 0.75rem; }
.agenda-item:hover { box-shadow: var(--shadow); }

.agenda-item-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.agenda-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--sky-dark);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.15rem;
  min-width: 70px;
}

.agenda-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--bark);
  flex: 1;
}

.agenda-toggle {
  color: var(--gray-400);
  font-size: 0.9rem;
  transition: transform var(--duration) var(--ease);
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.agenda-item.expanded .agenda-toggle { transform: rotate(180deg); }

.agenda-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--sand-dark);
}

.agenda-item.expanded .agenda-body { display: block; }

.agenda-body p {
  color: var(--bark-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 0.75rem;
}

.speaker-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--sand);
  border-radius: var(--radius);
}

.speaker-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--sand-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--bark-muted);
  flex-shrink: 0;
}

.speaker-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--bark);
}

.speaker-bio {
  font-size: 0.8rem;
  color: var(--bark-muted);
  line-height: 1.5;
}


/* ---- Notes Log ---- */
.notes-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-item {
  padding: 0.75rem 1rem;
  background: var(--sand);
  border-radius: var(--radius);
  border-left: 3px solid var(--sand-darker);
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.note-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--bark);
}

.note-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-400);
}

.note-content {
  font-size: 0.88rem;
  color: var(--bark-muted);
  line-height: 1.6;
}


/* ---- QR Scanner Area ---- */
.qr-scanner {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  background: var(--bark);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.qr-scanner-frame {
  width: 65%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  position: relative;
}

.qr-scanner-frame::before,
.qr-scanner-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--sky);
  border-style: solid;
}

.qr-scanner-frame::before {
  top: -2px; left: -2px;
  border-width: 3px 0 0 3px;
  border-radius: 4px 0 0 0;
}

.qr-scanner-frame::after {
  top: -2px; right: -2px;
  border-width: 3px 3px 0 0;
  border-radius: 0 4px 0 0;
}

.qr-scanner-corners-bottom {
  position: absolute;
  bottom: calc(17.5% - 2px);
  left: 17.5%;
  right: 17.5%;
  height: 24px;
  pointer-events: none;
}

.qr-scanner-corners-bottom::before,
.qr-scanner-corners-bottom::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--sky);
  border-style: solid;
}

.qr-scanner-corners-bottom::before {
  bottom: 0; left: -2px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 4px;
}

.qr-scanner-corners-bottom::after {
  bottom: 0; right: -2px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 4px 0;
}

.qr-scanner-label {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.qr-scanner-line {
  position: absolute;
  left: 17.5%;
  right: 17.5%;
  height: 2px;
  background: var(--sky);
  opacity: 0.7;
  animation: scanLine 2.5s ease-in-out infinite;
}

@keyframes scanLine {
  0%, 100% { top: 20%; }
  50% { top: 75%; }
}


/* ---- Check-in Feed ---- */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--sand-darker);
  animation: feedSlideIn 0.3s var(--ease);
}

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

.feed-dot {
  width: 8px;
  height: 8px;
  background: var(--forest);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.feed-name {
  font-weight: 500;
  font-size: 0.88rem;
  flex: 1;
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-400);
}


/* ---- Upload / Drop Zone ---- */
.drop-zone {
  border: 2px dashed var(--sand-darker);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--white);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--sky);
  background: var(--info-bg);
}

.drop-zone-icon {
  font-size: 2rem;
  color: var(--gray-300);
  margin-bottom: 0.5rem;
}

.drop-zone-text {
  font-size: 0.9rem;
  color: var(--bark-muted);
}

.drop-zone-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.3rem;
}


/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--sand-darker);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  background: var(--sand-dark);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bark-muted);
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--sand-darker);
}

tbody td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--sand-dark);
  color: var(--bark);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--sand); }


/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 3, 15, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(10px) scale(0.98);
  transition: transform var(--duration) var(--ease);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sand-dark);
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sand-dark);
}


/* ---- Guest Card (Registration/Staff) ---- */
.guest-card {
  background: var(--white);
  border: 1.5px solid var(--sand-darker);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  margin: 0 auto;
}

.guest-card-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--bark);
}

.guest-card-email {
  font-size: 0.88rem;
  color: var(--bark-muted);
  margin-top: 0.15rem;
}

.guest-card-status {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guest-card-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
}


/* ---- Venue Map ---- */
.map-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--sand-dark);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand-darker);
  overflow: hidden;
  position: relative;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.map-container:active { cursor: grabbing; }

.map-placeholder {
  text-align: center;
  color: var(--gray-400);
}

.map-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}


/* ---- Landing Page ---- */
.landing {
  text-align: center;
}

.landing-logo {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--bark);
  margin-bottom: 0.25rem;
}

.landing-tagline {
  font-size: 1rem;
  color: var(--bark-muted);
  margin-bottom: 2.5rem;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.landing-card {
  background: var(--white);
  border: 1px solid var(--sand-darker);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  color: var(--bark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--sky-light);
  color: var(--bark);
}

.landing-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.landing-card-icon-guest { background: var(--info-bg); color: var(--sky); }
.landing-card-icon-staff { background: var(--success-bg); color: var(--forest); }
.landing-card-icon-reg   { background: var(--warning-bg); color: var(--warm); }

.landing-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.landing-card p {
  font-size: 0.85rem;
  color: var(--bark-muted);
  line-height: 1.5;
}


/* ---- Login Box ---- */
.login-box {
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  margin-bottom: 0.25rem;
}

.login-box .text-muted {
  margin-bottom: 1.5rem;
}


/* ---- Section Headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
}

.section-divider {
  height: 1px;
  background: var(--sand-darker);
  margin: 2rem 0;
}


/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--sand-darker);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--bark);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bark-muted);
  margin-top: 0.25rem;
}


/* ---- Two-Column Layout ---- */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .layout-split { grid-template-columns: 1fr; }
}

.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 1.5rem;
  align-items: start;
}

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


/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-400);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 280px;
  margin: 0 auto;
}


/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fade { animation: fadeIn 0.4s var(--ease); }
.animate-slide { animation: slideUp 0.4s var(--ease); }
.animate-slide-delay-1 { animation: slideUp 0.4s var(--ease) 0.08s both; }
.animate-slide-delay-2 { animation: slideUp 0.4s var(--ease) 0.16s both; }
.animate-slide-delay-3 { animation: slideUp 0.4s var(--ease) 0.24s both; }


/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sand-darker); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }


/* ---- Misc ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gray-400);
  font-size: 0.8rem;
  margin: 1rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand-darker);
}

/* ---- Toggle Switch ---- */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

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

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  transition: background var(--duration) var(--ease);
  position: relative;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease);
}

.toggle input:checked + .toggle-track {
  background: var(--forest);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.88rem;
  color: var(--bark);
}


/* ---- Settings List ---- */
.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--sand-dark);
}

.settings-item:last-child { border-bottom: none; }

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

.settings-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--bark);
}

.settings-item-desc {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
}


/* ---- Staff/User List (admin) ---- */
.user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--sand-dark);
}

.user-row:last-child { border-bottom: none; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--sand-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--bark-muted);
  flex-shrink: 0;
}

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

.user-name {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--bark);
}

.user-email {
  font-size: 0.78rem;
  color: var(--gray-400);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--sand-darker);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--forest);
  transition: width 0.5s var(--ease);
}

.progress-fill-warning { background: var(--warm); }
.progress-fill-sky { background: var(--sky); }


/* ---- Mobile Enhancements ---- */
@media (max-width: 768px) {
  .app-header {
    height: 56px;
    padding: 0 0.75rem;
  }

  .app-header .logo { font-size: 1.2rem; }

  .app-header nav { gap: 0.4rem; }

  .header-role {
    font-size: 0.6rem;
    padding: 2px 7px;
  }

  .page-app-body {
    padding: 1rem 0.75rem 1.5rem;
  }

  .card { padding: 1rem; border-radius: var(--radius); }
  .card-header { flex-wrap: wrap; gap: 0.5rem; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { padding: 0.6rem 0.9rem; font-size: 0.8rem; white-space: nowrap; }

  .stat-card { padding: 0.75rem 0.5rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: 0.65rem; }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }

  .drop-zone { padding: 1.5rem 1rem; }
  .drop-zone-icon svg { width: 32px; height: 32px; }

  .guest-card { padding: 1rem; }
  .guest-card-actions { flex-direction: column; }
  .guest-card-actions .btn { width: 100%; }

  .section-header { flex-wrap: wrap; gap: 0.5rem; }

  .modal { margin: 0.5rem; border-radius: var(--radius); }
  .modal-header { padding: 1rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: 0.75rem 1rem; }

  .table-wrap { border-radius: var(--radius-sm); }
  thead th, tbody td { padding: 0.5rem 0.5rem; font-size: 0.8rem; }

  .qr-scanner { max-width: 100%; aspect-ratio: 4/3; }

  .btn-lg { padding: 0.75rem 1.25rem; font-size: 0.9rem; }

  .settings-item { flex-wrap: wrap; }
}

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

  .landing-cards { gap: 0.75rem; }
  .landing-card { padding: 1.25rem 1rem; }

  h1 { font-size: 1.6rem; }

  .form-input, .form-textarea, .form-select {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* ---- PWA Install Prompt ---- */
.install-prompt {
  position: fixed;
  inset: 0;
  background: rgba(40, 3, 15, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.25rem;
  animation: fadeIn 0.3s var(--ease);
}

.install-prompt-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.4s var(--ease);
}

.install-prompt-icon {
  width: 64px;
  height: 64px;
  background: var(--sand);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--bark);
}

.install-prompt-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.install-prompt-card p {
  font-size: 0.88rem;
  color: var(--bark-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.install-steps {
  text-align: left;
  margin-bottom: 1.5rem;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.install-step-num {
  width: 24px;
  height: 24px;
  background: var(--bark);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.install-step-text {
  font-size: 0.85rem;
  color: var(--bark);
  line-height: 1.5;
}

.install-step-text strong {
  color: var(--bark);
}

/* ---- Token Display ---- */
.token-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--sand);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.token-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--bark);
  background: var(--white);
  border: 1px solid var(--sand-darker);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.token-expiry {
  font-size: 0.75rem;
  color: var(--bark-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.token-url {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--sky-dark);
  background: var(--info-bg);
  border: 1px solid rgba(91, 141, 246, 0.2);
  border-radius: var(--radius);
  padding: 0.75rem;
  word-break: break-all;
  user-select: all;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
  position: relative;
}

.token-url:hover { background: rgba(91, 141, 246, 0.12); }

.token-url-copied {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--success-bg);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.token-url-copied.show { opacity: 1; }

@media (max-width: 768px) {
  .token-row { flex-wrap: wrap; }
  .token-expiry { width: 100%; }
}

/* ---- Auth Error ---- */
.auth-error {
  text-align: center;
  max-width: 400px;
}

.auth-error-icon {
  width: 64px;
  height: 64px;
  background: var(--error-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--error);
  font-size: 1.5rem;
}

.hidden { display: none !important; }
