:root {
  --navy-950: #0b182b;
  --navy-900: #102440;
  --navy-800: #18375f;
  --navy-700: #245080;
  --blue-100: #eaf2fa;
  --burgundy-800: #741f33;
  --burgundy-700: #922943;
  --burgundy-100: #faeaf0;
  --gold-600: #b88726;
  --gold-500: #d0a447;
  --gold-200: #f0dca8;
  --gold-100: #fbf2d9;
  --cream: #fbf8f1;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #637083;
  --line: #dfe5ed;
  --success: #16734b;
  --success-bg: #e6f6ee;
  --warning: #9b5900;
  --warning-bg: #fff3d8;
  --danger: #b3263e;
  --danger-bg: #fdecef;
  --shadow-sm: 0 2px 10px rgba(16, 36, 64, 0.08);
  --shadow-md: 0 12px 36px rgba(16, 36, 64, 0.14);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 95% 0%, rgba(208, 164, 71, 0.15), transparent 28rem),
    linear-gradient(180deg, #fffdf8 0%, var(--cream) 38%, #f5f2eb 100%);
}

body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--navy-700); }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid rgba(36, 80, 128, 0.35);
  outline-offset: 2px;
}

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

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--navy-800);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px 20px 24px 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-950));
  border: 2px solid var(--gold-500);
  box-shadow: 0 8px 22px rgba(16, 36, 64, 0.24);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark span { transform: translateY(-1px); }
.brand-mark.small { width: 44px; height: 44px; border-radius: 15px 15px 18px 18px; }

.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(20px, var(--safe-bottom));
  background:
    linear-gradient(150deg, rgba(11, 24, 43, 0.98), rgba(24, 55, 95, 0.95)),
    var(--navy-900);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(240, 220, 168, 0.2);
}

.login-page::before { width: 340px; height: 340px; right: -170px; top: -100px; }
.login-page::after { width: 280px; height: 280px; left: -160px; bottom: -90px; }

.login-top {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong { display: block; font-family: Georgia, serif; font-size: 1.03rem; }
.login-brand span { color: rgba(255, 255, 255, 0.68); font-size: 0.78rem; }

.language-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.language-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  min-width: 42px;
  min-height: 38px;
  font-weight: 800;
}

.language-switch button.active { background: #fff; color: var(--navy-900); }

.login-stage {
  width: 100%;
  max-width: 980px;
  margin: 32px auto;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(100%, 430px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(240, 220, 168, 0.8);
  border-radius: var(--radius-lg);
  padding: 28px 22px 24px;
  box-shadow: 0 30px 80px rgba(4, 12, 24, 0.35);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--burgundy-700);
  background: var(--burgundy-100);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 18px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy-900);
  font-size: clamp(2rem, 9vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.login-footer { text-align: center; color: rgba(255, 255, 255, 0.52); font-size: 0.78rem; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label, .field-label { color: var(--navy-900); font-size: 0.88rem; font-weight: 750; }
.field small { color: var(--muted); line-height: 1.35; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid #cad3df;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus,
.rich-editor:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 4px rgba(36, 80, 128, 0.1);
  outline: none;
}

.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #98a2af; }
.input:disabled, .select:disabled { background: #eef1f4; color: #7a8491; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 54px; }
.icon-input-button {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy-700);
  font-size: 1.15rem;
}

.button {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.15;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); box-shadow: 0 8px 20px rgba(16, 36, 64, 0.2); }
.button-primary:hover { box-shadow: 0 10px 25px rgba(16, 36, 64, 0.27); }
.button-gold { color: var(--navy-950); background: linear-gradient(135deg, var(--gold-200), var(--gold-500)); }
.button-secondary { color: var(--navy-800); background: #fff; border-color: #bcc8d7; }
.button-soft { color: var(--navy-800); background: var(--blue-100); border-color: #d6e2ee; }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: #f5c3cc; }
.button-success { color: #fff; background: var(--success); }
.button-block { width: 100%; }
.button-small { min-height: 42px; padding: 9px 13px; border-radius: 11px; font-size: 0.88rem; }
.button-link { border: 0; background: transparent; color: var(--navy-700); min-height: 44px; padding: 8px; }

.form-error {
  display: none;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f5c3cc;
  border-radius: 12px;
  padding: 11px 13px;
  margin: 0 0 15px;
  line-height: 1.4;
  font-size: 0.9rem;
}

.form-error.show { display: block; }

.app-shell { min-height: 100dvh; padding-bottom: calc(84px + var(--safe-bottom)); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 16px;
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid rgba(205, 211, 221, 0.8);
  backdrop-filter: blur(16px);
}

.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-brand-text { min-width: 0; }
.header-brand-text strong { display: block; color: var(--navy-900); font-family: Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-brand-text span { display: block; color: var(--muted); font-size: 0.7rem; white-space: nowrap; }

.account-area { position: relative; }
.account-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  background: linear-gradient(140deg, var(--burgundy-700), var(--burgundy-800));
  box-shadow: 0 2px 10px rgba(116, 31, 51, 0.25);
  font-weight: 850;
}

.account-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 245px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.account-menu[hidden] { display: none; }
.account-summary { padding: 8px 9px 12px; border-bottom: 1px solid var(--line); margin-bottom: 7px; }
.account-summary strong, .account-summary span { display: block; }
.account-summary span { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.account-menu button { width: 100%; justify-content: flex-start; }

.page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 22px 16px 34px;
}

.page-heading { margin: 4px 0 24px; }
.page-heading h1 {
  margin: 8px 0 7px;
  color: var(--navy-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 7vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.page-heading p { margin: 0; color: var(--muted); line-height: 1.5; }

.section-heading {
  margin: 28px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2 { margin: 0; color: var(--navy-900); font-size: 1.16rem; }
.section-heading span { color: var(--muted); font-size: 0.84rem; }

.event-grid { display: grid; gap: 15px; }
.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.event-card-head {
  padding: 17px;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  background: linear-gradient(135deg, #fff 30%, #fbf3df);
  border-bottom: 1px solid var(--line);
}

.date-tile {
  width: 62px;
  min-height: 67px;
  border-radius: 15px;
  display: grid;
  align-content: center;
  justify-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-950));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.date-tile strong { font-size: 1.65rem; line-height: 1; }
.date-tile span { margin-top: 3px; font-size: 0.69rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }

.event-title { min-width: 0; }
.event-title h3 { margin: 5px 0 3px; color: var(--navy-900); font-size: 1.12rem; }
.event-title p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--navy-800);
  background: var(--blue-100);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill.es { color: var(--burgundy-800); background: var(--burgundy-100); }

.unit-list { display: grid; }
.unit-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  min-height: 67px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 11px;
  text-align: left;
  align-items: center;
  color: var(--ink);
}
.unit-row:last-child { border-bottom: 0; }
.unit-row:hover { background: #fafcff; }
.unit-row[hidden] { display: none; }
.status-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
.status-icon.missing { color: var(--danger); background: var(--danger-bg); }
.status-icon.draft { color: var(--warning); background: var(--warning-bg); }
.status-icon.submitted { color: var(--success); background: var(--success-bg); }
.unit-name { font-weight: 780; }
.unit-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 0.78rem; }
.chevron { color: #8994a3; font-size: 1.2rem; }
.event-expand { width: 100%; border: 0; border-top: 1px solid var(--line); background: #f8fafc; color: var(--navy-700); min-height: 46px; font-weight: 800; }

.empty-state {
  border: 1px dashed #bdc7d4;
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.empty-state h3 { color: var(--navy-900); margin: 0 0 6px; }
.empty-state p { margin: 0; }

.breadcrumbs { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.82rem; margin-bottom: 15px; }
.breadcrumbs button { border: 0; background: transparent; color: var(--navy-700); padding: 7px 0; font-weight: 750; }

.hero-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(240,220,168,.27), transparent 15rem),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-md);
}
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hero-card h1 { margin: 12px 0 4px; font-family: Georgia, serif; font-size: clamp(1.7rem, 7vw, 2.4rem); }
.hero-card p { margin: 0; color: rgba(255,255,255,.72); }
.hero-date { white-space: nowrap; color: var(--gold-200); font-weight: 850; }

.progress-wrap { margin-top: 20px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 0.8rem; color: rgba(255,255,255,.8); }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.15); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-200), var(--gold-500)); }
.progress-native { display: block; width: 100%; border: 0; appearance: none; }
.progress-native::-webkit-progress-bar { border-radius: 999px; background: rgba(255,255,255,.15); }
.progress-native::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--gold-200), var(--gold-500)); }
.progress-native::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--gold-200), var(--gold-500)); }

.choice-card {
  margin-top: 18px;
  padding: 22px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.choice-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; font-size: 1.7rem; background: var(--gold-100); }
.choice-card h2 { margin: 0 0 8px; color: var(--navy-900); font-size: 1.25rem; }
.choice-card p { color: var(--muted); line-height: 1.5; margin: 0 auto 20px; max-width: 520px; }
.choice-actions { display: grid; gap: 11px; }

.location-list { display: grid; gap: 12px; }
.location-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-sm);
}
.location-card-top { display: flex; gap: 12px; align-items: flex-start; }
.location-number { flex: 0 0 auto; width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; color: var(--navy-800); background: var(--blue-100); font-weight: 900; }
.location-content { min-width: 0; flex: 1; }
.location-content h3 { margin: 0; font-size: 1rem; color: var(--navy-900); }
.location-content p { margin: 4px 0 0; color: var(--muted); font-size: 0.83rem; }
.location-status { margin-top: 10px; }
.status-label { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 0.75rem; font-weight: 800; }
.status-label.confirmed { color: var(--success); background: var(--success-bg); }
.status-label.pending { color: var(--warning); background: var(--warning-bg); }
.location-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 13px; }

.action-panel {
  position: sticky;
  bottom: calc(75px + var(--safe-bottom));
  z-index: 15;
  margin-top: 18px;
  padding: 10px;
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(16,36,64,.14);
}

.success-banner, .notice-banner, .warning-banner {
  border-radius: 15px;
  padding: 13px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.4;
}
.success-banner { color: #0d6040; background: var(--success-bg); border: 1px solid #b8e5cf; }
.notice-banner { color: var(--navy-800); background: var(--blue-100); border: 1px solid #cbddeb; }
.warning-banner { color: #7d4900; background: var(--warning-bg); border: 1px solid #f0d294; }
.success-banner strong, .notice-banner strong, .warning-banner strong { display: block; margin-bottom: 2px; }
.success-banner p, .notice-banner p, .warning-banner p { margin: 0; font-size: .86rem; }

.editor-shell { max-width: 780px; margin: 0 auto; }
.step-navigation { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-navigation button { width: 48px; height: 48px; border-radius: 15px; border: 1px solid var(--line); background: #fff; color: var(--navy-800); font-size: 1.2rem; }
.step-label { text-align: center; }
.step-label strong { display: block; color: var(--navy-900); }
.step-label span { color: var(--muted); font-size: .8rem; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 15px; box-shadow: var(--shadow-sm); }
.form-section { padding: 18px 0; border-top: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section:last-child { padding-bottom: 0; }
.form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.form-section-head h2 { margin: 0; color: var(--navy-900); font-size: 1.04rem; }
.form-section-head p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }

.rich-toolbar { display: flex; gap: 5px; flex-wrap: wrap; padding: 7px; border: 1.5px solid #cad3df; border-bottom: 0; border-radius: 12px 12px 0 0; background: #f5f7fa; }
.rich-toolbar button { min-width: 39px; height: 38px; border: 1px solid transparent; border-radius: 9px; background: #fff; color: var(--navy-800); font-weight: 850; }
.rich-toolbar button:hover { border-color: #b7c4d3; }
.rich-editor {
  min-height: 190px;
  border: 1.5px solid #cad3df;
  border-radius: 0 0 12px 12px;
  background: #fff;
  padding: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.rich-editor:empty::before { content: attr(data-placeholder); color: #98a2af; pointer-events: none; }
.rich-editor p:first-child { margin-top: 0; }
.rich-editor p:last-child { margin-bottom: 0; }

.repeat-list { display: grid; gap: 10px; }
.repeat-row { border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; padding: 11px; }
.repeat-grid { display: grid; gap: 9px; }
.repeat-remove { border: 0; background: transparent; color: var(--danger); min-height: 40px; padding: 7px; font-weight: 750; }

.editor-actions { display: grid; gap: 10px; margin-top: 15px; }

.review-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.review-card h2 { color: var(--navy-900); margin: 0 0 5px; }
.review-lead { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.review-block { padding: 14px 0; border-top: 1px solid var(--line); }
.review-block:first-of-type { border-top: 0; }
.review-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.review-value { color: var(--navy-900); font-weight: 750; }
.preview-rich { line-height: 1.6; overflow-wrap: anywhere; }
.preview-rich p:first-child { margin-top: 0; }
.preview-rich p:last-child { margin-bottom: 0; }
.review-list { display: grid; gap: 8px; }
.review-list-item { padding: 10px 11px; border-radius: 11px; background: #f5f7fa; }
.review-confirmation { margin: 17px 0; padding: 14px; border-radius: 14px; color: #0d6040; background: var(--success-bg); display: flex; align-items: flex-start; gap: 10px; font-weight: 750; }

.bottom-nav {
  position: fixed;
  z-index: 28;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(68px + var(--safe-bottom));
  padding: 7px 14px calc(7px + var(--safe-bottom));
  display: flex;
  justify-content: center;
  gap: 7px;
  background: rgba(255,255,255,.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-button { min-width: 90px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); padding: 6px 13px; display: grid; justify-items: center; gap: 2px; font-size: .71rem; font-weight: 750; }
.nav-button .nav-icon { font-size: 1.25rem; line-height: 1; }
.nav-button.active { color: var(--navy-800); background: var(--blue-100); }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(5, 15, 29, .6);
  backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-height: min(92dvh, 900px);
  overflow: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -10px 50px rgba(5,15,29,.28);
}
.modal-head { position: sticky; top: 0; z-index: 2; padding: 16px 17px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-head h2 { margin: 0; color: var(--navy-900); font-size: 1.25rem; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.modal-close { width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #eef2f6; color: var(--navy-900); font-size: 1.25rem; }
.modal-body { padding: 17px; }
.modal-actions { position: sticky; bottom: 0; padding: 12px 17px calc(12px + var(--safe-bottom)); display: grid; gap: 9px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }

.source-event { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; margin-bottom: 12px; }
.source-event-head { display: flex; align-items: center; gap: 10px; padding: 13px; color: var(--navy-900); background: #f5f7fa; font-weight: 800; }
.source-location { display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 12px 13px; border-top: 1px solid var(--line); align-items: flex-start; }
.source-location input { width: 21px; height: 21px; accent-color: var(--navy-700); }
.source-location strong { display: block; }
.source-location span { color: var(--muted); font-size: .8rem; }

.admin-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 3px 0 12px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { white-space: nowrap; min-height: 45px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); padding: 9px 15px; font-weight: 800; }
.admin-tab.active { color: #fff; background: var(--navy-800); border-color: var(--navy-800); }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 9px; justify-content: space-between; margin: 12px 0 15px; }
.search-input { flex: 1 1 210px; }
.admin-list { display: grid; gap: 11px; }
.admin-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 15px; box-shadow: var(--shadow-sm); }
.admin-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.admin-card h3 { margin: 0; color: var(--navy-900); font-size: 1rem; }
.admin-card p { margin: 4px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.4; }
.admin-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: .7rem; font-weight: 850; background: #eef2f6; color: var(--navy-800); }
.badge.inactive { background: var(--danger-bg); color: var(--danger); }
.badge.admin { background: var(--gold-100); color: #76500c; }
.badge.open { background: var(--success-bg); color: var(--success); }
.badge.closed { background: #eef1f4; color: #5b6572; }
.badge.draft { background: var(--warning-bg); color: var(--warning); }

.unit-picker { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 7px; background: #fafbfc; }
.unit-picker-group { margin-bottom: 8px; }
.unit-picker-title { position: sticky; top: -7px; z-index: 1; padding: 9px 7px 6px; background: #fafbfc; color: var(--burgundy-700); font-size: .77rem; font-weight: 900; text-transform: uppercase; }
.check-row { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: center; min-height: 44px; padding: 6px 7px; border-radius: 10px; }
.check-row:hover { background: #fff; }
.check-row input { width: 20px; height: 20px; accent-color: var(--navy-700); }
.check-row span { font-size: .88rem; }
.check-row small { display: block; color: var(--muted); }

.credential-box { text-align: center; padding: 13px 0 4px; }
.credential-code { display: block; margin: 12px 0; padding: 17px; border-radius: 15px; color: var(--navy-950); background: var(--gold-100); border: 1px dashed var(--gold-600); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem; font-weight: 900; letter-spacing: .08em; overflow-wrap: anywhere; }

.toast-root { position: fixed; z-index: 200; left: 12px; right: 12px; bottom: calc(83px + var(--safe-bottom)); display: grid; justify-items: center; pointer-events: none; }
.toast { width: min(100%, 500px); color: #fff; background: var(--navy-950); border-radius: 14px; box-shadow: var(--shadow-md); padding: 13px 15px; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; }
.toast.error { background: #8e2034; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.loading-card { min-height: 190px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #dce3eb; border-top-color: var(--navy-700); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 619px) {
  .admin-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 6px; }
  .admin-tab { min-width: 0; padding: 8px 5px; font-size: .82rem; }
}

@media (min-width: 620px) {
  .login-card { padding: 36px 34px 31px; }
  .page { padding: 30px 24px 46px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .choice-actions, .action-panel, .editor-actions, .modal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-panel { bottom: 18px; }
  .form-card { padding: 24px; }
  .repeat-grid { grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr) minmax(180px, 1.2fr) auto; align-items: end; }
  .admin-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { align-items: center; justify-items: center; padding: 24px; }
  .modal { width: min(100%, 680px); border-radius: 24px; }
  .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); bottom: 13px; width: auto; min-height: 62px; padding: 6px; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow-md); }
  .app-shell { padding-bottom: 98px; }
}

@media (min-width: 900px) {
  .app-header { padding-left: max(24px, calc((100vw - 1040px) / 2)); padding-right: max(24px, calc((100vw - 1040px) / 2)); }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-list.users { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
