html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(46, 125, 50, 0.18), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(2, 132, 199, 0.16), transparent 30%),
    linear-gradient(180deg, #fff8ef 0%, #f2f6f9 55%, #e9f2f6 100%);
  color: #111827;
}

body.product-console {
  background: #f3f5f9;
  overflow-x: hidden;
}

.customer-app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.customer-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  background: #303641;
  color: #fff;
  z-index: 20;
  box-shadow: 8px 0 30px rgba(15, 23, 42, .12);
}

.customer-console-brand {
  height: 82px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.customer-console-brand:hover { color: #fff; }
.customer-console-brand strong { display: block; font-size: 18px; }
.customer-console-brand small { display: block; margin-top: 2px; color: #aeb7c5; }
.customer-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(145deg, #ff8a24, #ff5d24);
  box-shadow: 0 8px 18px rgba(255, 93, 36, .28);
}

.customer-sidebar-nav { padding: 12px 0 24px; overflow-y: auto; }
.customer-sidebar-nav a {
  min-height: 46px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #d3d9e2;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: .16s ease;
}
.customer-sidebar-nav a span { width: 20px; text-align: center; color: #9ca8b7; }
.customer-sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.customer-sidebar-nav a.active {
  color: #fff;
  border-left-color: #ff6a2b;
  background: linear-gradient(90deg, rgba(255,106,43,.26), rgba(255,106,43,.04));
}
.customer-sidebar-nav a.active span { color: #ff8a50; }
.customer-nav-section {
  padding: 20px 26px 8px;
  color: #7f8a99;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.customer-sidebar-footer { margin-top: auto; padding: 18px 22px; color: #7f8a99; font-size: 11px; }
.customer-app-main { grid-column: 2; min-width: 0; }
.customer-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e5e9f0;
  backdrop-filter: blur(12px);
}
.customer-menu-toggle { border: 0; background: transparent; color: #667085; font-size: 22px; }
.customer-topbar-actions { display: flex; align-items: center; gap: 10px; color: #526071; }
.customer-user-dot { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg,#e8eef8,#cfd9e8); }
.customer-topbar-actions form { margin: 0 0 0 12px; }
.customer-topbar-actions button { border: 0; background: transparent; color: #526071; }
.customer-console-content { padding: 30px; }
.customer-console-content .demo-shell { max-width: 1500px; margin: 0 auto; }
.customer-app-frame.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.customer-app-frame.sidebar-collapsed .customer-sidebar { transform: translateX(-100%); }
.customer-app-frame.sidebar-collapsed .customer-app-main { grid-column: 2; }
.portal-error-card { max-width: 720px; margin: 70px auto; padding: 38px; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.08); }
.portal-error-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #fff1f0; color: #d92d20; font-size: 26px; font-weight: 800; }
.portal-error-card h1 { margin-top: 20px; }
.portal-error-request { padding: 12px; border-radius: 8px; background: #f7f8fa; }

@media (max-width: 820px) {
  .customer-app-frame { grid-template-columns: 0 minmax(0, 1fr); }
  .customer-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .customer-app-frame:not(.sidebar-collapsed) .customer-sidebar { transform: translateX(0); }
  .customer-app-main { grid-column: 2; }
  .customer-console-content { padding: 18px; }
  .customer-topbar { padding: 0 16px; }
}

.customer-shell {
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
}
.public-language-switch { margin-left: auto; padding: 7px 8px; color: #1987da; text-decoration: none; font-weight: 700; }

.hero-card {
  max-width: 1040px;
  margin: 42px auto;
  padding: 0 16px 40px;
}

.hero-card h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 700px;
  color: #4b5563;
  font-size: 1.05rem;
}

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

.market-card {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
}

.market-card h3 {
  margin-top: 0;
}

.hero-actions,
.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  align-items: center;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-weight: 700;
}

.placeholder-panel {
  margin-top: 20px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
}

.onboarding-grid {
  margin-top: 24px;
}

.token-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f4f6;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.status-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 600;
}

.status-banner.error {
  background: #fee2e2;
  color: #991b1b;
}

.status-banner.info {
  background: #dcfce7;
  color: #166534;
}

.inline-form {
  margin-top: 18px;
}

.btn-qi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn-qi.primary {
  background: linear-gradient(135deg, #ef6c00 0%, #f97316 56%, #fb923c 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(249, 115, 22, 0.24);
}

.btn-qi.secondary {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

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

.btn-qi:disabled {
  opacity: 0.45;
}

.details-panel {
  margin-top: 24px;
}

.customer-hero .market-card h3 {
  color: #1f2937;
  font-size: 1.05rem;
}

.plan-grid {
  margin-top: 12px;
}

.plan-stat-card {
  text-align: center;
}

.plan-stat {
  margin: 10px 0 0;
  font-size: 2rem;
  font-weight: 800;
  color: #d9480f;
}

.plans-heading {
    margin: 28px 0 14px;
    font-size: 1.25rem;
}

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

.customer-entry-actions {
    padding-top: 4px;
}

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

.available-plan-card {
    border-top: 4px solid #ff7a00;
}

.available-plan-card .plan-price {
    margin: 10px 0;
    color: #d83b01;
    font-size: 1.8rem;
    font-weight: 800;
}

.available-plan-card .plan-price small {
    color: #5f6b7a;
    font-size: .85rem;
    font-weight: 600;
}

.available-plan-card ul {
    margin: 12px 0 0;
    padding-left: 20px;
}

@media (max-width: 800px) {
    .product-capability-grid,
    .available-plan-grid {
        grid-template-columns: 1fr;
    }
}

.technical-panel {
  margin-top: 26px;
  padding: 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.26);
}

.technical-panel > summary {
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  color: #1f2937;
}

.technical-panel[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.technical-grid {
  padding: 12px 18px 18px;
}

.success-panel {
  background: rgba(220, 252, 231, 0.85);
}

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

.details-grid dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.details-grid dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.reviewer-panel {
  max-width: 880px;
}

.reviewer-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 700;
  color: #1f2937;
}

.form-row input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
}

.field-error {
  color: #b91c1c;
  font-size: 13px;
}

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

  .details-grid {
    grid-template-columns: 1fr;
  }
}

.customer-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.customer-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.customer-brand {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.customer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.customer-links a {
  color: rgba(241, 245, 249, 0.9);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}

.customer-links a:hover {
  background: rgba(148, 163, 184, 0.2);
}

.customer-main {
  padding: 22px 0 28px;
}

.demo-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 6px 8px 36px;
}

.demo-context-banner {
  max-width: 1320px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(90deg, rgba(255, 251, 235, 0.95), rgba(254, 243, 199, 0.92));
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.demo-context-banner-body {
  display: grid;
  gap: 4px;
}

.demo-context-banner strong {
  color: #92400e;
}

.demo-context-banner span {
  color: #78350f;
}

.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.demo-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 4px;
}

.demo-shell h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
}

.demo-subtitle {
  color: #64748b;
  margin-top: 8px;
}

.demo-section-title {
  margin: 24px 0 12px;
  font-size: 1.2rem;
}

.demo-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.demo-stat-card,
.demo-module-card,
.demo-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.demo-stat-card h2,
.demo-module-card h3,
.demo-panel h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1rem;
}

.demo-muted {
  color: #64748b;
  margin: 0;
}

.demo-large {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 8px 0 0;
  color: #c2410c;
}

.demo-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.demo-filter-row .form-control,
.demo-filter-row .form-select {
  min-width: 220px;
  max-width: 320px;
}

.demo-stat-inline {
  color: #475569;
  font-weight: 700;
  margin: 8px 0 12px;
}

.demo-status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  background: #e2e8f0;
}

.demo-status.healthy {
  background: #dcfce7;
  color: #166534;
}

.demo-status.warning {
  background: #fef3c7;
  color: #92400e;
}

.demo-status.critical {
  background: #fee2e2;
  color: #991b1b;
}

.demo-status.maintenance {
  background: #dbeafe;
  color: #1d4ed8;
}

.demo-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.demo-kv {
  margin: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 12px;
}

.demo-kv dt {
  color: #475569;
  font-weight: 700;
}

.demo-kv dd {
  margin: 0;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.demo-status-update-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  align-items: start;
}

.demo-audit-timeline-panel {
  margin-top: 14px;
}

.demo-audit-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.demo-audit-timeline li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.demo-audit-time {
  color: #475569;
  font-weight: 700;
  font-size: 13px;
}

.demo-audit-body p {
  margin: 4px 0;
}

.demo-actions-row {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.demo-ai-form {
  display: grid;
  gap: 10px;
  max-width: 840px;
  margin-bottom: 16px;
}

.demo-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.demo-tag {
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .demo-grid-4,
  .demo-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .customer-nav-inner,
  .demo-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-context-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-grid-4,
  .demo-grid-3,
  .demo-grid-2 {
    grid-template-columns: 1fr;
  }

  .demo-kv {
    grid-template-columns: 1fr;
  }

  .demo-audit-timeline li {
    grid-template-columns: 1fr;
  }

  .demo-filter-row .form-control,
  .demo-filter-row .form-select {
    min-width: 100%;
    max-width: none;
  }
}

/* Full customer operations console. The data remains tenant-scoped in CustomerSite. */
body.operations-console { background: #f1ede6; }
.operations-console .customer-app-frame { grid-template-columns: 228px minmax(0, 1fr); }
.operations-console .customer-sidebar { width: 228px; background: #363b45; box-shadow: none; }
.operations-console .customer-console-brand { height: 104px; padding: 20px 16px; }
.operations-console .customer-console-brand strong { font-size: 16px; }
.operations-console .customer-console-brand small { font-size: 12px; }
.operations-console .customer-brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.operations-console .customer-sidebar-nav { padding-top: 0; }
.operations-console .customer-sidebar-nav > a { min-height: 52px; padding: 0 20px; border-left: 0; }
.operations-console .customer-sidebar-nav > a.active { background: #ff6530; color: #fff; }
.operations-console .customer-nav-parent { min-height: 51px; padding: 0 20px 0 20px; display: flex; align-items: center; justify-content: space-between; color: #f2f4f7; font-size: 14px; font-weight: 700; cursor: pointer; }
.operations-console .customer-nav-parent.active { padding-left: 20px; background: #ff6530; }
.operations-console .customer-nav-parent b { color: #aeb6c3; font-size: 18px; font-weight: 400; }
.operations-console .customer-nav-group .customer-nav-child { display: none; min-height: 38px; padding: 0 18px 0 48px; border-left: 0; color: #bfc6d1; font-size: 12px; }
.operations-console .customer-nav-group.open .customer-nav-child { display: flex; }
.operations-console .customer-nav-group .customer-nav-child.active { background: transparent; color: #fff; border-left: 3px solid #ff6530; }
.operations-console .customer-topbar { height: 76px; padding: 0 24px; }
.operations-console .customer-topbar-actions { gap: 15px; font-size: 12px; }
.operations-console .customer-topbar-actions a { color: #526071; text-decoration: none; }
.operations-console .customer-language-switch { padding: 7px 8px; color: #1987da; font-weight: 700; }
.operations-console .customer-topbar-actions form { margin-left: 0; }
.operations-console .customer-console-content { min-height: calc(100vh - 76px); padding: 0 0 46px; background: #f1ede6; }
.customer-page-hero { min-height: 250px; padding: 25px 24px 95px; display: flex; justify-content: space-between; align-items: flex-start; color: #fff; background: linear-gradient(135deg, #7f83ec 0%, #6960cf 100%); }
.customer-breadcrumb { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 11px; }
.customer-page-hero h1 { margin: 12px 0 7px; font-size: 23px; font-weight: 750; }
.customer-page-hero p { margin: 0; color: rgba(255,255,255,.78); font-size: 13px; }
.customer-refresh { margin-top: 48px; padding: 11px 15px; border-radius: 9px; background: #15c4c8; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; box-shadow: 0 10px 20px rgba(6,182,188,.2); }
.customer-refresh:hover { color: #fff; }
.customer-body-stage { position: relative; z-index: 2; margin: -88px 22px 0; }
.customer-body-stage .demo-shell { max-width: none; margin: 0; padding: 0; }
.customer-body-stage .demo-header,
.customer-body-stage .demo-shell > h1,
.customer-body-stage .demo-shell > .demo-subtitle { display: none; }
.customer-body-stage .demo-context-banner { margin: 0 0 14px; border: 1px solid #f2d99c; border-radius: 11px; background: #fff7d8; box-shadow: 0 8px 22px rgba(38, 31, 75, .08); }
.operations-console .demo-grid { gap: 14px; }
.operations-console .demo-stat-card,
.operations-console .demo-module-card,
.operations-console .demo-panel { border: 0; border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 10px 25px rgba(36,32,76,.08); }
.operations-console .demo-stat-card { min-height: 112px; padding: 17px; }
.operations-console .demo-stat-card h2 { color: #657083; font-size: 12px; font-weight: 500; }
.operations-console .demo-large { margin-top: 8px; color: #1f2937; font-size: 25px; }
.operations-console .demo-stat-card small { color: #1b9b92; }
.operations-console .table-responsive { margin-top: 14px; padding: 16px 18px; border-radius: 15px; background: #fff; box-shadow: 0 10px 25px rgba(36,32,76,.08); }
.operations-console .table { margin: 0; font-size: 12px; }
.operations-console .table > :not(caption) > * > * { padding: 12px 10px; border-color: #edf0f5; }
.operations-console .table thead th { color: #667085; white-space: nowrap; }
.operations-console .demo-filter-row,
.operations-console .demo-actions-row,
.operations-console .demo-ai-form { padding: 16px; margin: 0 0 14px; border-radius: 15px; background: #fff; box-shadow: 0 10px 25px rgba(36,32,76,.08); }
.operations-console .btn-primary { border-color: #18bcc2; background: #18bcc2; }
.operations-console .btn-outline-secondary { border-color: #d5dbe5; color: #435064; background: #fff; }
.operations-metrics { margin-bottom: 15px; }
.operations-content-grid { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(480px, 1.2fr); gap: 15px; }
.operations-content-grid .demo-panel { padding: 20px; }
.operations-panel-title { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.operations-panel-title h2 { margin: 0; font-size: 17px; }
.operations-panel-title a { color: #6558d4; text-decoration: none; font-size: 12px; }
.operations-service-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.operations-service-list > a { min-height: 78px; padding: 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #e8eaf0; border-radius: 10px; color: #263244; text-decoration: none; }
.operations-service-list > a:hover { border-color: #8b82e8; background: #f7f6ff; }
.operations-service-list strong, .operations-service-list small { display: block; }
.operations-service-list small { margin-top: 5px; color: #7c8696; line-height: 1.35; }
.operations-service-list b { color: #7066d9; font-size: 22px; }
.operations-console .demo-kv { grid-template-columns: 115px minmax(0,1fr); font-size: 13px; }
@media (max-width: 1050px) {
  .operations-content-grid { grid-template-columns: 1fr; }
  .operations-console .customer-topbar-actions a { display: none; }
}
@media (max-width: 820px) {
  .operations-console .customer-app-frame { grid-template-columns: 0 minmax(0,1fr); }
  .customer-page-hero { min-height: 220px; }
  .customer-body-stage { margin-left: 14px; margin-right: 14px; }
  .operations-service-list { grid-template-columns: 1fr; }
}
