/*
 * Global layout, sidebar, dashboard, forms, calendar, admin UI.
 * Loaded by: public/index.html, public/login.html
 */

:root {
  --bg: #f4f4f3;
  --panel: #ffffff;
  --ink: #131313;
  --muted: #757575;
  --line: #e7e5e1;
  --accent: #ff5a3d;
  --accent-soft: #ffe3dc;
  --dark: #0e0e0e;
  --shadow: 0 16px 36px rgba(15, 15, 15, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 15, 15, 0.05);
  --radius: 12px;
  --sidebar-w: 272px;
  --sidebar-w-collapsed: 72px;
  --content-max: 1200px;
}

@media (min-width: 769px) {
  html { zoom: 0.85; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 0%, #fffaf8, var(--bg) 34%);
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

select[multiple] {
  min-height: 112px;
  padding: 8px 12px;
}

.activity-picker-field {
  position: relative;
  z-index: 1;
}

.multi-picker {
  position: relative;
}

.multi-picker-trigger {
  width: 100%;
  min-height: 44px;
  border: 1px solid #ddd8d2;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
}

.multi-picker-trigger:hover {
  border-color: #cfc7bc;
}

.multi-picker.is-open .multi-picker-trigger {
  border-color: #ffc2b6;
  box-shadow: 0 0 0 2px #ffe8e2;
}

.multi-picker-chevron {
  font-size: 11px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.multi-picker.is-open .multi-picker-chevron {
  transform: rotate(180deg);
}

#eventActivityPickerSummary {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.multi-picker-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(320px, calc(100vh - 240px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.multi-picker-options {
  display: grid;
  gap: 4px;
}

.multi-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.multi-picker-option:hover {
  background: #fff8f6;
}

.multi-picker-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  transition: grid-template-columns 240ms ease;
}

.app-shell.is-sidebar-collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 138, 110, 0.12) 0%, transparent 28%),
    linear-gradient(165deg, #2a4562 0%, #1e3349 42%, #152638 100%);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.04),
    4px 0 24px rgba(14, 24, 40, 0.12);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  color: #e8eef6;
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.brand-wrap {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 10px 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    grid-template-columns 240ms ease,
    gap 240ms ease,
    padding 240ms ease,
    background 240ms ease;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px solid rgba(255, 209, 102, 0.35);
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: width 240ms ease, height 240ms ease;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

[hidden] {
  display: none !important;
}

.brand-copy strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #f5f8fc;
}

.brand-copy p {
  margin-top: 3px;
  color: #a8b8d0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.screen-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  align-content: start;
}

.screen-nav::-webkit-scrollbar {
  width: 4px;
}

.screen-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-btn {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: left;
  padding: 0 11px;
  color: #c5d3e6;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    padding 240ms ease,
    transform 120ms ease;
}

.nav-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #ff8a6e, #ff5a3d);
  transform: translateY(-50%);
  transition: height 180ms ease;
}

.nav-btn__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  opacity: 0.92;
}

.nav-btn__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.nav-btn__label {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 200ms ease, max-width 240ms ease;
  max-width: 200px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f0f4fa;
}

.nav-btn.is-active {
  border-color: rgba(255, 138, 110, 0.35);
  background: linear-gradient(90deg, rgba(255, 90, 61, 0.22), rgba(255, 138, 110, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 180, 160, 0.1);
}

.nav-btn.is-active::before {
  height: 22px;
}

.nav-btn.is-active .nav-btn__icon {
  color: #ffc4b5;
}

/* ─── Sidebar logout button — mobile only (desktop uses topbar logout) ─── */
@media (min-width: 841px) {
  .sidebar-logout-btn {
    display: none !important;
  }
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(255, 90, 61, 0.28);
  border-radius: 11px;
  background: rgba(255, 90, 61, 0.07);
  color: #ff8a6e;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-logout-btn:hover {
  background: rgba(255, 90, 61, 0.14);
  color: #ffaaa0;
}

.sidebar-logout-btn:active {
  background: rgba(255, 90, 61, 0.2);
}

.sidebar-logout-btn__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.sidebar-logout-btn__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-logout-btn__label {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 200ms ease, max-width 240ms ease;
  max-width: 200px;
}

/* Collapsed sidebar: icon only */
.sidebar.is-collapsed .sidebar-logout-btn {
  justify-content: center;
  padding: 0;
}

.sidebar.is-collapsed .sidebar-logout-btn__label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* ─── Sidebar collapse button ─── */
.sidebar-collapse-btn {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.15);
  color: #b8c8de;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #eef3fa;
}

.sidebar-collapse-btn__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: transform 240ms ease;
}

.sidebar-collapse-btn__icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-collapse-btn__label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 200ms ease;
}

.sidebar.is-collapsed .brand-wrap {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar.is-collapsed .brand-logo {
  width: 44px;
  height: 44px;
}

.sidebar.is-collapsed .brand-copy,
.sidebar.is-collapsed .nav-btn__label,
.sidebar.is-collapsed .sidebar-collapse-btn__label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (min-width: 841px) {
  .sidebar.is-collapsed .brand-copy {
    display: none;
  }
}

.sidebar.is-collapsed .nav-btn {
  justify-content: center;
  padding: 0;
  min-height: 44px;
}

.sidebar.is-collapsed .nav-btn::before {
  left: 50%;
  top: auto;
  bottom: 4px;
  width: 0;
  height: 3px;
  border-radius: 3px;
  transform: translateX(-50%);
}

.sidebar.is-collapsed .nav-btn.is-active::before {
  width: 18px;
  height: 3px;
}

.sidebar.is-collapsed .sidebar-collapse-btn {
  justify-content: center;
  padding: 0;
  border-radius: 11px;
}

.sidebar.is-collapsed .sidebar-collapse-btn__icon {
  transform: rotate(180deg);
}

/* Collapsed rail: hover tooltips (desktop) */
@media (min-width: 841px) {
  .sidebar.is-collapsed {
    overflow: visible;
    z-index: 25;
  }

  .sidebar.is-collapsed .screen-nav {
    overflow-x: visible;
  }

  .sidebar.is-collapsed .nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .sidebar.is-collapsed .nav-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    color: #f5f8fc;
    background: #1a2d45;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    pointer-events: none;
  }
}

@media (min-width: 841px) {
  .sidebar-collapse-btn {
    display: flex;
  }
}

.mobile-close,
.menu-btn {
  display: none;
}

.main-app {
  padding: 28px 28px 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 90, 61, 0.06), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(36, 59, 85, 0.04), transparent 38%);
}

.main-app > .topbar {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

.topbar {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.micro-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 800;
}

.topbar-heading {
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", serif;
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.topbar-title__accent {
  background: linear-gradient(105deg, #ff5a3d 0%, #e84a2f 45%, #ff8fab 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  white-space: nowrap;
}

.topbar-title__accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.9), rgba(255, 143, 171, 0.75));
  opacity: 0.85;
  z-index: -1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  max-width: min(320px, 48vw);
  box-shadow: var(--shadow-soft);
}

/* Per-user hue (--avatar-hue) + motif (data-seed) set in script.js */
.user-profile-avatar {
  --avatar-hue: 18;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 28%,
    hsl(var(--avatar-hue) 72% 97%),
    hsl(var(--avatar-hue) 48% 90%)
  );
  border: 1.5px solid hsl(var(--avatar-hue) 52% 72% / 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 10px hsl(var(--avatar-hue) 40% 45% / 0.14);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-profile-avatar svg {
  width: 22px;
  height: 22px;
  display: block;
  color: hsl(var(--avatar-hue) 38% 32%);
}

.user-profile-avatar[data-seed="1"] svg {
  transform: rotate(18deg);
}

.user-profile-avatar[data-seed="3"] svg {
  transform: rotate(-12deg);
}

.user-profile-avatar[data-seed="5"] svg {
  transform: scale(1.06);
}

.user-profile-avatar[data-seed="7"] svg {
  transform: rotate(8deg);
}

.user-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: center;
}

.user-meta .user-display-name {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.user-meta span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen {
  display: none;
  animation: fade-up 300ms ease;
}

.screen.is-visible {
  display: block;
}

.screen-head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.screen-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.screen-head h2 {
  font-family: "Fraunces", "Iowan Old Style", serif;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.screen-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  max-width: 52ch;
  line-height: 1.45;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-grid--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-grid--sales {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 18px;
}

.kpi-card--sales::before {
  background: linear-gradient(90deg, #1a4a8a, transparent);
}

.kpi-grid article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(165deg, #fff 0%, #faf9f7 100%);
  padding: 18px 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.kpi-grid article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--line), transparent);
  opacity: 0.8;
}

.kpi-grid article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-card--checkins {
  border-color: #b8e0cf;
  background: linear-gradient(160deg, #f0faf4 0%, #fff 55%);
}

.kpi-card--checkins::before {
  background: linear-gradient(90deg, #3d9b6a, #b8e0cf);
}

.kpi-card--registered {
  border-color: #c5d4f5;
  background: linear-gradient(160deg, #f4f7ff 0%, #fff 55%);
}

.kpi-card--registered::before {
  background: linear-gradient(90deg, #4a6fa5, #c5d4f5);
}

.kpi-card--checkins strong {
  color: #1b6b42;
}

.kpi-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}

.tracking-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.tracking-filters .tracking-period-label input[type="date"],
.tracking-filters .tracking-period-label input[type="search"] {
  font-weight: 400;
}

.tracking-period-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.tracking-period-select {
  min-width: 180px;
  min-height: 40px;
  border: 1px solid #ddd8d2;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
}

.tracking-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tracking-stat {
  min-width: 140px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line, #e7e5e1);
}

.tracking-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #757575);
  margin-bottom: 4px;
}

.tracking-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink, #1a1a1a);
}

.tracking-stat--team {
  background: #f2faf8;
  border-color: #d4ebe4;
}

.tracking-stat--active {
  background: #f4f6fc;
  border-color: #d8dff0;
}

.user-tracking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  min-height: 120px;
}

.user-tracking-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
}

.user-track-card {
  border-radius: 16px;
  padding: 18px;
  color: var(--ink, #1a1a1a);
  display: grid;
  gap: 12px;
  border: 1px solid var(--line, #e7e5e1);
  border-left-width: 4px;
  box-shadow: var(--shadow-soft, 0 8px 20px rgba(20, 30, 50, 0.06));
  min-height: 168px;
  background: #fff;
}

.user-track-card--tone-1 {
  background: #fdf8f8;
  border-left-color: #e8caca;
}

.user-track-card--tone-2 {
  background: #f6fbfb;
  border-left-color: #bfe0dc;
}

.user-track-card--tone-3 {
  background: #f6f9fd;
  border-left-color: #c5d9eb;
}

.user-track-card--tone-4 {
  background: #f7fbf8;
  border-left-color: #c5dfd0;
}

.user-track-card--tone-5 {
  background: #fdfaf3;
  border-left-color: #ecd9b0;
}

.user-track-card--tone-6 {
  background: #f8f6fc;
  border-left-color: #cfc6e4;
}

.user-track-head {
  display: block;
}

.user-track-identity {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.user-track-name {
  margin: 0;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-track-role-pill {
  margin: 0;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line, #e7e5e1);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #757575);
}

.user-track-city {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted, #757575);
}

.user-track-email {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #757575);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line, #e7e5e1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-track-count {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e7e5e1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-track-count .user-track-stat-value {
  font-size: 26px;
}

.user-tracking-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: var(--muted);
}

.kpi-grid span {
  font-size: 12px;
  color: var(--muted);
}

.kpi-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #f0efec;
  font-size: 14px;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  align-items: start;
}

.parties-create-form {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line, #e7e5e1);
}

.parties-create-form .activity-picker-field.is-open {
  z-index: 20;
}

.party-edit-form {
  gap: 14px 16px;
}

label {
  display: grid;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
}

.req-mark {
  color: #c62828;
  font-weight: 700;
  margin-left: 2px;
}

.field-label .req-mark,
.form-select-label .req-mark {
  margin-left: 2px;
}

.form-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.form-stack > h3 {
  margin: 0;
}

.form-stack > .muted-line {
  margin: 0;
}

.after-party-card.form-stack {
  gap: 20px;
}

.form-stack > .assign-hint {
  margin: -10px 0 0;
  font-size: 12px;
}

.form-stack > label {
  margin: 0;
}

.form-stack > .wide,
.form-stack > button.wide {
  width: 100%;
  margin-top: 0;
  align-self: start;
  min-height: 40px;
  max-height: 44px;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid #ddd8d2;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.money-field {
  display: grid;
  gap: 10px;
}

.money-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #ddd8d2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.money-input-wrap:focus-within {
  border-color: #ffc2b6;
  box-shadow: 0 0 0 2px #ffe8e2;
}

.money-symbol {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f7f5f2;
  color: #5a534c;
  font-weight: 700;
  font-size: 15px;
  border-right: 1px solid #ebe6df;
  flex-shrink: 0;
}

.money-input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  min-height: 44px;
  padding: 0 14px;
  background: #fff;
}

.money-input:focus {
  outline: none;
}

.sticky-note-field {
  margin-top: 4px;
}

.sticky-note {
  min-height: 128px;
  padding: 14px 16px;
  border: 1px solid #e8d56a;
  border-radius: 4px 14px 12px 6px;
  background: linear-gradient(155deg, #fffef0 0%, #fff6a8 42%, #ffe566 100%);
  box-shadow:
    2px 3px 0 #e5d058,
    4px 8px 18px rgba(60, 50, 10, 0.14);
  color: #3d3820;
  line-height: 1.5;
  resize: vertical;
}

.sticky-note::placeholder {
  color: #8a8050;
}

.sticky-note:focus {
  outline: none;
  border-color: #d4c24a;
  box-shadow:
    2px 3px 0 #d9c850,
    4px 10px 22px rgba(60, 50, 10, 0.18),
    0 0 0 2px rgba(255, 230, 100, 0.45);
}

select {
  min-height: 48px;
  padding: 12px 40px 12px 14px;
  line-height: 1.35;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #ffc2b6;
  box-shadow: 0 0 0 2px #ffe8e2;
}

textarea {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-card {
  display: grid;
  gap: 16px;
}

.calendar-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-topline div {
  display: flex;
  gap: 8px;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.mini-calendar span {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-calendar button {
  min-height: 56px;
  border: 1px solid #e5e1db;
  border-radius: 8px;
  background: #fff;
}

.mini-calendar .event-dot {
  border-color: #ffc2b6;
  background: #fff4f1;
}

.mini-calendar .today-day:not(.active-day) {
  border-color: #ffd0c5;
  box-shadow: inset 0 0 0 1px #ffd0c5;
}

.mini-calendar .active-day {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.track-picker-card {
  margin-bottom: 16px;
}

.track-event-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.track-event-option {
  width: 100%;
  border: 1px solid #ebe6df;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  overflow: hidden;
}

.track-event-option:hover {
  border-color: #ffd0c5;
  background: #fff8f6;
}

.track-event-option.is-active,
.track-event-option.is-selected {
  border-color: #ffc2b6;
  background: #fff3ef;
  box-shadow: inset 0 0 0 1px #ffd0c5;
}

.track-event-option .event-picker-item__main strong {
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.track-event-option .event-picker-item__main .muted-line {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.track-event-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.track-empty-hint {
  margin-top: 8px;
  text-align: center;
}

#trackCheckinCard.is-locked .cta-row,
#trackCheckinCard.is-locked #checkinGallery {
  pointer-events: none;
  opacity: 0.55;
}

#trackImagesCard.is-locked .upload-box,
#trackImagesCard.is-locked #eventImagesGallery,
#trackImagesCard.is-locked #saveTrackBtn {
  pointer-events: none;
  opacity: 0.55;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.analytics-kpi-grid--biz,
.analytics-kpi-grid--future {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analytics-kpi {
  border-radius: 14px;
  padding: 16px 18px;
  color: #fff;
  display: grid;
  gap: 6px;
  min-height: 96px;
  box-shadow: 0 10px 24px rgba(30, 30, 60, 0.12);
}

.analytics-kpi span {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-kpi strong {
  font-size: 28px;
  line-height: 1.1;
}

.analytics-kpi em {
  font-size: 12px;
  font-style: normal;
  opacity: 0.9;
}

.analytics-kpi--total {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.analytics-kpi--upcoming {
  background: linear-gradient(135deg, #26a69a, #00897b);
}

.analytics-kpi--ongoing {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
}

.analytics-kpi--completed {
  background: linear-gradient(135deg, #7e57c2, #5e35b1);
}

.analytics-kpi--top {
  background: linear-gradient(135deg, #ef5350, #e53935);
}

.analytics-kpi--revenue {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
}

.analytics-kpi--settlement {
  background: linear-gradient(135deg, #d84315, #bf360c);
}

.analytics-kpi--pipeline {
  background: linear-gradient(135deg, #26a69a, #00897b);
}

.analytics-kpi--week {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.analytics-kpi--avg {
  background: linear-gradient(135deg, #7e57c2, #5e35b1);
}

.analytics-kpi--unassigned {
  background: linear-gradient(135deg, #ef6c00, #e65100);
}

.analytics-kpi--headcount {
  background: linear-gradient(135deg, #00838f, #006064);
}

.analytics-kpi--occasion {
  background: linear-gradient(135deg, #c2185b, #880e4f);
}

.analytics-insights-card {
  margin-bottom: 16px;
}

.analytics-insights-card--future {
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, #fffaf8 0%, #fff 55%);
}

.analytics-insights-card h3 {
  margin-bottom: 10px;
}

.analytics-insights-card--future h3 {
  font-size: 1.15rem;
}

.analytics-insights {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.analytics-insights-card--future .analytics-insights {
  font-size: 15px;
  gap: 12px;
}

.analytics-chart-hint {
  margin: -4px 0 10px;
  font-size: 13px;
}

.analytics-kpi--month {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.analytics-kpi--city {
  background: linear-gradient(135deg, #00838f, #006064);
}

.analytics-tables-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.analytics-table-hint {
  margin: -4px 0 10px;
  font-size: 13px;
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-chart-card h3 {
  margin-bottom: 12px;
}

.analytics-chart-card--wide {
  grid-column: 1 / -1;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-wrap--compact {
  height: 260px;
  max-width: 320px;
  margin: 0 auto;
}

.chart-wrap--tall {
  height: 320px;
}

.analytics-table-card {
  margin-top: 4px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.analytics-table tfoot th {
  font-weight: 700;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  align-items: stretch;
}

.admin-panel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1.15rem 1.25rem;
  min-height: 100%;
}

.admin-panel-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.admin-panel-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  min-height: 2.9em;
}

.admin-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #4a4a4a;
}

.admin-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.admin-panel-actions .dark-btn,
.admin-panel-actions .danger-btn {
  width: 100%;
  margin-top: 0;
  min-height: 40px;
  max-height: 44px;
}

.admin-panel-actions--split {
  flex-direction: row;
  flex-wrap: wrap;
}

.admin-panel-actions--split .dark-btn,
.admin-panel-actions--split .danger-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 7rem;
}

.admin-roster-card h3,
.admin-ops-card h3 {
  margin: 0 0 4px;
}

.admin-roster-card > .muted-line,
.admin-ops-card > .muted-line {
  margin: 0 0 12px;
  font-size: 13px;
}

#trackEventWorkspace,
#trackCheckinCard,
#trackImagesCard {
  scroll-margin-top: clamp(72px, 12vw, 104px);
  scroll-margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.admin-grid > .card {
  height: auto;
  align-self: stretch;
}

.activity-manage-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.activity-manage-grid .card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.activity-add-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 1rem 1.15rem;
}

.activity-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-add-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #4a4a4a;
}

.activity-add-field textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 14px;
}

.activity-add-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.activity-add-actions .dark-btn {
  width: auto;
  min-width: 0;
  padding: 0 18px;
  margin-top: 0;
}

.activity-catalog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1rem 1.15rem;
  min-height: 0;
  max-height: min(560px, calc(100vh - 240px));
}

.activity-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #f0ede7;
  border-radius: 8px;
  background: #fff;
}

.activity-row-copy {
  min-width: 0;
  flex: 1;
}

.activity-row-copy strong {
  display: block;
  font-size: 14px;
}

.activity-row-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.activity-empty {
  margin: 0;
}

.danger-text {
  color: #b42318;
  border-color: #f5c2c7;
  flex-shrink: 0;
}

.danger-text:hover {
  background: #fff4f2;
}

.cta-row {
  margin: 14px 0;
  display: flex;
  gap: 8px;
}

.placeholder-list {
  display: grid;
  gap: 8px;
}

.placeholder-list div {
  border: 1px solid #f0ede7;
  border-radius: 8px;
  padding: 10px;
}

.placeholder-list button {
  margin-top: 8px;
}

.placeholder-list p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.upload-box {
  min-height: 90px;
  border: 1px dashed #dac8bf;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-top: 8px;
}

.thumb-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.thumb-row span {
  border-radius: 8px;
  min-height: 70px;
  background: linear-gradient(145deg, #f8f8f8, #f1f1ef);
}

.ghost-btn,
.dark-btn,
.accent-btn,
.danger-btn {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
}

.ghost-btn {
  border-color: #e3ddd4;
  background: #fff;
  color: #353535;
}

.dark-btn {
  background: #101010;
  color: #fff;
}

.accent-btn {
  background: var(--accent);
  color: #fff;
}

.danger-btn {
  background: #fbe5e4;
  color: #7d1a15;
}

.small {
  min-height: 32px;
  font-size: 12px;
}

.wide {
  width: 100%;
  margin-top: 8px;
}

.admin-grid .wide {
  margin-top: 0;
}

.calendar-events {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.calendar-events-head {
  margin-bottom: 10px;
}

.event-accordion-list {
  display: grid;
  gap: 8px;
}

.event-accordion-item {
  border: 1px solid #ebe6df;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.event-accordion-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  cursor: pointer;
}

.event-accordion-trigger:hover {
  background: #fff8f6;
}

.event-accordion-item.is-open .event-accordion-trigger {
  background: #fff3ef;
  border-bottom: 1px solid #f0e8e2;
}

.event-accordion-title {
  font-size: 14px;
  font-weight: 700;
  grid-column: 1;
}

.event-accordion-meta {
  font-size: 12px;
  color: var(--muted);
  grid-column: 1;
}

.event-accordion-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 12px;
  transition: transform 180ms ease;
}

.event-accordion-item.is-open .event-accordion-chevron {
  transform: rotate(180deg);
}

.event-accordion-panel {
  padding: 0 14px 14px;
}

.event-accordion-panel .details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.event-details-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.audit-wrap {
  margin-top: 14px;
}

.audit-wrap h4 {
  margin-bottom: 8px;
  font-size: 13px;
}

.muted-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.details-grid label {
  font-size: 12px;
}

.audit-wrap {
  margin-top: 14px;
}

.audit-wrap h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 13px;
  z-index: 10001;
}

.toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1060px) {
  .kpi-grid--five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-kpi-grid,
  .analytics-kpi-grid--biz,
  .analytics-kpi-grid--future {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-tables-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .track-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-manage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .sidebar.is-collapsed {
    position: fixed;
    z-index: 20;
    left: -290px;
    width: 270px;
    transition: left 220ms ease;
    grid-template-rows: auto 1fr;
  }

  .sidebar.is-open {
    left: 0;
  }

  .sidebar.is-collapsed .brand-copy,
  .sidebar.is-collapsed .nav-btn__label,
  .sidebar.is-collapsed .sidebar-collapse-btn__label {
    opacity: 1;
    max-width: 200px;
    pointer-events: auto;
  }

  .sidebar.is-collapsed .nav-btn {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .mobile-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #3d5270;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eef6;
    justify-self: end;
  }

  .menu-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dbd6cc;
    border-radius: 8px;
    background: #fff;
    gap: 3px;
  }

  .menu-btn span {
    width: 16px;
    height: 2px;
    background: #1a1a1a;
    display: block;
  }

  .main-app {
    padding: 16px;
  }

  .main-app > .topbar {
    max-width: none;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .user-panel {
    flex: 1 1 auto;
    max-width: none;
  }

  .topbar-actions .danger-btn {
    flex: 0 0 auto;
  }

  .form-grid,
  .kpi-grid,
  .kpi-grid--five,
  .analytics-kpi-grid,
  .analytics-kpi-grid--biz,
  .analytics-charts-grid,
  .analytics-tables-grid,
  .track-grid,
  .admin-tools-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-hint {
    min-height: 0;
  }

  .admin-panel-actions--split {
    flex-direction: column;
  }

  .admin-panel-actions--split .dark-btn,
  .admin-panel-actions--split .danger-btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .analytics-kpi--top {
    grid-column: auto;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}

.overlay.is-visible {
  display: grid;
}

.modal,
.dialog-card {
  width: min(440px, 100%);
  padding: 28px;
  display: grid;
  gap: 20px;
}

/* Event history View / Edit — must follow .dialog-card so width is not capped at 440px */
.modal.party-edit-modal,
.dialog-card.party-edit-modal {
  width: min(960px, calc(100vw - 40px));
  max-height: min(92vh, 960px);
  overflow: auto;
}

.dialog-message {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}

.dialog-actions {
  margin-top: 4px;
  gap: 12px;
}

.user-roster {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.user-roster-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #f0ede7;
  border-radius: 10px;
  background: #fff;
}

.user-roster-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-roster-copy strong {
  font-size: 14px;
}

.user-roster-copy span {
  font-size: 13px;
  color: var(--muted);
}

.user-roster-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e3ddd4;
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: #4a4a4a;
}

.icon-btn:hover {
  background: #f7f5f2;
}

.icon-btn.danger {
  border-color: #f0c4c0;
  color: #b42318;
}

.icon-btn.danger:hover {
  background: #fff4f2;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

#editUserCityWrap.is-hidden {
  display: none;
}

.pending-images img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px dashed #dac8bf;
}

#eventImagesGallery img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
}

.checkin-user-block {
  margin-bottom: 14px;
}

.checkin-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  margin-top: 8px;
  align-items: start;
}

.checkin-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.card.full {
  grid-column: 1 / -1;
}

#eventImagesGallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Login page styles: see css/login.css */

body.auth-loading #appShell {
  visibility: hidden;
}

body.auth-loading::before {
  content: "Loading…";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #5c5650;
  background: #faf8f5;
  z-index: 9999;
}

.topbar-actions a.ghost-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkin-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.checkin-camera-modal {
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface, #fff);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.checkin-camera-modal h3 {
  margin: 0;
  font-size: 1.1rem;
}

.checkin-camera-preview-wrap {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.checkin-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkin-camera-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
