:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #152536;
  background: #f1f5f8;
  font-synthesis: none;
  --navy: #071d2d;
  --navy-soft: #102f43;
  --green: #0c9b70;
  --green-dark: #087a59;
  --line: #dfe7ed;
  --muted: #68798b;
  --surface: #fff;
  --danger: #d64545;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}

/* Authentication and onboarding */
.public-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(520px, 1.08fr);
}
.public-brand {
  padding: clamp(3rem, 7vw, 7rem);
  color: #dcebf3;
  background:
    radial-gradient(circle at 15% 15%, #174d62 0, transparent 34%),
    linear-gradient(145deg, #061824, #0a2d43 70%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #35dda4;
  border: 2px solid #35dda4;
  font-weight: 900;
}
.brand-mark.large {
  width: 54px;
  height: 54px;
  font-size: 1.5rem;
  border-radius: 16px;
}
.eyebrow {
  margin: 2rem 0 0.5rem;
  color: #35dda4;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  font-weight: 850;
}
.eyebrow.dark {
  margin-top: 0;
  color: var(--green-dark);
}
.public-brand h1 {
  margin: 0.4rem 0 1.4rem;
  color: white;
  font-size: clamp(2.7rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.public-brand h1 span {
  color: #35dda4;
}
.public-brand > p:last-of-type {
  max-width: 34rem;
  font-size: 1.08rem;
  line-height: 1.7;
}
.brand-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  margin-top: 1.5rem;
  color: #acd0de;
  font-size: 0.83rem;
}
.public-card {
  align-self: center;
  width: min(92%, 680px);
  max-height: calc(100vh - 4rem);
  overflow: auto;
  margin: 2rem auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: white;
  border: 1px solid #e4ebf0;
  border-radius: 24px;
  box-shadow: 0 28px 80px #17324f1f;
}
.auth-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.auth-tabs button {
  flex: 1;
  padding: 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: #78889a;
  font-weight: 750;
}
.auth-tabs button.active {
  color: var(--green-dark);
  border-color: var(--green);
}
h2 {
  margin: 0.35rem 0 1.25rem;
  font-size: 1.6rem;
  letter-spacing: -0.025em;
}
label {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0;
  color: #34495c;
  font-size: 0.82rem;
  font-weight: 750;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.84rem 0.95rem;
  color: #172b3b;
  background: white;
  border: 1px solid #cdd9e1;
  border-radius: 10px;
  outline: none;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #0c9b701a;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.primary,
.secondary,
.danger,
.ghost-button,
.table-action {
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 9px;
  font-weight: 800;
}
.primary {
  color: white;
  background: var(--green);
}
.primary:hover {
  background: var(--green-dark);
}
.secondary {
  color: #29465a;
  background: #eaf0f4;
}
.danger {
  color: white;
  background: var(--danger);
}
.public-card form > .primary,
#onboarding-view > button {
  width: 100%;
  margin-top: 0.7rem;
}
.summary {
  margin: 1rem 0;
  padding: 1rem;
  color: #405669;
  background: #f3f7fa;
  border-radius: 12px;
}
.form-message {
  min-height: 1.35rem;
  color: #c93d3d;
  font-size: 0.88rem;
  font-weight: 700;
}
.success {
  color: var(--green-dark) !important;
}

/* Authenticated layouts */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #d8e6ed;
  background: var(--navy);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: 78px;
  padding: 0 1.25rem;
  border-bottom: 1px solid #ffffff12;
}
.sidebar-brand div {
  display: grid;
}
.sidebar-brand b {
  color: white;
  font-size: 0.98rem;
}
.sidebar-brand small {
  color: #7fa0b0;
  font-size: 0.72rem;
}
.side-nav {
  flex: 1;
  padding: 1rem 0.7rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0;
  padding: 0.68rem 0.75rem;
  color: #9eb5c1;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 650;
}
.side-nav a:hover {
  color: white;
  background: #ffffff0a;
}
.side-nav a.active {
  color: white;
  background: #0c9b702e;
  box-shadow: inset 3px 0 #27d49c;
}
.nav-icon {
  width: 24px;
  color: #55d9ad;
  text-align: center;
  font-weight: 900;
}
.sidebar-footer {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #ffffff12;
}
.sidebar-footer small {
  overflow: hidden;
  color: #8ca7b4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ghost-button {
  padding: 0.65rem;
  color: #dce9ee;
  background: #ffffff0b;
}
.workspace {
  min-width: 0;
}
.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 78px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.menu-toggle {
  display: none;
  border: 0;
  background: none;
  font-size: 1.35rem;
}
.topbar-context {
  display: grid;
  margin-right: auto;
}
.topbar-context span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.user-chip > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: #dff8ef;
  border-radius: 50%;
  font-weight: 900;
}
.user-chip div {
  display: grid;
}
.user-chip b {
  font-size: 0.82rem;
}
.user-chip small {
  color: var(--muted);
  font-size: 0.68rem;
}
.route-content {
  max-width: 1500px;
  margin: auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  outline: none;
}
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.page-header h1 {
  margin: 0.55rem 0 0.35rem;
  color: #10283a;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.035em;
}
.page-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}
.status-neutral {
  color: #586a79;
  background: #eaf0f3;
}
.status-success {
  color: #087452;
  background: #d9f7ec;
}
.status-warning {
  color: #8a5b00;
  background: #fff1c2;
}
.status-info {
  color: #176187;
  background: #dceff8;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.metric-card {
  min-height: 138px;
  display: grid;
  align-content: space-between;
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px #17324f08;
}
.metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.metric-card strong {
  color: #0a7658;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}
.metric-card small {
  color: #8593a0;
}
.panel-section {
  margin-bottom: 1.5rem;
  padding: 1.35rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.section-heading {
  margin-bottom: 1rem;
}
.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}
.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.action-grid,
.capability-grid,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.action-card,
.capability-grid article,
.plan-card {
  padding: 1.1rem;
  background: #f7fafb;
  border: 1px solid #e3eaee;
  border-radius: 12px;
}
.action-card:hover {
  border-color: #7ad9bc;
  transform: translateY(-1px);
}
.action-card p,
.capability-grid p,
.plan-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.action-card span {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
}
.step-number {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.detail-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem;
  background: #f7fafb;
  border-radius: 9px;
}
.detail-item span {
  color: var(--muted);
  font-size: 0.72rem;
}
.detail-item b {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}
.plan-card {
  display: flex;
  flex-direction: column;
}
.plan-card h2 {
  margin: 0;
  font-size: 1.1rem;
}
.plan-card > strong {
  color: var(--green-dark);
  font-size: 1.45rem;
}
.plan-card > small {
  color: var(--muted);
}
.plan-card ul {
  padding-left: 1.1rem;
  color: #526676;
  font-size: 0.78rem;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.search-input {
  margin-bottom: 1rem;
  max-width: 460px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
th {
  padding: 0.75rem;
  color: #6a7b89;
  background: #f7f9fa;
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  padding: 0.85rem 0.75rem;
  border-top: 1px solid #e7edf0;
  vertical-align: middle;
}
.cell-stack {
  display: grid;
  min-width: 130px;
}
.cell-stack small {
  color: var(--muted);
}
.table-action {
  padding: 0.5rem 0.7rem;
  color: #087452;
  background: #dff8ef;
  font-size: 0.74rem;
}

/* Customer stores */
.store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.store-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #dce6eb;
  border-radius: 20px;
  box-shadow: 0 12px 38px #17324f0c;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.store-card:hover {
  transform: translateY(-3px);
  border-color: #9bdcc8;
  box-shadow: 0 20px 50px #17324f16;
}
.store-card-preview {
  min-height: 170px;
  padding: 0.85rem;
  background:
    radial-gradient(circle at 85% 0, #35dda42b, transparent 30%),
    linear-gradient(145deg, #081e2e, #0e3c52);
}
.store-browser-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.65rem;
  color: #9ab4c0;
  background: #ffffff0d;
  border: 1px solid #ffffff12;
  border-radius: 10px 10px 0 0;
}
.store-browser-bar > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff42;
}
.store-browser-bar small {
  margin-left: 0.25rem;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.store-preview-body {
  min-height: 112px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem;
  background: #fff;
  border-radius: 0 0 12px 12px;
}
.store-preview-brand {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #087a59;
  background: #dff8ef;
  border-radius: 14px;
  font-weight: 900;
}
.store-preview-lines {
  display: grid;
  gap: 0.55rem;
}
.store-preview-lines i {
  display: block;
  height: 9px;
  background: #e8eef2;
  border-radius: 999px;
}
.store-preview-lines i:nth-child(1) {
  width: 74%;
  background: #c9eede;
}
.store-preview-lines i:nth-child(2) {
  width: 92%;
}
.store-preview-lines i:nth-child(3) {
  width: 58%;
}
.store-card-content {
  padding: 1.25rem;
}
.store-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}
.store-card-heading h2 {
  margin: 0.2rem 0 0;
  color: #10283a;
  font-size: 1.12rem;
}
.store-label {
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.store-domain {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 0.8rem;
  overflow-wrap: anywhere;
  color: #466275;
  font-size: 0.8rem;
  font-weight: 750;
}
.store-domain:hover {
  color: var(--green-dark);
}
.store-helper {
  min-height: 42px;
  margin: 0.8rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}
.store-card-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
}
.store-secondary-action,
.store-primary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 0.9rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 850;
}
.store-secondary-action {
  color: #385366;
  background: #edf3f6;
}
.store-secondary-action:hover {
  background: #e2ebf0;
}
.store-primary-action {
  border: 0;
  color: #fff;
  background: var(--green);
}
.store-primary-action:hover {
  background: var(--green-dark);
}
.dialog-eyebrow {
  display: block;
  margin: 0.3rem 0 0.4rem;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.wordpress-access-link {
  color: var(--green-dark);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.loading,
.empty-state,
.route-error {
  padding: 3rem;
  color: var(--muted);
  text-align: center;
}
.empty-state {
  background: #f7fafb;
  border-radius: 10px;
}
.empty-state p {
  margin-bottom: 0;
}
.route-error {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.toast {
  position: fixed;
  z-index: 30;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 390px;
  padding: 1rem 1.2rem;
  color: white;
  background: #a83232;
  border-radius: 10px;
  box-shadow: 0 15px 50px #071d2d40;
  font-size: 0.85rem;
  font-weight: 700;
}
.toast-success {
  background: #087452;
}
dialog {
  width: min(92vw, 620px);
  padding: 1.5rem;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 35px 100px #071d2d55;
}
dialog::backdrop {
  background: #071d2db8;
}
.dialog-close {
  float: right;
  padding: 0.2rem;
  border: 0;
  background: none;
  font-size: 1.8rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}
.review-summary {
  display: grid;
  gap: 0.7rem;
}
.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.inline-form label {
  margin: 0;
}
.check-label {
  display: flex !important;
  align-items: center;
}
.check-label input {
  width: auto;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .action-grid,
  .capability-grid,
  .plan-grid,
  .store-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 850px) {
  .public-shell {
    grid-template-columns: 1fr;
  }
  .public-brand {
    min-height: 32vh;
    padding: 2rem;
  }
  .public-brand h1 {
    font-size: 2.5rem;
  }
  .brand-features {
    display: none;
  }
  .public-card {
    max-height: none;
    margin: 1.25rem auto;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 20;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-shell.menu-open .sidebar {
    transform: translateX(0);
    box-shadow: 20px 0 60px #071d2d66;
  }
  .menu-toggle {
    display: block;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 580px) {
  .form-grid,
  .metric-grid,
  .action-grid,
  .capability-grid,
  .plan-grid,
  .detail-grid,
  .inline-form,
  .store-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .public-brand {
    min-height: 24vh;
  }
  .public-brand h1 {
    font-size: 2rem;
  }
  .topbar {
    height: 66px;
  }
  .user-chip div {
    display: none;
  }
  .route-content {
    padding: 1rem;
  }
  .panel-section {
    padding: 1rem;
  }
  .store-card-actions {
    grid-template-columns: 1fr;
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .dialog-actions button {
    width: 100%;
  }
}
