/* Information architecture and operational surfaces added in the 2026-08 admin pass. */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--dark-1);
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

#admin-page,
.main-content,
.content-page {
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.52);
}

.nav-group-label {
  margin: 18px 12px 7px;
  color: var(--gray-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-group-label:first-child { margin-top: 4px; }

.legacy-home-cards-section #card-config-grid { display: none; }
.legacy-home-cards-section.is-expanded #card-config-grid { display: grid; }
.legacy-home-cards-section .section-header { margin-bottom: 0; }
.legacy-home-cards-section.is-expanded .section-header { margin-bottom: 18px; }

.compat-readonly-field {
  opacity: 0.72;
}

.compat-readonly-field input,
.compat-readonly-field select {
  cursor: not-allowed;
}

.canonical-config-note {
  display: block;
  margin-top: 6px;
  color: var(--gray-2);
  font-size: 12px;
  line-height: 1.5;
}

.model-config-validation {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
}

.model-config-validation.is-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.model-validation-summary,
.model-validation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.model-validation-summary strong { color: #fbbf24; }
.model-config-validation.has-errors .model-validation-summary strong { color: #fca5a5; }
.model-config-validation.is-ready strong { color: #6ee7b7; }
.model-validation-summary span,
.model-config-validation.is-ready span { color: var(--gray-2); font-size: 12px; }

.model-validation-list { display: grid; gap: 6px; }

.model-validation-item {
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--gray-1);
  font-size: 13px;
}

.model-validation-item.error { color: #fecaca; }
.model-validation-item.warning { color: #fde68a; }

.effective-config-panel {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--dark-1);
  overflow: hidden;
}

.effective-config-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.effective-config-head h2 {
  margin: 3px 0 5px;
  font-size: 18px;
}

.effective-config-head p {
  margin: 0;
  color: var(--gray-2);
  font-size: 13px;
}

.effective-provider-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.effective-provider {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--dark-1);
}

.effective-provider span { color: var(--gray-2); font-size: 12px; }
.effective-provider strong { color: #fca5a5; font-size: 13px; }
.effective-provider.configured strong { color: #6ee7b7; }

.effective-table-wrap { overflow-x: auto; }

.effective-config-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.effective-config-table th,
.effective-config-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.effective-config-table th {
  color: var(--gray-2);
  font-size: 12px;
  font-weight: 600;
}

.effective-config-table td strong,
.effective-config-table td small {
  display: block;
}

.effective-config-table td small { margin-top: 4px; color: var(--gray-2); }

.effective-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  font-size: 12px;
}

.effective-status.ready {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.effective-message { max-width: 220px; }
.effective-error { color: #fca5a5; }

.effective-action-cell {
  min-width: 92px;
  white-space: nowrap;
}

.effective-action-cell .link-button + .link-button { margin-left: 10px; }

.feature-config-workbench { padding: 0; overflow: hidden; }
.feature-config-workbench > .service-card-header { margin: 0; padding: 20px; border-bottom: 1px solid var(--border); }

.feature-workbench-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 680px;
}

.feature-workbench-sidebar {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.feature-workbench-sidebar > input {
  width: 100%;
  min-height: 40px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid var(--dark-3);
  border-radius: 6px;
  background: var(--dark-1);
  color: var(--gray-5);
  font-size: 14px;
}

.feature-workbench-sidebar > input::placeholder {
  color: var(--gray-1);
  opacity: 1;
}
#feature-workbench-navigation { display: grid; gap: 18px; }
.feature-workbench-nav-group { display: grid; gap: 5px; }

.feature-workbench-nav-group > span {
  padding: 0 7px 5px;
  color: var(--gray-2);
  font-size: 11px;
  font-weight: 700;
}

.feature-workbench-nav-group > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-3);
  text-align: left;
}

.feature-workbench-nav-group > button:hover { border-color: var(--border); background: rgba(255, 255, 255, 0.035); }
.feature-workbench-nav-group > button.active { border-color: rgba(59, 130, 246, 0.48); background: rgba(59, 130, 246, 0.1); color: var(--gray-5); }
.feature-workbench-nav-group strong,
.feature-workbench-nav-group small { display: block; max-width: 100%; overflow-wrap: anywhere; }
.feature-workbench-nav-group strong { font-size: 13px; }
.feature-workbench-nav-group small { color: var(--gray-2); font-size: 10px; }

.feature-workbench-detail { min-width: 0; background: var(--dark-1); }
.feature-workbench-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px; border-bottom: 1px solid var(--border); }
.feature-workbench-detail-head > div:first-child { min-width: 0; }
.feature-workbench-detail-head span { color: #93c5fd; font-size: 11px; font-weight: 700; }
.feature-workbench-detail-head h3 { margin: 5px 0; color: var(--gray-5); font-size: 20px; }
.feature-workbench-detail-head p { margin: 0; color: var(--gray-2); font-size: 12px; line-height: 1.6; }

.feature-workbench-chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border);
}

.feature-workbench-chain > div { min-width: 0; padding: 12px 14px; background: var(--dark-1); }
.feature-workbench-chain span,
.feature-workbench-chain strong,
.feature-workbench-chain small { display: block; overflow-wrap: anywhere; }
.feature-workbench-chain span { color: var(--gray-2); font-size: 10px; }
.feature-workbench-chain strong { margin-top: 5px; color: var(--gray-4); font-size: 12px; }
.feature-workbench-chain small { margin-top: 3px; color: var(--gray-2); font-size: 10px; }

.feature-workbench-section { padding: 20px; border-bottom: 1px solid var(--border); }
.feature-workbench-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.feature-workbench-section-head h4 { margin: 0 0 4px; color: var(--gray-5); font-size: 14px; }
.feature-workbench-section-head p { margin: 0; color: var(--gray-2); font-size: 11px; line-height: 1.55; }

.feature-workbench-route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feature-workbench-route-grid select { width: 100%; }
.feature-workbench-frontend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feature-workbench-frontend-grid.is-disabled { opacity: 0.52; }
.feature-workbench-billing-mode { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.6fr); gap: 12px; max-width: 620px; margin-bottom: 14px; }

.feature-workbench-price-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.feature-workbench-price-head,
.feature-workbench-price-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(100px, 0.65fr) minmax(100px, 0.65fr) 110px 62px; gap: 10px; align-items: center; min-width: 720px; padding: 10px 12px; }
.feature-workbench-price-head { border-bottom: 1px solid var(--border); color: var(--gray-2); background: rgba(255, 255, 255, 0.025); font-size: 10px; font-weight: 700; }
.feature-workbench-price-row { border-bottom: 1px solid rgba(148, 163, 184, 0.12); color: var(--gray-3); font-size: 11px; }
.feature-workbench-price-row:last-child { border-bottom: 0; }
.feature-workbench-price-row.is-missing { background: rgba(245, 158, 11, 0.055); }
.feature-workbench-price-row strong,
.feature-workbench-price-row small { display: block; overflow-wrap: anywhere; }
.feature-workbench-price-row strong { color: var(--gray-4); font-size: 11px; }
.feature-workbench-price-row small { margin-top: 3px; color: var(--gray-2); font-size: 10px; }
.feature-workbench-price-row input[type="number"] { width: 100%; min-width: 0; }

.feature-workbench-footer { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: rgba(24, 24, 27, 0.96); backdrop-filter: blur(10px); }
.feature-workbench-footer .config-state { margin-right: auto; }

.user-account-cell strong,
.user-membership-cell strong { display: block; }

.user-account-cell small,
.user-membership-cell small { display: block; margin-top: 3px; color: var(--gray-2); }

.user-actions-menu {
  position: relative;
}

.user-actions-menu > summary {
  list-style: none;
  cursor: pointer;
}

.user-actions-menu > summary::-webkit-details-marker { display: none; }

.user-actions-menu[open] .user-actions-popover {
  display: grid;
}

.user-actions-popover {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--dark-1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.user-actions-popover button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
}

.user-list-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--gray-2);
  font-size: 13px;
}

.user-list-footer-actions { display: flex; gap: 8px; }

.compact-modal { max-width: 460px; }

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

.user-quick-action-grid .btn {
  min-height: 42px;
  justify-content: flex-start;
}

.template-card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

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

.template-card-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: var(--gray-2);
}

.template-card-placeholder strong { color: inherit; font-size: 14px; }
.template-card-placeholder span { font-size: 12px; }

.template-video-indicator {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 14px;
}

.status-badge.pending::before,
.status-badge.processing::before,
.status-badge.completed::before,
.status-badge.failed::before {
  content: '';
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.btn.has-pending-changes { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24); }

@media (max-width: 1100px) {
  .effective-provider-strip { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .feature-workbench-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .feature-workbench-frontend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1440px) {
  .model-center-grid { grid-template-columns: minmax(0, 1fr); }
  .model-subnav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .model-subnav-item { min-width: 168px; }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .sidebar { transition: transform 180ms ease; }
  .admin-sidebar-open .sidebar { transform: translateX(0); }
  .admin-sidebar-open .sidebar-backdrop { display: block; }
  #admin-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .main-content {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    overflow-x: hidden;
  }
  .admin-workbench-bar {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: -16px -16px 20px;
    padding: 12px 16px;
  }
  .admin-search-box,
  .admin-theme-switcher {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .admin-theme-switcher {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  }
  .admin-theme-switcher select {
    width: 100%;
    min-width: 0;
  }
  .content-page,
  .page-header,
  .page-header > div,
  .header-actions,
  .config-section,
  .template-browser-toolbar,
  .template-list,
  .template-category-manager {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .table-container,
  .effective-table-wrap,
  .zone-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .template-list { grid-template-columns: minmax(0, 1fr); }
  .effective-config-head { flex-direction: column; align-items: stretch; }
  .effective-provider-strip { grid-template-columns: 1fr; }
  .feature-workbench-layout { grid-template-columns: 1fr; }
  .feature-workbench-sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  #feature-workbench-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 320px;
    padding-right: 4px;
    overflow-y: auto;
    align-content: start;
  }
  .feature-workbench-detail-head { flex-direction: column; }
  .feature-workbench-route-grid,
  .feature-workbench-frontend-grid,
  .feature-workbench-billing-mode { grid-template-columns: 1fr; }
  .feature-workbench-footer { flex-wrap: wrap; }
  .model-config-validation.is-ready,
  .model-validation-summary,
  .model-validation-item { align-items: flex-start; flex-direction: column; }
  .user-list-footer { align-items: stretch; flex-direction: column; }
  .user-list-footer-actions .btn { flex: 1; }
  .user-quick-action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  #feature-workbench-navigation { grid-template-columns: 1fr; }
  .feature-workbench-detail-head .model-card-actions { width: 100%; }
  .feature-workbench-detail-head .model-card-actions .btn { flex: 1; }
  .feature-workbench-footer .btn { flex: 1 1 calc(50% - 8px); }
  .feature-workbench-footer .config-state { flex: 1 0 100%; }
}

/* Readability overrides for dense configuration workbenches. */
.canonical-config-note,
.model-validation-summary span,
.model-config-validation.is-ready span,
.effective-provider span,
.effective-config-table th,
.effective-config-table td small,
.feature-workbench-nav-group > span,
.feature-workbench-nav-group small,
.feature-workbench-detail-head span,
.feature-workbench-detail-head p,
.feature-workbench-chain span,
.feature-workbench-chain small,
.feature-workbench-section-head p,
.feature-workbench-price-head,
.feature-workbench-price-row small,
.template-card-placeholder span {
  color: var(--gray-2);
  font-size: 12px;
  line-height: 1.55;
}

.feature-workbench-nav-group > button {
  min-height: 58px;
  padding: 11px 12px;
  color: var(--gray-4);
}

.feature-workbench-nav-group strong,
.feature-workbench-chain strong,
.feature-workbench-price-row,
.feature-workbench-price-row strong {
  font-size: 13px;
  line-height: 1.45;
}

.feature-workbench-section-head h4 {
  font-size: 15px;
}

.feature-workbench-sidebar {
  background: var(--dark-2);
}

.feature-workbench-nav-group > button:hover {
  border-color: var(--dark-3);
  background: var(--dark-1);
}

.feature-workbench-price-head {
  background: var(--dark-2);
}

.feature-workbench-price-head,
.feature-workbench-price-row {
  padding: 12px 14px;
}

.feature-workbench-footer {
  background: var(--topbar-bg);
}

:root[data-admin-theme="light"] .model-validation-summary strong,
:root[data-admin-theme="light"] .effective-status,
:root[data-admin-theme="light"] .feature-workbench-price-row.is-missing strong {
  color: #9a5b00;
}

:root[data-admin-theme="light"] .model-config-validation.has-errors .model-validation-summary strong,
:root[data-admin-theme="light"] .model-validation-item.error,
:root[data-admin-theme="light"] .effective-provider strong,
:root[data-admin-theme="light"] .effective-error {
  color: #b42318;
}

:root[data-admin-theme="light"] .model-validation-item.warning {
  color: #8a4b00;
}

:root[data-admin-theme="light"] .model-config-validation.is-ready strong,
:root[data-admin-theme="light"] .effective-provider.configured strong,
:root[data-admin-theme="light"] .effective-status.ready {
  color: #067647;
}

:root[data-admin-theme="light"] .feature-workbench-detail-head span {
  color: #1d4ed8;
}
