:root {
  --background: #020816;
  --surface: rgba(10, 19, 44, 0.92);
  --surface-alt: rgba(15, 26, 56, 0.98);
  --text: #f5f7ff;
  --muted: #b8c4e0;
  --accent: #ffd262;
  --accent-dark: #ffb248;
  --border: rgba(255, 210, 98, 0.18);
  --shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 88px;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(255, 210, 98, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.06), transparent 18%),
    linear-gradient(180deg, #020816 0%, #08102a 100%);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  width: 100%;
  backdrop-filter: blur(18px);
  background: rgba(2, 8, 22, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.4rem, 1vw, 1rem);
  flex-wrap: nowrap;
  width: 100%;
  margin: 0;
  padding: clamp(0.5rem, 1vw, 1rem) clamp(0.75rem, 2vw, 1.5rem);
}

.brand {
  font-weight: 700;
  font-size: clamp(0.8rem, 1.3vw, 1.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0.25rem, 0.9vw, 0.85rem);
  align-items: center;
  flex: 1 1 auto;
  justify-content: space-evenly;
  margin: 0 clamp(0.25rem, 0.8vw, 0.75rem);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(1.8rem, 2.5vw, 2.4rem);
  padding: 0 clamp(0.45rem, 1vw, 0.95rem);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  opacity: 0.95;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 210, 98, 0.55);
  background: rgba(255, 210, 98, 0.14);
  box-shadow: 0 10px 18px rgba(255, 179, 72, 0.14);
}

.header-button {
  padding: 0.85rem 1.3rem;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #08102a;
  background: linear-gradient(135deg, var(--accent), #ffb24d);
  box-shadow: 0 8px 18px rgba(255, 179, 72, 0.22);
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header .header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background-image: linear-gradient(180deg, rgba(2, 8, 22, 0.46), rgba(2, 8, 22, 0.72)),
    var(--admin-bg-image);
  background-size: cover;
  background-position: top center;
  color: var(--text);
  padding: 3rem 0 4rem;
}

.hero-overlay {
  position: absolute;
  inset:0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(255, 210, 98, 0.1), transparent 32%);
}

/* Keep hero text/buttons above the tint overlay so they stay clickable */
.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index:1;
  display: grid;
  gap: 1.5rem;
  max-width: 720px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 5vw, 3.4rem);
  line-height: 1.1;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  line-height: 0.95;
  font-weight: 800;
}

.hero-copy {
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.8;
}

.history-hero h1,
.history-hero .hero-copy {
  color: #08102a;
}

.history-hero .eyebrow {
  color: #6b4e12;
}

.history-hero {
  min-height: 48vh;
}

.events-hero {
  min-height: 52vh;
}

.events-hero .container {
  max-width: 760px;
}

.royal-court-hero {
  min-height: 82vh;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #020816;
}

.contact-hero {
  min-height: 48vh;
}

.join-hero {
  min-height: 48vh;
}

.photos-hero {
  min-height: 52vh;
}

.royal-court-hero .container {
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  color: #08102a;
  background: linear-gradient(135deg, var(--accent), #ffb24d);
  border-color: transparent;
  box-shadow: 0 18px 38px rgba(255, 179, 72, 0.18);
}

.secondary,
.outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: rgba(5, 13, 32, 0.9);
}

.section-header {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.section-tag {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.section-copy,
p {
  color: var(--muted);
  line-height: 1.85;
}

.grid-two,
.card-grid,
.gallery-grid,
.feature-grid,
.footer-grid {
  display: grid;
  gap: 1.75rem;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.contact-layout {
  align-items: start;
  gap: 2rem;
}

.contact-copy-card,
.contact-form-card {
  background: linear-gradient(180deg, rgba(10, 19, 44, 0.94), rgba(15, 26, 56, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 14px 38px rgba(2, 8, 22, 0.34);
}

.contact-copy-card {
  padding: 2rem;
}

.contact-form-card {
  padding: 2rem;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

.contact-form-field {
  margin-bottom: 0;
}

.contact-form-field-half {
  grid-column: span 1;
}

.contact-form-field-full {
  grid-column: 1 / -1;
}

.contact-form label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.contact-form select {
  background-color: #12203f;
  color: #f5f7ff;
  color-scheme: dark;
}

.contact-form select option {
  background: #12203f;
  color: #f5f7ff;
}

.contact-form input,
.contact-form select {
  min-height: 3.35rem;
}

.contact-form textarea {
  min-height: 13rem;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(226, 232, 240, 0.52);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(239, 191, 88, 0.75);
  box-shadow: 0 0 0 4px rgba(239, 191, 88, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.contact-form .button {
  min-width: 13rem;
  margin-top: 1.25rem;
}

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

  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-field-half,
  .contact-form-field-full {
    grid-column: 1;
  }
}

.intro-card,
.feature-card,
.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.intro-card {
  margin-left: 2rem;
}

.intro-card img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: rgba(2, 8, 22, 0.85);
}

.intro-card div,
.feature-card div,
.cta-card div {
  padding: 2rem;
}

.intro-card h3,
.feature-card h3,
.cta-card h2 {
  margin-top: 0;
}

.history-values-title {
  padding-left: 0.75rem;
}

.feature-card {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

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

.feature-card.small {
  padding: 2rem;
  min-height: 220px;
}

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

.feature-card img {
  border-radius: 24px;
  max-height: 360px;
  object-fit: contain;
  background: rgba(2, 8, 22, 0.85);
}

.gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid img {
  height: 260px;
  object-fit: contain;
  background: rgba(2, 8, 22, 0.85);
  border-radius: 24px;
}

.media-albums-root {
  display: grid;
  gap: 1.2rem;
}

.album-admin-toolbar {
  display: none;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

body.admin-edit-mode .album-admin-toolbar {
  display: flex;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.album-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 16, 42, 0.72);
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
}

.album-cover {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(2, 8, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-cover-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(219, 231, 255, 0.8);
  font-size: 0.92rem;
}

.album-meta h3 {
  margin: 0;
}

.album-meta p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.album-tools {
  display: none;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body.admin-edit-mode .album-tools {
  display: flex;
}

.album-tools button,
.album-admin-toolbar button,
.album-viewer-toolbar button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7ff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.album-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.8rem;
}

.album-photo-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(2, 8, 22, 0.82);
}

.album-photo-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.album-photo-caption {
  font-size: 0.82rem;
  color: #dbe7ff;
  padding: 0.45rem 0.5rem 0.55rem;
}

/* Album/editor modal backdrop — fixed full-screen overlay so the modal
   opens centered in the viewport instead of at the bottom of the page. */
.admin-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(2, 8, 22, 0.72);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.admin-editor-modal {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  margin: auto 0;
  background: linear-gradient(180deg, rgba(10, 19, 44, 0.98), rgba(15, 26, 56, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 1.75rem;
}

.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  margin: 0;
  padding: 1.25rem;
  border-radius: 0;
  border: none;
  background: rgba(2, 8, 22, 0.94);
}

.album-lightbox-stage {
  min-height: 70vh;
  max-height: 96vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.5rem;
}

.album-lightbox-stage img {
  max-width: min(92vw, 1700px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
}

.album-lightbox-caption {
  font-size: 0.9rem;
  color: #dbe7ff;
  text-align: center;
  display: grid;
  gap: 0.25rem;
}

.album-lightbox-caption span {
  font-size: 0.8rem;
  color: rgba(219, 231, 255, 0.72);
}

.album-lightbox-nav {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.album-lightbox-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
}

.countdown-card {
  max-width: 100%;
  padding: 1.5rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.countdown-card .label {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.countdown-item {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.countdown-item strong {
  display: block;
  font-size: 1.75rem;
  color: var(--text);
}

.countdown-item small {
  color: var(--muted);
}

.vertical-image {
  width: 100%;
  border-radius: 24px;
  max-height: 420px;
  object-fit: contain;
  background: rgba(2, 8, 22, 0.85);
}

.cta-section {
  padding-bottom: 6rem;
}

.cta-card {
  align-items: center;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 2rem 2.5rem;
}

.cta-section h2 {
  margin: 0;
}

.footer {
  padding: 2rem 0;
}

.footer-grid {
  grid-template-columns: 1fr auto;
  gap: 1rem;
  color: var(--muted);
}

/* ── Hamburger nav toggle ─────────────────────────────── */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
    top: 0;
    background: rgba(2, 8, 22, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
  }

  body {
    padding-top: 0;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 0.75rem 1rem;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .site-nav {
    width: 100%;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: visible;
    white-space: normal;
    margin: 0;
    flex: none;
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    width: 100%;
    min-height: 2.6rem;
    padding: 0 0.55rem;
    font-size: 0.88rem;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .contact-copy-card,
  .contact-form-card {
    padding: 1.4rem;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    padding: 0.9rem 0.95rem;
  }

  .contact-form .button {
    width: 100%;
  }

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

  .hero {
    min-height: 80vh;
    padding-top: 2rem;
  }

  .hero-actions,
  .countdown-grid,
  .footer-grid,
  .cta-card,
  .feature-grid,
  .gallery-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
  }

  .countdown-grid {
    gap: 0.75rem;
  }

  .feature-card.small,
  .cta-card {
    padding: 1.5rem;
  }
}

/* iOS input zoom prevention – font-size must be ≥ 16px */
@media (max-width: 900px) {
  input,
  select,
  textarea {
    font-size: max(1rem, 16px) !important;
  }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 900px) {
  .button,
  .db-add-btn,
  .br-action-btn,
  .br-page-btn {
    min-height: 2.75rem;
  }
}

/* Auth and form styles */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(2,8,22,0.6), rgba(2,8,22,0.9));
}

.auth-card {
  background: linear-gradient(180deg, rgba(10,19,44,0.98), rgba(15,26,56,0.98));
  padding: 2.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(2,8,22,0.6);
  width: 100%;
  max-width: 680px;
}

.auth-card h1 {
  margin-top: 0;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.1;
}

.auth-card label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  margin-top: 0.5rem;
  color-scheme: dark;
}

.auth-card .button { 
  width: 100%;
  margin-top: 1.25rem;
}

/* MFA method-switch buttons should stay compact, not full-width like the
   primary submit button */
#mfa-method-switch .button {
  width: auto;
  margin-top: 0;
  min-height: 2.25rem;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

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

/* ── Dashboard ─────────────────────────────────────────── */

.db-layout {
  padding-top: 2rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero banner */
.db-hero {
  background: linear-gradient(135deg, rgba(10,19,44,0.98) 0%, rgba(20,35,72,0.98) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.db-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,210,98,0.25), rgba(255,178,72,0.15));
  border: 2px solid rgba(255,210,98,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

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

.db-hero-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
}

.db-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.db-hero-meta li {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.db-hero-meta strong {
  color: var(--text);
  font-weight: 600;
}

.db-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.db-badge--member {
  background: rgba(255,210,98,0.14);
  border: 1px solid rgba(255,210,98,0.35);
  color: var(--accent);
}

.db-badge--admin {
  background: rgba(100,180,255,0.14);
  border: 1px solid rgba(100,180,255,0.35);
  color: #7ec8f5;
}

.db-badge--store-admin {
  background: rgba(167,139,250,0.14);
  border: 1px solid rgba(167,139,250,0.35);
  color: #c4b5fd;
}

.db-badge--paid {
  background: rgba(74,222,128,0.14);
  border: 1px solid rgba(74,222,128,0.35);
  color: #4ade80;
}

.db-badge--unpaid {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  color: #f87171;
}

.db-hero-label {
  margin: 0 0 0.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.db-payment-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* Payment tab rows */
.db-pay-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid;
  margin-bottom: 0.65rem;
}

.db-pay-row--paid {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
}

.db-pay-row--unpaid {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

.db-pay-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-pay-icon-svg {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.db-pay-row--paid   .db-pay-icon-svg { fill: #4ade80; }
.db-pay-row--unpaid .db-pay-icon-svg { fill: #f87171; }

.db-pay-details {
  flex: 1;
}

.db-pay-name {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text);
}

.db-pay-status {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid;
}

.db-pay-status--paid {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.1);
}

.db-pay-status--unpaid {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
}

/* Tab nav */
.db-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0;
}

.db-tab {
  padding: 0.55rem 1.25rem;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
  bottom: -1px;
}

.db-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.db-tab.is-active {
  background: linear-gradient(180deg, rgba(15,26,56,0.98), rgba(10,19,44,0.98));
  border-color: rgba(255,255,255,0.1);
  color: var(--accent);
  font-weight: 600;
}

/* Tab panels */
.db-tab-panel {
  display: none;
}

.db-tab-panel.is-active {
  display: block;
}

/* Cards grid */
.db-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.db-cards-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Single card */
.db-card {
  background: linear-gradient(180deg, rgba(10,19,44,0.98), rgba(15,26,56,0.95));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.db-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.db-card-header svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: var(--accent);
  flex-shrink: 0;
}

.db-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Form inside card */
.db-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.db-form input[type="text"],
.db-form input[type="tel"],
.db-form input[type="date"],
.db-form input[type="email"],
.db-form input[type="number"] {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
  color-scheme: dark;
}

.db-form input:focus {
  outline: none;
  border-color: rgba(255,210,98,0.5);
  background: rgba(255,210,98,0.04);
}

.db-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.db-add-btn {
  margin-top: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.db-add-btn:hover {
  border-color: rgba(255,210,98,0.4);
  color: var(--accent);
}

.db-feedback {
  min-height: 1.2em;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.db-save-btn {
  margin-top: 0.25rem;
}

.db-cards-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.db-config-section-label {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.db-form select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
  appearance: none;
  color-scheme: dark;
}

.db-form select:focus {
  outline: none;
  border-color: rgba(255,210,98,0.5);
}

/* Native dropdown options inherit OS styling (often light) and ignore the dark
   theme, making them invisible. Force a dark option list. */
.db-form select option {
  background-color: #12203f;
  color: var(--text);
}

.db-form select option:hover,
.db-form select option:checked {
  background-color: var(--accent, #ffd262);
  color: #0b1020;
}

.db-form input[type="number"]:focus {
  outline: none;
  border-color: rgba(255,210,98,0.5);
}

.db-form input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.db-form input[type="password"]:focus {
  outline: none;
  border-color: rgba(255,210,98,0.5);
}

/* User Edit Modal tabs */
.uem-tabs {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.uem-tab-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  position: relative;
  bottom: -1px;
}

.uem-tab-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.uem-tab-btn.is-active {
  background: rgba(15,26,56,0.98);
  border-color: rgba(255,255,255,0.12);
  color: var(--accent);
  font-weight: 700;
}

.uem-panel { display: none; }
.uem-panel.is-active { display: block; }

/* Admin user-edit modal CSS grids (responsive via classes) */
.uem-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

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

/* ── Dashboard responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .db-cards-grid--2,
  .db-cards-grid--3 {
    grid-template-columns: 1fr;
  }

  .db-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .db-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .db-hero {
    padding: 1.1rem;
    gap: 0.75rem;
  }

  .db-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }

  .db-hero-name {
    font-size: 1.15rem;
  }

  .db-card {
    padding: 1.1rem;
  }

  .db-payment-status .db-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }

  .uem-grid-2,
  .uem-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Hide "Created By" column in backups table on phones */
  .br-table th:nth-child(3),
  .br-table td:nth-child(3) {
    display: none;
  }
}

/* Legacy #profile override (kept for compat) */
#profile.db-hero { background: unset; padding: unset; border-radius: unset; border: unset; }

.admin-user-select {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #12203f;
  color: #f5f7ff;
}

.admin-user-select option {
  background: #12203f;
  color: #f5f7ff;
}

.admin-user-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.event-calendar-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.event-calendar-card,
.event-calendar-notes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.event-card {
  display: grid;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 210, 98, 0.45);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.4);
}

.event-card-tag {
  align-self: start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #08102a;
  background: linear-gradient(135deg, var(--accent), #ffb24d);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.event-card h3 {
  margin: 0;
  font-size: 1.4rem;
}

.event-card p {
  margin: 0;
}

.event-calendar-card h3,
.event-calendar-notes h3,
.event-card h3 {
  margin-top: 0;
}

.event-calendar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.event-calendar-header-row h3 {
  margin: 0;
}

.event-calendar-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.event-calendar-controls label {
  font-size: 0.8rem;
  color: var(--muted);
}

.event-calendar-controls select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12203f;
  color: var(--text);
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.event-calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.event-calendar th,
.event-calendar td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  vertical-align: top;
  padding: 0.5rem;
  min-height: 4.25rem;
}

.event-calendar th {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
}

.event-calendar td {
  color: var(--text);
  font-weight: 600;
}

.event-calendar td small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}

.event-calendar td.is-event {
  background: rgba(255, 210, 98, 0.11);
}

.event-calendar td.is-event span {
  color: var(--accent);
}

.event-calendar-notes ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.6rem;
}

.events-cta {
  text-align: center;
  border-radius: 28px;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(255, 210, 98, 0.18), rgba(255, 178, 72, 0.05));
  border: 1px solid rgba(255, 210, 98, 0.32);
  box-shadow: var(--shadow);
}

.events-cta h2 {
  margin: 0 0 0.75rem;
}

.events-cta p {
  max-width: 42rem;
  margin: 0 auto 1.5rem;
}

.events-page .section {
  padding: 3.25rem 0;
}

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

  /* Make calendar table horizontally scrollable on mobile */
  .event-calendar-card {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .auth-card { padding: 1.25rem; border-radius: 8px; }

  .event-calendar-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-calendar-controls {
    flex-wrap: wrap;
  }

  .event-calendar th,
  .event-calendar td {
    font-size: 0.78rem;
    padding: 0.35rem 0.25rem;
    min-height: 2.5rem;
  }
}

@media (max-width: 480px) {
  .auth-card { padding: 1rem 0.85rem; }

  /* Section padding reduced on small phones */
  .section { padding: 3rem 0; }
  .db-layout { padding-top: 1.25rem; }
}

/* ── Profile MFA verification prompt ─────────────────────
   Explicit dark theme so the code entry is clearly visible. The bare
   #pd-mfa-code input has no type attribute (so it is not matched by the
   .db-form input[type="text"] rule) and would otherwise fall back to the
   browser default, which is unreadable on this dark UI. */
#pd-mfa-verify {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}

#pd-mfa-verify .field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 0.35rem;
}

#pd-mfa-verify label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

#pd-mfa-code {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  letter-spacing: 0.15em;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#pd-mfa-code::placeholder {
  color: rgba(226, 232, 240, 0.52);
}

#pd-mfa-code:focus {
  outline: none;
  border-color: rgba(239, 191, 88, 0.75);
  box-shadow: 0 0 0 4px rgba(239, 191, 88, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

/* "Resend code" secondary action inside the MFA verify block. Explicit
   light text (the base .button no longer relies on inheritance) plus a
   visible outline + hover so it is clearly readable on the dark panel. */
#pd-mfa-verify .db-resend-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}
#pd-mfa-verify .db-resend-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}
