/* ═══════════════════════════════════════════════════════════════
   Inbjuden – main stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────── */
:root {
  --ib-primary: #6366f1;
  --ib-primary-hover: #4f46e5;
  --ib-primary-soft: rgba(99,102,241,.06);
  --ib-primary-glow: rgba(99,102,241,.18);
  --ib-accent: #06d6a0;
  --ib-accent-soft: rgba(6,214,160,.10);
  --ib-warm: #faf7f5;
  --ib-dark: #0f172a;
  --ib-surface: #ffffff;
  --ib-bg: #f6f5f3;
  --ib-border: #e8e5e1;
  --ib-text: #1e293b;
  --ib-text-muted: #78716c;
  --ib-radius: 1rem;
  --ib-radius-sm: .625rem;
  --ib-radius-lg: 1.25rem;
  --ib-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 6px rgba(0,0,0,.03);
  --ib-shadow-md: 0 2px 8px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --ib-shadow-lg: 0 8px 24px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --ib-transition: .2s cubic-bezier(.4,0,.2,1);

  /* Typography scale */
  --ib-text-xs:   .75rem;   /* icon badges, fieldset titles */
  --ib-text-sm:   .8125rem; /* dropdowns, pagination, small UI */
  --ib-text-base: .9375rem; /* table cells, form inputs, body text */
  --ib-text-md:   1rem;     /* body default */
  --ib-text-lg:   1.1rem;   /* h5, .lead */
}

/* ── Base ──────────────────────────────────────── */
body {
  background-color: var(--ib-bg);
  color: var(--ib-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ib-primary); transition: color var(--ib-transition); }
a:hover { color: var(--ib-primary-hover); }
h1, h2, h3, h4, h5, h6 {
  font-weight: 700; color: var(--ib-dark);
  letter-spacing: -.015em; line-height: 1.25;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: var(--ib-text-lg); font-weight: 600; }
.lead { font-size: var(--ib-text-lg); color: var(--ib-text-muted); line-height: 1.6; }

/* Desktop: cap container width for better reading density */
@media (min-width: 768px) {
  main { padding-top: 1.75rem; padding-bottom: 2rem; }
}
@media (min-width: 992px) {
  main > .container, main.container,
  footer > .container { max-width: 920px; }
}
@media (min-width: 1280px) {
  main > .container, main.container,
  footer > .container,
  .navbar-ib > .container { max-width: 1040px; }
}

/* ── Navbar ────────────────────────────────────── */
.navbar-ib {
  background: var(--ib-surface);
  border-bottom: 1px solid var(--ib-border);
  padding: 0;
  box-shadow: var(--ib-shadow);
  min-height: 56px;
  overflow: visible;
}
.navbar-ib > .container {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.navbar-ib .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -.025em;
  color: var(--ib-dark) !important;
  margin-right: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-ib .navbar-brand i {
  color: var(--ib-primary);
  font-size: 1.3rem;
}

/* Toggler */
.navbar-ib .navbar-toggler {
  border: none;
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: var(--ib-text-muted);
  border-radius: .5rem;
  transition: background var(--ib-transition);
}
.navbar-ib .navbar-toggler:hover { background: var(--ib-primary-soft); }
.navbar-ib .navbar-toggler:focus { box-shadow: none; }
.navbar-ib .navbar-toggler-icon {
  width: 1.1em;
  height: 1.1em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(30,41,59,0.78)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Desktop nav links */
.navbar-ib .navbar-nav {
  gap: .125rem;
}
.navbar-ib .nav-item { display: block; }
.navbar-ib .nav-link {
  color: var(--ib-text-muted);
  font-weight: 500;
  font-size: .95rem;
  padding: .45rem .9rem;
  border-radius: .5rem;
  transition: color var(--ib-transition), background var(--ib-transition);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem;
  white-space: nowrap;
  position: relative;
  line-height: 1;
  width: 100%;
}
.navbar-ib .nav-link i { font-size: .95rem; }
.navbar-ib .nav-link:hover {
  color: var(--ib-dark);
  background: var(--ib-primary-soft);
}
.navbar-ib .nav-link.active {
  color: var(--ib-primary);
  background: var(--ib-primary-soft);
}
/* User section (base – mobile first) */
.navbar-ib .navbar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  flex-wrap: wrap;
  border-top: 1px solid var(--ib-border);
  margin-top: .375rem;
  padding-top: .625rem;
}
.navbar-ib .nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ib-primary-soft);
  color: var(--ib-primary);
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: .01em;
}
.navbar-ib .nav-username {
  color: var(--ib-text);
  font-size: .925rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}
.navbar-ib .nav-sep {
  width: 1px;
  height: 20px;
  background: var(--ib-border);
  flex-shrink: 0;
}

/* Desktop navbar layout */
@media (min-width: 768px) {
  .navbar-ib .navbar-toggler {
    display: none;
  }
  /* Bootstrap sets display:flex on .navbar-collapse inside navbar-expand-md.
     We only add layout properties — no display override here. */
  .navbar-ib .navbar-collapse {
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    gap: .9rem;
  }
  .navbar-ib .navbar-nav {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: .25rem;
    margin-right: auto !important;
  }
  .navbar-ib .nav-item {
    display: flex;
    align-items: center;
  }
  .navbar-ib .nav-link {
    min-height: 2.25rem;
    padding: .45rem .8rem;
    width: auto;
    justify-content: center;
  }
  .navbar-ib .navbar-user {
    width: auto;
    margin-left: auto;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    border-top: 0;
    margin-top: 0;
    padding: .35rem .45rem .35rem .7rem;
    border: 1px solid var(--ib-border);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,247,245,.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  }
}

/* Mobile collapse — Bootstrap owns show/hide via the .collapse/.show classes.
   We only add visual layout when the panel is open (.show). */
@media (max-width: 767.98px) {
  .navbar-ib { height: auto; min-height: 56px; }
  .navbar-ib > .container { flex-wrap: wrap; }
  .navbar-ib .navbar-toggler { display: inline-flex; }
  /* Visual shell for the expanded panel — only active when Bootstrap adds .show */
  .navbar-ib .navbar-collapse.show {
    width: 100%;
    padding: .375rem 0 .625rem;
    border-top: 1px solid var(--ib-border);
  }
  .navbar-ib .navbar-nav { padding: .25rem 0; }
  .navbar-ib .nav-link {
    padding: .5rem .65rem;
    border-radius: .5rem;
  }
  .navbar-ib .nav-link.active {
    background: var(--ib-primary-soft);
  }
}
/* Very small screens ≤360px: stack org-chip on its own row */
@media (max-width: 359.98px) {
  .navbar-ib .nav-org-chip {
    flex: 0 0 100%;
  }
  .navbar-ib .nav-org-chip + .nav-sep {
    display: none;
  }
  .navbar-ib .nav-username {
    max-width: 7rem;
  }
}
/* Tablet small: 768–991 */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar-ib .navbar-brand { margin-right: 1rem; }
  .navbar-ib .nav-link { padding: .42rem .6rem; font-size: .9rem; }
  .navbar-ib .nav-org-chip .org-name,
  .navbar-ib .nav-username { max-width: 8ch; }
  .navbar-ib .navbar-user { gap: .375rem; }
}
/* Tablet large: 992–1279 */
@media (min-width: 992px) and (max-width: 1279.98px) {
  .navbar-ib .navbar-brand { margin-right: 1rem; }
  .navbar-ib .navbar-nav { gap: .1rem; }
  .navbar-ib .nav-link { padding: .45rem .65rem; font-size: .9rem; }
  .navbar-ib .nav-org-chip .org-name,
  .navbar-ib .nav-username { max-width: 8ch; }
  .navbar-ib .navbar-user { gap: .375rem; }
}

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius);
  box-shadow: var(--ib-shadow);
  transition: box-shadow var(--ib-transition);
}
.card-body { padding: 1.35rem; }
@media (min-width: 768px) {
  .card-body { padding: 1.75rem; }
}
.card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ib-dark);
  margin-bottom: 1rem;
  letter-spacing: -.01em;
}

/* ── Stat cards ────────────────────────────────── */
.card-stat {
  border-radius: var(--ib-radius);
  transition: transform var(--ib-transition), box-shadow var(--ib-transition);
}
.card-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--ib-shadow-md);
}
.card-stat .card-body {
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: .85rem;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: .625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.card-stat .stat-value {
  font-size: 1.5rem; font-weight: 800;
  line-height: 1; letter-spacing: -.02em;
  color: var(--ib-dark); display: block;
}
.card-stat .stat-label {
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--ib-text-muted); margin-top: .2rem;
  display: block;
}
.stat-icon-events  { background: rgba(99,102,241,.1);  color: #6366f1; }
.stat-icon-guests  { background: rgba(14,165,233,.1);  color: #0ea5e9; }
.stat-icon-rsvp    { background: rgba(16,185,129,.1);  color: #10b981; }
.stat-icon-checkin { background: rgba(245,158,11,.1);  color: #f59e0b; }

/* ── Buttons ───────────────────────────────────── */
.btn {
  font-weight: 600;
  border-radius: .5rem;
  font-size: .925rem;
  padding: .55rem 1.2rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: background var(--ib-transition), color var(--ib-transition), border-color var(--ib-transition), box-shadow var(--ib-transition);
  letter-spacing: -.005em;
}
.btn-sm { padding: .35rem .8rem; font-size: .85rem; min-height: 2rem; border-radius: .375rem; }
.btn-lg { padding: .72rem 1.45rem; font-size: 1rem; min-height: 2.75rem; border-radius: .625rem; }
.btn-primary {
  background: var(--ib-primary);
  border-color: var(--ib-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99,102,241,.25);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--ib-primary-hover);
  border-color: var(--ib-primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.auth-submit-btn {
  min-height: 3.25rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-weight: 700;
}
.auth-submit-btn i {
  font-size: .95rem;
  margin-right: 0 !important;
}
.btn-outline-secondary {
  border-color: var(--ib-border);
  color: var(--ib-text);
}
.btn-outline-secondary:hover {
  background: var(--ib-warm);
  border-color: #d6d3d1;
  color: var(--ib-dark);
}
.btn-outline-primary {
  color: var(--ib-primary);
  border-color: rgba(99,102,241,.3);
}
.btn-outline-primary:hover {
  background: var(--ib-primary);
  border-color: var(--ib-primary);
  color: #fff;
}
.btn-outline-danger {
  border-color: rgba(239,68,68,.25);
}
.btn-outline-danger:hover {
  box-shadow: 0 4px 12px rgba(239,68,68,.2);
}

/* ── Badges ────────────────────────────────────── */
.badge {
  font-weight: 600;
  font-size: .82rem;
  padding: .35em .75em;
  border-radius: 999px;
  letter-spacing: .01em;
}
.badge-rsvp-yes     { background: #dcfce7; color: #15803d; }
.badge-rsvp-no      { background: #fee2e2; color: #b91c1c; }
.badge-rsvp-pending { background: #fef3c7; color: #a16207; }
.badge-published    { background: #dbeafe; color: #1d4ed8; }
.badge-draft        { background: #f5f5f4; color: #78716c; }
.badge-checkedin    { background: var(--ib-accent-soft); color: #047857; }

/* Badge icons (a11y – not color-only) */
.badge-rsvp-yes i,
.badge-rsvp-no i,
.badge-rsvp-pending i,
.badge-published i,
.badge-draft i,
.badge-checkedin i { font-size: var(--ib-text-xs); }

/* ── Tables ────────────────────────────────────── */
.table { --bs-table-hover-bg: var(--ib-primary-soft); }
.table th {
  font-weight: 600;
  font-size: .825rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ib-text-muted);
  border-bottom: 2px solid var(--ib-border);
  padding: .75rem 1rem;
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  font-size: var(--ib-text-base);
  vertical-align: middle;
  border-color: var(--ib-border);
}
.table tbody tr { transition: background var(--ib-transition); }
.table td a { font-weight: 600; }
.guest-action-label {
  display: none;
}
@media (min-width: 1200px) {
  .guest-action-label {
    display: inline;
  }
}

/* Table inside card — seamless join */
.card > .table-responsive { border-radius: inherit; overflow: hidden; }
.card > .table-responsive > .table { margin-bottom: 0; }

/* ── Mobile stacked helper for tables ─────────── */
@media (max-width: 575.98px) {
  .table-mobile-compact th,
  .table-mobile-compact td {
    padding: .625rem .75rem;
    font-size: .8125rem;
  }
  .table-mobile-compact .btn-sm {
    padding: .25rem .5rem;
    font-size: .75rem;
  }
  .mobile-sub {
    display: block;
    font-size: .75rem;
    color: var(--ib-text-muted);
    font-weight: 400;
    margin-top: .15rem;
  }
  .guest-list-table thead,
  .guest-list-table td.d-none {
    display: none !important;
  }
  .guest-list-table,
  .guest-list-table tbody,
  .guest-list-table tr,
  .guest-list-table td {
    display: block;
    width: 100%;
  }
  .guest-list-table tbody {
    padding: .75rem;
  }
  .guest-list-table tr {
    border: 1px solid var(--ib-border);
    border-radius: var(--ib-radius-sm);
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,247,245,.92));
    box-shadow: var(--ib-shadow);
    overflow: hidden;
  }
  .guest-list-table tr + tr {
    margin-top: .75rem;
  }
  .guest-list-table td {
    border: 0;
    padding: .7rem .85rem;
    text-align: left !important;
  }
  .guest-list-table td + td {
    border-top: 1px solid var(--ib-border);
  }
  .guest-list-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .35rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ib-text-muted);
  }
  .guest-list-table td:first-child::before {
    display: none;
  }
  .guest-name-cell {
    display: flex;
    flex-direction: column;
    gap: .35rem;
  }
  .guest-name {
    font-weight: 700;
    color: var(--ib-dark);
  }
  .guest-mobile-contact,
  .guest-mobile-meta {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: .78rem;
    color: var(--ib-text-muted);
    line-height: 1.4;
  }
  .guest-actions-cell {
    padding-top: .8rem;
  }
  .guest-actions-group {
    display: flex !important;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .45rem;
  }
  .guest-actions-group > form,
  .guest-actions-group > .dropdown {
    flex: 1 1 auto;
  }
  .guest-actions-group .btn {
    width: 100%;
    justify-content: center;
  }
  .guest-action-label {
    display: inline;
  }
}
@media (min-width: 576px) {
  .mobile-sub { display: none; }
}

/* ── Forms ─────────────────────────────────────── */
.form-label {
  font-weight: 600; font-size: var(--ib-text-base);
  color: var(--ib-dark); margin-bottom: .4rem;
}
.form-control, .form-select {
  border: 1.5px solid var(--ib-border);
  border-radius: var(--ib-radius-sm);
  padding: .6rem .9rem;
  min-height: 2.9rem;
  font-size: var(--ib-text-base);
  background: var(--ib-surface);
  transition: border-color var(--ib-transition), box-shadow var(--ib-transition);
  color: var(--ib-text);
}
.form-control::placeholder {
  color: var(--ib-text-muted);
  opacity: .65;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ib-primary);
  box-shadow: 0 0 0 3px var(--ib-primary-soft);
}
textarea.form-control {
  line-height: 1.55;
  min-height: 7.5rem;
  resize: vertical;
}
/* datetime-local & file inputs */
input[type="datetime-local"].form-control {
  min-height: calc(1.5em + .6rem * 2 + 3px);
}
input[type="file"].form-control {
  padding: .45rem .75rem;
  font-size: var(--ib-text-sm);
}
.form-text { font-size: var(--ib-text-sm); color: var(--ib-text-muted); margin-top: .35rem; }
.text-danger.small {
  display: block;
  margin-top: .4rem;
  line-height: 1.4;
}
.input-group {
  align-items: stretch;
}
.input-group-text {
  min-width: 2.9rem;
  justify-content: center;
  padding-inline: .8rem;
}
.input-group > .form-control,
.input-group > .form-select {
  min-width: 0;
}
.form-check-input {
  width: 1.15em; height: 1.15em;
  border: 1.5px solid var(--ib-border);
  margin-top: .15em;
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--ib-primary);
  border-color: var(--ib-primary);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--ib-primary-soft);
  border-color: var(--ib-primary);
}
.form-check-label { font-size: var(--ib-text-base); cursor: pointer; }
.form-fieldset .form-check {
  position: relative;
  padding: .85rem 1rem .85rem 2.7rem;
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius-sm);
  background: linear-gradient(180deg, rgba(250,247,245,.6), rgba(255,255,255,.9));
}
.form-fieldset .form-check + .form-text {
  margin-top: .5rem;
}
.form-fieldset .form-check-input {
  position: absolute;
  left: 1rem;
  top: .95rem;
  margin-top: 0;
}

/* Form fieldsets */
.form-fieldset {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.2rem 1rem;
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius);
  background: linear-gradient(180deg, rgba(250,247,245,.72), rgba(255,255,255,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
@media (max-width: 575.98px) {
  .form-fieldset {
    padding: .95rem 1rem .9rem;
  }
}
.form-fieldset-title {
  font-size: var(--ib-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ib-text-muted);
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--ib-border);
}
.form-shell {
  display: grid;
  gap: .95rem;
}
.form-shell > .alert,
.form-shell > .mb-3,
.form-shell > .mb-4,
.form-shell > .form-fieldset,
.form-shell > .form-actions {
  margin-bottom: 0;
}

/* Form actions row */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--ib-border);
  margin-top: 1.25rem;
}
.form-actions .btn:first-child { flex: 1; }
@media (min-width: 576px) {
  .form-actions { flex-direction: row; }
  .form-actions .btn:first-child { flex: 0 1 auto; }
}

/* ── Page header ──────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin-bottom: .3rem; }
.page-header h1 i { color: var(--ib-primary); opacity: .7; }
.page-header .text-muted {
  color: var(--ib-text-muted) !important;
  font-size: .975rem; font-weight: 400;
}
.page-header-action {
  justify-content: center;
}
.page-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex-shrink: 0;
}
@media (min-width: 576px) {
  .page-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
  }
}
@media (max-width: 575.98px) {
  .auth-submit-btn {
    min-height: 3rem;
  }
  .page-actions,
  .page-header-action {
    width: 100%;
  }
}

/* ── Breadcrumbs ──────────────────────────────── */
.breadcrumb-ib {
  padding: 0;
  margin: 0 0 1.25rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
  font-size: .875rem;
}
.breadcrumb-ib li {
  display: flex;
  align-items: center;
  gap: .25rem;
  color: var(--ib-text-muted);
}
.breadcrumb-ib li a {
  color: var(--ib-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--ib-transition);
  max-width: 12ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb-ib li a:hover {
  color: var(--ib-primary);
}
@media (min-width: 768px) {
  .breadcrumb-ib li a { max-width: none; }
}
.breadcrumb-ib li.active {
  color: var(--ib-dark);
  font-weight: 600;
}
.breadcrumb-ib .bi-chevron-right {
  font-size: .6rem;
  color: var(--ib-text-muted);
  opacity: .6;
}

/* ── Alerts ────────────────────────────────────── */
.alert {
  border-radius: var(--ib-radius-sm);
  font-size: .95rem; border: none;
  padding: 1rem 1.25rem;
}

/* ── Definition lists ─────────────────────────── */
dt {
  font-weight: 600; font-size: .825rem;
  color: var(--ib-text-muted);
  letter-spacing: .01em;
  padding-top: .2rem;
}
dd { font-size: var(--ib-text-base); margin-bottom: .75rem; }

/* ── Footer ────────────────────────────────────── */
footer {
  color: var(--ib-text-muted); font-size: .875rem;
  border-top: 1px solid var(--ib-border);
  background: var(--ib-warm);
}

/* ── Empty states ──────────────────────────────── */
.empty-state {
  padding: 2.5rem 1.5rem; text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,214,160,.06));
  border: 1px solid rgba(99,102,241,.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.empty-state-icon i {
  font-size: 1.5rem;
  color: var(--ib-primary);
  opacity: .7;
}
/* Legacy fallback: bare i inside .empty-state */
.empty-state > i {
  font-size: 2.5rem; color: var(--ib-primary); opacity: .4;
  display: block; margin-bottom: .6rem;
}
.empty-state h5 {
  font-size: 1.05rem; font-weight: 700;
  color: var(--ib-dark); margin-bottom: .35rem;
}
.empty-state p {
  color: var(--ib-text-muted); font-size: var(--ib-text-base);
  max-width: 24rem; margin-inline: auto;
  line-height: 1.55; margin-bottom: 0;
}
.empty-state .btn { margin-top: 1rem; }

/* ── Icon circles ─────────────────────────────── */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.icon-circle-sm  { width: 76px;  height: 76px; }
.icon-circle-lg  { width: 100px; height: 100px; }
.icon-circle-sm i { font-size: 2rem; }
.icon-circle-lg i { font-size: 2.75rem; }
.icon-circle-primary   { background: var(--ib-primary-glow); }
.icon-circle-primary i { color: var(--ib-primary); }
.icon-circle-success   { background: rgba(16,185,129,.12); }
.icon-circle-success i { color: #059669; }
.icon-circle-warning   { background: rgba(245,158,11,.12); }
.icon-circle-warning i { color: #d97706; }
.icon-circle-danger    { background: rgba(239,68,68,.1); }
.icon-circle-danger i  { color: #dc2626; }

/* ── Status text (replaces inline color styles) ── */
.text-status-ok     { color: #059669; }
.text-status-warn   { color: #d97706; }
.text-status-danger { color: #dc2626; }

/* ── Poster & QR images ───────────────────────── */
.poster-img {
  max-height: min(400px, 50vh); object-fit: cover;
  width: 100%; border-radius: var(--ib-radius);
}
.qr-img { max-width: min(280px, 80vw); }

/* ── Stat row (event detail sidebar) ──────────── */
.stat-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; padding: .75rem 0;
  gap: .75rem;
  flex-wrap: wrap;
}
.stat-row + .stat-row { border-top: 1px solid var(--ib-border); }
.stat-row .stat-row-label {
  font-size: .875rem; color: var(--ib-text);
  display: flex; align-items: center; gap: .4rem;
  flex: 1 1 9rem;
  min-width: 0;
}
.stat-row .badge,
.stat-row .fw-bold {
  margin-left: auto;
  flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .stat-row {
    flex-direction: column;
    gap: .35rem;
  }
  .stat-row .stat-row-label {
    flex: 1 1 auto;
  }
  .stat-row .badge,
  .stat-row .fw-bold {
    margin-left: 0;
  }
}

/* ── Utility ──────────────────────────────────── */
.text-accent { color: var(--ib-accent); }

/* ── Navbar logout ────────────────────────────── */
.btn-nav-logout {
  color: var(--ib-text-muted);
  font-size: .85rem;
  font-weight: 500;
  padding: .375rem .75rem;
  border: 1px solid var(--ib-border);
  border-radius: .5rem;
  transition: all var(--ib-transition);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1;
  background: transparent;
  white-space: nowrap;
}
.btn-nav-logout:hover {
  color: var(--ib-dark);
  background: var(--ib-warm);
  border-color: #d6d3d1;
}
.btn-nav-logout i { font-size: .85rem; }

/* ── Org chip ──────────────────────────────────── */
.nav-org-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ib-primary);
  background: var(--ib-primary-soft);
  padding: .25rem .65rem;
  border-radius: 999px;
  text-decoration: none;
  transition: all var(--ib-transition);
  white-space: nowrap;
  line-height: 1;
}
.nav-org-chip:hover {
  background: var(--ib-primary-glow);
  color: var(--ib-primary-hover);
}
.nav-org-chip i { font-size: .7rem; }
.nav-org-chip .org-name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 991.98px) {
  .nav-org-chip {
    max-width: min(100%, 22rem);
  }
  .nav-org-chip .org-name {
    max-width: calc(100vw - 12rem);
  }
}

/* ── Public dark navbar ───────────────────────── */
.navbar-ib-dark {
  background: var(--ib-dark);
  border-bottom: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.navbar-ib-dark .navbar-brand { color: #fff !important; }
.navbar-ib-dark .navbar-brand i { color: rgba(255,255,255,.7); }

/* ── Invitation public pages ──────────────────── */
.invitation-hero {
  text-align: center; padding: 1.5rem 0 .75rem;
}
.invitation-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800; letter-spacing: -.03em;
  margin-bottom: .35rem;
  color: var(--ib-dark);
}
.invitation-hero .invitation-meta {
  font-size: .95rem; color: var(--ib-text-muted);
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; flex-wrap: wrap;
}
.invitation-greeting {
  background: linear-gradient(135deg, var(--ib-primary-glow), rgba(6,214,160,.08));
  border-radius: var(--ib-radius);
  padding: 1.75rem; text-align: center;
  border: 1px solid rgba(99,102,241,.1);
}
.invitation-greeting p:last-child { margin-bottom: 0; }

/* Public page wrapper — reduced card separation */
.invitation-section {
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius);
  box-shadow: var(--ib-shadow);
  overflow: hidden;
}
.invitation-section .section-row {
  padding: 1.25rem 1.5rem;
}
.invitation-section .section-row + .section-row {
  border-top: 1px solid var(--ib-border);
}
.invitation-section .section-row h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ib-text-muted);
  font-weight: 600;
  margin-bottom: .75rem;
}

/* ── Misc ──────────────────────────────────────── */
.input-group-text {
  background: var(--ib-warm);
  border: 1.5px solid var(--ib-border);
  color: var(--ib-text-muted);
  font-size: var(--ib-text-base);
  border-top-left-radius: var(--ib-radius-sm);
  border-bottom-left-radius: var(--ib-radius-sm);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
/* Small variant inside input-group-sm */
.input-group-sm > .input-group-text {
  font-size: var(--ib-text-sm);
  padding: .25rem .5rem;
}

/* Fix Bootstrap input-group join (we use 1.5px borders, BS expects 1px) */
.input-group {
  --bs-border-width: 1.5px;
}
.input-group > .form-control,
.input-group > .form-select {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: var(--ib-radius-sm);
  border-bottom-right-radius: var(--ib-radius-sm);
}
/* Standalone selects (not inside input-group) keep full radius */
.form-select-sm:not(.input-group .form-select-sm) {
  font-size: var(--ib-text-sm);
  border-radius: var(--ib-radius-sm);
}
.pagination .page-link {
  border-radius: var(--ib-radius-sm);
  margin: 0 .15rem;
  font-size: var(--ib-text-sm);
  font-weight: 600;
  border: 1px solid var(--ib-border);
  color: var(--ib-text);
}
.pagination .page-item.active .page-link {
  background: var(--ib-primary);
  border-color: var(--ib-primary);
}

/* ── Responsive list metadata ─────────────────── */
.list-item-title {
  display: inline-block;
  font-weight: 600;
}
.list-item-meta {
  display: none;
}
@media (max-width: 767.98px) {
  .list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .2rem;
    font-size: .75rem;
    color: var(--ib-text-muted);
    line-height: 1.35;
  }
  .list-item-meta span + span::before {
    content: '·';
    margin-right: .35rem;
    opacity: .55;
  }
}

/* ── Mobile filter toolbar ────────────────────── */
@media (max-width: 575.98px) {
  .filter-toolbar .form-select,
  .filter-toolbar-actions,
  .filter-toolbar-actions .btn {
    width: 100%;
  }
}

/* ── Dashboard hero ───────────────────────────── */
.dashboard-stack {
  display: grid;
  gap: 1.5rem;
}
.dashboard-hero {
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(6,214,160,.05) 52%, rgba(255,255,255,.92) 100%);
  border: 1px solid rgba(99,102,241,.12);
  border-radius: var(--ib-radius-lg);
  padding: 2rem;
  box-shadow: var(--ib-shadow-md);
}
.dashboard-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.dashboard-hero-copy {
  max-width: 36rem;
}
.dashboard-greeting {
  font-size: var(--ib-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ib-primary);
  margin-bottom: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  opacity: .75;
}
.dashboard-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  margin-bottom: .35rem;
  letter-spacing: -.025em;
}
.dashboard-subtitle {
  font-size: var(--ib-text-base);
  color: var(--ib-text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}
.dashboard-hero-actions {
  flex-shrink: 0;
}
.dashboard-hero-action {
  min-width: 13rem;
}
.dashboard-stats {
  margin-bottom: 0;
}
@media (max-width: 575.98px) {
  .dashboard-stack {
    gap: 1.25rem;
  }
  .dashboard-hero {
    padding: 1.5rem 1.1rem;
    text-align: center;
  }
  .dashboard-hero-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-hero-copy {
    max-width: none;
  }
  .dashboard-hero-action {
    width: 100%;
    min-width: 0;
  }
}

/* ── Dashboard events card wrapper ────────────── */
.dashboard-events-card { overflow: hidden; }
.dashboard-events-header {
  padding-bottom: 1rem;
}
.dashboard-events-card > .card-body { padding-bottom: 0; }

.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Dashboard section heading ────────────────── */
.dashboard-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  color: var(--ib-dark);
}
.dashboard-section-title i {
  color: var(--ib-primary);
  opacity: .55;
  font-size: .9rem;
}
.dashboard-section-subtitle {
  margin: .3rem 0 0;
  color: var(--ib-text-muted);
  font-size: .875rem;
  line-height: 1.45;
}

/* ── Dashboard event list ─────────────────────── */
.dashboard-event-list {
  display: flex;
  flex-direction: column;
}
.dashboard-event-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
  text-decoration: none;
  color: var(--ib-text);
  transition: background var(--ib-transition);
  border-top: 1px solid var(--ib-border);
}
.dashboard-event-row:hover {
  background: var(--ib-primary-soft);
  color: var(--ib-text);
}

/* Date tile — replaces the generic icon */
.dashboard-event-date {
  width: 44px;
  height: 44px;
  border-radius: var(--ib-radius-sm);
  background: linear-gradient(135deg, rgba(99,102,241,.07), rgba(99,102,241,.03));
  border: 1px solid rgba(99,102,241,.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.dashboard-event-day {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ib-dark);
}
.dashboard-event-month {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ib-primary);
  margin-top: 1px;
}

/* Info block */
.dashboard-event-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: .15rem;
}
.dashboard-event-name-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.dashboard-event-name {
  font-weight: 600;
  font-size: var(--ib-text-base);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-event-name-row .badge {
  flex-shrink: 0;
  font-size: .65rem;
  padding: .2em .5em;
}
.dashboard-event-meta {
  font-size: .775rem;
  color: var(--ib-text-muted);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.dashboard-event-guests-inline {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  color: var(--ib-text-muted);
  font-size: .75rem;
}
.dashboard-event-guests-inline::before {
  content: "·";
  margin-right: .15rem;
  color: var(--ib-text-muted);
  opacity: .5;
}

/* Arrow */
.dashboard-event-arrow {
  color: var(--ib-text-muted);
  font-size: .8rem;
  flex-shrink: 0;
  transition: transform var(--ib-transition);
}
.dashboard-event-row:hover .dashboard-event-arrow {
  transform: translateX(2px);
  color: var(--ib-primary);
}

/* Mobile tweaks */
@media (max-width: 575.98px) {
  .dashboard-section-head {
    flex-direction: column;
  }
  .dashboard-section-action {
    width: 100%;
    justify-content: center;
  }
  .dashboard-event-row { padding: .75rem .85rem; gap: .75rem; }
  .dashboard-event-date { width: 40px; height: 40px; }
  .dashboard-event-day { font-size: .95rem; }
  .dashboard-event-name-row .badge { display: none; }
}

/* ── Login page ───────────────────────────────── */
.login-page {
  background: linear-gradient(160deg, var(--ib-warm) 0%, var(--ib-bg) 50%, var(--ib-warm) 100%);
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
}
.login-page > .container {
  width: 100%;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 34rem;
  margin: 0 auto;
}
.auth-hero {
  text-align: center;
  padding: .25rem .75rem 0;
}
.auth-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 .35rem;
}
.auth-hero p {
  margin: 0;
  color: var(--ib-text-muted);
  font-size: 1rem;
  line-height: 1.55;
}
.auth-card {
  border-radius: 1.25rem;
  border-color: rgba(99,102,241,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,247,245,.92));
  box-shadow: var(--ib-shadow-lg);
}
.auth-card .card-body {
  padding: 1.6rem;
}
.auth-card .form-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ib-text-muted);
}
.auth-card .input-group:focus-within .input-group-text {
  border-color: var(--ib-primary);
  color: var(--ib-primary);
  background: rgba(99,102,241,.06);
}
.auth-switch {
  margin: 0;
  text-align: center;
  color: var(--ib-text-muted);
  font-size: .95rem;
}
.auth-switch a {
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.auth-choice-list {
  gap: .75rem;
}
.auth-choice-btn {
  border-radius: .9rem;
  justify-content: flex-start;
  min-height: 3.25rem;
  padding-inline: 1rem !important;
}
.auth-choice-btn span {
  min-width: 0;
  white-space: normal;
}
@media (max-width: 575.98px) {
  .login-page {
    padding: 2rem .85rem;
  }
  .auth-panel {
    gap: .85rem;
  }
  .auth-hero {
    padding-inline: .25rem;
  }
  .auth-card .card-body {
    padding: 1.2rem;
  }
  .form-fieldset {
    padding: .95rem 1rem .9rem;
  }
}

/* ── RSVP option cards ─────────────────────────── */
.rsvp-choices {
  display: flex; flex-direction: column; gap: .5rem;
  margin-bottom: 1.25rem;
}
.rsvp-option {
  position: relative;
  border: 1.5px solid var(--ib-border);
  border-radius: var(--ib-radius-sm);
  padding: .9rem 1rem .9rem 2.75rem;
  cursor: pointer;
  transition: all var(--ib-transition);
  background: var(--ib-surface);
  margin: 0;
}
@media (max-width: 575.98px) {
  .rsvp-option {
    padding: .85rem .85rem .85rem 2.45rem;
  }
}
.rsvp-option:hover {
  border-color: rgba(99,102,241,.3);
  background: var(--ib-primary-soft);
}
.rsvp-option:has(input:checked) {
  border-color: var(--ib-primary);
  background: var(--ib-primary-soft);
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.rsvp-option .form-check-input {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
.rsvp-option .form-check-label {
  font-weight: 500;
  cursor: pointer;
  display: block;
}

/* ── Action dropdown (guest list) ──────────────── */
.dropdown-menu {
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius-sm);
  box-shadow: var(--ib-shadow-md);
  padding: .35rem;
  font-size: var(--ib-text-sm);
  list-style: none !important;
  margin: 0;
}
.dropdown-menu li {
  list-style: none !important;
}
.dropdown-menu .dropdown-item {
  border-radius: .375rem;
  padding: .45rem .75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: background var(--ib-transition);
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: var(--ib-primary-soft);
  color: var(--ib-text);
}
.dropdown-menu .dropdown-item.text-danger:hover {
  background: rgba(239,68,68,.06);
}
.dropdown-menu .dropdown-divider {
  margin: .25rem 0;
  border-color: var(--ib-border);
}

/* ── Confirm modal ────────────────────────────── */
.modal-confirm {
  display: none;               /* safety: guarantee hidden until .show */
}
.modal-confirm .modal-content {
  border: none;
  border-radius: var(--ib-radius);
  box-shadow: var(--ib-shadow-lg);
  max-width: 90vw;
}
.modal-confirm .modal-header {
  border-bottom: 1px solid var(--ib-border);
  padding: 1.25rem 1.5rem;
}
.modal-confirm .modal-body {
  padding: 1.5rem;
  color: var(--ib-text);
  font-size: var(--ib-text-base);
  line-height: 1.6;
}
.modal-confirm .modal-footer {
  border-top: 1px solid var(--ib-border);
  padding: 1rem 1.5rem;
  gap: .5rem;
}
@media (max-width: 575.98px) {
  .modal-confirm .modal-header {
    padding: 1rem 1.25rem;
  }
  .modal-confirm .modal-body {
    padding: 1rem 1.25rem;
  }
  .modal-confirm .modal-footer {
    padding: .9rem 1.25rem 1.1rem;
  }
}

/* ── Toast container ──────────────────────────── */
.toast-container-ib {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1090;
  pointer-events: none;
}
.toast-container-ib .toast.show { pointer-events: auto; }
@media (max-width: 575.98px) {
  .toast-container-ib {
    bottom: .75rem;
    right: .75rem;
  }
}
.toast-ib {
  background: var(--ib-dark);
  color: #fff;
  border: none;
  border-radius: var(--ib-radius-sm);
  box-shadow: var(--ib-shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
}
.toast-ib.show {
  opacity: 1;
  visibility: visible;
}
.toast-ib .toast-body {
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toast-ib .toast-body i { font-size: 1rem; opacity: .8; }

/* ── Submit spinner ───────────────────────────── */
.btn .spinner-border-sm {
  width: .875rem;
  height: .875rem;
  border-width: 2px;
  margin-right: .35rem;
  display: none;
}
.btn.is-loading .spinner-border-sm { display: inline-block; }

/* ── Footer brand ─────────────────────────────── */
.footer-brand-icon {
  color: var(--ib-primary);
  opacity: .5;
}

/* ── Narrow input helper ──────────────────────── */
.input-narrow { max-width: 180px; }

/* ── Role badges ──────────────────────────────── */
.badge-role-owner  { background: var(--ib-dark); color: #fff; }
.badge-role-admin  { background: var(--ib-primary); color: #fff; }
.badge-role-editor { background: #0ea5e9; color: #fff; }
.badge-role-viewer { background: #a8a29e; color: #fff; }

/* ── btn-success override ─────────────────────── */
.btn-success {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 1px 3px rgba(16,185,129,.25);
}
.btn-success:hover, .btn-success:focus {
  background: #059669;
  border-color: #059669;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

/* ── Focus-visible ────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ib-primary);
  outline-offset: 2px;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ib-primary-glow);
}
.form-control:focus-visible,
.form-select:focus-visible {
  outline: none;
}
.nav-link:focus-visible,
.navbar-brand:focus-visible {
  outline: 2px solid var(--ib-primary);
  outline-offset: -2px;
  border-radius: .5rem;
}
.page-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ib-primary-glow);
}

/* ── RSVP :has() fallback ─────────────────────── */
.rsvp-option.is-selected {
  border-color: var(--ib-primary);
  background: var(--ib-primary-soft);
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}

/* ── Detail header (event/item detail pages) ──── */
.detail-header {
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: var(--ib-radius);
  box-shadow: var(--ib-shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.detail-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.detail-header h1 {
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  margin-bottom: .2rem;
}
.detail-header h1 i { color: var(--ib-primary); opacity: .7; }
.detail-header .detail-meta {
  color: var(--ib-text-muted);
  font-size: .925rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.detail-header .detail-badge { margin-top: .65rem; }
.detail-header .detail-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .detail-header { padding: 1.25rem; }
  .detail-header .detail-actions { width: 100%; }
  .detail-header .detail-actions .btn { flex: 1; }
}

/* ── Confirm page pattern ─────────────────────── */
.confirm-page {
  text-align: center;
  padding: 2rem 1.5rem;
}
.confirm-page .confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.confirm-page .confirm-icon-danger {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.1);
}
.confirm-page .confirm-icon-danger i {
  font-size: 1.75rem;
  color: #dc2626;
}
.confirm-page h1 {
  font-size: 1.35rem;
  margin-bottom: .35rem;
}
.confirm-page .confirm-desc {
  color: var(--ib-text-muted);
  font-size: var(--ib-text-base);
  max-width: 28rem;
  margin-inline: auto;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}
.confirm-page .confirm-details {
  text-align: left;
  background: var(--ib-bg);
  border-radius: var(--ib-radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--ib-border);
}
.confirm-page .confirm-details dl { margin-bottom: 0; }
.confirm-page .confirm-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 575.98px) {
  .confirm-page { padding: 1.5rem 1rem; }
  .confirm-page .confirm-actions { flex-direction: column; }
  .confirm-page .confirm-actions .btn { width: 100%; }
}

/* ── Public page ──────────────────────────────── */
.public-main {
  background: linear-gradient(175deg, var(--ib-warm) 0%, var(--ib-bg) 60%);
  padding-top: 2.5rem !important;
  padding-bottom: 3rem !important;
}
.public-page {
  max-width: 640px;
  margin: 0 auto;
}

/* ── Form card header ─────────────────────────── */
.form-card-header {
  padding-bottom: 1rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid var(--ib-border);
}
.form-card-header h1 {
  font-size: 1.3rem;
  margin-bottom: .15rem;
}
.form-card-header h1 i {
  color: var(--ib-primary);
  opacity: .7;
}
.form-card-header .text-muted {
  font-size: var(--ib-text-base);
  margin-bottom: 0;
}
.form-actions {
  margin-top: .25rem;
  padding-top: 1rem;
}

/* ── Form validation hint (progressive) ───────── */
.mb-3:has(> .text-danger) .form-control,
.mb-3:has(> .text-danger) .form-select {
  border-color: #dc3545;
}
.btn.is-loading .btn-label { opacity: 0; position: absolute; }

/* ── Card section header (above tables / filter bars) ── */
.card-header-ib {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--ib-border);
  background: linear-gradient(180deg, var(--ib-warm), var(--ib-bg));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .card-header-ib { padding: 1rem 1.75rem; }
}
.card-header-title {
  font-size: .775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ib-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.card-header-title i {
  color: var(--ib-primary);
  opacity: .6;
  font-size: .85rem;
}

/* ── Card filter bar (search + filter toolbar inside card) ── */
.card-filter-bar {
  padding: .75rem 1.35rem;
  border-bottom: 1px solid var(--ib-border);
  background: var(--ib-bg);
}
@media (min-width: 768px) {
  .card-filter-bar { padding: .85rem 1.75rem; }
}
@media (max-width: 575.98px) {
  .card-filter-bar { padding: .65rem 1rem; }
}
.card-filter-bar .form-control,
.card-filter-bar .form-select {
  background: var(--ib-surface);
}

/* ── Card footer CTA ──────────────────────────── */
.card-footer-cta {
  border-top: 1px solid var(--ib-border);
  padding: 1rem 1.35rem;
  background: transparent;
}
@media (min-width: 768px) {
  .card-footer-cta { padding: 1rem 1.75rem; }
}

/* ── Sticky sidebar (lg+) ─────────────────────── */
@media (min-width: 992px) {
  .sidebar-sticky { position: sticky; top: 1.5rem; }
}

/* ── Team / member avatar ─────────────────────── */
.team-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ib-primary-soft);
  color: var(--ib-primary);
  font-size: .725rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: .01em;
}

/* ── Page header meta strip ───────────────────── */
.page-header-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .825rem;
  color: var(--ib-text-muted);
  margin-top: .25rem;
}
.page-header-meta i { font-size: .825rem; opacity: .7; }
.page-header-meta .meta-sep { opacity: .4; }

/* ── Utilities (replaces inline styles) ─────── */
.progress-xs { height: 5px; }
.text-2xs { font-size: .7rem; }
.text-xs-custom { font-size: .75rem; }
