:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --stone: #f3f0eb;
  --stone-2: #e8e2d9;
  --paper: #faf8f5;
  --white: #ffffff;
  --line: #ddd6cb;
  --gold: #a67c52;
  --gold-deep: #8b6540;
  --success: #1f6b4a;
  --success-bg: #e8f5ef;
  --error: #9b2c2c;
  --error-bg: #fdeeee;
  --warning: #8a5a00;
  --warning-bg: #fff6e5;
  --info: #1e4d6b;
  --info-bg: #e8f3f8;
  --sidebar-w: 260px;
  --topbar-h: 72px;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(26, 26, 26, 0.08);
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--stone);
  line-height: 1.5;
}

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

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

button,
input {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Admin shell —— */
.admin-body {
  min-height: 100vh;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  z-index: 1;
}

.brand-logo {
  width: auto;
  height: 34px;
  max-width: min(280px, 60vw);
  object-fit: contain;
}

.brand-text {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.topbar-user {
  text-align: left;
  min-width: 0;
  z-index: 2;
}

.topbar-user-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.topbar-user-email {
  display: none;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  z-index: 2;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.admin-body-grid {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}

.admin-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: min(86vw, var(--sidebar-w));
  z-index: 35;
  background: #111;
  color: rgba(255, 255, 255, 0.88);
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: var(--shadow);
}

.admin-sidebar.is-open {
  transform: translateX(0);
}

.sidebar-backdrop {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.sidebar-link.is-active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-icon {
  opacity: 0.7;
  width: 1.1rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-note {
  margin: 0.85rem 0.5rem 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

.logout-form {
  margin: 0;
}

.admin-main {
  padding: 1.25rem 1rem 2.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* —— Flash —— */
.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success);
}
.flash-error {
  background: var(--error-bg);
  color: var(--error);
}
.flash-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.flash-info {
  background: var(--info-bg);
  color: var(--info);
}

.flash-dismiss {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

/* —— Typography / page —— */
.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}

.page-hero {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, rgba(250, 248, 245, 0.96), rgba(243, 240, 235, 0.9)),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 38rem;
}

.page-hero-art {
  border-radius: 10px;
  overflow: hidden;
  max-height: 180px;
}

.page-hero-art img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.page-hero-gallery {
  min-height: 180px;
}

.page-hero--compact {
  grid-template-columns: 1fr;
}

.dashboard-empty {
  min-height: 50vh;
}

/* —— Fade gallery —— */
.fade-gallery {
  width: 100%;
}

.fade-gallery-stage {
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  height: 100%;
}

.fade-gallery-slot {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  aspect-ratio: 4 / 5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.fade-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity var(--fade-duration, 1.1s) ease,
    transform 1.6s ease;
  will-change: opacity, transform;
}

.fade-gallery-img.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.fade-gallery--login .fade-gallery-slot {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.fade-gallery--login .fade-gallery-slot:nth-child(1) {
  transform: translateY(6%);
}

.fade-gallery--login .fade-gallery-slot:nth-child(2) {
  transform: translateY(-4%);
}

.fade-gallery--login .fade-gallery-slot:nth-child(3) {
  transform: translateY(10%);
}

.fade-gallery--hero .fade-gallery-slot {
  aspect-ratio: 16 / 11;
  border: 1px solid var(--line);
  background: var(--stone-2);
}

.fade-gallery--promo .fade-gallery-slot {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  background: var(--white);
}

@media (prefers-reduced-motion: reduce) {
  .fade-gallery-img {
    transition: none;
    transform: none;
  }
}

.stats-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card,
.module-card,
.form-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 1.1rem 1.2rem;
}

.stat-card h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  margin: 0.55rem 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  word-break: break-word;
}

.stat-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.module-grid {
  display: grid;
  gap: 1rem;
}

.module-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.module-card-media {
  aspect-ratio: 16 / 10;
  background: var(--stone-2);
  overflow: hidden;
}

.module-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.module-card-body h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.1rem;
}

.module-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: rgba(166, 124, 82, 0.12);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

/* —— Forms —— */
.form-panel {
  padding: 1.25rem;
  max-width: 520px;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.field input:not([type='file']):not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='color']) {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.field input:not([type='file']):not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='color']):focus {
  outline: 2px solid rgba(166, 124, 82, 0.45);
  border-color: var(--gold);
  background: var(--white);
}

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

.password-field input {
  padding-right: 2.85rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
  background: rgba(26, 26, 26, 0.06);
  outline: none;
}

.password-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.password-toggle .icon-eye-off[hidden] {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form-actions--split {
  justify-content: space-between;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.btn:disabled,
.btn.is-loading,
button.is-loading,
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-loading,
button.is-loading {
  gap: 0.55rem;
}

.btn-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  animation: btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-ghost .btn-spinner,
button.linkish .btn-spinner {
  border-color: rgba(26, 26, 26, 0.2);
  border-top-color: currentColor;
}

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

form.is-submitting {
  pointer-events: none;
}

.btn-primary {
  background-color: var(--ink);
  background-image: none;
  color: var(--white);
}

.btn-primary:hover {
  background-color: #000;
  background-image: none;
}

.btn-ghost {
  background-color: transparent;
  background-image: none;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-block {
  width: 100%;
}

.security-box {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(166, 124, 82, 0.06);
}

.security-box legend {
  padding: 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 700;
}

.security-prompt {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
}

/* —— Login page —— */
.login-body {
  min-height: 100vh;
  background: var(--ink);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.login-showcase {
  display: none;
  position: relative;
  overflow: hidden;
  background: #0d0d0d;
  min-height: 280px;
}

.login-showcase-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.78)),
    radial-gradient(circle at top right, rgba(166, 124, 82, 0.35), transparent 45%);
}

.login-showcase .fade-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 8% 7% 22%;
}

.login-showcase-copy {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  z-index: 3;
  color: var(--white);
}

.login-showcase-copy h1 {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 600;
}

.login-showcase-copy p {
  margin: 0;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.78);
}

.login-eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #d4b48c !important;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  background:
    radial-gradient(circle at top, rgba(166, 124, 82, 0.12), transparent 40%),
    var(--paper);
}

.login-panel-inner {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  height: 52px;
  width: auto;
  max-width: min(380px, 100%);
  object-fit: contain;
  border-radius: 6px;
}

.login-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
}

.login-subheading {
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
}

.login-footnote {
  margin: 1.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* —— SaaS Super Admin login (form left, Mobikasa + Shopify phones right) —— */
.login-body--saas {
  --saas-orange: #f37021;
  --saas-orange-deep: #d95c12;
  --saas-ink: #111111;
  --saas-muted: #6b7280;
  --saas-line: #e5e7eb;
  background: #ffffff;
  color: var(--saas-ink);
}

.login-page--saas {
  grid-template-columns: 1fr;
}

.login-page--saas .login-panel {
  background: #ffffff;
}

.login-page--saas .login-heading {
  color: var(--saas-ink);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-page--saas .login-subheading,
.login-page--saas .login-footnote {
  color: var(--saas-muted);
}

.login-page--saas .field-label {
  color: #374151;
}

.login-page--saas .field input,
.login-page--saas .field select,
.login-page--saas .password-field input {
  background: #ffffff;
  border-color: var(--saas-line);
  color: var(--saas-ink);
}

.login-page--saas .field input:focus,
.login-page--saas .field select:focus,
.login-page--saas .password-field input:focus {
  border-color: var(--saas-orange);
  outline: 2px solid rgba(243, 112, 33, 0.2);
  outline-offset: 0;
}

.login-page--saas .security-box {
  border-color: var(--saas-line);
  background: #fafafa;
}

.login-page--saas .security-box legend {
  color: var(--saas-orange-deep);
}

.login-page--saas .btn-primary {
  background: var(--saas-orange);
  border-color: var(--saas-orange);
  color: #ffffff;
}

.login-page--saas .btn-primary:hover,
.login-page--saas .btn-primary:focus-visible {
  background: var(--saas-orange-deep);
  border-color: var(--saas-orange-deep);
}

.login-page--saas .password-toggle {
  color: var(--saas-muted);
}

.login-logo--mobikasa {
  height: 48px;
  border-radius: 0;
}

.login-showcase--saas {
  background:
    radial-gradient(ellipse at 75% 15%, rgba(243, 112, 33, 0.28), transparent 42%),
    radial-gradient(ellipse at 15% 85%, rgba(17, 17, 17, 0.35), transparent 45%),
    linear-gradient(160deg, #111111 0%, #1a1a1a 48%, #0d0d0d 100%);
}

.login-showcase-overlay--saas {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.88) 100%),
    radial-gradient(circle at top right, rgba(243, 112, 33, 0.22), transparent 50%);
}

.login-page--saas .login-eyebrow {
  color: #f3a06a !important;
}

.saas-phones {
  position: absolute;
  inset: 6% 4% 28%;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.saas-phone {
  position: absolute;
  margin: 0;
  width: min(38%, 220px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #111;
  animation: saas-phone-float 6s ease-in-out infinite;
}

.saas-phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.saas-phone--left {
  left: 6%;
  top: 18%;
  transform: rotate(-8deg) scale(0.88);
  z-index: 1;
  animation-delay: -1.2s;
}

.saas-phone--center {
  left: 50%;
  top: 4%;
  width: min(44%, 260px);
  transform: translateX(-50%) rotate(0deg) scale(1);
  z-index: 3;
  animation-delay: 0s;
}

.saas-phone--right {
  right: 6%;
  top: 22%;
  left: auto;
  transform: rotate(8deg) scale(0.88);
  z-index: 2;
  animation-delay: -2.4s;
}

@keyframes saas-phone-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

.login-showcase-copy--saas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.saas-showcase-logo {
  height: 32px;
  width: auto;
  margin-bottom: 0.65rem;
  opacity: 0.98;
}

@media (prefers-reduced-motion: reduce) {
  .saas-phone {
    animation: none;
  }
}

/* —— Errors —— */
.error-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--stone);
}

.error-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.error-logo {
  margin: 0 auto 1rem;
  height: 40px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  border-radius: 6px;
}

.error-card h1 {
  margin: 0.2rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 2rem;
}

.error-card p {
  color: var(--muted);
}

.error-card code {
  font-size: 0.85em;
  word-break: break-all;
}

/* —— Responsive breakpoints —— */
@media (min-width: 640px) {
  .admin-topbar {
    padding: 0 1.35rem;
  }

  .brand-logo {
    height: 40px;
    max-width: 320px;
  }

  .topbar-user-email {
    display: block;
  }

  .admin-main {
    padding: 1.75rem 1.5rem 3rem;
  }

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

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

  .page-hero {
    padding: 1.5rem;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .admin-body-grid {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .admin-sidebar {
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    width: var(--sidebar-w);
    transform: none;
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-backdrop {
    display: none !important;
  }

  .page-hero:not(.page-hero--compact) {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }

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

  .login-page {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .login-page.login-page--saas {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .login-showcase {
    display: block;
    min-height: 100vh;
  }
}

@media (min-width: 1100px) {
  .module-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 899px) {
  body.nav-open {
    overflow: hidden;
  }

  .fade-gallery--promo .fade-gallery-stage,
  .fade-gallery--hero .fade-gallery-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fade-gallery--promo .fade-gallery-slot:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 70%;
    justify-self: center;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 480px) {
  .fade-gallery--promo .fade-gallery-stage {
    grid-template-columns: 1fr;
  }

  .fade-gallery--promo .fade-gallery-slot:nth-child(3) {
    max-width: 100%;
    aspect-ratio: 4 / 5;
  }

  .fade-gallery--hero .fade-gallery-stage {
    grid-template-columns: 1fr;
  }
}

/* —— Homepage management —— */
.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.table-panel,
.form-panel--wide,
.manage-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}

.admin-table th {
  background: var(--stone);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem !important;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(166, 124, 82, 0.12);
  color: var(--gold-deep);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-active {
  background: var(--success-bg);
  color: var(--success);
}

.status-inactive {
  background: var(--error-bg);
  color: var(--error);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

/* Keep actions <td> as a real table-cell so row borders stay continuous */
.actions-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.actions-cell > a,
.actions-cell > .inline-form,
.actions-cell > .linkish {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.55rem;
}

.actions-cell > :last-child {
  margin-right: 0;
}

.actions-cell a,
.linkish {
  color: var(--gold-deep);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  line-height: 1.2;
}

.linkish.danger,
.actions-cell .danger {
  color: var(--error);
}

.inline-form {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
}

/* Offer / promo card admin styling */
.offer-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .offer-form-layout {
    grid-template-columns: 1fr;
  }
}

.offer-style-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #ddd6cb);
}

.offer-style-block h4,
.offer-form-main h4,
.offer-preview-panel h4,
.offer-options-heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.offer-options-heading {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #ddd6cb);
}

.use-default-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted, #6b6b6b);
  margin: 0.25rem 0 0.4rem;
}

.offer-preview-panel {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: var(--paper, #faf8f5);
  border: 1px solid var(--line, #ddd6cb);
  border-radius: 12px;
}

.offer-preview-card {
  overflow: hidden;
  padding: 0.85rem;
}

.offer-preview-image {
  width: 100%;
  height: 140px;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 0.75rem;
}

.offer-preview-title {
  margin: 0 0 0.35rem;
}

.offer-preview-description,
.offer-preview-availability {
  margin: 0 0 0.5rem;
}

.offer-preview-cta {
  display: inline-block;
  text-align: center;
}

.config-subheading {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.order-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-panel--wide {
  padding: 1.25rem;
  max-width: none;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%236a7389' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 0.75rem 0.5rem;
  padding-right: 2.5rem;
}

.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(166, 124, 82, 0.45);
  border-color: var(--gold);
  background: var(--white);
}

.source-panel {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(166, 124, 82, 0.05);
}

.source-panel h3,
.nested-form h3,
.manage-block h2 {
  margin-top: 0;
  font-family: var(--font-display);
}

.picker-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.picker-search input {
  flex: 1;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.picker-results {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.picker-result {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.picker-result strong {
  display: block;
}

.selected-ref {
  margin: 0;
  color: var(--ink-soft);
}

.cart-gifts-intro {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.cart-gift-tiers {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.cart-gift-tiers [data-cart-gift-empty][hidden] {
  display: none !important;
}

.cart-gift-tier {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.cart-gift-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  min-height: 2rem;
}

.cart-gift-tier-header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  flex: 1 1 auto;
}

.cart-gift-tier-remove {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border-radius: 8px;
  align-self: center;
}

.cart-gift-tier-remove svg {
  display: block;
}

.cart-gift-tier-remove:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--white);
}

.cart-gift-tier input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.cart-gift-tier input[type='number']::-webkit-outer-spin-button,
.cart-gift-tier input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

[data-cart-gift-actions] [data-cart-gift-save][hidden] {
  display: none !important;
}

.cart-gift-variant {
  margin-top: 0.25rem;
}

.cart-gift-variant-error {
  margin: 0.35rem 0 0;
  color: #b42318;
  font-size: 0.875rem;
}

.cart-gift-variant input[aria-invalid='true'] {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12);
}

.cart-gift-product {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.cart-gift-product:not(.is-unlinked) {
  cursor: pointer;
}

a.cart-gift-product:not(.is-unlinked):hover {
  border-color: rgba(57, 37, 232, 0.35);
  box-shadow: 0 0 0 2px rgba(57, 37, 232, 0.1);
}

a.cart-gift-product.is-unlinked {
  cursor: default;
  pointer-events: none;
}

.cart-gift-product[hidden],
.cart-gift-product img[hidden],
.cart-gift-product-meta .mono[hidden],
.selected-ref[hidden],
.cart-gift-variant-error[hidden] {
  display: none !important;
}

.cart-gift-product img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  background: #eef0f5;
  border: 1px solid var(--line);
}

.cart-gift-product img.is-empty {
  display: block !important;
  background:
    linear-gradient(135deg, #eef0f5 0%, #dde1ea 100%);
}

.cart-gift-product-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cart-gift-product-meta strong {
  font-size: 0.95rem;
}

.cart-gift-product-meta .mono {
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-block {
  padding: 1.25rem;
}

.nested-form {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.preview-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 720px) {
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.json-preview {
  overflow: auto;
  background: #111;
  color: #f5f5f5;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.preview-cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .preview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .preview-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}

.preview-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.preview-card h3,
.preview-card p {
  margin: 0.35rem 1rem;
}

.preview-card h3 {
  margin-top: 0.85rem;
}

.preview-card .stat-meta {
  margin-bottom: 1rem;
}

/* —— Confirm modal (Yes / No) —— */
body.confirm-modal-open {
  overflow: hidden;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
}

.confirm-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 1.35rem 1.35rem 1.2rem;
}

.confirm-modal-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
}

.confirm-modal-message {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.confirm-modal-actions .btn {
  min-width: 5.5rem;
}

.confirm-modal.is-alert-only .confirm-modal-actions {
  justify-content: flex-end;
}

/* —— Homepage active counter + drag reorder —— */
.active-counter {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.active-counter strong {
  color: var(--ink);
}

.active-counter-limit {
  display: block;
  margin-top: 0.25rem;
  color: #9a3412;
  font-weight: 600;
}

.col-drag {
  width: 2.5rem;
  text-align: center;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  color: var(--ink-soft);
  cursor: grab;
  user-select: none;
  font-size: 1.05rem;
  letter-spacing: -0.05em;
}

.drag-handle:active {
  cursor: grabbing;
}

.draggable-row.is-dragging {
  opacity: 0.55;
  background: var(--paper);
}

.draggable-row.drag-over {
  outline: 2px dashed var(--line-strong, #c4b5a0);
}

.display-order-badge {
  display: inline-flex;
  min-width: 1.5rem;
  justify-content: center;
  font-weight: 600;
}

.table-sub {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.reorder-hint {
  margin: 0.75rem 1rem 1rem;
}

.reorder-hint.is-error {
  color: #9a3412;
}

.radio-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.35rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.data-source-fieldset {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}

.form-note--prominent {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(166, 124, 82, 0.45);
  border-left: 4px solid var(--gold, #a67c52);
  border-radius: 8px;
  background: rgba(166, 124, 82, 0.1);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-note--prominent strong {
  color: var(--ink);
}

.reorder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.reorder-toolbar-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
}

.pill-draft {
  background: rgba(166, 124, 82, 0.15);
  color: #7a542e;
  border: 1px solid rgba(166, 124, 82, 0.35);
}

.publish-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.publish-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.publish-stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
}

.publish-stat-value--sm {
  font-size: 0.95rem;
  font-weight: 600;
}

.publish-stat-value.is-warn {
  color: #9a3412;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.publish-summary-list {
  margin: 0;
  padding-left: 1.1rem;
}

.publish-summary-list ul {
  margin: 0.25rem 0 0.75rem;
  padding-left: 1rem;
}

.publish-feedback {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.publish-feedback--success {
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}

.publish-feedback--error {
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
}

.publish-feedback-list {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.publish-progress {
  margin: 0 0 1rem;
}

.publish-progress-label {
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.publish-progress-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
  overflow: hidden;
}

.publish-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold, #a67c52), #c4a07a);
  transition: width 0.25s ease;
}

#publish-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.field-label--with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.field-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  outline: none;
}

.field-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.field-tooltip:hover .field-tooltip-icon,
.field-tooltip:focus .field-tooltip-icon,
.field-tooltip:focus-visible .field-tooltip-icon {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--white);
}

.field-tooltip-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.45rem);
  z-index: 40;
  width: min(22rem, 78vw);
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.field-tooltip:hover .field-tooltip-panel,
.field-tooltip:focus .field-tooltip-panel,
.field-tooltip:focus-visible .field-tooltip-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shopify-resource-panel {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.shopify-resource-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.links-summary {
  margin-bottom: 1.25rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.meta-grid dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.meta-grid dd {
  margin: 0.25rem 0 0;
  font-weight: 600;
}

/* —— Configuration —— */
.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.config-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.config-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.25rem;
  align-items: start;
}

.config-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.config-panel h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.05rem;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.color-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-input-row input[type='color'] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: transparent;
  cursor: pointer;
}

.color-input-row input[type='text'] {
  flex: 1;
  font-family: ui-monospace, monospace;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  cursor: pointer;
}

.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
}

.switch-field-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.switch-field-title {
  font-weight: 650;
  color: var(--ink);
}

.switch-field-hint {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 1.55rem;
}

.switch input[type='checkbox'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c5cad6;
  transition: background-color 0.18s ease;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
  transition: transform 0.18s ease;
}

.switch input[type='checkbox']:checked + .switch-track {
  background: var(--ink, #1a1a1a);
}

.switch input[type='checkbox']:checked + .switch-track::after {
  transform: translateX(1.2rem);
}

.switch input[type='checkbox']:focus-visible + .switch-track {
  outline: 2px solid rgba(166, 124, 82, 0.45);
  outline-offset: 2px;
}

.config-style-picker {
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

.config-style-picker .field-label {
  display: block;
  margin-bottom: 0.55rem;
}

.config-style-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.config-style-options--cards {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.config-style-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}

.config-style-options--cards .config-style-option {
  gap: 0.45rem;
  padding: 0.75rem;
}

.config-style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.config-style-option.is-selected,
.config-style-option:has(input:checked) {
  border-color: var(--gold, #a67c52);
  box-shadow: 0 0 0 1px var(--gold, #a67c52);
  background: var(--white);
}

.config-style-option-label {
  font-weight: 650;
  color: var(--ink);
}

.config-style-option-copy {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}

/* Product card layout thumbnails (admin config) */
.pc-style-thumb {
  width: 100%;
  margin-bottom: 0.15rem;
}

.pc-mock {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pc-border, #ddd6cb);
  border-radius: var(--pc-radius, 12px);
  background: var(--pc-bg, #fff);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
}

.pc-style-thumb .pc-mock {
  min-height: 210px;
}

.pc-mock-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(145deg, #f1ebe3 0%, #e4ddd3 48%, #f7f3ee 100%);
}

.pc-mock-img::after {
  content: '';
  position: absolute;
  inset: 28% 32%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8f0, #d9cfc3 70%);
  opacity: 0.9;
}

.pc-mock-ribbon {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 2;
  padding: 2px 8px 2px 6px;
  border-radius: 0 4px 4px 0;
  background: var(--pc-badge-bg, #e11d48);
  color: var(--pc-badge-fg, #fff);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pc-mock-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px 10px;
}

.pc-mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pc-mock-brand {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #645e69;
}

.pc-mock-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--pc-title, #1d1a20);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pc-mock-type,
.pc-mock-rating {
  font-size: 9.5px;
  line-height: 1.2;
  color: #645e69;
}

.pc-mock-price {
  color: var(--pc-price, #1d1a20);
  font-size: 11px;
  line-height: 1.25;
}

.pc-mock-price s {
  margin-left: 4px;
  color: var(--pc-compare, #8a8494);
  font-weight: 400;
}

.pc-mock-discount {
  color: var(--pc-discount, #a30e5c);
  font-size: 10px;
  font-weight: 650;
}

.pc-mock-promo {
  margin-top: 2px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fdeef5;
  color: #a30e5c;
  font-size: 9.5px;
  font-weight: 700;
}

.pc-mock-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid #ddd6cb;
  border-radius: 6px;
  background: #fff;
  color: #1d1a20;
  font-size: 10.5px;
  font-weight: 650;
}

.pc-mock-heart {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border: 1.5px solid #9a93a1;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.pc-mock-heart--on-img {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pc-mock-heart--on-img::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 10px;
  height: 10px;
  border: 1.4px solid #9a93a1;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

/* Shop layout — delivery strip + Add to cart */
.pc-mock--shop {
  border-radius: 4px;
}

.pc-mock--shop .pc-mock-body {
  gap: 6px;
  padding: 8px 8px 10px;
}

.pc-mock-heart--light {
  background: transparent;
  box-shadow: none;
}

.pc-mock-heart--light::before {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.pc-mock-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
}

.pc-mock-price-now {
  color: var(--pc-price, #1d1a20);
  font-size: 13px;
  font-weight: 700;
}

.pc-mock-price-was {
  color: var(--pc-compare, #8a8494);
  font-size: 11px;
}

.pc-mock-off {
  color: var(--pc-discount, #8b6540);
  font-size: 11px;
  font-weight: 600;
}

.pc-mock-ship {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 7px;
  border-radius: 4px;
  background: #f1f1f1;
  color: #1d1a20;
  font-size: 10px;
}

.pc-mock-ship-icon {
  width: 12px;
  height: 9px;
  border: 1.5px solid #555;
  border-radius: 2px;
  flex-shrink: 0;
}

.pc-mock-cta--cart {
  margin-top: 12px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: #8b6540;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Showcase layout — rounded media + Buy now */
.pc-mock--showcase {
  border-radius: 22px;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.1);
  border-color: transparent;
}

.pc-mock-img--showcase {
  border-radius: 18px 18px 14px 14px;
  overflow: hidden;
}

.pc-mock-pill-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 650;
}

.pc-mock-dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}

.pc-mock-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.pc-mock-dots i:first-child {
  background: #fff;
}

.pc-mock--showcase .pc-mock-body {
  gap: 3px;
  padding: 10px 12px 12px;
}

.pc-mock-subtitle {
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 550;
}

.pc-mock-desc {
  color: #9ca3af;
  font-size: 9.5px;
  line-height: 1.35;
}

.pc-mock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.pc-mock-price-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
}

.pc-mock-price-plain {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.pc-mock-cart-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111827;
  position: relative;
}

.pc-mock-cart-icon::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 8px;
  width: 12px;
  height: 10px;
  border: 1.5px solid #fff;
  border-radius: 2px 2px 3px 3px;
  box-sizing: border-box;
}

.pc-mock-cart-icon::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 4px;
  height: 4px;
  border-left: 1.4px solid #fff;
  border-bottom: 1.4px solid #fff;
  transform: translate(1px, -1px) rotate(-45deg);
  box-sizing: border-box;
}

.pc-mock-buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
}

.pc-mock-buy i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: relative;
}

.pc-mock-buy i::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid #111;
  border-right: 1.5px solid #111;
  transform: rotate(45deg);
}

/* Live aside preview */
.preview-card--product {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.preview-card--product .pc-mock {
  min-height: 0;
  max-width: 220px;
}

.preview-card--product .pc-mock[hidden] {
  display: none !important;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.image-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: var(--paper);
}

.image-card h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.image-preview {
  position: relative;
  height: 88px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.image-preview img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.image-preview.has-image {
  border-style: solid;
}

.image-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(29, 26, 32, 0.78);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.image-clear-btn svg {
  display: block;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.image-clear-btn:hover,
.image-clear-btn:focus,
.image-clear-btn:focus-visible,
.image-clear-btn:active {
  background: rgba(29, 26, 32, 0.78);
  color: #fff;
  outline: none;
  box-shadow: none;
  transform: none;
}

.nav-item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--paper);
}

.nav-item-card h4 {
  margin: 0 0 0.65rem;
  text-transform: capitalize;
}

.config-preview {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.config-preview h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.preview-swatches {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.swatch {
  height: 36px;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.preview-btn {
  width: 100%;
  border: 0;
  padding: 0.75rem 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  cursor: default;
}

.preview-card {
  border: 1px solid var(--line);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.preview-card-img {
  height: 90px;
  border-radius: 0.4rem;
  background: linear-gradient(135deg, #e8e2d9, #f3f0eb);
  margin-bottom: 0.55rem;
}

.preview-card-title,
.preview-card-price {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.config-panel .form-actions,
.config-panel .config-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.config-panel .form-actions .btn,
.config-panel .config-actions .btn {
  width: auto;
  flex: 0 0 auto;
}

.config-panel .config-reset-form {
  margin: 0;
  display: inline-flex;
}

/* User management / permissions / audit */
.filters-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.filters-form {
  display: grid;
  gap: 0.85rem;
  align-items: end;
}

@media (min-width: 720px) {
  .filters-form {
    grid-template-columns: 1.4fr 1fr 1fr auto;
  }

  .filters-form--wide {
    grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, 0.9fr)) auto;
  }
}

.filters-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.permission-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(166, 124, 82, 0.05);
}

.permission-panel h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.lede-sm {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.permission-matrix {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .permission-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.permission-module {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.permission-module h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.permission-checks {
  display: grid;
  gap: 0.4rem;
}

.perm-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.perm-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.perm-list li:last-child {
  border-bottom: 0;
}

.perm-list .is-granted strong {
  color: #2f6b3a;
}

.perm-list .is-denied strong {
  color: #8a4b4b;
}

.form-meta {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-meta {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.brand--saas {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo-saas {
  height: 26px;
  width: auto;
  display: block;
  border-radius: 0;
}

.brand--saas .brand-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.02em;
}

/* —— SaaS Projects index —— */
.saas-projects-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at top right, rgba(243, 112, 33, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid #ececec;
}

.saas-projects-hero-copy {
  max-width: 40rem;
}

.saas-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f37021;
}

.saas-projects-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
}

.saas-projects-hero .lede {
  margin: 0.45rem 0 0;
  color: #6b7280;
  max-width: 36rem;
}

.saas-projects-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.saas-projects-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.saas-stat {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.saas-stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
  line-height: 1.1;
}

.saas-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8f98;
}

.saas-stat--success .saas-stat-value {
  color: #1f6b4a;
}

.saas-stat--muted .saas-stat-value {
  color: #6b7280;
}

.saas-stat--warn .saas-stat-value {
  color: #8a5a00;
}

.saas-projects-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #fff;
  border: 1px dashed #d7dbe0;
  border-radius: var(--radius);
}

.saas-projects-empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.saas-projects-empty p {
  margin: 0 0 1.25rem;
  color: #6b7280;
}

.saas-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.saas-project-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.1rem;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.saas-project-card:hover {
  border-color: #f0c7a8;
  box-shadow: 0 12px 28px rgba(243, 112, 33, 0.08);
  transform: translateY(-1px);
}

.saas-project-card.is-inactive {
  opacity: 0.88;
  background: #fcfcfc;
}

.saas-project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.saas-project-brand {
  display: flex;
  gap: 0.8rem;
  min-width: 0;
}

.saas-project-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f4f5f7;
  border: 1px solid #ececec;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
  color: #f37021;
  font-size: 1.15rem;
}

.saas-project-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.saas-project-titles {
  min-width: 0;
}

.saas-project-titles h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.saas-project-titles h2 a:hover {
  color: #f37021;
}

.saas-project-slug {
  margin: 0.2rem 0 0;
}

.saas-project-slug code {
  font-size: 0.78rem;
  color: #6b7280;
  background: #f6f7f9;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}

.saas-project-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.saas-db-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #6b7280;
}

.saas-db-pill--connected {
  background: #e8f5ef;
  color: #1f6b4a;
}

.saas-db-pill--failed,
.saas-db-pill--disconnected {
  background: #fdeeee;
  color: #9b2c2c;
}

.saas-db-pill--pending,
.saas-db-pill--provisioning {
  background: #fff6e5;
  color: #8a5a00;
}

.saas-project-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid #f0f1f3;
}

.saas-project-meta > div {
  min-width: 0;
}

.saas-project-meta dt {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa0a6;
}

.saas-project-meta dd {
  margin: 0;
  font-size: 0.9rem;
  color: #1f2937;
}

.saas-project-meta dd strong {
  display: block;
  font-weight: 600;
}

.saas-project-meta dd span {
  display: block;
  color: #6b7280;
  font-size: 0.84rem;
  word-break: break-all;
}

.saas-project-meta code {
  font-size: 0.78rem;
  color: #4b5563;
}

.saas-project-error {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #fdeeee;
  color: #9b2c2c;
  font-size: 0.84rem;
}

.saas-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid #f0f1f3;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  border-radius: 8px;
}

.btn-danger-text {
  color: #9b2c2c !important;
}

.btn-danger-text:hover,
.btn-danger-text:focus-visible {
  background: #fdeeee;
  border-color: #f0c8c8;
}

.status-badge.status-provisioning,
.status-badge.status-failed {
  background: #fff6e5;
  color: #8a5a00;
}

.status-badge.status-failed {
  background: #fdeeee;
  color: #9b2c2c;
}

@media (max-width: 640px) {
  .saas-projects-hero {
    padding: 1.15rem 1.1rem;
  }

  .saas-projects-grid {
    grid-template-columns: 1fr;
  }

  .saas-project-card-head {
    flex-direction: column;
  }

  .saas-project-badges {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}
