:root {
  color-scheme: light;
  --ink: #201b18;
  --muted: #756b65;
  --paper: #fffaf6;
  --surface: #ffffff;
  --shell: #f7eee8;
  --line: #eaded6;
  --accent: #9f3d3f;
  --accent-strong: #7f282d;
  --teal: #1b7f79;
  --gold: #b87514;
  --green: #287a4f;
  --shadow: 0 18px 45px rgba(53, 33, 24, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
}

body.admin-mode {
  background: #fbfcfd;
}

body.admin-mode .topbar {
  grid-template-columns: minmax(150px, 0.75fr) auto minmax(0, 1.4fr) auto;
  border-bottom-color: #edf0f2;
  background: rgba(255, 255, 255, 0.96);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 84px;
}

.admin-only-shell {
  padding-bottom: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid rgba(234, 222, 214, 0.82);
  background: rgba(255, 250, 246, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: start;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.77rem;
}

.admin-top-label {
  justify-self: end;
  padding: 8px 12px;
  border: 1px solid #edf0f2;
  border-radius: 999px;
  color: #4b5563;
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.mode-switch,
.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.mode-btn,
.lang-btn {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.mode-btn {
  padding: 0 15px;
}

.lang-btn {
  width: 38px;
}

.mode-btn.active,
.lang-btn.active {
  color: #fff;
  background: var(--ink);
}

main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 42px) 0;
}

body.admin-mode main {
  width: 100%;
  max-width: none;
  padding: 22px clamp(18px, 2vw, 34px) 0;
}

body.admin-mode #admin {
  width: 100%;
}

body.admin-gate-minimal {
  background: #fff;
}

body.admin-gate-minimal .topbar {
  display: none;
}

body.admin-gate-minimal .app-shell {
  min-height: 100vh;
  padding-bottom: 0;
}

body.admin-gate-minimal main {
  display: grid;
  min-height: 100vh;
  max-width: none;
  padding: 24px 12px;
  place-items: center;
}

body.admin-gate-minimal #admin {
  width: min(100%, 560px);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.admin-only-shell #buyer,
.admin-only-shell #seller,
.admin-only-shell .mode-switch,
.admin-only-shell .bottom-nav {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0;
}

.hero-grid,
.checkout-preview,
.workspace-heading,
.seller-layout,
.admin-grid,
.operations-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: stretch;
  min-height: 430px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  padding: clamp(28px, 6vw, 68px);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(110deg, rgba(32, 27, 24, 0.92), rgba(127, 40, 45, 0.74)),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #7f282d, #1b7f79 62%, #b87514);
  box-shadow: var(--shadow);
}

.hero-copy h1,
.workspace-heading h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow),
.workspace-heading p:not(.eyebrow),
.checkout-preview p {
  max-width: 640px;
  color: inherit;
  opacity: 0.86;
  font-size: 1.05rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #ffd9cc;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.primary-action,
.ghost-action,
.text-action {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 650;
}

.primary-action {
  padding: 0 20px;
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(127, 40, 45, 0.14);
}

.primary-action:hover {
  background: var(--accent-strong);
}

.ghost-action {
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.text-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: #fff;
  box-shadow: none;
}

.wide {
  width: 100%;
}

.trust-panel,
.dashboard-card,
.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trust-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.trust-panel div {
  display: grid;
  align-content: center;
  min-height: 112px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fdf4ee;
}

.metric {
  color: var(--accent-strong);
  font-size: 2.2rem;
  font-weight: 900;
}

.trust-panel span:last-child,
.dashboard-card span,
.dashboard-card small {
  color: var(--muted);
}

.section-band {
  margin-top: 22px;
  padding: 22px 0;
}

.section-heading,
.card-title-row {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading h2,
.checkout-preview h2,
.dashboard-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  width: min(100%, 380px);
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.category-pill.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

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

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(53, 33, 24, 0.08);
}

.product-art {
  position: relative;
  min-height: 210px;
  background: var(--product-bg);
}

.product-art::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 42% 58% 50% 50%;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.product-card:nth-child(2n) .product-art::after {
  border-radius: 56% 44% 52% 48%;
}

.product-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 1;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(32, 27, 24, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.like-button {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.88);
}

.product-body {
  padding: 14px;
}

.product-body h3 {
  min-height: 44px;
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.product-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}

.price {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.checkout-preview {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  margin: 12px 0 34px;
  padding: 24px;
  border-radius: var(--radius);
  background: #2b2420;
  color: #fff;
}

.order-card {
  padding: 18px;
  color: var(--ink);
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-row.total {
  border-bottom: 0;
  font-size: 1.1rem;
}

.workspace-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 20px;
}

.workspace-heading h1 {
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 4.6rem);
}

.workspace-heading p:not(.eyebrow) {
  color: var(--muted);
}

#admin .workspace-heading {
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 0 2px;
  border-bottom: 1px solid #edf0f2;
}

#admin .workspace-heading .eyebrow {
  margin: 0;
  color: #667085;
  font-size: 0.76rem;
  font-weight: 650;
  text-transform: none;
}

.admin-top-copy {
  display: grid;
  gap: 2px;
}

.admin-top-copy h2 {
  margin: 0;
  color: #1f2933;
  font-size: 1.35rem;
  font-weight: 610;
  line-height: 1.1;
}

.admin-top-copy small {
  color: #7a818c;
  font-size: 0.78rem;
  font-weight: 500;
}

.seller-layout {
  grid-template-columns: 300px minmax(0, 1fr);
}

.dashboard-card {
  padding: 18px;
}

.onboarding-card {
  align-self: start;
  position: sticky;
  top: 94px;
}

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

.checklist li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checklist span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.checklist .done span {
  border-color: var(--green);
  background: var(--green);
}

.checklist .done span::after {
  content: "✓";
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

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

.metric-grid .dashboard-card {
  display: grid;
  gap: 7px;
}

.metric-grid strong {
  font-size: 1.8rem;
  font-weight: 650;
}

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

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: #fbf5f0;
}

.stack-item h3,
.stack-item p {
  margin: 0;
}

.stack-item h3 {
  font-size: 0.98rem;
}

.stack-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-chip {
  padding: 6px 9px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  color: #475467;
  background: #f6f7f8;
  font-size: 0.76rem;
  font-weight: 520;
  white-space: nowrap;
}

.status-chip.warn {
  border-color: #f7e3b8;
  color: #8a5a10;
  background: #fff8eb;
}

.status-chip.danger {
  border-color: #f2ccd0;
  color: var(--accent-strong);
  background: #fff3f4;
}

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

.admin-actions,
.admin-top-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

#admin .admin-actions .primary-action,
#admin .admin-actions .ghost-action,
#admin .admin-actions .text-action,
#admin .admin-actions .mini-action,
#admin .admin-top-menu .primary-action,
#admin .admin-top-menu .ghost-action,
#admin .admin-top-menu .text-action,
#admin .admin-top-menu .mini-action {
  min-height: 34px;
  box-shadow: none;
  font-weight: 560;
}

#admin .admin-actions .primary-action,
#admin .admin-top-menu .primary-action {
  border: 1px solid #d0d5dd;
  color: #344054;
  background: #fff;
}

#admin .admin-actions .primary-action:hover,
#admin .admin-top-menu .primary-action:hover {
  border-color: #b8c0cc;
  background: #f9fafb;
}

.admin-top-menu {
  align-items: center;
  justify-self: end;
  margin-bottom: 0;
  padding: 0;
}

.admin-top-menu .admin-session {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-top-menu .admin-avatar,
.admin-top-menu .admin-session span:nth-child(2) {
  display: none;
}

.admin-session {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 5px 7px 5px 5px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.admin-session[hidden] {
  display: none;
}

.admin-session span:nth-child(2) {
  display: grid;
  gap: 1px;
}

.admin-session strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 560;
  line-height: 1;
}

.admin-session small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1;
}

.admin-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #344054;
  background: #f2f4f7;
  font-size: 0.72rem;
  font-weight: 560;
}

.sync-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #dbe7e5;
  border-radius: 999px;
  color: #24726e;
  background: #f6fbfa;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.sync-status.loading {
  border-color: rgba(184, 117, 20, 0.32);
  color: #8a5a0c;
  background: #fff7e8;
}

.sync-status.offline,
.sync-status.error {
  border-color: rgba(159, 61, 63, 0.28);
  color: var(--accent-strong);
  background: #fff1f1;
}

.admin-ghost {
  border-color: #e4e7ec;
  color: #667085;
  background: #fff;
  box-shadow: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: clamp(270px, 16vw, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

#admin .admin-content :where(strong) {
  font-weight: 600;
}

#admin .admin-content :where(h2, h3, h4) {
  font-weight: 600;
}

#admin .admin-content :where(p, small, span, label, input, select, button) {
  letter-spacing: 0;
}

.admin-opsbar {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(128px, 0.2fr) minmax(320px, 1.15fr);
  gap: 14px;
  align-items: end;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #e7eaee;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.025);
}

.admin-page-header {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e7eaee;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.03);
}

.admin-page-header[hidden] {
  display: none;
}

.admin-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 520;
}

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

.admin-page-heading h2 {
  margin: 0;
  color: #1f2933;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 620;
  line-height: 1.08;
}

.admin-page-heading p {
  max-width: 820px;
  margin: 7px 0 0;
  color: #667085;
  font-size: 0.94rem;
  line-height: 1.45;
}

.admin-page-badge,
.admin-nav-badge,
.admin-page-tab small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #475467;
  background: #f9fafb;
  font-weight: 620;
  white-space: nowrap;
}

.admin-page-badge {
  min-width: 44px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.admin-nav-badge {
  min-width: 24px;
  min-height: 22px;
  padding: 0 7px;
  font-size: 0.72rem;
}

.admin-page-badge.warn,
.admin-nav-badge.warn,
.admin-page-tab small.warn {
  border-color: rgba(184, 117, 20, 0.22);
  color: #8a5a0c;
  background: #fff7e8;
}

.admin-page-badge.danger,
.admin-nav-badge.danger,
.admin-page-tab small.danger {
  border-color: rgba(159, 61, 63, 0.22);
  color: var(--accent-strong);
  background: #fff1f1;
}

.admin-page-badge.neutral,
.admin-nav-badge.neutral,
.admin-page-tab small.neutral {
  border-color: #dce4ea;
  color: #52616f;
  background: #f6f8fa;
}

.admin-page-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-page-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #e1e5ea;
  border-radius: 999px;
  color: #52616f;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 540;
  box-shadow: none;
}

.admin-page-tab.active {
  border-color: rgba(27, 127, 121, 0.18);
  color: #0f6f68;
  background: #eefaf8;
}

.admin-page-tab small {
  min-width: 20px;
  min-height: 20px;
  padding: 0 6px;
  font-size: 0.68rem;
}

.admin-global-search,
.admin-role-control {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #5b6675;
  font-size: 0.76rem;
  font-weight: 540;
}

.admin-global-search input,
.admin-role-control select {
  min-height: 38px;
  width: 100%;
  border: 1px solid #d6dde5;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 0.91rem;
  font-weight: 480;
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.02);
}

.admin-global-search input::placeholder {
  color: #8a94a3;
  font-weight: 480;
}

.admin-saved-filter-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding-top: 19px;
}

.admin-filter-label,
.saved-filter-list {
  display: flex;
  align-items: center;
}

.admin-filter-label {
  color: #5b6675;
  font-size: 0.76rem;
  font-weight: 540;
  white-space: nowrap;
}

.saved-filter-list {
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.saved-filter-chip {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #d6dde5;
  border-radius: 999px;
  color: #3f4b5b;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 520;
}

.saved-filter-more {
  min-width: 32px;
  justify-content: center;
  color: #667085;
  background: #f6f8fa;
}

.admin-save-filter-action {
  min-height: 32px;
  padding: 0 11px;
  border-color: #ead8d7;
  color: #7f282d;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 560;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-state-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(184, 117, 20, 0.25);
  border-radius: var(--radius);
  color: #6b4008;
  background: #fff8eb;
  font-size: 0.9rem;
}

.admin-state-banner strong {
  font-weight: 620;
}

.admin-state-banner.neutral {
  border-color: #e4e7ec;
  color: #344054;
  background: #fff;
}

.admin-sidebar {
  position: sticky;
  top: 88px;
  z-index: 15;
  display: grid;
  gap: 18px;
  padding: 4px 10px 18px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-sidebar-title {
  display: grid;
  gap: 3px;
  padding: 0 10px 4px;
  border-bottom: 0;
}

.admin-sidebar-title strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.1;
}

.admin-sidebar-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-tabs {
  display: grid;
  gap: 18px;
}

.admin-menu-group {
  display: grid;
  gap: 3px;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.admin-menu-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-menu-group.active {
  background: transparent;
  box-shadow: none;
}

.admin-menu-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 10px;
  color: #7a7280;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0;
  list-style: none;
  text-transform: uppercase;
}

.admin-menu-group summary::-webkit-details-marker {
  display: none;
}

.admin-menu-group summary::after {
  content: "⌄";
  color: #9aa0aa;
  font-size: 0.86rem;
  transition: transform 140ms ease;
}

.admin-menu-group[open] summary::after {
  transform: rotate(180deg);
}

.admin-tab {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  justify-content: flex-start;
  margin: 1px 0;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: #4f4a4b;
  background: transparent;
  font-weight: 430;
  text-align: start;
}

.admin-menu-group[open] .admin-tab {
  border-inline-start: 0;
}

.admin-subtab {
  min-height: 38px;
  padding-inline-start: 10px;
  font-size: 0.88rem;
  font-weight: 430;
}

.admin-tab::before {
  content: none;
}

.admin-nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: #a49da2;
}

.admin-nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.admin-nav-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tab.active {
  color: #8f3438;
  background: #f7f3f2;
  font-weight: 560;
}

.admin-tab.active .admin-nav-icon {
  color: #b35543;
  font-weight: 560;
}

.admin-bulk-toolbar,
.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  color: #475467;
  background: #f9fafb;
  font-size: 0.86rem;
  font-weight: 560;
}

.admin-pagination {
  margin-bottom: 0;
}

.admin-table-control-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.admin-table-control-summary span {
  color: #667085;
  font-size: 0.78rem;
}

.admin-table-control-summary strong,
.admin-pagination-summary strong {
  font-weight: 560;
}

.admin-density-control select {
  min-width: 104px;
}

.admin-pagination-summary {
  display: flex;
  gap: 4px;
  align-items: baseline;
  color: #667085;
}

.admin-pagination-summary strong {
  color: var(--ink);
}

.admin-page-size {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 560;
}

.admin-page-size select {
  min-height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 8px;
}

.admin-sort-button {
  min-height: 28px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 560;
  text-align: start;
}

.admin-sort-button.active {
  color: var(--accent-strong);
  font-weight: 650;
}

.admin-row-select {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.admin-table-empty {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed #d0d5dd;
  border-radius: var(--radius);
  color: #667085;
  background: #fcfcfd;
}

.admin-table-empty strong {
  color: var(--ink);
}

.admin-scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.scenario-tab {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #eaecf0;
  border-radius: 999px;
  color: var(--ink);
  background: #f2f4f7;
  font-size: 0.82rem;
  font-weight: 560;
  white-space: nowrap;
}

.scenario-tab small {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 560;
}

.scenario-tab.active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
  font-weight: 560;
}

.scenario-tab.active small {
  color: var(--ink);
  background: #fff;
}

.scenario-tab.warn.active {
  border-color: #b87514;
  background: #b87514;
}

.scenario-tab.danger.active {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.order-workflow-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0 12px;
  padding: 13px;
  border: 1px solid #eaded6;
  border-radius: 8px;
  background: #fffaf6;
}

.order-workflow-strip strong,
.order-workflow-strip small,
.order-workflow-kicker {
  display: block;
}

.order-workflow-kicker {
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 560;
  text-transform: uppercase;
}

.order-workflow-strip strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
}

.order-workflow-strip small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.order-workflow-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.order-sla-pill {
  display: inline-flex;
  width: fit-content;
  margin: 0 6px 2px 0;
  padding: 2px 6px;
  border-radius: 999px;
  color: #14635f;
  background: #e9f7f5;
  font-size: 0.68rem;
  font-weight: 560;
}

.order-sla-pill.warn {
  color: #8a5a10;
  background: #fff4df;
}

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

.risk-card h2 {
  margin: 0;
  font-size: 2.25rem;
}

.risk-scoring-panel {
  grid-column: 1 / -1;
}

.risk-control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.risk-control-strip label,
.risk-rule-card {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
}

.risk-control-strip input[type="number"] {
  width: 76px;
}

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

.risk-rule-card span,
.risk-rule-card strong,
.risk-rule-card small {
  display: block;
}

.risk-rule-card small {
  margin-top: 3px;
  color: var(--muted);
}

.risk-review-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.risk-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
}

.risk-review-row small,
.risk-review-row p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.risk-dashboard-list {
  display: grid;
  gap: 8px;
}

.risk-dashboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: start;
}

.risk-dashboard-item strong,
.risk-dashboard-item small {
  display: block;
}

.risk-dashboard-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.admin-detail-page-card {
  min-height: 62vh;
}

.detail-page-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid #eaecf0;
}

.detail-page-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.detail-header-spacer {
  min-width: 1px;
}

.detail-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: 16px;
  margin-top: 16px;
}

.detail-action-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #eaded6;
  border-radius: 8px;
  background: #fffaf6;
}

.detail-action-panel h3,
.detail-action-panel p {
  margin: 0;
}

.detail-action-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.detail-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-danger-zone {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #f2ccd0;
  border-radius: 8px;
  background: #fff3f4;
}

.detail-danger-zone strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.detail-danger-zone small {
  color: #7a4b54;
}

.detail-side-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.detail-side-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #eaecf0;
  border-radius: var(--radius);
  background: #f9fafb;
}

.detail-relation-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #eaecf0;
  border-radius: var(--radius);
  background: #fff;
}

.detail-relation-section h3,
.detail-relation-section h4 {
  margin: 0;
}

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

.detail-relation-card {
  display: grid;
  gap: 4px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f9fafb;
}

.detail-relation-card.warn {
  border-color: #f4d9a4;
  background: #fff8eb;
}

.detail-relation-card.danger {
  border-color: #f0c4c8;
  background: #fff0f1;
}

.detail-relation-card span,
.detail-relation-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.detail-relation-card strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.detail-mini-list {
  display: grid;
  gap: 8px;
}

.detail-mini-list button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  color: var(--ink);
  background: #f9fafb;
  text-align: start;
}

.detail-mini-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.admin-note-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px;
}

.note-list {
  display: grid;
  gap: 8px;
}

.note-item {
  padding: 10px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
}

.note-item p {
  margin: 5px 0;
  color: #344054;
  line-height: 1.45;
}

.note-item small,
.compact-timeline small {
  display: block;
  color: var(--muted);
}

#admin .dashboard-card {
  border-color: #e4e7ec;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.028);
}

#admin .admin-kpi {
  min-height: 112px;
}

#admin .priority-item,
#admin .admin-record,
#admin .config-card,
#admin .rule-item,
#admin .exception-lane,
#admin .admin-editor-form {
  border-color: #e9edf1;
  background: #fff;
}

#admin .exception-card,
#admin .admin-table-row,
#admin .admin-table-head,
#admin .config-record,
#admin .directory-record {
  border-color: #eaecf0;
}

#admin .admin-table-head {
  background: #f9fafb;
}

.admin-toast {
  position: fixed;
  right: 24px;
  bottom: 104px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-locked > :not(.admin-login-gate):not(.admin-toast) {
  display: none;
}

.admin-login-gate {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.admin-login-card {
  width: min(100%, 520px);
}

.admin-login-card h1,
.admin-login-card p {
  margin: 0;
}

.admin-login-card p {
  margin-top: 8px;
  color: var(--muted);
}

.admin-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 18px 0 10px;
}

.admin-mfa-row {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.admin-login-row input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
  font-weight: 520;
  color: var(--ink);
  background: #fff;
}

body.admin-gate-minimal .admin-login-gate {
  display: block;
  min-height: 0;
}

body.admin-gate-minimal .admin-login-card {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.admin-gate-minimal .admin-login-card :where(.eyebrow, h1, p, small) {
  display: none;
}

body.admin-gate-minimal .admin-login-row {
  margin: 0;
}

body.admin-gate-minimal .admin-login-row:first-of-type {
  align-items: center;
}

body.admin-gate-minimal .admin-mfa-row {
  margin-top: 10px;
}

body.admin-gate-minimal .admin-login-row input {
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

body.admin-gate-minimal .admin-login-row .primary-action {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  body.admin-gate-minimal .admin-login-row:first-of-type {
    grid-template-columns: minmax(0, 1fr);
  }

  body.admin-gate-minimal .admin-login-row .primary-action {
    width: 100%;
  }
}

.admin-view .dashboard-card h2 {
  font-size: 1.35rem;
  font-weight: 620;
  line-height: 1.15;
}

.admin-focus-card h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.admin-command-center,
.admin-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

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

.admin-focus-card {
  min-height: 360px;
}

.admin-kpi {
  min-height: 128px;
}

.priority-list,
.admin-record-list,
.rule-list {
  display: grid;
  gap: 10px;
}

.priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fbf5f0;
  text-align: start;
}

.priority-item small,
.admin-record small,
.admin-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 480;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.warn {
  background: var(--gold);
}

.status-dot.danger {
  background: var(--accent);
}

.admin-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf5f0;
}

.record-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.record-main h3,
.record-main p,
.rule-item strong,
.rule-item span {
  margin: 0;
}

.record-main h3 {
  font-weight: 600;
  line-height: 1.2;
}

.record-main p {
  color: var(--muted);
  font-weight: 500;
}

.admin-note {
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(27, 127, 121, 0.22);
  border-radius: 8px;
  color: var(--teal);
  background: #effaf7;
  font-size: 0.82rem;
  font-weight: 560;
}

.record-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
}

.record-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.conversation-transcript {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}

.conversation-transcript.muted {
  color: var(--muted);
  background: #fafafa;
}

.conversation-transcript-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.conversation-transcript-header strong {
  font-weight: 620;
}

.conversation-transcript-header span,
.conversation-transcript > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 520;
}

.conversation-message {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #fbf5f0;
}

.conversation-message.seller {
  background: #effaf7;
}

.conversation-message span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 620;
}

.conversation-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 480;
}

.admin-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-form.compact-form {
  margin-top: 4px;
}

.admin-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 560;
}

.admin-form input,
.admin-form select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 520;
}

.config-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.config-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 520;
}

.admin-editor-form {
  display: grid;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf5f0;
}

.admin-editor-heading {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.admin-editor-heading h3,
.admin-editor-heading p {
  margin: 0;
}

.admin-editor-heading p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

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

.admin-editor-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
}

.admin-editor-grid input,
.admin-editor-grid select,
.admin-editor-grid textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 520;
}

.admin-editor-grid select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.admin-editor-grid textarea {
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

.toggle-row {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 560;
  white-space: nowrap;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.toggle-row small {
  color: var(--muted);
  font-weight: 520;
}

.app-content-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-content-settings-grid,
.app-content-editor-grid {
  margin-top: 2px;
}

.app-content-wide-field {
  grid-column: 1 / -1;
}

.app-content-card {
  align-content: start;
}

.home-carousel-card {
  align-content: start;
}

.home-carousel-preview {
  display: grid;
  min-height: 150px;
  align-content: end;
  gap: 8px;
  overflow: hidden;
  padding: 18px;
  border-radius: 14px;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.home-carousel-preview span {
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.home-carousel-preview strong {
  max-width: 420px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 650;
  line-height: 1.04;
}

.home-carousel-preview small {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  line-height: 1.35;
}

.revenue-record {
  grid-template-columns: minmax(0, 1fr) auto minmax(260px, 0.5fr);
}

.revenue-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

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

.revenue-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.revenue-dashboard-summary article {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.revenue-dashboard-summary article.primary {
  grid-column: span 2;
  border-color: rgba(28, 106, 91, 0.28);
  background: linear-gradient(135deg, #f4fbf8 0%, #fff 72%);
}

.revenue-dashboard-summary span,
.revenue-lifecycle span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
}

.revenue-dashboard-summary strong,
.revenue-lifecycle strong {
  color: var(--ink);
  font-size: clamp(1.25rem, 1.6vw, 1.65rem);
  font-weight: 650;
}

.revenue-dashboard-summary small,
.revenue-lifecycle small {
  color: var(--muted);
  line-height: 1.35;
}

.revenue-lifecycle article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-warning-note {
  padding: 11px 12px;
  border: 1px solid #f7e3b8;
  border-radius: 8px;
  color: #6b4008;
  background: #fff8eb;
  font-size: 0.84rem;
  line-height: 1.4;
}

.fee-preview-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fee-preview-grid article {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #fff;
}

.fee-preview-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.fee-preview-grid strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.fee-preview-grid small {
  color: var(--muted);
  font-size: 0.72rem;
}

.revenue-lifecycle span,
.revenue-lifecycle small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.revenue-lifecycle strong {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 600;
}

.compact-revenue-invoice {
  background: #fff;
}

.config-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 520;
}

.revenue-rate-control {
  display: grid;
  gap: 5px;
  min-width: 132px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 560;
}

.revenue-rate-control input,
.revenue-rate-control select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 520;
}

.field-help {
  display: block;
  max-width: 190px;
  color: #8a7a73;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.25;
}

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

.config-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.status-chip.muted {
  border-color: #e7e5e4;
  color: #78716c;
  background: #f5f5f4;
}

.readiness-card {
  align-content: start;
  min-width: 0;
}

.readiness-runtime-card {
  background: #fff;
}

.runtime-card {
  background: #fffaf6;
}

.readiness-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.readiness-meta span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  color: #57534e;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.admin-inline-control {
  display: grid;
  gap: 6px;
}

.admin-inline-control span,
.readiness-list strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 560;
  text-transform: uppercase;
}

.admin-inline-control select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.readiness-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.readiness-list p,
.readiness-list ul {
  margin: 0;
  color: #57534e;
  overflow-wrap: anywhere;
}

.readiness-list ul {
  padding-left: 18px;
}

.permission-matrix-card {
  grid-column: 1 / -1;
}

.role-summary-card {
  min-height: 104px;
}

.permission-matrix-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.permission-matrix {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.permission-matrix th,
.permission-matrix td {
  padding: 10px;
  border-bottom: 1px solid #eaecf0;
  text-align: center;
  vertical-align: middle;
}

.permission-matrix th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 190px;
  background: #fff;
  text-align: start;
}

.permission-matrix thead th {
  color: #475467;
  background: #f9fafb;
  font-size: 0.76rem;
  font-weight: 560;
}

.permission-matrix thead th:first-child {
  background: #f9fafb;
}

.permission-matrix tbody th strong,
.permission-matrix tbody th small {
  display: block;
}

.permission-matrix tbody th small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.permission-group-row th:first-child {
  position: static;
  color: var(--brand);
  background: #fff7f7;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permission-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #667085;
  background: #f2f4f7;
  font-size: 0.72rem;
  font-weight: 560;
}

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

.permission-toggle.checked {
  border-color: rgba(16, 135, 122, 0.24);
  color: var(--teal);
  background: #e9f7f5;
}

.permission-toggle.disabled {
  opacity: 0.65;
}

.config-heading {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
}

.config-heading h3,
.config-heading p {
  margin: 0;
}

.config-heading p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.directory-record,
.config-record {
  background: #fff;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 560;
}

.mini-action:hover {
  border-color: var(--accent);
}

.proof-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.proof-detail-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  color: var(--ink);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.proof-detail-list small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 520;
}

.proof-detail-list a {
  color: var(--accent-strong);
  text-decoration: none;
}

.policy-card {
  align-self: start;
}

.admin-checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.admin-checklist li {
  padding: 12px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 560;
}

.table-toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.table-toolbar h2,
.table-toolbar p {
  margin: 0;
}

.table-toolbar p {
  margin-top: 6px;
  color: var(--muted);
}

.compact-search {
  width: min(100%, 320px);
}

.admin-directory-stack {
  display: grid;
  gap: 18px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0 16px;
}

.admin-filter-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 560;
}

.admin-filter-control input,
.admin-filter-control select,
.drawer-form input,
.drawer-form select {
  min-height: 42px;
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 520;
  outline: none;
  padding: 0 11px;
}

.admin-filter-control input:focus,
.admin-filter-control select:focus,
.drawer-form input:focus,
.drawer-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 55, 62, 0.08);
}

.drawer-form input:invalid,
.drawer-form select:invalid {
  border-color: #f0c4c8;
  background: #fff8f8;
}

.queue-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.queue-meta-row > span:not(.status-chip) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.admin-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-data-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: #fff;
}

.admin-data-table th,
.admin-data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eaecf0;
  text-align: start;
  vertical-align: top;
}

.admin-data-table.density-compact th,
.admin-data-table.density-compact td {
  padding: 8px 10px;
}

.admin-data-table.density-compact strong {
  font-size: 0.86rem;
}

.admin-data-table.density-compact small {
  font-size: 0.72rem;
}

.admin-data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #f9fafb;
  font-size: 0.74rem;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-data-table tr:last-child td {
  border-bottom: 0;
}

.admin-data-table strong,
.admin-data-table small {
  display: block;
}

.admin-data-table strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}

.admin-data-table small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 540;
  line-height: 1.3;
}

.compact-tags {
  gap: 5px;
}

.admin-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.9fr) minmax(70px, 0.45fr) minmax(160px, 1fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-table-row:last-child {
  border-bottom: 0;
}

.admin-table-head {
  color: var(--muted);
  background: #fbf5f0;
  font-size: 0.78rem;
  font-weight: 560;
  text-transform: uppercase;
}

.order-table {
  grid-template-columns: minmax(120px, 0.7fr) minmax(170px, 1.1fr) minmax(110px, 0.65fr) minmax(170px, 0.9fr) minmax(210px, 1fr);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.row-primary-action {
  border-color: #d0d5dd;
  color: #344054;
  font-weight: 560;
}

.row-action-menu {
  position: relative;
}

.row-action-menu summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  color: #667085;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 560;
  list-style: none;
  cursor: pointer;
}

.row-action-menu summary::-webkit-details-marker {
  display: none;
}

.row-action-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  display: grid;
  min-width: 168px;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.12);
}

.row-action-menu-panel .mini-action {
  justify-content: flex-start;
  border-radius: 8px;
}

.admin-entity-drawer {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 40;
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.18);
}

.admin-entity-drawer[hidden] {
  display: none;
}

.drawer-header {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #eaecf0;
}

.drawer-header h3,
.drawer-header p,
.drawer-header small {
  margin: 0;
}

.drawer-header h3 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.15rem;
}

.drawer-header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.drawer-detail-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.drawer-detail-list div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eaecf0;
}

.drawer-detail-list dt,
.drawer-detail-list dd {
  margin: 0;
}

.drawer-detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
}

.drawer-detail-list dd {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.drawer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 560;
}

.drawer-form-wide,
.drawer-form .primary-action {
  grid-column: 1 / -1;
}

.drawer-actions {
  margin-top: 16px;
}

.risk-mark {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(27, 127, 121, 0.18);
  border-radius: 999px;
  color: #14635f;
  background: #e9f7f5;
  font-size: 0.76rem;
  font-weight: 560;
}

.risk-mark.warn {
  border-color: #f7e3b8;
  color: #8a5a10;
  background: #fff8eb;
}

.risk-mark.danger {
  border-color: #f2ccd0;
  color: var(--accent-strong);
  background: #fff3f4;
}

.cod-record {
  grid-template-columns: auto minmax(0, 1fr);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 5px solid var(--teal);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-weight: 650;
}

.score-ring.warn {
  border-color: var(--gold);
}

.score-ring.danger {
  border-color: var(--accent);
}

.rule-item {
  display: grid;
  gap: 5px;
  padding: 13px;
  border-radius: var(--radius);
  background: #fbf5f0;
}

.rule-item span {
  color: var(--muted);
  line-height: 1.45;
}

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

.exception-board.single-scenario {
  grid-template-columns: minmax(0, 1fr);
}

.exception-lane {
  min-height: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf5f0;
}

.exception-lane h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.exception-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.exception-card p,
.exception-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.exception-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.wide-card {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-time {
  color: var(--muted);
  font-weight: 500;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: 14px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  width: min(calc(100vw - 28px), 520px);
  transform: translateX(50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.nav-item.active {
  color: #fff;
  background: var(--ink);
}

.nav-item span {
  font-size: 1rem;
  line-height: 1;
}

.nav-item small {
  font-size: 0.68rem;
  font-weight: 800;
}

[dir="rtl"] .hero-copy,
[dir="rtl"] .workspace-heading,
[dir="rtl"] .section-heading,
[dir="rtl"] .checkout-preview,
[dir="rtl"] .dashboard-card {
  text-align: right;
}

[dir="rtl"] .admin-menu-group.active {
  box-shadow: none;
}

/* Admin console typography and density pass. */
body.admin-mode {
  --admin-text: #20242a;
  --admin-muted: #687182;
  --admin-border: #e6e9ee;
  --admin-soft: #f7f8fa;
  --admin-shadow: 0 2px 10px rgba(16, 24, 40, 0.03);
  font-size: 14px;
}

body.admin-mode .topbar {
  padding-block: 10px;
}

body.admin-mode #admin {
  color: var(--admin-text);
  font-size: 0.92rem;
}

body.admin-mode #admin :where(p, small, span, label, td, th, input, select, textarea, button) {
  font-weight: 400;
}

body.admin-mode #admin :where(strong, h2, h3, h4),
body.admin-mode #admin .admin-data-table strong,
body.admin-mode #admin .record-main h3,
body.admin-mode #admin .admin-sidebar-title strong {
  font-weight: 580;
}

body.admin-mode #admin .dashboard-card,
body.admin-mode #admin .admin-page-header,
body.admin-mode #admin .admin-opsbar,
body.admin-mode #admin .admin-sidebar,
body.admin-mode #admin .admin-table,
body.admin-mode #admin .admin-editor-form,
body.admin-mode #admin .config-card,
body.admin-mode #admin .detail-side-card,
body.admin-mode #admin .detail-relation-section,
body.admin-mode #admin .admin-record,
body.admin-mode #admin .priority-item,
body.admin-mode #admin .exception-lane,
body.admin-mode #admin .exception-card,
body.admin-mode #admin .rule-item,
body.admin-mode #admin .config-record,
body.admin-mode #admin .directory-record {
  border-color: var(--admin-border);
  background: #fff;
  box-shadow: var(--admin-shadow);
}

body.admin-mode #admin .dashboard-card,
body.admin-mode #admin .admin-page-header,
body.admin-mode #admin .admin-opsbar,
body.admin-mode #admin .admin-editor-form,
body.admin-mode #admin .config-card,
body.admin-mode #admin .detail-side-card,
body.admin-mode #admin .detail-relation-section {
  padding: 13px;
}

body.admin-mode #admin .admin-content,
body.admin-mode #admin .admin-view,
body.admin-mode #admin .admin-command-center,
body.admin-mode #admin .admin-workspace-grid,
body.admin-mode #admin .admin-settings-grid,
body.admin-mode #admin .admin-config-grid,
body.admin-mode #admin .risk-dashboard-grid,
body.admin-mode #admin .risk-rule-grid,
body.admin-mode #admin .detail-page-grid {
  gap: 12px;
}

body.admin-mode #admin .admin-layout {
  gap: 15px;
}

body.admin-mode #admin .admin-page-heading h2 {
  font-size: clamp(1.15rem, 1.25vw, 1.45rem);
  font-weight: 580;
  line-height: 1.22;
}

body.admin-mode #admin .admin-page-heading p,
body.admin-mode #admin .table-toolbar p,
body.admin-mode #admin .config-heading p,
body.admin-mode #admin .admin-editor-heading p,
body.admin-mode #admin .record-main p,
body.admin-mode #admin .rule-item span,
body.admin-mode #admin .admin-empty-state,
body.admin-mode #admin .admin-note {
  color: var(--admin-muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

body.admin-mode #admin .admin-view .dashboard-card h2,
body.admin-mode #admin .table-toolbar h2,
body.admin-mode #admin .config-heading h3,
body.admin-mode #admin .admin-editor-heading h3,
body.admin-mode #admin .detail-page-header h2,
body.admin-mode #admin .detail-relation-section h3,
body.admin-mode #admin .detail-relation-section h4 {
  font-size: 1.03rem;
  font-weight: 580;
  line-height: 1.25;
}

body.admin-mode #admin .admin-focus-card h2 {
  font-size: 1.15rem;
}

body.admin-mode #admin .risk-card h2,
body.admin-mode #admin .metric-grid strong {
  font-size: 1.34rem;
  font-weight: 560;
  letter-spacing: 0;
}

body.admin-mode #admin .admin-kpi {
  min-height: 92px;
}

body.admin-mode #admin .admin-focus-card {
  min-height: 300px;
}

body.admin-mode #admin .metric-grid {
  gap: 10px;
  margin-bottom: 12px;
}

body.admin-mode #admin .metric-grid .dashboard-card {
  gap: 4px;
}

body.admin-mode #admin .admin-data-table th,
body.admin-mode #admin .admin-data-table td {
  padding: 9px 10px;
}

body.admin-mode #admin .admin-data-table th,
body.admin-mode #admin .admin-filter-control,
body.admin-mode #admin .admin-global-search,
body.admin-mode #admin .admin-role-control,
body.admin-mode #admin .admin-page-size,
body.admin-mode #admin .admin-filter-label,
body.admin-mode #admin .saved-filter-list {
  color: var(--admin-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

body.admin-mode #admin .admin-data-table strong {
  font-size: 0.86rem;
}

body.admin-mode #admin .admin-data-table small,
body.admin-mode #admin .admin-table-row small {
  color: var(--admin-muted);
  font-size: 0.72rem;
}

body.admin-mode #admin .admin-global-search input,
body.admin-mode #admin .admin-role-control select,
body.admin-mode #admin .admin-page-size select,
body.admin-mode #admin .admin-filter-control input,
body.admin-mode #admin .admin-filter-control select,
body.admin-mode #admin .admin-form input,
body.admin-mode #admin .admin-form select,
body.admin-mode #admin .admin-form textarea,
body.admin-mode #admin .admin-editor-grid input,
body.admin-mode #admin .admin-editor-grid select,
body.admin-mode #admin .admin-editor-grid textarea,
body.admin-mode #admin .drawer-form input,
body.admin-mode #admin .drawer-form select,
body.admin-mode #admin .drawer-form textarea {
  min-height: 36px;
  border-color: var(--admin-border);
  color: var(--admin-text);
  font-size: 0.84rem;
}

body.admin-mode #admin .primary-action,
body.admin-mode #admin .ghost-action,
body.admin-mode #admin .text-action,
body.admin-mode #admin .mini-action,
body.admin-mode #admin .status-chip,
body.admin-mode #admin .scenario-tab,
body.admin-mode #admin .saved-filter-chip,
body.admin-mode #admin .row-action-menu summary,
body.admin-mode #admin .admin-page-tab,
body.admin-mode #admin .risk-mark {
  font-weight: 540;
}

body.admin-mode #admin .status-chip {
  border-color: #e2e6eb;
  color: #5f6b7a;
  background: #f4f6f8;
}

body.admin-mode #admin .status-chip.success {
  border-color: #cfe7dc;
  color: #287a4f;
  background: #eff8f3;
}

body.admin-mode #admin .status-chip.warn {
  border-color: #ead8aa;
  color: #9a6a10;
  background: #fbf6e9;
}

body.admin-mode #admin .status-chip.danger {
  border-color: #efd1d1;
  color: #a33a3d;
  background: #fff2f2;
}

body.admin-mode #admin .queue-meta-row > span:not(.status-chip) {
  font-weight: 500;
}

body.admin-mode #admin .admin-menu-link,
body.admin-mode #admin .admin-menu-sublink {
  font-size: 0.86rem;
  font-weight: 400;
}

body.admin-mode #admin .admin-menu-group > summary .admin-menu-root {
  font-weight: 580;
}

body.admin-mode #admin .admin-sidebar {
  padding: 2px 10px 18px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.admin-mode #admin .admin-sidebar-title {
  padding-inline: 10px;
}

body.admin-mode #admin .admin-sidebar-title strong {
  font-size: 0.98rem;
  font-weight: 580;
}

body.admin-mode #admin .admin-sidebar-title span,
body.admin-mode #admin .admin-menu-group summary {
  color: #7b7480;
  font-weight: 520;
}

body.admin-mode #admin .admin-menu-group.active summary {
  color: #8f3438;
}

body.admin-mode #admin .admin-tab {
  color: #514d50;
  font-weight: 400;
}

body.admin-mode #admin .admin-nav-label {
  font-size: 0.88rem;
  font-weight: 400;
}

body.admin-mode #admin .admin-nav-icon {
  color: #a9a2a7;
}

body.admin-mode #admin .admin-tab:hover {
  background: #f7f8fa;
}

body.admin-mode #admin .admin-tab.active {
  color: #8f3438;
  background: #f7f1f0;
  font-weight: 540;
}

body.admin-mode #admin .admin-tab.active .admin-nav-icon,
body.admin-mode #admin .admin-tab.active .admin-nav-label {
  color: #9f3d3f;
  font-weight: 540;
}

body.admin-mode #admin .admin-nav-badge {
  margin-inline-start: auto;
}

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

  .mode-switch,
  .language-switch,
  .admin-top-menu {
    width: 100%;
    justify-content: center;
  }

  .hero-grid,
  .checkout-preview,
  .seller-layout,
  .operations-grid,
  .admin-grid,
	  .admin-layout,
	  .admin-opsbar,
	  .admin-command-center,
	  .admin-workspace-grid,
	  .risk-dashboard-grid,
    .risk-rule-grid,
	  .detail-page-grid,
    .detail-relation-grid {
	    grid-template-columns: 1fr;
	  }

  .admin-sidebar {
    position: static;
  }

  body.admin-mode {
    overflow-x: hidden;
  }

  body.admin-mode .admin-content,
  body.admin-mode .admin-opsbar,
  body.admin-mode .admin-page-header,
  body.admin-mode .admin-state-banner,
  body.admin-mode .admin-view,
  body.admin-mode .dashboard-card,
  body.admin-mode .config-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.admin-mode .admin-global-search,
  body.admin-mode .admin-role-control,
  body.admin-mode .admin-saved-filter-shell,
  body.admin-mode .admin-filter-label,
  body.admin-mode .saved-filter-list {
    min-width: 0;
    max-width: 100%;
  }

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

  .admin-settings-grid,
  .admin-config-grid,
  .admin-editor-grid,
  .admin-filter-bar,
  .drawer-form {
    grid-template-columns: 1fr;
  }

  .admin-entity-drawer {
    inset: auto 10px 10px;
    width: auto;
    max-height: min(78vh, 720px);
  }

  .admin-editor-heading {
    display: grid;
  }

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

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

  .admin-table-row {
    min-width: 780px;
  }

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

  .onboarding-card {
    position: static;
  }
}

@media (min-width: 981px) {
  .app-shell {
    padding-bottom: 24px;
  }

  .bottom-nav {
    display: none;
  }
}

@media (max-width: 620px) {
  main {
    padding-top: 18px;
  }

  .hero-copy {
    min-height: 520px;
    padding: 28px;
  }

  .hero-copy h1,
  .workspace-heading h1 {
    font-size: 2.45rem;
  }

  .section-heading,
  .workspace-heading,
  .card-title-row,
  .table-toolbar {
    display: grid;
    align-items: start;
  }

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

  .admin-actions,
  .admin-top-menu {
    justify-content: start;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }

  body.admin-mode .admin-opsbar,
  body.admin-mode .admin-saved-filter-shell {
    display: grid;
  }

  body.admin-mode .admin-opsbar {
    gap: 10px;
    padding: 10px;
  }

  body.admin-mode .admin-saved-filter-shell {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-top: 0;
  }

  body.admin-mode .admin-save-filter-action {
    width: fit-content;
  }

  body.admin-mode .admin-page-header {
    padding: 13px;
  }

  body.admin-mode .admin-page-heading {
    display: grid;
    gap: 10px;
  }

  body.admin-mode .admin-page-heading h2 {
    font-size: 1.35rem;
  }

  body.admin-mode .permission-matrix {
    min-width: 100%;
    table-layout: fixed;
  }

  body.admin-mode .permission-matrix th,
  body.admin-mode .permission-matrix td {
    padding: 7px 4px;
    font-size: 0.64rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.admin-mode .permission-matrix th:first-child {
    width: 96px;
  }

  body.admin-mode .permission-toggle {
    min-width: 38px;
    padding: 4px 6px;
    font-size: 0.65rem;
  }

  .search-box {
    width: 100%;
  }

  .product-grid,
	  .metric-grid,
	  .admin-metrics,
	  .revenue-dashboard-summary,
	  .revenue-lifecycle,
	  .fee-preview-grid {
	    grid-template-columns: 1fr;
	  }

	  .revenue-dashboard-summary article.primary {
	    grid-column: auto;
	  }

  .checkout-preview {
    padding: 18px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exception-board {
    grid-template-columns: 1fr;
  }

  .admin-record,
  .cod-record,
  .risk-review-row,
  .revenue-record {
    grid-template-columns: 1fr;
  }

  .record-side {
    justify-items: start;
  }

  .revenue-controls {
    justify-content: start;
  }

  .bottom-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .nav-item small {
    display: none;
  }
}
