:root {
  --brand: #301934;
  --brand-hover: #251528;
  --brand-muted: #5c4a63;
  --gold: #ffd973;
  --gold-hover: #ffcf4d;
  --bg: #faf8fc;
  --surface: #ffffff;
  --text: #301934;
  --muted: #5c4a63;
  --border: #e4dce8;
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --accent-on-solid: #ffffff;
  --link: var(--brand);
  --brand-accent: var(--gold);
  --brand-accent-hover: var(--gold-hover);
  --success: #0d7a55;
  --warning: #a16207;
  --sidebar: #ffffff;
  --sidebar-text: #301934;
  --radius: 12px;
  --shadow: 0 4px 6px rgba(48, 25, 52, 0.05), 0 14px 38px rgba(48, 25, 52, 0.07);
}

[data-theme="dark"] {
  --bg: #0c0810;
  --surface: #161018;
  --text: #f4eef9;
  --muted: #a89bab;
  --border: #2d2433;
  --accent: var(--gold);
  --accent-hover: #ffe08a;
  --accent-on-solid: #301934;
  --success: #4ade80;
  --warning: #fbbf24;
  --sidebar: #0a060d;
  --sidebar-text: #e8e0ef;
  --link: #f0d78c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Jost", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

[data-theme="dark"] a:hover { color: var(--brand-accent-hover); }

[data-theme="dark"] .btn--primary,
[data-theme="dark"] .btn--primary:hover {
  color: var(--brand);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; }
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1.25rem 0;
  border-right: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar__brand {
  padding: 0 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar__brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  padding: 0.35rem 0.25rem;
  margin: -0.35rem -0.25rem;
  transition: background 0.15s ease;
}

.sidebar__brand-link:hover {
  background: rgba(48, 25, 52, 0.06);
}

[data-theme="dark"] .sidebar__brand-link:hover {
  background: rgba(255, 217, 115, 0.08);
}

.sidebar__brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand);
  box-shadow: 0 2px 12px rgba(48, 25, 52, 0.22), 0 0 0 1px rgba(255, 217, 115, 0.35);
}

.sidebar__brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar__brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sidebar__nav a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: var(--sidebar-text);
  opacity: 0.85;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}

.sidebar__nav {
  overflow-y: auto;
  min-height: 0;
}

.nav-icon {
  display: inline-block;
  width: 1.3rem;
  margin-right: 0.35rem;
}

.sidebar__footer {
  margin-top: auto;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--sidebar);
}

.sidebar__account-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: rgba(48, 25, 52, 0.06);
  border: 1px solid rgba(48, 25, 52, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.sidebar__account-link:hover {
  background: rgba(48, 25, 52, 0.09);
}

[data-theme="dark"] .sidebar__account-link {
  background: rgba(255, 217, 115, 0.06);
  border-color: rgba(255, 217, 115, 0.14);
}

[data-theme="dark"] .sidebar__account-link:hover {
  background: rgba(255, 217, 115, 0.1);
}

.sidebar__account-link strong {
  display: block;
  font-size: 0.86rem;
}

.sidebar__account-link small {
  display: block;
  opacity: 0.8;
  font-size: 0.73rem;
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(2,6,23,0.12);
}

.sidebar__avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #301934, #5c3d66);
  color: #fff;
}

.sidebar__nav a:hover, .sidebar__nav a.is-active {
  opacity: 1;
  background: rgba(48, 25, 52, 0.07);
  border-left-color: var(--brand);
}

[data-theme="dark"] .sidebar__nav a:hover,
[data-theme="dark"] .sidebar__nav a.is-active {
  background: rgba(255, 217, 115, 0.08);
  border-left-color: var(--brand-accent);
}

.main {
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 0.45rem 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar__search {
  flex: 1 1 340px;
  max-width: 520px;
  position: relative;
}

.topbar__search input[type="search"] {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.topbar__search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  pointer-events: none;
}

.topbar-menu {
  position: relative;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.icon-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #301934, #5c3d66);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.topbar-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 270px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18);
  padding: 0.7rem;
  display: none;
  z-index: 45;
}

.topbar-popover.is-open {
  display: block;
}

.topbar-popover__title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.topbar-popover--notifications {
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
}

.notify-item {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.45rem;
  background: rgba(48, 25, 52, 0.06);
  color: var(--text);
  text-decoration: none;
}

.notify-item strong {
  display: block;
  font-size: 0.82rem;
}

.notify-item small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.notify-item.is-read {
  background: transparent;
}

.topbar-action-link {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-top: 0.45rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.84rem;
}

.topbar-action-link--danger {
  color: #dc2626;
}

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

[data-theme="dark"] .btn--primary:hover {
  color: var(--brand);
}

.btn--primary.btn--gradient {
  background: linear-gradient(90deg, #301934, #4a2754);
}
.btn--primary.btn--gradient:hover {
  background: linear-gradient(90deg, #251528, #3d1f45);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--danger {
  background: #dc2626;
  color: #fff;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.kpi__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.kpi__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(48, 25, 52, 0.06), var(--surface));
  border: 1px solid var(--border);
}

.dash-hero__title {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.dash-hero__subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-pill-group {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.dash-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
}

.dash-pill--accent {
  background: rgba(48, 25, 52, 0.1);
  color: var(--brand);
}

[data-theme="dark"] .dash-pill--accent {
  background: rgba(255, 217, 115, 0.14);
  color: var(--brand-accent);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.dash-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
}

.dash-kpi-card__label {
  margin-bottom: 0.3rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dash-kpi-card__value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dash-card {
  border-radius: 14px;
  margin-bottom: 1rem;
}

.dash-table th {
  background: transparent;
}

.dash-table tbody tr {
  background: rgba(148, 163, 184, 0.08);
}

.dash-table tbody tr:nth-child(2n) {
  background: rgba(148, 163, 184, 0.04);
}

.dash-table td,
.dash-table th {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.dash-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.dash-inline-form {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.dash-inline-form input[type="number"] {
  max-width: 200px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-hero__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-panel {
  padding: 1rem 1.1rem;
  border-radius: 14px;
}

.filter-panel__label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-panel .dash-inline-form .form-row {
  margin: 0;
  min-width: 140px;
}

.filter-panel .dash-inline-form input,
.filter-panel .dash-inline-form select {
  max-width: 100%;
  min-width: 140px;
}

.data-card .card__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.data-card .table-wrap {
  margin: 0;
}

.link-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.link-card:hover {
  border-color: rgba(48, 25, 52, 0.28);
  box-shadow: 0 8px 22px rgba(48, 25, 52, 0.08);
  transform: translateY(-1px);
}

[data-theme="dark"] .link-card:hover {
  border-color: rgba(255, 217, 115, 0.35);
}

.link-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.link-card__desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.link-card__meta {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--brand);
}

.owner-admin-panel .settings-panel__placeholder {
  padding: 1.25rem;
  text-align: center;
}

.owner-row.is-active {
  background: rgba(48, 25, 52, 0.06);
}

[data-theme="dark"] .owner-row.is-active {
  background: rgba(255, 217, 115, 0.08);
}

.dash-progress-wrap {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.dash-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.dash-progress {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
}

.dash-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #301934, #6b4d74);
}

[data-theme="dark"] .dash-progress > span {
  background: linear-gradient(90deg, #ffd973, #c9a227);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 1rem 1.1rem;
}

.modal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
}

tr:last-child td { border-bottom: none; }

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

textarea { max-width: 100%; min-height: 80px; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--ok { background: rgba(5, 150, 105, 0.15); color: var(--success); }
.badge--warn { background: rgba(217, 119, 6, 0.15); color: var(--warning); }
.badge--muted { background: var(--bg); color: var(--muted); }
.badge--ticket-open { background: rgba(59, 130, 246, 0.16); color: #1d4ed8; }
.badge--ticket-pending { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.badge--ticket-resolved { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.badge--ticket-closed { background: rgba(107, 114, 128, 0.2); color: #374151; }
.badge--ticket-sla-ok { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.badge--ticket-sla-warn { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.badge--ticket-sla-danger { background: rgba(239, 68, 68, 0.18); color: #991b1b; }

.ticket-attachment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.ticket-attachment-preview__img {
    display: block;
    max-width: min(220px, 100%);
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash--ok { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.flash--err { background: rgba(220, 38, 38, 0.12); color: #dc2626; }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-page.auth-page--split {
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-page--split .auth-split {
  flex: 1 1 auto;
}

.auth-split {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  min-height: 100dvh;
  min-width: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  align-items: stretch;
}

.auth-split__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #0a0610;
  color: #f4eef9;
}

.auth-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-visual__svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-visual__orbit--slow {
  transform-origin: 400px 400px;
  animation: auth-visual-spin 105s linear infinite;
}

.auth-visual__orbit--mid {
  transform-origin: 400px 400px;
  animation: auth-visual-spin-reverse 78s linear infinite;
}

.auth-visual__ring {
  animation: auth-visual-ring 6s ease-in-out infinite;
}

.auth-visual__wave--a {
  animation: auth-visual-wave-a 22s ease-in-out infinite alternate;
}

.auth-visual__wave--b {
  animation: auth-visual-wave-b 26s ease-in-out infinite alternate;
}

.auth-visual__spark {
  animation: auth-visual-spark 4.5s ease-in-out infinite;
}

.auth-visual__spark:nth-child(2) {
  animation-delay: -1.2s;
}

.auth-visual__spark:nth-child(3) {
  animation-delay: -2.4s;
}

.auth-visual__spark:nth-child(4) {
  animation-delay: -3.1s;
}

.auth-visual__node {
  animation: auth-visual-node 5s ease-in-out infinite;
}

.auth-visual__node:nth-child(2) {
  animation-delay: -1.6s;
}

.auth-visual__node:nth-child(3) {
  animation-delay: -3s;
}

.auth-visual__node:nth-child(4) {
  animation-delay: -0.8s;
}

.auth-visual--admin .auth-visual__orbit--mid circle {
  opacity: 0.42;
}

.auth-visual--admin .auth-visual__mesh {
  opacity: 0.48;
}

@keyframes auth-visual-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes auth-visual-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes auth-visual-ring {
  0%,
  100% {
    opacity: 0.65;
    stroke-width: 2px;
  }
  50% {
    opacity: 1;
    stroke-width: 3px;
  }
}

@keyframes auth-visual-wave-a {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(24px, -18px);
  }
}

@keyframes auth-visual-wave-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-18px, 12px) scale(1.03);
  }
}

@keyframes auth-visual-spark {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.35);
  }
}

@keyframes auth-visual-node {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual__orbit--slow,
  .auth-visual__orbit--mid,
  .auth-visual__ring,
  .auth-visual__wave--a,
  .auth-visual__wave--b,
  .auth-visual__spark,
  .auth-visual__node {
    animation: none !important;
  }
}

.auth-split__brand-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    168deg,
    rgba(10, 6, 16, 0.15) 0%,
    rgba(10, 6, 16, 0.02) 42%,
    rgba(10, 6, 16, 0.88) 100%
  );
}

.auth-split__brand-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 100dvh;
  padding:
    max(1.25rem, env(safe-area-inset-top, 0))
    max(1.5rem, env(safe-area-inset-right, 0))
    max(1.5rem, env(safe-area-inset-bottom, 0))
    max(1.5rem, env(safe-area-inset-left, 0));
}

.auth-split__brand-body {
  margin-top: auto;
}

@media (max-width: 768px) {
  .auth-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
    height: auto;
  }

  .auth-split__brand {
    min-height: clamp(220px, 38vh, 340px);
    max-height: 46vh;
  }

  .auth-split__brand-content {
    min-height: 0;
    justify-content: flex-end;
    padding: 1rem 1.15rem 1.35rem;
  }

  .auth-split__quote {
    font-size: clamp(1rem, 4.2vw, 1.2rem);
  }

  .auth-brand-logo__wordmark {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) and (max-height: 520px) {
  .auth-split__brand {
    min-height: 160px;
    max-height: 36vh;
  }
}

.auth-brand-logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  align-self: flex-start;
}

.auth-brand-logo__mark {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand);
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 217, 115, 0.42);
}

.auth-brand-logo__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-brand-logo__wordmark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 1.42rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.auth-brand-logo__fund {
  color: #fff;
}

.auth-brand-logo__olar {
  color: var(--gold);
}

.auth-split__quote {
  margin: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.96);
}

.auth-split__byline {
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.auth-split__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}

.auth-split__role {
  font-size: 0.82rem;
  color: rgba(232, 224, 239, 0.55);
}

.auth-split__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  min-width: 0;
  background: #ffffff;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="dark"] .auth-split__panel {
  background: var(--surface);
  color: var(--text);
}

.auth-split__panel-inner {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(1.35rem, 4vw, 2.75rem) clamp(1.15rem, 5vw, 2rem);
  box-sizing: border-box;
}

.auth-split__panel-inner--home {
  max-width: 420px;
}

.auth-split__header {
  margin-bottom: 1.5rem;
}

.auth-split__title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand);
}

[data-theme="dark"] .auth-split__title {
  color: var(--text);
}

.auth-split__lede {
  margin: 0.45rem 0 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--muted);
}

.auth-form .form-row {
  margin-bottom: 1.05rem;
}

.auth-form .form-row label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"] {
  max-width: none;
  width: 100%;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.auth-form input::placeholder {
  color: rgba(92, 74, 99, 0.45);
}

[data-theme="dark"] .auth-form input::placeholder {
  color: rgba(232, 224, 239, 0.35);
}

.auth-req {
  color: var(--brand);
  font-weight: 700;
}

[data-theme="dark"] .auth-req {
  color: var(--gold);
}

.auth-split__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0 0.35rem;
}

.auth-split__row--footer {
  margin-top: 1.5rem;
}

.auth-split__row-spacer {
  flex: 1;
}

.theme-toggle--quiet {
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-color: var(--border);
  background: transparent;
}

.auth-split__inline-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-theme="dark"] .auth-split__inline-link {
  color: var(--gold);
}

.btn--auth {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
}

.btn--auth-secondary {
  margin-top: 0.65rem;
}

.auth-home-actions {
  display: grid;
  gap: 0.65rem;
}

.auth-split__footer {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.auth-split__footer--shift {
  margin-top: 1rem;
}

.auth-split__footer a {
  font-weight: 700;
  color: var(--brand);
}

[data-theme="dark"] .auth-split__footer a {
  color: var(--gold);
}

.auth-split__hint {
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.auth-split__mono {
  margin: 0.35rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(48, 25, 52, 0.03);
  font-size: 0.78rem;
}

[data-theme="dark"] .auth-split__mono {
  background: rgba(255, 255, 255, 0.04);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); font-size: 0.9rem; }
.mono { font-family: ui-monospace, monospace; font-size: 0.82rem; word-break: break-all; }

.stack { display: flex; flex-direction: column; gap: 0.5rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(148,163,184,0.12);
  border: 1px solid var(--border);
}

.tabs__btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
  text-decoration: none;
  gap: 0.45rem;
}

.tabs__btn.is-active {
  background: linear-gradient(135deg, #301934, #4a2754);
  border-color: rgba(255, 217, 115, 0.35);
  color: #fff;
  box-shadow: 0 4px 14px rgba(48, 25, 52, 0.22);
}

[data-theme="dark"] .tabs__btn.is-active {
  background: linear-gradient(135deg, #ffd973, #e8b84a);
  color: var(--brand);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.tabs__icon {
  width: 1rem;
  text-align: center;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.settings-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tab-panel[hidden] {
  display: none !important;
}

.settings-email-split {
  align-items: start;
}

.settings-email-col__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.settings-email-col--test {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
}

@media (min-width: 960px) {
  .settings-email-split.dash-split-grid {
    grid-template-columns: 1fr minmax(280px, 340px);
  }
}

.settings-payments-intro {
  margin-bottom: 1.35rem;
}

.settings-page-lead {
  max-width: 46rem;
  line-height: 1.55;
}

.settings-tab-intro,
.settings-payments-intro {
  margin-bottom: 1.35rem;
}

.settings-tab-title,
.settings-payments-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-tab-lead,
.settings-payments-lead {
  margin: 0.4rem 0 0;
  max-width: 44rem;
  line-height: 1.55;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-panel {
  --settings-accent: #301934;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.settings-panel__header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--settings-accent) 10%, transparent),
    rgba(148, 163, 184, 0.06)
  );
}

.settings-panel__icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.settings-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-panel__desc {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.settings-panel__body {
  padding: 1.05rem 1.15rem 1.15rem;
}

.settings-panel__section {
  margin-top: 1rem;
}

.settings-panel__section:first-child {
  margin-top: 0;
}

.settings-panel__field {
  margin: 0;
}

.settings-panel__field--full {
  grid-column: 1 / -1;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.35rem 1rem;
}

.settings-input-wide,
.settings-panel .settings-input-wide,
.settings-panel input[type="text"],
.settings-panel input[type="email"],
.settings-panel input[type="password"],
.settings-panel input[type="number"],
.settings-panel input[type="url"],
.settings-panel select,
.settings-panel textarea {
  max-width: 100%;
}

.settings-textarea {
  min-height: 9rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
}

.settings-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.settings-section-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.settings-callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.1);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.settings-callout:first-child {
  margin-top: 0;
}

.settings-callout--info {
  margin-bottom: 1rem;
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

.settings-callout code {
  font-size: 0.8rem;
}

.settings-toggle-card--inline {
  grid-template-columns: 1fr auto;
  width: 100%;
}

.settings-toggle-card--inline .settings-toggle-card__icon {
  display: none;
}

.settings-toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-chip {
  position: relative;
  cursor: pointer;
}

.settings-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-chip__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s ease;
}

.settings-chip input:checked + .settings-chip__text {
  border-color: color-mix(in srgb, var(--settings-accent, #301934) 45%, var(--border));
  background: color-mix(in srgb, var(--settings-accent, #301934) 14%, transparent);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.settings-chip:hover .settings-chip__text {
  border-color: rgba(148, 163, 184, 0.45);
}

.settings-email-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 960px) {
  .settings-email-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
  }
}

.settings-panel--grow {
  min-width: 0;
}

.settings-panel--aside .settings-panel__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

.settings-payments-section {
  margin-bottom: 1.5rem;
}

.settings-payments-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.settings-payments-section__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings-payments-section__desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 40rem;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.settings-toggle-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.settings-toggle-card:hover {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
}

.settings-toggle-card:has(.settings-toggle-card__input:checked) {
  border-color: rgba(48, 25, 52, 0.28);
  box-shadow: 0 8px 24px rgba(48, 25, 52, 0.08);
  background: rgba(48, 25, 52, 0.04);
}

[data-theme="dark"] .settings-toggle-card:has(.settings-toggle-card__input:checked) {
  border-color: rgba(255, 217, 115, 0.35);
  background: rgba(255, 217, 115, 0.06);
}

.settings-toggle-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.settings-toggle-card__copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.settings-toggle-card__title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
}

.settings-toggle-card__desc {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.settings-toggle-card__desc code {
  font-size: 0.78rem;
}

.settings-switch {
  position: relative;
  flex-shrink: 0;
  width: 2.85rem;
  height: 1.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: background 0.18s ease;
}

.settings-switch__knob {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease;
}

.settings-switch--compact {
  width: 2.35rem;
  height: 1.3rem;
}

.settings-switch--compact .settings-switch__knob {
  width: 1rem;
  height: 1rem;
}

.settings-toggle-card__input:checked ~ .settings-switch,
.gateway-panel__enable input:checked + .settings-switch {
  background: #16a34a;
}

.settings-toggle-card__input:checked ~ .settings-switch .settings-switch__knob,
.gateway-panel__enable input:checked + .settings-switch .settings-switch__knob {
  transform: translateX(1.25rem);
}

.gateway-panel__enable input:checked + .settings-switch--compact .settings-switch__knob {
  transform: translateX(1rem);
}

.gateway-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.1);
}

.gateway-tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gateway-tabs__btn:hover {
  background: rgba(148, 163, 184, 0.14);
}

.gateway-tabs__btn.is-active {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--gateway-accent, #64748b) 42%, var(--border));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.gateway-tabs__btn.is-active .gateway-tabs__label {
  color: var(--gateway-accent, var(--text));
}

.gateway-tabs__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gateway-tabs__pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.22);
  color: var(--muted);
}

.gateway-tabs__pill--on {
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
}

.gateway-tabs__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

.gateway-tabs__dot--ok {
  background: #16a34a;
}

.gateway-panel {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.gateway-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--gateway-accent, #64748b) 10%, transparent),
    rgba(148, 163, 184, 0.06)
  );
}

.gateway-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.gateway-panel__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--gateway-accent, #64748b);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--gateway-accent, #64748b) 35%, transparent);
}

.gateway-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gateway-panel__tagline {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.gateway-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gateway-panel__status {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.gateway-panel__status--ok {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.gateway-panel__enable {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.gateway-panel__enable input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gateway-panel__enable-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.gateway-panel__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.35rem 1rem;
  padding: 1.05rem 1.15rem 1.15rem;
}

.gateway-panel__field {
  margin: 0;
}

.gateway-panel__input {
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
}

.smtp-test-form-anchor {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tabs__btn--danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.tabs__btn--danger.is-active,
.tabs__btn--danger:hover {
  color: #fff;
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(248, 113, 113, 0.55);
}

.danger-zone {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.danger-zone__gate {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.28), rgba(15, 23, 42, 0.55));
}

.danger-zone__gate-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.danger-zone__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.18);
}

.danger-zone__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fca5a5;
}

.danger-zone__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.danger-zone__lead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 46rem;
}

.danger-zone__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.danger-zone__card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(15, 23, 42, 0.45);
}

.danger-zone__card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.danger-zone__card-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.danger-zone__card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.danger-zone__card-desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.danger-zone__targets {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  line-height: 1.55;
}

.danger-zone__action-form {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.danger-zone__unlock-form {
  margin-top: 1rem;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.account-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.account-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.account-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #301934, #5c3d66);
}

.flash--warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.sidebar__copyright {
  margin: 0.85rem 0 0;
  padding: 0 0.5rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .sidebar__copyright {
  opacity: 0.82;
}

.owner-tabs {
  flex-wrap: wrap;
}

.modal-card--feature-guide {
  width: min(480px, 100%);
  max-height: min(85vh, 540px);
  padding: 1.35rem 1.45rem;
}

.modal-backdrop--feature-guide {
  z-index: 120;
  background: rgba(2, 6, 23, 0.72);
}

.feature-guide__steps {
  margin: 0 0 1.1rem;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.feature-guide__steps strong {
  color: var(--text);
}

.feature-guide__actions {
  margin: 0;
}

.owner-tour-trigger {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.owner-tour-trigger:hover {
  background: var(--bg);
}

.owner-tour-trigger span {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.assistant-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.25rem;
  z-index: 125;
  width: min(440px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.35);
  padding: 0.9rem;
}

.assistant-panel[hidden] {
  display: none !important;
}

.assistant-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.assistant-beta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.assistant-panel__note {
  margin: 0.55rem 0 0.65rem;
  font-size: 0.82rem;
}

.assistant-chat-log {
  max-height: 310px;
  overflow-y: auto;
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  background: var(--bg);
}

.assistant-msg {
  border-radius: 9px;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.assistant-msg--user {
  background: rgba(48, 25, 52, 0.12);
}

.assistant-msg--assistant {
  background: rgba(16, 185, 129, 0.1);
}

.assistant-msg--sys {
  background: rgba(148, 163, 184, 0.2);
}

.assistant-chat-form {
  margin-top: 0.65rem;
}

.assistant-chat-form textarea {
  max-width: 100%;
  min-height: 86px;
}

.assistant-chat-actions {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.owner-tour {
  position: fixed;
  inset: 0;
  z-index: 130;
}

.owner-tour[hidden] {
  display: none !important;
}

.owner-tour__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.64);
}

.owner-tour__card {
  position: fixed;
  width: min(420px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.35);
  padding: 0.95rem;
  z-index: 132;
}

.owner-tour__step {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.owner-tour__card h2 {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.05rem;
}

.owner-tour__actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.owner-tour-highlight {
  position: relative;
  z-index: 131 !important;
  box-shadow: 0 0 0 3px rgba(255, 217, 115, 0.92), 0 0 0 9999px rgba(2, 6, 23, 0.42);
  border-radius: 10px;
}

.owner-dash-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  background: linear-gradient(135deg, rgba(48, 25, 52, 0.06), transparent);
}

[data-theme="dark"] .owner-dash-hero {
  background: linear-gradient(135deg, rgba(255, 217, 115, 0.08), transparent);
}

.owner-kpi-grid .dash-kpi-card__label {
  font-size: 0.78rem;
  line-height: 1.25;
}

.card__lede {
  margin-top: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.card__head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.input-select {
  max-width: 280px;
  width: 100%;
}

.btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.template-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.template-toggle.is-on {
  background: rgba(22, 163, 74, 0.18);
  color: #166534;
}

.template-toggle.is-off {
  background: rgba(220, 38, 38, 0.17);
  color: #991b1b;
}

.template-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.template-toggle__dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  background: currentColor;
}

.owner-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.owner-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  line-height: 1.45;
}

.owner-site-kpi .kpi--wide {
  grid-column: 1 / -1;
}

.kpi__mono {
  word-break: break-all;
  font-size: 0.92rem;
}

.owner-site-details {
  margin-top: 0.5rem;
  padding: 0.35rem 0;
}

.owner-site-details summary {
  cursor: pointer;
  list-style: none;
}

.owner-site-details summary::-webkit-details-marker {
  display: none;
}

.owner-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 1rem;
  align-items: start;
}

.owner-admin-panel {
  position: sticky;
  top: 88px;
}

.owner-row {
  cursor: pointer;
}

.owner-row.is-active {
  background: rgba(48, 25, 52, 0.08);
}

.account-settings-shell {
  display: grid;
  gap: 1rem;
}

.account-settings-tabs {
  margin-bottom: 0;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem 1rem;
}

.account-form-grid .form-row {
  margin-bottom: 0;
}

/* --- Maintenance mode (503 owner-facing) --- */
.maintenance-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.maintenance-page__ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 18% 12%, rgba(255, 217, 115, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 82% 28%, rgba(48, 25, 52, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 92%, rgba(48, 25, 52, 0.08), transparent 45%);
  z-index: 0;
}

[data-theme="dark"] .maintenance-page__ambient {
  background:
    radial-gradient(ellipse 80% 55% at 18% 12%, rgba(255, 217, 115, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 82% 22%, rgba(255, 217, 115, 0.05), transparent 50%),
    radial-gradient(ellipse 55% 40% at 50% 95%, rgba(93, 63, 107, 0.15), transparent 45%);
}

.maintenance-page__top {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 5vw, 2.75rem);
}

.maintenance-page__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.maintenance-page__logo img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.maintenance-page__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.maintenance-page__brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.maintenance-page__brand-tag {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.maintenance-page__theme {
  flex-shrink: 0;
}

.maintenance-page__main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.maintenance-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow);
}

.maintenance-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.maintenance-card__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(255, 217, 115, 0.55);
  animation: maintenance-pulse 2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .maintenance-card__pulse {
    animation: none;
    box-shadow: none;
  }
}

@keyframes maintenance-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 217, 115, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 217, 115, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 217, 115, 0);
  }
}

.maintenance-card__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.maintenance-card__lede {
  margin: 0 0 1.15rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.maintenance-card__list {
  margin: 0 0 1.35rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--text);
}

.maintenance-card__contact {
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 0.92rem;
  line-height: 1.5;
}

.maintenance-card__contact strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.maintenance-card__link {
  color: var(--link);
  font-weight: 600;
  word-break: break-word;
}

.maintenance-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.maintenance-card__logout-form {
  margin: 0;
}

.maintenance-card__footnote {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.maintenance-page__footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.maintenance-page__footer p {
  margin: 0;
}
