@charset "UTF-8";
:root {
  --ink: #16171f;
  --ink-2: #3a3d4d;
  --muted: #6c7384;
  --dim: #9aa0ad;
  --line: #ebecf1;
  --line-2: #e0e2ea;
  --bg: #f6f6f9;
  --card: #ffffff;
  --brand: #1a1a2e;
  --accent: var(--tix-accent, #e94560);
  --accent-ink: #ffffff;
  --ok: #0f9b6c;
  --ok-bg: #e7f6ef;
  --warn: #b7791f;
  --warn-bg: #fbf3e2;
  --bad: #d64550;
  --bad-bg: #fdecee;
  --info: #2563c9;
  --info-bg: #e9f0fd;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,21,31,.05);
  --shadow: 0 6px 24px -8px rgba(20,21,31,.14);
  --ease: 180ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Fira Sans", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  margin: 0;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p {
  margin-top: 0;
}

.text-secondary, .text-muted {
  color: var(--muted) !important;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}

a:hover {
  text-decoration: none;
}

code, .font-monospace, .mono {
  font-family: "Fira Code", ui-monospace, monospace;
  font-feature-settings: "tnum" 1;
}

code {
  background: #f1f2f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.92em;
}

img, svg {
  vertical-align: middle;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 1;
  margin: 1rem 0;
}

:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent) !important;
  border-radius: 8px;
}

/* Cards — flat, hairline border, whisper shadow */
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  word-wrap: break-word;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.card.tix-card, .card.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  padding: 16px 20px;
  font-size: 14.5px;
}

.card-body {
  flex: 1 1 auto;
  padding: 22px;
}

/* Muted info strip at the top of a card (e.g. an explanatory note above a table) */
.card-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.card-note .i {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--dim);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  padding: 9px 16px;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  background: transparent;
  color: var(--ink);
  transition: all var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled, .btn.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn svg, .btn .i {
  width: 16px;
  height: 16px;
}

.btn-primary, .btn-tix {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(20, 21, 31, 0.12);
}

.btn-primary:hover, .btn-tix:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--ink-2);
  border-color: var(--line-2);
}

.btn-outline-secondary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-outline-danger {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

.btn-outline-danger:hover {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.btn-success {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.btn-success:hover {
  background: color-mix(in srgb, var(--ok) 88%, #000);
  border-color: color-mix(in srgb, var(--ok) 88%, #000);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 13px 22px;
  font-size: 16px;
}

/* Forms */
.form-label {
  display: inline-block;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.form-label .req {
  color: var(--accent);
} /* required marker — same as .label .req in modals */
.form-control, .form-select {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.form-control::placeholder {
  color: var(--dim);
}

.form-control:disabled {
  background: var(--hover);
  color: var(--muted);
  cursor: not-allowed;
}

/* File inputs — the native "Choose file" button reads as our outline button in both themes. */
.form-control[type=file] {
  padding: 6px 13px 6px 6px;
}

.form-control::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  padding: 4px 12px;
  margin-right: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--ease);
}

.form-control::file-selector-button:hover {
  background: var(--hover);
}

.form-control-sm, .form-select-sm {
  padding: 7px 11px;
  font-size: 13px;
}

.form-select {
  appearance: none;
  padding-right: 36px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b94a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Colour pickers — rounded swatch inside the field frame, optional live hex readout beside it. */
.form-control-color {
  width: 3rem;
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

.form-control-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.form-control-color::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

.form-control-color::-moz-color-swatch {
  border: 0;
  border-radius: 6px;
}

.colour-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colour-field .form-control-color {
  flex: none;
}

.colour-field code {
  font-size: 12.5px;
}

.form-text {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 5px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.form-check-inline {
  display: inline-flex;
  margin-right: 16px;
}

.form-check-input {
  width: 1.05em;
  height: 1.05em;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check-label {
  font-size: 13.5px;
}

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group > :not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group > :not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: #f4f4f7;
  border: 1px solid var(--line-2);
  color: var(--muted);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  vertical-align: top;
  color: var(--ink);
  margin: 0;
}

.table > :not(caption) > * > * {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

/* `.align-middle` on a <table> must target the cells — vertical-align doesn't cascade from
   the table element — so every cell stays centred even when one column wraps to two lines. */
.table.align-middle > :not(caption) > * > * {
  vertical-align: middle;
}

.table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.table-sm > :not(caption) > * > * {
  padding: 8px 12px;
}

.table-hover > tbody > tr {
  transition: background var(--ease);
}

.table-hover > tbody > tr:hover > * {
  background: #fafafc;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Data-table links read as ink, not coral — accent only on hover. */
.table tbody td a {
  color: var(--ink);
  font-weight: 500;
}

.table tbody td a:hover {
  color: var(--accent);
}

.table tbody td .small a, .table tbody td a.small {
  font-weight: 400;
}

/* Badges — soft tinted pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  line-height: 1;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  padding: 0.4em 0.7em;
  border-radius: 999px;
}

.badge.text-bg-success, .badge.bg-success {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.text-bg-warning, .badge.bg-warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.text-bg-danger, .badge.bg-danger {
  background: var(--bad-bg);
  color: var(--bad);
}

.badge.text-bg-info, .badge.bg-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge.text-bg-secondary, .badge.bg-secondary {
  background: #eef0f4;
  color: var(--ink-2);
}

.badge.text-bg-light, .badge.bg-light {
  background: #f1f2f6;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.badge.text-bg-dark {
  background: #2a2c3a;
  color: #fff;
}

/* Alerts */
.alert {
  border: 1px solid;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 14px;
}

.alert-success {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 26%, transparent);
  color: #0a6b4a;
}

.alert-warning {
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn) 26%, transparent);
  color: #8a5a12;
}

.alert-danger {
  background: var(--bad-bg);
  border-color: color-mix(in srgb, var(--bad) 26%, transparent);
  color: #a82c36;
}

.alert-info {
  background: var(--info-bg);
  border-color: color-mix(in srgb, var(--info) 26%, transparent);
  color: #1d4f9e;
}

/* Progress (dashboard) */
.progress {
  display: flex;
  overflow: hidden;
  background: #eef0f4;
  border-radius: 999px;
}

.progress.sm {
  height: 6px;
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  background: var(--accent);
}

.progress-bar.bg-success {
  background: var(--ok);
}

/* Tabular numerals for data */
.num, td .num, .table td {
  font-variant-numeric: tabular-nums;
}

/* Icon helper sizing */
.i {
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  flex: none;
}

.i-lg {
  width: 22px;
  height: 22px;
}

/* Tixello client portal — generated from resources/scss/portal/. Do not edit directly. */
:root {
  --sidebar-w: 252px;
  --sidebar-bg: #fbfbfd;
  --field-bg: #ffffff;
  --hover: #f3f4f8;
  --accent-soft: rgba(233, 69, 96, 0.10);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent);
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --pshadow: 0 10px 30px -12px rgba(20, 21, 31, .25);
}

/* ---------- Dark theme: re-point shared + portal tokens ---------- */
[data-bs-theme=dark] {
  --ink: #e7ecf3;
  --ink-2: #c3c9d6;
  --muted: #8b94a6;
  --dim: #6a7385;
  --bg: #0d1017;
  --card: #151a23;
  --line: #232a36;
  --line-2: #2d3543;
  --sidebar-bg: #10141c;
  --field-bg: #1a212c;
  --hover: #1b222e;
  --topbar-bg: rgba(13, 16, 23, 0.82);
  --accent-soft: rgba(233, 69, 96, 0.16);
  --pshadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  /* Status tints readable on dark */
  --ok: #34d399;
  --ok-bg: rgba(52,211,153,.15);
  --warn: #fbbf24;
  --warn-bg: rgba(251,191,36,.15);
  --bad: #f87171;
  --bad-bg: rgba(248,113,113,.15);
  --info: #60a5fa;
  --info-bg: rgba(96,165,250,.15);
}

/* Re-skin the few hard light literals under dark */
[data-bs-theme=dark] body {
  background: var(--bg);
  color: var(--ink);
}

[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select {
  background-color: var(--field-bg);
  color: var(--ink);
  border-color: var(--line-2);
}

[data-bs-theme=dark] .form-control:disabled {
  background-color: var(--hover);
  color: var(--muted);
}

[data-bs-theme=dark] .form-control::placeholder {
  color: var(--dim);
}

[data-bs-theme=dark] .input-group-text {
  background: #1f2733;
  color: var(--muted);
  border-color: var(--line-2);
}

[data-bs-theme=dark] .table-hover > tbody > tr:hover > * {
  background: var(--hover);
}

[data-bs-theme=dark] .badge.text-bg-light {
  background: #232c3a !important;
  color: var(--ink-2) !important;
  border-color: var(--line-2);
}

[data-bs-theme=dark] .badge.text-bg-secondary {
  background: #232c3a !important;
  color: var(--ink-2) !important;
}

[data-bs-theme=dark] .progress {
  background: var(--line);
}

[data-bs-theme=dark] code {
  background: var(--field-bg);
  color: #cdd7ea;
  border-color: var(--line-2);
}

/* ---------- Layout primitives + utilities ----------
   Reimplements the exact subset of Bootstrap the portal used, so Bootstrap can be
   dropped. Grid + gutters + the flex/spacing/text utilities, same class names. */
/* Grid (Bootstrap-compatible: .row + .col* + .g-* gutters) */
.row {
  --gx: 1.5rem;
  --gy: 0rem;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--gy));
  margin-right: calc(-0.5 * var(--gx));
  margin-left: calc(-0.5 * var(--gx));
}

.row > * {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  margin-top: var(--gy);
  padding-right: calc(0.5 * var(--gx));
  padding-left: calc(0.5 * var(--gx));
}

.g-2 {
  --gx: .5rem;
  --gy: .5rem;
}

.g-3 {
  --gx: 1rem;
  --gy: 1rem;
}

.g-4 {
  --gx: 1.5rem;
  --gy: 1.5rem;
}

.col {
  flex: 1 0 0%;
}

.col-1 {
  flex: 0 0 auto;
  width: 8.3333333333%;
}

.col-2 {
  flex: 0 0 auto;
  width: 16.6666666667%;
}

.col-3 {
  flex: 0 0 auto;
  width: 25%;
}

.col-4 {
  flex: 0 0 auto;
  width: 33.3333333333%;
}

.col-5 {
  flex: 0 0 auto;
  width: 41.6666666667%;
}

.col-6 {
  flex: 0 0 auto;
  width: 50%;
}

.col-7 {
  flex: 0 0 auto;
  width: 58.3333333333%;
}

.col-8 {
  flex: 0 0 auto;
  width: 66.6666666667%;
}

.col-9 {
  flex: 0 0 auto;
  width: 75%;
}

.col-10 {
  flex: 0 0 auto;
  width: 83.3333333333%;
}

.col-11 {
  flex: 0 0 auto;
  width: 91.6666666667%;
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 auto;
    width: 33.3333333333%;
  }
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-md-8 {
    flex: 0 0 auto;
    width: 66.6666666667%;
  }
}
@media (min-width: 992px) {
  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.3333333333%;
  }
  .col-lg-5 {
    flex: 0 0 auto;
    width: 41.6666666667%;
  }
  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-lg-7 {
    flex: 0 0 auto;
    width: 58.3333333333%;
  }
  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.6666666667%;
  }
}
/* Display / flex */
.d-flex {
  display: flex !important;
}

.d-block {
  display: block !important;
}

.d-none {
  display: none !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

/* Sizing */
.w-100 {
  width: 100% !important;
}

.w-auto {
  width: auto !important;
}

.h-100 {
  height: 100% !important;
}

/* Text */
.text-center {
  text-align: center !important;
}

.text-end {
  text-align: right !important;
}

.text-nowrap {
  white-space: nowrap !important;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-success {
  color: var(--ok) !important;
}

.text-tix-accent {
  color: var(--accent) !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

.small {
  font-size: 0.875em;
}

.align-middle {
  vertical-align: middle !important;
}

/* Heading helper classes */
.h5 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.h6 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* Spacing scale (Bootstrap: 0, 1=.25, 2=.5, 3=1, 4=1.5 rem) */
.m-0 {
  margin: 0 !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.ms-0 {
  margin-left: 0 !important;
}

.me-0 {
  margin-right: 0 !important;
}

.my-0 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.mx-0 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.p-0 {
  padding: 0 !important;
}

.pt-0 {
  padding-top: 0 !important;
}

.pb-0 {
  padding-bottom: 0 !important;
}

.ps-0 {
  padding-left: 0 !important;
}

.pe-0 {
  padding-right: 0 !important;
}

.py-0 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.px-0 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.m-1 {
  margin: 0.25rem !important;
}

.mt-1 {
  margin-top: 0.25rem !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.ms-1 {
  margin-left: 0.25rem !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}

.my-1 {
  margin-top: 0.25rem !important;
  margin-bottom: 0.25rem !important;
}

.mx-1 {
  margin-left: 0.25rem !important;
  margin-right: 0.25rem !important;
}

.p-1 {
  padding: 0.25rem !important;
}

.pt-1 {
  padding-top: 0.25rem !important;
}

.pb-1 {
  padding-bottom: 0.25rem !important;
}

.ps-1 {
  padding-left: 0.25rem !important;
}

.pe-1 {
  padding-right: 0.25rem !important;
}

.py-1 {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

.px-1 {
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.m-2 {
  margin: 0.5rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.my-2 {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.mx-2 {
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.pt-2 {
  padding-top: 0.5rem !important;
}

.pb-2 {
  padding-bottom: 0.5rem !important;
}

.ps-2 {
  padding-left: 0.5rem !important;
}

.pe-2 {
  padding-right: 0.5rem !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.px-2 {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.m-3 {
  margin: 1rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.ms-3 {
  margin-left: 1rem !important;
}

.me-3 {
  margin-right: 1rem !important;
}

.my-3 {
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.mx-3 {
  margin-left: 1rem !important;
  margin-right: 1rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.pt-3 {
  padding-top: 1rem !important;
}

.pb-3 {
  padding-bottom: 1rem !important;
}

.ps-3 {
  padding-left: 1rem !important;
}

.pe-3 {
  padding-right: 1rem !important;
}

.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.m-4 {
  margin: 1.5rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.ms-4 {
  margin-left: 1.5rem !important;
}

.me-4 {
  margin-right: 1.5rem !important;
}

.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.mx-4 {
  margin-left: 1.5rem !important;
  margin-right: 1.5rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.pt-4 {
  padding-top: 1.5rem !important;
}

.pb-4 {
  padding-bottom: 1.5rem !important;
}

.ps-4 {
  padding-left: 1.5rem !important;
}

.pe-4 {
  padding-right: 1.5rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.px-4 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

/* ---------- Auth (login) — split-screen ---------- */
/* Page backdrop extends to the viewport edges; the split panel is capped to a
   centred "window" so it never stretches on ultrawide / oversized monitors. */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  /* Mirrors the brand-panel gradient (.auth-aside) at viewport scale so the
     card's dark edge melts into the page instead of reading as a hard box. */
  background: radial-gradient(1100px 700px at 72% -2%, rgba(233, 69, 96, 0.22), transparent 60%), radial-gradient(900px 760px at 2% 102%, rgba(233, 69, 96, 0.12), transparent 55%), linear-gradient(158deg, #20213a 0%, #14141f 72%);
}

.auth-split {
  width: 100%;
  max-width: 1440px;
  height: min(900px, 100dvh - 64px);
  min-height: 600px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  border-radius: 22px;
  /* No background of its own: each panel paints itself, and carries the matching corner
     radius, so a light fill can't bleed through the anti-aliased edge of the dark panel. */
  background: transparent;
  /* Soft diffuse depth only — no bright hairline, so the brand-side edge
     blends into the matching backdrop. */
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.55);
}

/* Brand panel */
.auth-aside {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: 22px 0 0 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  background: radial-gradient(680px 420px at 82% 6%, rgba(233, 69, 96, 0.4), transparent 60%), radial-gradient(620px 520px at 4% 98%, rgba(233, 69, 96, 0.2), transparent 55%), linear-gradient(158deg, #20213a 0%, #14141f 72%);
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 27px;
}

/* Three anchors: logo top-left, message centred in the remaining space, © foot bottom. */
.auth-aside-inner {
  position: relative;
  max-width: 430px;
  margin: auto 0;
  padding: 40px 0;
}

/* app.css forces all headings to var(--ink); keep the brand-panel heading white. */
.auth-aside h1, .auth-aside h2, .auth-aside h3 {
  color: #fff;
}

.auth-logo {
  position: relative;
  height: 42px;
  width: auto;
  align-self: flex-start;
}

.auth-tagline {
  font-size: 31px;
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}

.auth-lede {
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 30px;
  max-width: 40ch;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.9);
}

.auth-points .ap-ic {
  flex: none;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-points .ap-ic .i {
  width: 17px;
  height: 17px;
  color: #fff;
}

.auth-aside-foot {
  position: relative;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
}

.auth-aside-foot a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.auth-aside-foot a:hover {
  color: #fff;
}

/* Form panel */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  background: var(--bg);
  border-radius: 0 22px 22px 0;
}

.auth-form {
  width: 100%;
  max-width: 392px;
}

.auth-mark {
  display: block;
  margin-bottom: 36px;
}

/* On the split, the wordmark above the form only earns its place once the brand panel
   is hidden (mobile); the solo forgot/reset card has no panel, so it always keeps it. */
.auth-split .auth-mark {
  display: none;
}

.auth-mark img {
  height: 42px;
  width: auto;
}

.auth-mark .d, [data-bs-theme=dark] .auth-mark .l {
  display: none;
}

[data-bs-theme=dark] .auth-mark .d {
  display: inline-block;
}

/* Dark theme: keep the form panel a shade lighter than the brand panel plus a hairline,
   so the two halves still read as two panels rather than one dark slab. */
[data-bs-theme=dark] .auth-main {
  background: #161925;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-form h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 7px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 30px;
}

/* Larger, comfier controls for the focal login form (scoped — global forms unchanged) */
.auth-form .field {
  margin-bottom: 18px;
}

.auth-form .label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.auth-form .input {
  min-height: 48px;
  padding: 13px 15px;
  font-size: 15px;
  border-radius: 11px;
}

.auth-pw {
  position: relative;
}

.auth-pw .input {
  padding-right: 46px;
}

/* Scoped under .auth-pw so it outranks the generic [data-tooltip] { position: relative }
   utility, which would otherwise drop the button out of the field and into normal flow. */
.auth-pw .pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--dim);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--ease);
}

.pw-toggle:hover {
  color: var(--ink);
  background: var(--hover);
}

.pw-toggle .i {
  width: 17px;
  height: 17px;
}

.pw-toggle .eye-off {
  display: none;
}

.pw-toggle.on .eye {
  display: none;
}

.pw-toggle.on .eye-off {
  display: inline;
}

.auth-submit {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 11px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 38%, transparent);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 26%, transparent);
}

.auth-meta {
  color: var(--dim);
  font-size: 12.5px;
  text-align: center;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.auth-meta a {
  color: var(--muted);
  text-decoration: none;
}

.auth-meta a:hover {
  color: var(--ink);
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-link {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.caps-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--warn);
}

.caps-warn .i {
  width: 14px;
  height: 14px;
}

.auth-submit[disabled] {
  opacity: 0.82;
  cursor: default;
}

/* Flash / error alerts sit above the form — give them breathing room and match the field radius. */
.auth-form .alert {
  margin-bottom: 18px;
  border-radius: 11px;
}

/* Loading spinner during the full-page sign-in POST (button text swaps to "Signing in…"). */
.js-submit-loading .auth-submit[disabled]::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
  border-top-color: var(--accent-ink);
  animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Keep browser autofill on-brand instead of the default yellow/blue wash (both themes). */
.auth-form .input:-webkit-autofill,
.auth-form .input:-webkit-autofill:hover,
.auth-form .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-form .input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset, var(--ring);
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit, .auth-submit:hover, .auth-submit:active {
    transform: none;
  }
  .js-submit-loading .auth-submit[disabled]::before {
    animation: none;
  }
}
/* Single-column auth pages (forgot / reset) — a centred card that mirrors the
   login's form panel, sitting on the same dark backdrop provided by .auth. */
.auth-solo {
  width: 100%;
  max-width: 448px;
  border-radius: 22px;
  background: var(--bg);
  padding: 52px 44px;
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.55);
}

.auth-solo .auth-form {
  max-width: none;
}

/* Short viewports (e.g. small laptops with browser chrome): the 600px card floor plus
   the 32px page inset would overflow, so let the split fill the viewport edge-to-edge. */
@media (max-height: 720px) and (min-width: 861px) {
  .auth {
    padding: 0;
  }
  .auth-split {
    height: auto;
    min-height: 100dvh;
    box-shadow: none;
    border-radius: 0;
  }
  .auth-aside, .auth-main {
    border-radius: 0;
  }
  .auth-main {
    padding: 32px 28px;
  }
}
@media (max-width: 860px) {
  .auth {
    padding: 0;
    background: var(--bg);
  }
  .auth-split {
    max-width: none;
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    box-shadow: none;
    border-radius: 0;
  }
  .auth-aside {
    display: none;
  }
  .auth-main {
    border-radius: 0;
  }
  .auth-split .auth-mark {
    display: block;
  }
  [data-bs-theme=dark] .auth-main {
    background: var(--bg);
    border-left: 0;
  }
  .auth-main {
    padding: 32px 20px;
    min-height: 100dvh;
  }
  .auth-solo {
    max-width: none;
    min-height: 100dvh;
    box-shadow: none;
    border-radius: 0;
    display: grid;
    align-content: center;
    padding: 32px 20px;
  }
}
/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 40;
}

.brand {
  display: block;
  padding: 6px 4px 0;
}

.brand-logo {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.brand .brand-dark {
  display: none;
}

[data-bs-theme=dark] .brand .brand-light {
  display: none;
}

[data-bs-theme=dark] .brand .brand-dark {
  display: block;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 14px 12px 6px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14.5px;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}

.nav a .i {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.nav a:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav a.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.nav a.active .i {
  opacity: 1;
  color: var(--accent);
}

.nav a.locked {
  color: var(--muted);
}

.nav a .nav-lock {
  width: 13px;
  height: 13px;
  margin-left: auto;
  opacity: 0.55;
}

/* ---------- Main / topbar ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

/* Inner row is capped + left-aligned to the same column as .content, so the action
   buttons sit above the content's right edge instead of the screen edge on wide screens. */
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  min-height: 72px;
  max-width: 1440px;
  width: 100%;
  padding: 14px 32px;
}

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

.topbar h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}

.topbar .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 1px;
}

.topbar .spacer {
  flex: 1;
}

/* Page actions ($topbar_action) live in one flex group so the responsive layer can drop
   them onto their own row instead of letting the bar overflow. Hidden when a page has none. */
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-actions:empty {
  display: none;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--ease);
}

/* Hide the mobile hamburger on desktop. Must come after .theme-toggle: the button
   carries both classes, so equal specificity means source order decides. Responsive
   (@use'd last) re-shows it below 900px. */
.menu-btn {
  display: none;
}

/* Drawer close (X) — same trick as .menu-btn: hidden here, re-shown by responsive under 900px. */
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 1;
}

/* Mobile-only account group at the foot of the drawer. */
.nav.nav-mobile {
  display: none;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.nav-mobile form {
  margin: 0;
}

.nav-signout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--bad);
  font: inherit;
  font-weight: 500;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}

.nav-signout .i {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.nav-signout:hover {
  background: var(--bad-bg);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--hover);
}

.theme-toggle .i {
  width: 18px;
  height: 18px;
}

.theme-toggle .moon {
  display: none;
}

[data-bs-theme=dark] .theme-toggle .sun {
  display: none;
}

[data-bs-theme=dark] .theme-toggle .moon {
  display: inline;
}

.content {
  padding: 26px 32px;
  max-width: 1440px;
  width: 100%;
}

/* ---------- Page head / helpers ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head h1, .page-head .ph-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-head .ph-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 16px;
  text-decoration: none;
}

.back:hover {
  color: var(--ink);
}

.back .i {
  width: 16px;
  height: 16px;
}

/* Eyebrow / section heading inside a card or page */
.section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 13px;
}

.section-title.tight {
  margin: 6px 0 0;
}

/* Toolbar / filter bar */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

/* Inputs/selects may shrink (down to a 140px floor) and wrap onto their own line instead of
   overflowing; flex-grow:0 (not 1) keeps them from expanding to soak up the row's leftover
   space, which on narrow lines left too little width for the Search button and made the
   browser mis-measure the row's scrollWidth as wider than the viewport even though nothing
   was visibly clipped. The submit button never grows or shrinks — its icon+label stay intact
   and it simply wraps to a new line if the row it's sharing doesn't have room. */
.toolbar > * {
  min-width: 0;
}

.toolbar .form-control, .toolbar .form-select {
  min-height: 40px;
  flex: 0 1 140px;
  min-width: 0;
}

.toolbar .form-control-sm, .toolbar .form-select-sm {
  min-height: 38px;
}

.toolbar .btn {
  flex: 0 0 auto;
}

/* Definition list (order / connect details) */
.dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 11px 14px;
  margin: 0;
}

.dl dt {
  color: var(--dim);
  font-size: 13px;
}

.dl dd {
  margin: 0;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
} /* long <code> (MCP URL, pi_…) wraps instead of pushing the page wide */
/* Statement variant — value column hugs the right, total rows get a hairline rule */
.dl.dl-stmt {
  grid-template-columns: 1fr auto;
}

.dl-stmt .rule {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* Empty states — leading icon sits in a soft disc */
.t-empty, .empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}

.empty.in-table {
  padding: 34px 16px;
}

.empty div {
  font-size: 14px;
}

.empty > .i {
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  padding: 13px;
  border-radius: 50%;
  background: var(--hover);
  color: var(--dim);
  margin-bottom: 14px;
}

/* Stat cards */
.stat {
  padding: 18px 20px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.stat-ic {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.stat-ic .i {
  width: 19px;
  height: 19px;
}

.stat-ic.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.stat-ic.info {
  background: var(--info-bg);
  color: var(--info);
}

.stat-ic.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.stat .k {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.stat .v {
  font-family: "Fira Code", monospace;
  font-size: 27px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.stat .v.accent {
  color: var(--accent);
}

.stat .v.success {
  color: var(--ok);
}

.stat .v.warning {
  color: var(--warn);
}

.stat .d {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* KPI row that always stays on one line (4 across), collapsing to 2-up only on phones. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
} /* free events: no revenue card */
@media (max-width: 575.98px) {
  .stat-grid, .stat-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Compact KPI — icon beside a stacked label/value; tighter than the default card. */
.stat-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}

.stat-compact .stat-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 0;
  flex: none;
}

.stat-compact .stat-ic .i {
  width: 17px;
  height: 17px;
}

.stat-compact .k {
  font-size: 10.5px;
}

.stat-compact .v {
  font-size: 20px;
  margin-top: 1px;
}

/* Segmented sub-nav (settings) */
.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
}

.seg a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.seg a:hover {
  color: var(--ink);
}

.seg a.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* File-preview thumbnail (branding logo, event cover image) */
.file-thumb {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--hover);
  max-width: 100%;
}

.file-thumb img {
  max-height: 80px;
  max-width: 240px;
  width: auto;
  height: auto;
  display: block;
}

/* Count footer below a list table */
.list-count {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
}

/* Deactivated table row (e.g. a soft-deleted team member) */
.is-deactivated td:not(.row-actions) {
  opacity: 0.55;
}

/* Layout helpers */
.panel-narrow {
  max-width: 680px;
}

.config-rail {
  position: sticky;
  top: 84px;
}

/* Row actions / icon buttons. Kept as a normal table cell (NOT display:flex — that collapses
   the cell below the row height); children lay out inline and the cell's vertical-align centres
   them, so the buttons line up even when another column wraps to two lines. */
.row-actions {
  text-align: right;
  white-space: nowrap;
}

.row-actions > * {
  display: inline-flex;
  vertical-align: middle;
  margin: 0;
}

.row-actions > * + * {
  margin-left: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: all var(--ease);
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.icon-btn.danger:hover {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

.icon-btn .i {
  width: 16px;
  height: 16px;
}

/* Extra button variants the modal helper + shell use */
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn-outline:hover {
  background: var(--hover);
  border-color: var(--line-2);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--hover);
  color: var(--ink);
}

.btn-ghost-danger {
  background: transparent;
  color: var(--bad);
  border-color: transparent;
}

.btn-ghost-danger:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--bad) 88%, #000);
  border-color: color-mix(in srgb, var(--bad) 88%, #000);
  color: #fff;
}

/* Bespoke form controls used inside modals (match Bootstrap sizing) */
.field {
  margin-bottom: 15px;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.label .req {
  color: var(--accent);
}

.input, .select, textarea.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--field-bg);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.input::placeholder {
  color: var(--dim);
}

.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  outline: none;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b94a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.help {
  font-size: 12px;
  color: var(--dim);
  margin-top: 6px;
}

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

.geo-field {
  position: relative;
  display: block;
}

.geo-ac {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.4);
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.geo-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-2);
  cursor: pointer;
}

.geo-ac-item + .geo-ac-item {
  border-top: 1px solid var(--line);
}

.geo-ac-item:hover, .geo-ac-item.is-active {
  background: var(--hover);
  color: var(--ink);
}

/* ---------- Modals (native <dialog>) ---------- */
/* The portal loads Bootstrap, whose .modal { display:none; position:fixed; top/left:0 }
   bleeds onto our native <dialog class="modal">: it hid the dialog (while showModal()
   still added a click-blocking backdrop → frozen page) and broke centring. Re-assert
   with dialog.modal / dialog.modal[open], which outrank Bootstrap's plain .modal. */
dialog.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, 100vw - 32px);
  max-width: 560px;
  height: fit-content;
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--ink);
  overflow: visible;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--pshadow);
}

dialog.modal:not([open]) {
  display: none;
}

dialog.modal.modal-lg {
  width: min(720px, 100vw - 32px);
  max-width: 720px;
}

dialog.modal::backdrop {
  background: rgba(15, 18, 28, 0.42);
  backdrop-filter: blur(3px);
}

dialog.modal[open] {
  display: block;
  animation: modal-in 0.16s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal-card {
  display: block;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.modal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--ease);
}

.modal-x:hover {
  background: var(--hover);
  color: var(--ink);
}

.modal-x .i, .modal-x svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 20px;
  max-height: min(68vh, 600px);
  overflow-y: auto;
}

.modal-body > p:only-child, .modal-body > p[data-modal-text] {
  margin: 0;
}

.modal-lead {
  margin: -4px 0 14px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.modal-errors {
  margin: 16px 20px -4px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bad-bg);
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
  color: #b3303a;
  font-size: 13.5px;
}

[data-bs-theme=dark] .modal-errors {
  color: #fda4a4;
}

.modal-errors > div + div {
  margin-top: 4px;
}

/* ---------- Account menu (topbar avatar dropdown) ---------- */
.acct {
  position: relative;
}

.acct > summary {
  list-style: none;
  cursor: pointer;
}

.acct > summary::-webkit-details-marker {
  display: none;
}

/* Avatar button — sits beside the theme toggle, matches its 38px height. */
.acct-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all var(--ease);
}

.acct-avatar:hover {
  border-color: var(--line-2);
}

.acct[open] > .acct-avatar, .acct-avatar.active {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.acct-avatar .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Dropdown panel — opens downward, right-aligned under the avatar. */
.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 232px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: var(--pshadow);
  padding: 6px;
  z-index: 50;
}

.acct-head {
  padding: 8px 10px 6px;
  min-width: 0;
}

.acct-head b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acct-head span {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.acct-menu a, .acct-signout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.acct-menu a:hover, .acct-signout:hover {
  background: var(--hover);
  color: var(--ink);
}

.acct-menu a.active {
  background: var(--accent-soft);
  color: var(--ink);
}

.acct-menu a .i, .acct-signout .i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.acct-menu a.active .i {
  color: var(--accent);
}

.acct-div {
  margin: 6px 4px;
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 1;
}

.acct-signout, .acct-signout .i {
  color: var(--bad);
}

.acct-signout:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

/* ---------- Plan entitlement: "feature locked" upgrade card ---------- */
.upgrade-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px dashed var(--line-2);
  background: var(--accent-soft);
  margin-bottom: 18px;
}

.upgrade-card .upgrade-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--card);
  color: var(--accent);
}

.upgrade-card .upgrade-ic .i {
  width: 20px;
  height: 20px;
}

.upgrade-card .upgrade-body h3 {
  margin: 0 0 4px;
  font-size: 15.5px;
}

.upgrade-card .upgrade-body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13.5px;
}

.border-tix-accent {
  border-color: var(--accent) !important;
}

/* ---------- Event hub (profile) ---------- */
/* Slim header strip: badges + meta on one line under the back link (the event title
   itself lives in the topbar heading, like every other detail page). */
.event-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 20px;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.event-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.event-meta .i {
  width: 15px;
  height: 15px;
  color: var(--dim);
  flex: none;
}

/* Unsaved-changes bar — its own banner above the tabbed card, hidden until the form is dirty. */
.unsaved-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
}

.unsaved-bar span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.unsaved-bar .i {
  width: 16px;
  height: 16px;
}

/* ---------- Tabs (card-embedded) ---------- */
.tabs .tabbar {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs .tabbar::-webkit-scrollbar {
  display: none;
}

/* Phones: the strip scrolls; fade the right edge as the affordance and pad so the last tab clears it. */
@media (max-width: 640px) {
  .tabs .tabbar {
    padding-right: 36px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
}
.tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  border: 0;
  background: transparent;
  padding: 13px 12px;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--ease), border-color var(--ease);
}

.tabs .tab .i {
  width: 16px;
  height: 16px;
}

.tabs .tab:hover {
  color: var(--ink);
}

.tabs .tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--hover);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tabs .tab.is-active .tab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel .panel-foot {
  border-top: 1px solid var(--line);
}

.tab-panel {
  padding: 22px;
  animation: tab-fade 0.18s ease both;
}

@keyframes tab-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* ---------- Onboarding checklist ---------- */
.onboard {
  max-width: 760px;
}

.onboard-steps {
  display: flex;
  flex-direction: column;
}

.onboard-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 2px;
  border-top: 1px solid var(--line);
}

.onboard-step:first-child {
  border-top: 0;
}

.onboard-step .os-ic .i {
  width: 22px;
  height: 22px;
  color: var(--dim);
}

.onboard-step.done .os-ic .i {
  color: var(--ok);
}

.onboard-step .os-body {
  flex: 1;
  min-width: 0;
}

.onboard-step .os-title {
  font-weight: 600;
  font-size: 14.5px;
}

.onboard-step.done .os-title {
  color: var(--muted);
}

.onboard-step .os-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.onboard-step .os-act {
  flex: none;
}

/* ---------- Revenue chart ---------- */
.chart-total {
  font-family: "Fira Code", monospace;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.chart-sub {
  color: var(--dim);
  font-size: 12px;
  margin-top: 2px;
}

.spark {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 4px;
}

.spark .bar {
  fill: var(--accent);
  opacity: 0.9;
}

.chart-x {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 22px 0;
  font-size: 13.5px;
}

.chart-empty .i {
  width: 26px;
  height: 26px;
  color: var(--dim);
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(360px, 100vw - 32px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--pshadow);
  animation: toast-in 0.22s var(--ease, ease);
}

/* Tinted icon badge — same idiom as .stat-ic / status badges */
.toast-ic {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--hover);
  color: var(--muted);
}

.toast-ic .i {
  width: 17px;
  height: 17px;
}

.toast-item.toast-success .toast-ic {
  background: var(--ok-bg);
  color: var(--ok);
}

.toast-item.toast-danger .toast-ic {
  background: var(--bad-bg);
  color: var(--bad);
}

.toast-item.toast-warning .toast-ic {
  background: var(--warn-bg);
  color: var(--warn);
}

.toast-item.toast-info .toast-ic {
  background: var(--info-bg);
  color: var(--info);
}

.toast-msg {
  flex: 1;
  min-width: 0;
  align-self: center;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.toast-x {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--dim);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.toast-x:hover {
  background: var(--hover);
  color: var(--ink);
}

.toast-x .i {
  width: 15px;
  height: 15px;
}

.toast-item.toast-hide {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
.event-editor {
  max-width: 920px;
}

.editor-tabbar {
  margin-bottom: 22px;
  padding: 0;
  gap: 4px;
}

.editor-tabbar .tab {
  padding: 10px 14px;
  font-size: 14.5px;
}

.event-editor .tab-panel {
  animation: editor-fade 0.18s ease both;
}

@keyframes editor-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cf-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

[data-cf-remove] {
  margin-left: auto;
}

.eblocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eblock {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2, var(--hover));
  padding: 12px;
}

.eblock-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eblock-grip {
  display: inline-flex;
  align-items: center;
  color: var(--dim);
  cursor: grab;
}

.eblock-grip .i {
  width: 16px;
  height: 16px;
}

.eblock-ic {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.eblock-ic .i {
  width: 17px;
  height: 17px;
}

.eblock-title {
  flex: 1;
  min-width: 0;
}

.eblock-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.eblock-body {
  margin-top: 10px;
}

.eitems {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.eitem {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}

.eitem > .form-control {
  flex: 1;
  min-width: 0;
}

.eitem-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eitem-fields.eitem-agenda {
  display: grid;
  grid-template-columns: 96px 1fr 1fr;
  gap: 6px;
}

.eitem [data-item-remove] {
  flex: none;
  margin-top: 2px;
}

.eitem-add {
  margin-top: 2px;
}

.eitem-image {
  align-items: center;
}

.eimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 96px;
}

.eimg-thumb {
  width: 96px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--hover);
}

.eimg-btn {
  width: 100%;
}

.eblock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
  padding: 6px 2px;
}

.eblock-note .i {
  width: 16px;
  height: 16px;
}

.eblock-body .quill-host {
  margin-top: 2px;
}

[data-block-kind=single] .eitem-fields {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}

@media (max-width: 640px) {
  .eitem-fields.eitem-agenda {
    grid-template-columns: 1fr;
  }
}
.eblocks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}

.eblocks-empty .i {
  width: 26px;
  height: 26px;
  color: var(--dim);
}

.editor-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.4);
}

.editor-savebar .spacer {
  flex: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--pshadow);
  }
  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35;
  }
  body.nav-open .scrim {
    display: block;
  }
  .menu-btn {
    display: inline-grid;
  }
  .sidebar-close {
    display: inline-grid;
  }
  .brand-logo {
    margin: 0;
  } /* left-align so the close X (top-right) never overlaps it */
  .nav.nav-mobile {
    display: flex;
  }
  .content {
    padding: 20px 16px;
  }
  .topbar-inner {
    padding: 13px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  /* Flex line-wrap decisions use each item's unshrunk (hypothetical) width, so a long
     subheading in .topbar-title (content-sized by default) can by itself exceed the row
     and push the theme toggle/avatar onto their own line. flex-basis:0 removes the
     content size from that calculation; flex-grow:1 still lets the title fill the row
     and keep theme/avatar flush right, taking over the now-redundant .spacer's job. */
  .topbar-title {
    flex: 1 1 0%;
  }
  .topbar .spacer {
    display: none;
  }
  /* Actions drop to a full-width second row under the title; theme + avatar stay on row one. */
  .topbar-actions {
    order: 10;
    flex: 0 0 100%;
  }
}
@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  /* Phone tables: drop low-value columns so Status / Total stay in view (put on <th> and <td> alike). */
  .hide-sm {
    display: none !important;
  }
  /* Unbreakable tokens (emails) in the remaining columns still push the table wider than the
     card — wrap them instead of letting them set the column's min-content width. */
  .table-responsive td, .table-responsive th {
    overflow-wrap: anywhere;
  }
  /* The search box is the toolbar's widest item (min-width:220px inline); giving it the
     full row lets the selects + Search button wrap onto their own line(s) below it instead
     of everything fighting for space on one line and the button's label bleeding past its box. */
  .toolbar .form-control[type=search], .toolbar input[name=q] {
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
/* ---------- Settings sub-sidebar shell ---------- */
.settings-shell {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.settings-rail {
  flex: 0 0 200px;
  position: sticky;
  top: 84px;
}

.settings-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 4px 12px 8px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14.5px;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}

.settings-nav a .i {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.settings-nav a:hover {
  background: var(--hover);
  color: var(--ink);
}

.settings-nav a.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.settings-nav a.active .i {
  opacity: 1;
  color: var(--accent);
}

.settings-nav a.locked {
  color: var(--muted);
}

.settings-nav a .nav-lock {
  width: 13px;
  height: 13px;
  margin-left: auto;
  opacity: 0.55;
}

.settings-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Locked items sink below this divider + label, with an upgrade CTA. */
.settings-nav-sep {
  height: 1px;
  background: var(--line);
  margin: 12px 6px 2px;
}

.settings-nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 4px 12px;
}

/* Upgrade CTA — shared by the settings rail and the main sidebar nav. */
.menu-upgrade {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, transparent);
  transition: background var(--ease), border-color var(--ease);
}

.menu-upgrade:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.menu-upgrade .i {
  width: 16px;
  height: 16px;
  flex: none;
}

@media (max-width: 991.98px) {
  .settings-shell {
    flex-direction: column;
    gap: 18px;
  }
  .settings-rail {
    position: static;
    top: auto;
    flex-basis: auto;
    width: 100%;
  }
  .settings-eyebrow {
    padding: 0 2px 6px;
  }
  /* Horizontal strip; the right edge fades out as the "there's more" affordance and the
     trailing padding lets the last item scroll clear of the fade. */
  .settings-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding: 0 36px 4px 0;
    align-items: center;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
  .settings-nav::-webkit-scrollbar {
    display: none;
  }
  .settings-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .settings-nav a .nav-lock {
    margin-left: 4px;
  }
  .settings-nav-sep, .settings-nav-label {
    display: none;
  }
  .menu-upgrade {
    margin-top: 0;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
/* ---------- Plan / tier comparison ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg);
}

.plan-card.is-included {
  background: var(--card);
}

.plan-card.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-pill .i {
  width: 12px;
  height: 12px;
}

.plan-pill.current {
  background: var(--accent);
  color: var(--accent-ink);
}

.plan-pill.included {
  background: var(--ok-bg);
  color: var(--ok);
}

.plan-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan-feat {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
}

.plan-feat .i {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}

.plan-feat.on .i {
  color: var(--ok);
}

.plan-feat.off {
  color: var(--dim);
}

.plan-feat.off .i {
  color: var(--dim);
  opacity: 0.7;
}

.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.plan-actions form {
  margin: 0;
}

.plan-actions .btn {
  width: 100%;
}

.plan-current-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-bg);
  border-radius: var(--r-sm);
  padding: 7px 10px;
}

.plan-current-pill .i {
  width: 14px;
  height: 14px;
}

.plan-downgrade-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.plan-downgrade-note .i {
  width: 13px;
  height: 13px;
  flex: none;
}

@media (max-width: 767.98px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}
/* ---------- Team / member rows ---------- */
.card-count {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--hover);
  border-radius: 999px;
  padding: 1px 9px;
}

.member {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.member-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.member-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.member-email {
  font-size: 12.5px;
  color: var(--muted);
}

.mini-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.mini-tag.you {
  color: var(--accent);
  background: var(--accent-soft);
}

.mini-tag.off {
  color: var(--muted);
  background: var(--hover);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.role-chip .i {
  width: 13px;
  height: 13px;
}

.role-chip.role-owner {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.role-chip.role-manager {
  color: var(--info);
  background: var(--info-bg);
}

.role-chip.role-viewer {
  color: var(--muted);
  background: var(--hover);
}

.role-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.role-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-legend .role-chip {
  flex: none;
  min-width: 86px;
}

/* ---------- Tooltips (hover / keyboard-focus) ---------- */
.i-xs {
  width: 13px;
  height: 13px;
}

[data-tooltip] {
  position: relative;
  --tip-x: -50%;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(var(--tip-x)) translateY(4px);
  width: max-content;
  max-width: 230px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--card);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity var(--ease), transform var(--ease);
}

[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(var(--tip-x));
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity var(--ease);
}

[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(var(--tip-x)) translateY(0);
}

[data-tooltip]:hover::before, [data-tooltip]:focus-visible::before {
  opacity: 1;
}

.row-actions [data-tooltip], .eblock-actions [data-tooltip], .cf-row [data-tooltip],
.eitem [data-tooltip], .toast-item [data-tooltip], .acct [data-tooltip],
.modal-foot [data-tooltip] {
  --tip-x: 0;
}

.row-actions [data-tooltip]::after, .row-actions [data-tooltip]::before,
.eblock-actions [data-tooltip]::after, .eblock-actions [data-tooltip]::before,
.cf-row [data-tooltip]::after, .cf-row [data-tooltip]::before,
.eitem [data-tooltip]::after, .eitem [data-tooltip]::before,
.toast-item [data-tooltip]::after, .toast-item [data-tooltip]::before,
.acct [data-tooltip]::after, .acct [data-tooltip]::before,
.modal-foot [data-tooltip]::after, .modal-foot [data-tooltip]::before {
  left: auto;
  right: 0;
}

.topbar [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 9px);
  transform: translateX(var(--tip-x)) translateY(-4px);
}

.topbar [data-tooltip]:hover::after, .topbar [data-tooltip]:focus-visible::after {
  transform: translateX(var(--tip-x)) translateY(0);
}

.topbar [data-tooltip]::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: var(--ink);
}

@media (min-width: 992px) {
  .table-responsive.tips {
    overflow: visible;
  }
}
