:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f8fafc;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --panel: #ffffff;
  --primary: #111827;
  --primary-foreground: #ffffff;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --ring: #111827;
  --shadow: 0 16px 42px rgba(15, 23, 42, .08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12px;
  letter-spacing: .04em;
}

.brand-text {
  font-size: 18px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.desktop-nav a:hover,
.footer-links a:hover {
  color: var(--foreground);
}

.header-actions,
.hero-actions,
.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

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

.btn:focus-visible,
.mobile-menu-button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 1px rgba(43, 36, 53, .12);
}

.btn-primary:hover {
  background: #584bb6;
}

.btn-outline,
.btn-ghost {
  border-color: var(--border);
  background: #f8f9fa;
  color: #3b3347;
  box-shadow: 0 1px 1px rgba(43, 36, 53, .06);
}

.btn-ghost {
  border-color: transparent;
}

.btn-outline:hover,
.btn-ghost:hover {
  border-color: #cbd5e1;
  background: #eef0f3;
}

.btn-large {
  min-height: 46px;
  padding-inline: 18px;
}

.btn-small {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.btn-danger:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.app-confirm-modal.fade {
  opacity: 0;
  transition: opacity .15s linear;
}

.app-confirm-modal.show {
  opacity: 1;
}

.app-confirm-modal .modal-dialog {
  max-width: 500px;
  margin: 1.75rem auto;
  transition: none;
  transform: none !important;
}

.app-confirm-modal.show .modal-dialog {
  transform: none !important;
}

.app-confirm-modal .modal-content {
  border: 1px solid rgba(0, 0, 0, .175);
  border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.app-confirm-modal .modal-header,
.app-confirm-modal .modal-footer {
  border-color: #dee2e6;
}

.app-confirm-modal .modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.app-confirm-modal .modal-body p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .app-confirm-modal.fade,
  .app-confirm-modal .modal-dialog {
    transition: none;
  }
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--foreground);
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px 16px 16px;
  background: var(--panel);
}

.mobile-menu[data-open="true"] {
  display: grid;
  gap: 10px;
}

.mobile-menu a {
  border-radius: 8px;
  padding: 10px;
  color: var(--muted-foreground);
  font-weight: 600;
}

.mobile-menu a:hover {
  background: var(--muted);
  color: var(--foreground);
}

.hero-section {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: 48px;
}

.hero-copy h1,
.section-heading h2,
.operations-grid h2,
.portal-inner h2 {
  margin: 12px 0 0;
  max-width: 760px;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-heading h2,
.operations-grid h2,
.portal-inner h2 {
  font-size: clamp(30px, 4.5vw, 48px);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  padding: 5px 10px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-lede,
.section-heading p,
.operations-grid p {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted-foreground);
  font-size: 18px;
}

.hero-actions {
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 34px 0 0;
}

.hero-stats div,
.feature-card,
.checklist-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.hero-stats div {
  padding: 15px;
}

.hero-stats dt {
  font-size: 26px;
  font-weight: 800;
}

.hero-stats dd {
  margin: 2px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  min-height: 420px;
  object-fit: cover;
}

.media-panel {
  position: absolute;
  display: grid;
  gap: 2px;
  max-width: 240px;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  padding: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  font-size: 13px;
}

.media-panel span {
  color: var(--muted-foreground);
}

.media-panel-top {
  top: 18px;
  right: 18px;
}

.media-panel-bottom {
  bottom: 18px;
  left: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}

.section-band,
.operations-section,
.portal-strip {
  padding: 72px 0;
}

.section-band {
  background: var(--muted);
}

.section-heading {
  display: grid;
  gap: 0;
  margin-bottom: 28px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 220px;
  padding: 22px;
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #134e4a;
  font-size: 12px;
  font-weight: 800;
}

.feature-card h3,
.checklist-panel h3 {
  margin: 18px 0 0;
  font-size: 18px;
}

.feature-card p {
  margin: 10px 0 0;
  color: var(--muted-foreground);
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 40px;
  align-items: start;
}

.checklist-panel {
  padding: 24px;
}

.checklist-panel ul {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.checklist-panel li {
  position: relative;
  padding-left: 26px;
  color: var(--muted-foreground);
}

.checklist-panel li::before {
  position: absolute;
  left: 0;
  top: 3px;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  content: "";
}

.checklist-panel li::after {
  position: absolute;
  left: 6px;
  top: 7px;
  width: 6px;
  height: 9px;
  border-right: 2px solid #0f766e;
  border-bottom: 2px solid #0f766e;
  content: "";
  transform: rotate(40deg);
}

.portal-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.portal-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.property-portal-landing {
  min-height: 100vh;
  background: var(--background);
}

.property-portal-hero {
  display: grid;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  align-content: center;
  gap: 56px;
  padding-top: 42px;
  padding-right: clamp(24px, 6vw, 88px);
  padding-bottom: 42px;
  padding-left: clamp(24px, 6vw, 88px);
}

.property-portal-copy h1 {
  margin: 10px 0 0;
  color: var(--foreground);
  font-size: clamp(38px, 6vw, 72px);
  line-height: .98;
  letter-spacing: 0;
}

.property-portal-copy p {
  margin: 18px 0 0;
  color: var(--muted-foreground);
  font-size: 18px;
  line-height: 1.6;
}

.property-soon-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 18%, rgba(20, 184, 166, .12), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.property-soon-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  align-content: center;
  gap: 48px;
  padding-top: 42px;
  padding-right: clamp(24px, 6vw, 88px);
  padding-bottom: 42px;
  padding-left: clamp(24px, 6vw, 88px);
}

.property-soon-card {
  display: grid;
  width: 100%;
  min-height: 64vh;
  align-content: center;
  border-top: 1px solid rgba(108, 95, 199, .18);
  border-bottom: 1px solid rgba(108, 95, 199, .18);
  padding: clamp(28px, 6vw, 56px) 0;
}

.property-soon-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 22px;
}

.property-soon-card h1 {
  margin: 10px 0 0;
  color: var(--foreground);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.property-soon-card p {
  margin: 18px 0 0;
  color: var(--muted-foreground);
  font-size: 17px;
  line-height: 1.65;
}

.property-soon-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.property-soon-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.register-section {
  padding: 64px 0 72px;
  background: #f8fafc;
}

.register-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.register-copy {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 18px;
}

.register-copy h1,
.register-success h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.register-copy p,
.register-success p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 17px;
}

.register-note,
.register-panel,
.register-success {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.register-note {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.register-note span {
  color: var(--muted-foreground);
  font-size: 14px;
}

.register-panel {
  padding: 24px;
}

.register-panel .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.register-panel .panel-heading h2 {
  margin: 0;
  font-size: 22px;
}

.register-panel .panel-heading p {
  margin: 4px 0 0;
  color: var(--muted-foreground);
}

.public-register-form {
  gap: 18px;
}

.public-register-form input,
.public-register-form select,
.public-register-form textarea {
  width: 100%;
}

.register-success-section {
  min-height: 58vh;
  display: grid;
  align-items: center;
}

.register-success {
  display: grid;
  gap: 18px;
  max-width: 720px;
  padding: 34px;
}

.site-footer {
  padding: 38px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.footer-brand {
  color: var(--foreground);
}

.footer-inner p {
  margin: 12px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  font-weight: 600;
}

.footer-copy {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

@media (max-width: 920px) {
  .desktop-nav,
  .header-actions {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .hero-grid,
  .operations-grid {
    grid-template-columns: 1fr;
  }

  .hero-media img {
    min-height: 320px;
  }

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

  .portal-inner,
  .footer-inner,
  .register-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .register-copy {
    position: static;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding-top: 48px;
  }

  .hero-stats,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .media-panel {
    position: static;
    margin: 12px;
  }
}

.app-body {
  --background: #f6f5f8;
  --foreground: #2b2435;
  --muted: #faf9fb;
  --muted-foreground: #6f6878;
  --border: #dedbe5;
  --panel: #ffffff;
  --primary: #6c5fc7;
  --primary-foreground: #ffffff;
  --accent: #6c5fc7;
  --accent-soft: #f0ecff;
  --ring: #6c5fc7;
  --shadow: 0 1px 2px rgba(43, 36, 53, .08);
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-size: 13px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 64px 252px minmax(0, 1fr);
}

.client-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.client-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  align-content: start;
  gap: 22px;
  border-right: 1px solid var(--border);
  background: #fbfafc;
  padding: 24px 18px;
}

.client-sidebar-header {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.client-sidebar-header > span {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
}

.client-main {
  min-width: 0;
}

.client-nav {
  display: grid;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  border-right: 1px solid var(--border);
  background: #ffffff;
  padding: 10px 8px;
}

.app-rail-brand,
.app-rail-item,
.app-rail-user {
  position: relative;
  display: grid;
  width: 42px;
  min-height: 42px;
  align-items: center;
  justify-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px;
  color: #4f465c;
  font-size: 12px;
  font-weight: 800;
}

.app-rail-brand {
  color: var(--foreground);
}

.app-rail-brand::after,
.app-rail-item::after,
.app-rail-user::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  z-index: 80;
  width: max-content;
  max-width: 220px;
  padding: 6px 9px;
  border: 1px solid #23202a;
  border-radius: 6px;
  background: #23202a;
  box-shadow: 0 10px 22px rgba(24, 19, 32, 0.18);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.app-rail-brand::before,
.app-rail-item::before,
.app-rail-user::before {
  position: absolute;
  top: 50%;
  left: calc(100% + 5px);
  z-index: 81;
  width: 8px;
  height: 8px;
  background: #23202a;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%) rotate(45deg);
  transition: opacity 120ms ease, transform 120ms ease;
}

.app-rail-brand:hover::after,
.app-rail-brand:hover::before,
.app-rail-brand:focus-visible::after,
.app-rail-brand:focus-visible::before,
.app-rail-item:hover::after,
.app-rail-item:hover::before,
.app-rail-item:focus-visible::after,
.app-rail-item:focus-visible::before,
.app-rail-user:hover::after,
.app-rail-user:hover::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.app-rail-brand:hover::before,
.app-rail-brand:focus-visible::before,
.app-rail-item:hover::before,
.app-rail-item:focus-visible::before,
.app-rail-user:hover::before {
  transform: translate(0, -50%) rotate(45deg);
}

.app-rail-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 18px;
}

.app-rail-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #f2f0f6;
  color: #5f566c;
  font-size: 14px;
  font-weight: 900;
}

.app-rail-item:hover,
.app-rail-item.active {
  border-color: #cfc9ef;
  background: var(--accent-soft);
  color: var(--primary);
}

.app-rail-brand .app-rail-icon,
.app-rail-item.active .app-rail-icon {
  background: var(--primary);
  color: var(--primary-foreground);
}

.app-rail-user {
  border-color: var(--border);
  background: var(--muted);
  color: var(--foreground);
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--border);
  background: #fbfafc;
  padding: 0;
}

.app-sidebar-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  min-height: 72px;
  align-content: center;
  border-bottom: 1px solid var(--border);
  background: rgba(251, 250, 252, .96);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

.app-sidebar-header span {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-sidebar-header strong {
  margin-top: 2px;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 800;
}

.app-sidebar-content {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.app-brand {
  display: flex;
  margin-bottom: 18px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--border);
}

.app-brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
}

.app-brand .brand-text {
  font-size: 15px;
  font-weight: 800;
}

.app-nav {
  display: grid;
  gap: 3px;
}

.app-nav-label,
.app-kicker {
  margin: 14px 8px 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-nav-item {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 5px 8px;
  color: #4f465c;
  font-size: 13px;
  font-weight: 600;
}

.app-nav-item:hover {
  background: #f1eff6;
  color: var(--foreground);
}

.app-nav-item.active {
  background: var(--accent-soft);
  color: var(--primary);
}

.app-nav-item.disabled {
  cursor: not-allowed;
  opacity: .55;
}

.app-nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  background: #f2f0f6;
  color: #6f6878;
  font-size: 12px;
  font-weight: 800;
}

.app-nav-item.active .app-nav-icon {
  background: #ffffff;
  color: var(--primary);
}

.app-main {
  min-width: 0;
  background: var(--background);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px) auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .92);
  padding: 7px 22px;
  backdrop-filter: blur(12px);
}

.client-main .app-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.client-shell.has-client-impersonation {
  min-height: calc(100vh - 44px);
}

.client-shell.has-client-impersonation .client-sidebar {
  top: 44px;
  height: calc(100vh - 44px);
}

.client-shell.has-client-impersonation .app-topbar {
  top: 44px;
}

.client-impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985;
  padding: 8px 22px;
}

.client-impersonation-banner > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.client-impersonation-banner i {
  color: #0284c7;
  font-size: 14px;
}

.client-impersonation-banner span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.client-impersonation-banner strong,
.client-impersonation-banner small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-impersonation-banner strong {
  font-size: 12px;
  line-height: 1.15;
}

.client-impersonation-banner small {
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
}

.app-breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
}

.app-breadcrumbs strong {
  color: var(--foreground);
}

.app-search {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfafc;
  padding: 0 10px;
  color: var(--muted-foreground);
}

.app-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  outline: 0;
}

.app-search:focus-within {
  border-color: #b8b0df;
  box-shadow: 0 0 0 2px rgba(108, 95, 199, .14);
}

.app-view-site {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfafc;
  padding: 0 11px;
  color: #3b3347;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(43, 36, 53, .05);
}

.app-view-site:hover {
  border-color: #c8c1d5;
  background: #f2f0f6;
}

.app-topbar h1 {
  margin: 0;
  font-size: 18px;
}

.app-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-user-trigger {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 3px 6px;
  color: var(--foreground);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.app-user-trigger:hover,
.app-user-trigger[aria-expanded="true"] {
  background: #f4f1fb;
}

.app-user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d8d1f2;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.app-user-label {
  min-width: 0;
}

.app-user strong,
.app-user span {
  display: block;
  font-size: 13px;
}

.app-user span {
  color: var(--muted-foreground);
}

.app-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 220px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(26, 19, 43, .16);
  padding: 6px;
}

.app-user-menu[hidden] {
  display: none !important;
}

.app-user-menu-header {
  border-bottom: 1px solid var(--border);
  margin: 0 0 4px;
  padding: 8px 9px 10px;
}

.app-user-menu-header strong,
.app-user-menu-header span {
  display: block;
}

.app-user-menu-header strong {
  color: var(--foreground);
  font-size: 13px;
}

.app-user-menu-header span {
  color: var(--muted-foreground);
  font-size: 12px;
}

.app-user-menu-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--foreground);
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.app-user-menu-item:hover {
  background: #f4f1fb;
  color: var(--foreground);
}

.app-user-menu-button {
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.app-content {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.root-module-shell {
  display: grid;
  width: 100%;
  min-height: calc(100vh - 92px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.root-module-header {
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.root-module-header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 14px;
}

.root-module-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.root-module-header p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.root-module-content-container {
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.root-module-content-grid {
  display: grid;
  width: 100%;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.root-module-side-panel[hidden] {
  display: none !important;
}

.root-module-side-panel {
  min-width: 250px;
  overflow: auto;
  background: var(--panel);
}

.root-module-side-panel-left {
  border-right: 1px solid var(--border);
}

.root-module-side-panel-right {
  border-left: 1px solid var(--border);
}

.root-module-content {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  gap: 14px;
  overflow: auto;
  padding: 16px 0 0;
  background: transparent;
}

.root-module-content > * {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.root-module-content .app-panel,
.root-module-content .datatable-controls,
.root-module-content .app-table-panel,
.root-module-content .form-panel {
  width: 100%;
  max-width: none;
}

.root-module-content[aria-busy="true"] {
  cursor: wait;
  opacity: .72;
}

.root-module-footer {
  min-height: 60px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.app-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.app-page-heading h1,
.app-page-heading h2 {
  margin: 7px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.app-page-heading p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.app-stat-card,
.app-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-stat-card {
  padding: 15px;
}

.app-stat-card span {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.app-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

.app-stat-card p {
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.app-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 16px;
}

.client-stat-grid {
  margin-top: 18px;
}

.client-dashboard-grid,
.client-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

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

.app-panel {
  padding: 16px;
}

.app-panel h2,
.app-panel h3 {
  margin: 0;
  font-size: 15px;
}

.app-panel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 15px;
}

.client-onboarding-card {
  display: flex;
  min-height: 190px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.client-onboarding-action,
.panel-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.client-onboarding-action {
  justify-content: flex-end;
}

.client-flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  background: #f0fdf4;
  color: #166534;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.client-form-panel,
.client-properties-panel {
  margin-top: 16px;
}

.client-onboarding-card p,
.client-next-steps p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.client-next-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.panel-heading p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.app-panel p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
}

.app-panel-note {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.app-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted-foreground);
}

.app-alert {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 700;
}

.app-alert-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.app-alert-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.app-toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.app-toast {
  --ui-toast-bg: rgba(255, 255, 255, .96);
  --ui-toast-border-color: var(--border);
  --ui-toast-border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-toast .toast-header {
  color: var(--foreground);
  font-weight: 800;
}

.app-toast-title {
  margin-right: auto;
}

.app-toast-success {
  border-color: #bbf7d0;
}

.app-toast-error {
  border-color: #fecaca;
}

.app-toast-warning {
  border-color: #fde68a;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 200px auto;
  gap: 12px;
  align-items: end;
}

.datatable-controls {
  padding: 14px;
}

.datatable-filter-form {
  display: grid;
  gap: 14px;
}

.datatable-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px auto auto;
  gap: 10px;
  align-items: end;
}

.datatable-search,
.datatable-limit {
  min-width: 0;
}

.datatable-advanced {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 280px) auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.datatable-filter-actions {
  display: flex;
  justify-content: flex-end;
}

.datatable-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}

.datatable-stats div {
  display: grid;
  gap: 4px;
  background: var(--panel);
  padding: 11px 13px;
}

.datatable-stats span,
.datatable-state > span {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.datatable-stats strong {
  font-size: 15px;
  line-height: 1.15;
}

.datatable-state {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 11px 13px;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sort-icon {
  position: relative;
  display: inline-grid;
  width: 10px;
  height: 14px;
  opacity: .42;
}

.sort-icon::before,
.sort-icon::after {
  position: absolute;
  left: 1px;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
}

.sort-icon::before {
  top: 1px;
  border-bottom: 5px solid currentColor;
}

.sort-icon::after {
  bottom: 1px;
  border-top: 5px solid currentColor;
}

.sort-link.active {
  color: var(--foreground);
}

.sort-link.active .sort-icon {
  opacity: 1;
}

.sort-link.active[data-sort-dir="asc"] .sort-icon::after,
.sort-link.active[data-sort-dir="desc"] .sort-icon::before {
  opacity: .24;
}

.permission-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.permission-main {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.permission-toolbar {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.module-sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
}

.module-sidebar-inner {
  max-height: calc(100vh - 128px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
  padding: 12px;
}

.module-filter {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  padding: 2px 2px 12px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 800;
}

.module-filter input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
}

.module-filter input:focus {
  border-color: var(--ring);
  outline: 2px solid rgba(17, 24, 39, .16);
  outline-offset: 1px;
}

.module-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.module-list-item {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 700;
}

.module-list-item:hover {
  background: var(--muted);
  color: var(--foreground);
}

.module-list-item.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.module-list-item strong {
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--muted);
  color: var(--foreground);
  font-size: 12px;
}

.module-list-item.active strong {
  background: rgba(255, 255, 255, .16);
  color: var(--primary-foreground);
}

.app-table-panel {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.table-meta span {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  border-top: 1px solid var(--border);
  padding: 10px 13px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #fbfafc;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.data-table th a {
  color: var(--foreground);
}

.data-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.empty-cell {
  color: var(--muted-foreground);
  text-align: center;
}

.badge-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.badge {
  background: #f2f0f6;
  color: var(--foreground);
}

.status-badge {
  border: 1px solid var(--border);
}

.status-active {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.status-pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.status-archived {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.status-inactive {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.status-trial {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.status-suspended {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* Cron module sub-navigation */
.cron-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

/* Cron run statuses */
.status-completed {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.status-started {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.status-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  color: #075985;
  padding: 10px 12px;
}

.impersonation-banner strong,
.impersonation-banner span {
  display: block;
}

.impersonation-banner span {
  margin-top: 2px;
  color: #0369a1;
  font-size: 12px;
}

.pagination {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
}

.pagination a {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.pagination a.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.form-panel {
  max-width: none;
}

.resource-form {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

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

.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
}

.form-field select {
  min-height: 34px;
  background: var(--panel);
}

.password-field {
  display: flex;
  width: 100%;
  align-items: stretch;
}

.password-field input {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle {
  display: inline-grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  min-width: 0;
  min-height: 34px;
  margin-left: -1px;
  border-color: var(--border);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0;
  align-self: stretch;
  background: var(--panel);
  color: var(--muted-foreground);
  box-shadow: none;
}

.password-toggle:hover {
  transform: none;
  border-color: var(--ring);
  background: var(--muted);
  color: var(--foreground);
}

.password-field:focus-within .password-toggle {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(108, 95, 199, .16);
  clip-path: inset(-3px -3px -3px 0);
}

.password-field input:focus {
  position: relative;
  z-index: 1;
}

.password-field input.is-invalid + .password-toggle {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .1);
  clip-path: inset(-3px -3px -3px 0);
}

.password-toggle .bi {
  color: currentColor;
  font-size: 16px;
  line-height: 1;
}

.form-field textarea {
  resize: vertical;
}

.checkbox-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.checkbox-section h3,
.permission-group h4,
.settings-card h3 {
  margin: 0;
}

.checkbox-section p,
.settings-card p {
  margin: 6px 0 0;
  color: var(--muted-foreground);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.choice-card input {
  margin-top: 3px;
}

.choice-card small {
  display: block;
  color: var(--muted-foreground);
  font-size: 12px;
}

.permission-groups {
  display: grid;
  gap: 18px;
}

.permission-group {
  display: grid;
  gap: 10px;
}

.field-error {
  color: #b91c1c;
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  display: grid;
  min-height: 220px;
  align-content: space-between;
  gap: 18px;
}

.settings-count {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #134e4a;
  font-weight: 900;
}

/* Settings form — label/help on the left, control on the right */
.settings-form {
  display: grid;
  gap: 22px;
  max-width: 940px;
  margin-top: 14px;
}

.settings-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.settings-panel-head {
  padding: 15px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.settings-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.settings-panel-head p {
  margin: 3px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 28px;
  padding: 18px 22px;
  align-items: start;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-row-label {
  font-size: 14px;
  font-weight: 700;
}

.settings-row-label label {
  display: block;
}

.settings-row-help {
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

.settings-row .form-field {
  gap: 6px;
}

@media (max-width: 760px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Notifications — topbar bell + list */
.topbar-bell {
  position: relative;
}

.topbar-bell-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 6px;
}

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

.notification-item.is-unread {
  background: var(--accent-soft);
  border-radius: 8px;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.notification-item.is-unread .notification-icon {
  background: var(--panel);
  color: var(--foreground);
}

.notification-body strong {
  font-size: 14px;
}

.notification-body p {
  margin: 3px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.notification-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.notification-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notification-empty {
  padding: 26px 6px;
  color: var(--muted-foreground);
  text-align: center;
  list-style: none;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, .86), rgba(255, 255, 255, .96)),
    #f8fafc;
  padding: 32px 16px;
}

.auth-panel {
  width: min(100%, 440px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  margin-bottom: 26px;
}

.auth-panel h1 {
  margin: 14px 0 0;
  font-size: 32px;
  line-height: 1.1;
}

.auth-copy,
.auth-footer {
  color: var(--muted-foreground);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--ring);
  outline: 2px solid rgba(108, 95, 199, .16);
  outline-offset: 1px;
}

.form-field input.is-invalid,
.form-field select.is-invalid,
.form-field textarea.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .1);
}

.form-field small {
  color: var(--muted-foreground);
  font-weight: 600;
}

.form-field small.field-error,
.form-field .field-error {
  color: #b91c1c;
  font-weight: 700;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 700;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--foreground);
}

.invalid-feedback {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

.form-field .password-field input {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.form-field .password-field .password-toggle {
  flex: 0 0 40px;
  width: 40px;
  min-height: 34px;
  margin-left: -1px;
  border-color: var(--border);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: #f8f9fa;
}

.form-field .password-field input:focus {
  outline-offset: 0;
  box-shadow: none;
}

.form-field .password-field input.is-invalid {
  border-right-color: #dc2626;
  box-shadow: none;
}

.form-field .password-field input.is-invalid + .password-toggle {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fff7f7;
}

.spinner-border {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -2px;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-alert {
  margin-top: 18px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.auth-footer {
  margin: 20px 0 0;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-rail {
    position: static;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app-rail-nav {
    grid-template-columns: repeat(6, minmax(0, auto));
    justify-content: end;
    margin-top: 0;
  }

  .app-rail-user {
    display: none;
  }

  .app-rail-brand::before,
  .app-rail-brand::after,
  .app-rail-item::before,
  .app-rail-item::after,
  .app-rail-user::before,
  .app-rail-user::after {
    display: none;
  }

  .app-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app-sidebar-header {
    position: static;
  }

  .app-sidebar-content {
    overflow: visible;
  }

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

  .app-stat-grid,
  .app-panel-grid,
  .settings-grid,
  .client-dashboard-grid,
  .client-onboarding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .permission-workspace {
    grid-template-columns: 1fr;
  }

  .module-sidebar {
    position: static;
  }

  .module-sidebar-inner {
    max-height: none;
  }

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

  .root-module-shell {
    min-height: auto;
  }

  .client-shell {
    grid-template-columns: 1fr;
  }

  .client-sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 680px) {
  .app-topbar,
  .app-user,
  .app-page-heading {
    align-items: flex-start;
  }

  .app-topbar,
  .app-user,
  .app-page-heading,
  .app-nav,
  .client-impersonation-banner {
    display: grid;
  }

  .client-main .app-topbar,
  .client-impersonation-banner {
    grid-template-columns: 1fr;
  }

  .client-impersonation-banner {
    align-items: flex-start;
  }

  .app-content,
  .app-topbar {
    padding: 18px;
  }

  .root-module-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .root-module-content {
    padding: 18px;
  }

  .app-stat-grid,
  .app-panel-grid,
  .table-toolbar,
  .form-grid,
  .checkbox-grid,
  .settings-grid,
  .client-dashboard-grid,
  .client-onboarding-grid {
    grid-template-columns: 1fr;
  }

  .client-next-steps {
    align-items: flex-start;
    flex-direction: column;
  }

  .datatable-toolbar,
  .datatable-advanced {
    grid-template-columns: 1fr;
  }

  .datatable-stats {
    grid-template-columns: 1fr;
  }

  .datatable-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .datatable-filter-actions {
    justify-content: stretch;
  }

  .datatable-filter-actions .btn {
    width: 100%;
  }

  .module-list {
    grid-template-columns: 1fr;
  }
}

.form-label { display:block; margin-bottom:4px; color: var(--muted-foreground); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.app-topbar-link { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:6px; padding:6px 10px; background:#f8fafc; color: var(--muted-foreground); font-size:13px; font-weight:600; }
.app-topbar-link:hover { border-color:#cbd5e1; background:#eef2f7; color: var(--foreground); }
.app-topbar-actions { display:flex; align-items:center; gap:12px; margin-left:auto; }
.app-user-logout { margin-left: 12px; }
.app-alert-success { border-color:#bbf7d0; background:#ecfdf5; color:#047857; }
.app-alert-error { border-color:#fecaca; background:#fef2f2; color:#b91c1c; }

/* Marketplace catalogue (slice 009.3) */
.marketplace-hero { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color:#e2e8f0; padding:48px 0; }
.marketplace-hero h1 { color:#fff; font-size:36px; margin:0 0 8px; }
.marketplace-hero p { font-size:17px; max-width:640px; }
.marketplace-search { display:flex; gap:8px; margin-top:16px; max-width:520px; }
.marketplace-search input { flex:1; padding:10px 14px; border:1px solid #334155; border-radius:8px; background:#fff; color:#111; font-size:15px; }

.marketplace-section { padding:32px 0; }
.marketplace-section h2 { font-size:22px; margin:0 0 16px; }

.marketplace-category-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:12px; }
.marketplace-category-card { display:flex; flex-direction:column; gap:6px; padding:18px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; color:#0f172a; text-decoration:none; transition: border-color .12s, transform .12s; }
.marketplace-category-card:hover { border-color:#3b82f6; transform: translateY(-2px); }
.marketplace-category-card i { font-size:22px; color:#3b82f6; }
.marketplace-category-card strong { font-size:15px; }
.marketplace-category-card small { color:#64748b; font-size:12px; }

.marketplace-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.marketplace-card { display:flex; flex-direction:column; gap:8px; padding:18px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; color:inherit; text-decoration:none; transition: border-color .12s, transform .12s, box-shadow .12s; }
.marketplace-card:hover { border-color:#3b82f6; transform: translateY(-2px); box-shadow: 0 8px 24px -12px rgba(59,130,246,0.35); }
.marketplace-card header { display:flex; gap:6px; align-items:center; }
.marketplace-card header strong { font-size:16px; }
.marketplace-card-tagline { font-size:13px; color:#475569; margin:0; min-height:36px; }
.marketplace-card footer { display:flex; justify-content:space-between; align-items:center; font-size:13px; margin-top:auto; }
.marketplace-card footer strong { color:#0f172a; }

.marketplace-tagline { font-size:18px; color:#cbd5e1; max-width:720px; }

.marketplace-detail { display:grid; grid-template-columns:1fr 320px; gap:32px; align-items:start; }
.marketplace-description { white-space:pre-wrap; font-family:inherit; font-size:15px; line-height:1.55; }
.marketplace-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:16px; }
.marketplace-tags code { background:#eef2f7; color:#334155; padding:3px 8px; border-radius:999px; font-size:12px; }

.marketplace-install-card { padding:20px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; position:sticky; top:96px; }
.marketplace-price { display:block; font-size:24px; font-weight:700; margin-bottom:12px; }
.marketplace-install-help { font-size:12px; color:#64748b; margin-top:8px; }
.marketplace-install-form .form-field { margin-bottom:12px; }
.marketplace-meta { list-style:none; padding:0; margin:16px 0 0; font-size:13px; color:#475569; }
.marketplace-meta li { padding:4px 0; border-top:1px solid #f1f5f9; }
.marketplace-meta li:first-child { border-top:none; }

@media (max-width:900px) {
  .marketplace-detail { grid-template-columns:1fr; }
  .marketplace-install-card { position:static; }
}

/* ─────────────────────────────────────────────────────────────────────
   Marketplace SPA polish (slice 009 refactor)
   ───────────────────────────────────────────────────────────────────── */

/* Sub-nav active state: the .btn-primary toggle that initMarketplaceSpa
   applies via JS already wins, but ensure focus + spacing reads well */
[data-marketplace-subnav] {
  margin: 8px 0 20px;
  padding: 6px;
  background: var(--muted, #f1f5f9);
  border-radius: 10px;
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

[data-marketplace-subnav] .btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground, #475569);
  box-shadow: none;
}

[data-marketplace-subnav] .btn:hover {
  background: rgba(255,255,255,0.55);
  color: var(--foreground, #0f172a);
}

[data-marketplace-subnav] .btn.btn-primary {
  background: var(--panel, #fff);
  color: var(--foreground, #0f172a);
  border-color: var(--border, #e2e8f0);
  box-shadow: 0 1px 0 rgba(15,23,42,0.04), 0 4px 12px -8px rgba(15,23,42,0.2);
}

/* Loading state on the SPA panel */
[data-marketplace-spa][aria-busy="true"] {
  opacity: 0.55;
  transition: opacity 120ms ease-out;
  pointer-events: none;
}

[data-marketplace-spa] {
  transition: opacity 120ms ease-in;
}

/* Settings form polish — wider container + tighter row separators */
.settings-panel { box-shadow: 0 1px 0 rgba(15,23,42,0.03); }

.settings-row .form-field { margin: 0; max-width: 420px; }

/* Input with an inline affix (e.g. "%" in the fee field) */
.input-with-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  max-width: 200px;
  background: #fff;
}

.input-with-affix input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  outline: none;
  min-width: 0;
}

.input-with-affix:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.input-with-affix .input-affix {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  background: var(--muted, #f1f5f9);
  color: var(--muted-foreground, #475569);
  font-weight: 700;
  font-size: 14px;
  border-left: 1px solid var(--border, #e2e8f0);
}

/* Checkbox pill group (e.g. USD/CAD chooser) */
.form-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  margin: 0;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground, #475569);
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}

.checkbox-pill input[type="checkbox"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border, #cbd5e1);
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
}

.checkbox-pill input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-pill input[type="checkbox"]:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  clip-path: polygon(15% 50%, 0 65%, 40% 100%, 100% 30%, 85% 15%, 40% 65%);
}

.checkbox-pill:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1e3a8a;
}

.checkbox-pill input:disabled,
.checkbox-pill:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Toggle switch (Sentry-style) */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground, #475569);
}

.toggle-switch input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background .12s ease;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15,23,42,0.25);
  transition: transform .15s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: #16a34a;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.toggle-switch input:disabled + .toggle-track {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle-switch input:checked ~ .toggle-label::before {
  content: '';
}

/* Tighten status pills inside settings */
.settings-row .status-badge {
  align-self: flex-start;
}

/* Reviews — star input, public list, Root reject inline form (slice 009.7) */
.star-input { display:flex; gap:8px; align-items:center; padding:0; border:0; }
.star-input legend { width:100%; }
.star-input-cell {
  display:inline-flex; flex-direction:column; align-items:center; gap:2px;
  cursor:pointer; padding:6px 10px; border-radius:8px;
  border:1px solid var(--border,#e2e8f0); background:#fff; user-select:none;
}
.star-input-cell input { position:absolute; opacity:0; pointer-events:none; }
.star-input-cell span { font-size:24px; line-height:1; color:#cbd5e1; transition:color .12s; }
.star-input-cell small { font-size:11px; color:var(--muted-foreground,#475569); font-weight:700; }
.star-input-cell:has(input:checked),
.star-input-cell:has(input:checked) ~ .star-input-cell {
  /* keep filled stars to the LEFT of the selected one — sibling selector is forward */
}
.star-input-cell:has(input:checked) span { color:#f59e0b; }
.star-input-cell:has(input:checked) { border-color:#f59e0b; background:#fffbeb; }
/* Fill stars at-or-before the checked one using :has on the parent */
.star-input:has(input[value="1"]:checked) .star-input-cell:nth-of-type(-n+1) span,
.star-input:has(input[value="2"]:checked) .star-input-cell:nth-of-type(-n+2) span,
.star-input:has(input[value="3"]:checked) .star-input-cell:nth-of-type(-n+3) span,
.star-input:has(input[value="4"]:checked) .star-input-cell:nth-of-type(-n+4) span,
.star-input:has(input[value="5"]:checked) .star-input-cell:nth-of-type(-n+5) span { color:#f59e0b; }

.marketplace-rating { color:#f59e0b; font-weight:700; letter-spacing:1px; }

.marketplace-reviews { display:grid; gap:16px; margin-top:12px; }
.marketplace-review { border:1px solid var(--border,#e2e8f0); border-radius:12px; padding:18px; background:#fff; }
.marketplace-review header { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.marketplace-review-avatar {
  width:36px; height:36px; border-radius:50%;
  display:grid; place-items:center;
  background:#eef2f7; color:#1e3a8a; font-weight:800;
}
.marketplace-review header > div { flex:1; display:flex; flex-direction:column; gap:2px; }
.marketplace-review header strong { font-size:15px; }
.marketplace-review header small { color:var(--muted-foreground,#475569); font-size:12px; }
.marketplace-review-stars { color:#f59e0b; font-size:18px; letter-spacing:1px; }
.marketplace-review p { margin:0; line-height:1.5; color:#0f172a; }

.reject-inline { margin-top:8px; display:grid; gap:6px; padding:10px; border:1px dashed #fecaca; border-radius:8px; background:#fef2f2; }
.reject-inline textarea { width:100%; font-family:inherit; font-size:13px; padding:8px; border:1px solid var(--border,#e2e8f0); border-radius:6px; resize:vertical; }

/* Slice 003a — store admin */
.room-color-swatch {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 4px; vertical-align: middle; margin-right: 4px;
  border: 1px solid rgba(15,23,42,0.15);
}

/* Slice 003d — calendar panel + session detail dialog */
.calendar-panel { padding: 16px; }
#store-admin-calendar { background: var(--panel, #fff); border-radius: 8px; }
.fc .fc-event.cs-cancelled { opacity: 0.45; text-decoration: line-through; }
.fc .fc-event { cursor: pointer; }

.session-dialog {
  border: none; border-radius: 12px; padding: 0;
  max-width: 460px; width: calc(100vw - 32px);
  box-shadow: 0 20px 60px -10px rgba(15,23,42,0.4);
}
.session-dialog::backdrop { background: rgba(15,23,42,0.5); }
.session-dialog article { padding: 18px; }
.session-dialog header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.session-dialog header strong { font-size: 17px; }
.session-dialog header button {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted-foreground, #475569);
}
.session-detail-grid {
  display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px;
  margin: 0 0 16px; font-size: 13px;
}
.session-detail-grid dt { color: var(--muted-foreground, #475569); font-weight: 600; }
.session-detail-grid dd { margin: 0; }

/* Slice 004b — store-portal customer surfaces */
.portal-header {
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #fff;
}
.portal-header-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
}
.portal-nav {
  display: flex; gap: 16px; margin-left: 12px;
}
.portal-nav a {
  color: var(--muted-foreground, #475569);
  font-weight: 600; font-size: 14px;
}
.portal-nav a:hover { color: var(--foreground, #0f172a); }
.portal-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.portal-greeting { font-size: 13px; color: var(--muted-foreground, #475569); }
.portal-main { padding: 24px 0 60px; }
.portal-hero {
  padding: 16px 0 24px;
}
.portal-hero h1 { font-size: 28px; margin: 0 0 6px; }
.portal-hero p { color: var(--muted-foreground, #475569); margin: 0; }
.portal-auth { max-width: 460px; margin: 32px auto; padding: 24px; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; background: #fff; }
.portal-auth h1 { font-size: 24px; margin: 0 0 6px; }
.portal-auth p { color: var(--muted-foreground, #475569); margin: 0 0 16px; }
.portal-booking-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.portal-booking-list li {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px;
}
.portal-booking-list li div { display: flex; flex-direction: column; gap: 2px; }
.portal-booking-list li small { color: var(--muted-foreground, #475569); font-size: 12px; }
