:root {
  color: #202722;
  background: #f4f7f4;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-synthesis: none;
  --ink: #202722;
  --muted: #717b74;
  --line: #dde5df;
  --surface: #ffffff;
  --soft: #f4f7f4;
  --green: #24875d;
  --green-dark: #166342;
  --green-soft: #eaf5ee;
  --red: #bc4b4b;
  --amber: #a96818;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--soft);
}
button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: #eef2ef;
}
.login-panel {
  width: min(420px, 100%);
  padding: 42px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e1e8e3;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(30, 62, 44, 0.12);
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  padding: 11px;
  border-radius: 8px;
  background: var(--ink);
}
.brand-mark span {
  width: 6px;
  border-radius: 3px 3px 1px 1px;
  background: #8bd3aa;
  animation: meter 1.8s ease-in-out infinite;
  transform-origin: bottom;
}
.brand-mark span:nth-child(1) {
  height: 17px;
  animation-delay: -0.4s;
}
.brand-mark span:nth-child(2) {
  height: 28px;
  animation-delay: -0.8s;
}
.brand-mark span:nth-child(3) {
  height: 22px;
  animation-delay: -1.2s;
}
.brand-mark.small {
  width: 38px;
  height: 38px;
  padding: 8px;
  gap: 3px;
}
.brand-mark.small span {
  width: 4px;
}
.brand-mark.small span:nth-child(1) {
  height: 11px;
}
.brand-mark.small span:nth-child(2) {
  height: 19px;
}
.brand-mark.small span:nth-child(3) {
  height: 15px;
}
@keyframes meter {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark span {
    animation: none;
  }
}

.eyebrow {
  margin: 24px 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.login-panel h1,
.topbar h1,
.dialog h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}
.login-panel h1 {
  font-size: 28px;
}
.login-copy {
  margin: 10px 0 30px;
  color: var(--muted);
  font-size: 14px;
}
label {
  display: block;
  margin: 17px 0 7px;
  color: #445049;
  font-size: 13px;
  font-weight: 600;
}
input,
textarea {
  width: 100%;
  border: 1px solid #cfd9d2;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
textarea {
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(36, 135, 93, 0.12);
}
input:disabled {
  background: #f2f5f2;
  color: #5d6861;
}
.form-error {
  min-height: 20px;
  margin: 8px 0;
  color: var(--red);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  transition:
    background-color 0.18s,
    transform 0.18s,
    opacity 0.18s;
}
.primary-button {
  width: 100%;
  padding: 12px 16px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}
.primary-button:hover {
  background: var(--green-dark);
}
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}
.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary-button.compact {
  width: auto;
  padding: 10px 18px;
}
.secondary-button {
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3c4740;
}
.secondary-button:hover {
  background: #f8faf8;
}
.text-button {
  padding: 4px 0;
  background: transparent;
  color: #aeb9b2;
}
.text-button:hover {
  color: #fff;
}
.icon-button {
  width: 34px;
  height: 34px;
  background: transparent;
  color: #657068;
  font-size: 24px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: #1d2721;
  color: #fff;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}
.sidebar-brand strong {
  font-size: 16px;
}
.sidebar-brand small {
  margin-top: 2px;
  color: #94a299;
  font-size: 11px;
}
#main-nav {
  display: grid;
  gap: 4px;
  margin-top: 20px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b8c4bc;
  text-align: left;
  font-size: 13px;
}
.nav-item > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #536158;
  border-radius: 5px;
  color: #91a097;
  font-size: 11px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}
.nav-item.active {
  background: #2d3c32;
  color: #fff;
}
.nav-item.active > span {
  border-color: #6ab58d;
  background: #4c9b72;
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a299;
  font-size: 11px;
}
.sidebar-foot .text-button {
  grid-column: 2;
  justify-self: start;
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #58c489;
  box-shadow: 0 0 0 4px rgba(88, 196, 137, 0.12);
}

.main-content {
  min-width: 0;
}
.topbar {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}
.topbar .eyebrow {
  margin: 0 0 6px;
}
.topbar h1 {
  font-size: 23px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-badge {
  padding: 7px 10px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}
.content {
  padding: 28px 34px 42px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  min-height: 128px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.metric small {
  color: #8a958e;
  font-size: 11px;
}
.metric.alert strong {
  color: var(--red);
}
.section-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}
.section-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.section-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.section-head h2 {
  margin: 0;
  font-size: 16px;
}
.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filters input,
.filters select {
  width: 230px;
  padding: 9px 10px;
  border: 1px solid #d5ddd7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.filters select {
  width: 130px;
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf1ee;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #fafcfa;
  color: #7b857e;
  font-size: 11px;
  font-weight: 600;
}
td {
  color: #3a443e;
}
tbody tr:hover {
  background: #fafcfa;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 4px;
  background: #eef2ef;
  color: #59645d;
  font-size: 11px;
}
.status.success {
  background: var(--green-soft);
  color: var(--green-dark);
}
.status.warning {
  background: #fbf2e4;
  color: var(--amber);
}
.status.danger {
  background: #fbecec;
  color: var(--red);
}
.action-button {
  padding: 5px 8px;
  border: 1px solid #cfe0d5;
  border-radius: 5px;
  background: #fff;
  color: var(--green-dark);
  font-size: 11px;
}
.action-button:hover {
  background: var(--green-soft);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 18px;
  color: var(--muted);
  font-size: 12px;
}
.pagination button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

.state-box {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}
.state-box strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 15px;
}
.loading-line {
  height: 3px;
  background: var(--green);
  background-size: 45% 100%;
  animation: loading 1.2s linear infinite;
}
@keyframes loading {
  to {
    background-position: 220% 0;
  }
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.runtime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid #e5ebe6;
  border-radius: 6px;
}
.runtime-row span:first-child {
  color: #536058;
  font-size: 13px;
}
.switch-state {
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
}
.switch-state.on {
  color: var(--green);
}

.settings-stack {
  display: grid;
  gap: 16px;
}
.settings-panel {
  margin-top: 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 18px;
  padding: 8px 18px 18px;
}
.setting-field {
  min-width: 0;
}
.setting-field > span,
.setting-field > small {
  display: block;
}
.setting-help,
.field-help {
  line-height: 1.5;
}
.setting-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.generate-button {
  min-width: 82px;
  padding: 9px 12px;
  white-space: nowrap;
}
.secret-action-row {
  grid-template-columns: repeat(3, auto);
}
.secret-action-row input {
  grid-column: 1 / -1;
}
.secret-action-button {
  min-width: 92px;
  padding: 9px 12px;
  white-space: nowrap;
}
.secret-action-button:disabled {
  color: #98a39e;
  cursor: not-allowed;
  opacity: 0.72;
}
.configuration-guide,
.product-guide {
  margin: 0 18px 12px;
  padding: 16px;
  border: 1px solid #cfe0d5;
  border-radius: 6px;
  background: #f3f8f4;
}
.guide-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.guide-title .ui-icon {
  width: 20px;
  height: 20px;
  color: var(--green);
}
.guide-title strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}
.guide-title p,
.product-warning {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.callback-address {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 10px;
  border: 1px solid #dce8df;
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
}
.callback-address code {
  overflow: hidden;
  color: #30453a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.callback-address button {
  padding: 6px 10px;
}
.configuration-guide ol {
  margin: 12px 0 0 30px;
  padding: 0;
  color: #536058;
  font-size: 11px;
  line-height: 1.75;
}
.setting-field > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.toggle-field {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.toggle-field input {
  width: 42px;
  height: 23px;
  margin: 0;
  accent-color: var(--green);
}
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.product-stack {
  display: grid;
  gap: 14px;
}

.catalog-list {
  display: grid;
  gap: 16px;
}

.catalog-form {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.catalog-list .catalog-form:first-child {
  border-top: 0;
  padding-top: 0;
}

.catalog-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.catalog-fields label {
  display: grid;
  gap: 7px;
}

.catalog-fields .wide-field {
  grid-column: 1 / -1;
}

.catalog-fields textarea {
  resize: vertical;
  min-height: 72px;
}

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

@media (max-width: 720px) {
.model-config-row, .tier-config-row { grid-template-columns: 1fr 1fr; align-items: end; }
.model-config-row > div:first-child, .tier-config-row > div:first-child { grid-column: 1 / -1; }
.model-config-row .primary-button, .tier-config-row .primary-button { width: 100%; }
  .catalog-fields {
    grid-template-columns: 1fr;
  }

  .catalog-fields .wide-field {
    grid-column: auto;
  }
}

.toggle-field input[type="checkbox"], .announcement-toggle input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 42px !important;
  height: 24px !important;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #ccd8d2;
  box-shadow: none;
  cursor: pointer;
}
.toggle-field input[type="checkbox"]::after, .announcement-toggle input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 46, 37, .2);
  content: "";
  transition: transform .18s ease;
}
.toggle-field input[type="checkbox"]:checked, .announcement-toggle input[type="checkbox"]:checked { background: var(--teal); }
.toggle-field input[type="checkbox"]:checked::after, .announcement-toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* Final responsive guardrails for the settings workbench. */
@media (max-width: 1120px) {
  .settings-layout { grid-template-columns: 210px minmax(0, 1fr) !important; }
  .settings-aside { display: none !important; }
}
@media (max-width: 720px) {
  .settings-layout { display: block !important; }
  .settings-nav { position: static !important; margin-bottom: 14px; overflow-x: auto; }
  .settings-main { display: block; }
  .model-create-dialog { width: calc(100% - 24px); }
  .model-create-grid { grid-template-columns: 1fr; }
  .model-create-grid .wide-field, .model-default-toggle { grid-column: auto; }
}

.empty-state { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 7px; flex-direction: column; padding: 24px; text-align: center; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { color: var(--muted); font-size: 11px; }
.empty-table-cell { padding: 0 !important; }
.empty-table-cell .empty-state { min-height: 150px; border: 0; }
.workspace-progress-empty { display: inline-flex; align-items: center; min-height: 18px; color: var(--muted); font-size: 10px; }
.detail-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.detail-form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.detail-form-grid select { width: 100%; }
.json-view { max-height: 180px; margin: 8px 0 0; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #f7faf8; color: var(--ink-soft); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-copy { border-left: 3px solid var(--coral); padding-left: 12px; }
.drawer-row-button { width: 100%; border: 1px solid #e8eeeb; text-align: left; cursor: pointer; }
.drawer-row-button:hover { border-color: var(--teal); background: #f1f8f4; }
.todo-empty { display: flex; align-items: center; gap: 8px; padding: 16px; color: var(--muted); font-size: 11px; }
.todo-empty .ui-icon { width: 16px; height: 16px; }
.signal-bars { display: grid; gap: 9px; padding: 16px 20px 18px; }
.signal-bar-legend { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.signal-bar-legend span::before { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--teal); content: ''; }
.signal-bar-legend span:nth-child(2)::before { background: var(--coral); }
.signal-bar-legend span:nth-child(3)::before { background: var(--amber); }
.signal-bar-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(22px, 1fr)); align-items: end; gap: 5px; min-height: 164px; border-bottom: 1px solid var(--line); }
.signal-bar-column { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 2px; height: 150px; min-width: 0; }
.signal-bar { display: block; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--teal); }
.signal-bar.failed { background: var(--coral); }
.signal-bar.risk { background: var(--amber); }
.signal-bar-column small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

/* Catalog and settings workbench refinements: match the reference's dense desktop information architecture. */
.catalog-tabbar { display: flex; align-items: center; gap: 26px; min-height: 45px; border-bottom: 1px solid var(--line); }
.catalog-tab { position: relative; padding: 11px 2px 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.catalog-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ""; }
.catalog-tab.active { color: var(--teal-dark); }
.catalog-tab.active::after { background: var(--teal); }
.catalog-library-view { display: grid; gap: 14px; }
.catalog-library-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 16px; align-items: start; }
.catalog-library-panel { min-width: 0; overflow: hidden; }
.catalog-filter-toolbar { display: flex; align-items: center; gap: 8px; padding: 13px 18px; border-bottom: 1px solid #edf1ef; background: #fff; }
.catalog-filter-toolbar .workspace-toolbar { display: contents; }
.catalog-filter-toolbar .filter-search-wrap { flex: 1 1 260px; min-width: 210px; }
.catalog-filter-toolbar input { min-height: 36px; padding-left: 34px; border-color: #dce7e2; border-radius: 8px; }
.catalog-filter-toolbar select { min-width: 78px; padding: 9px 10px; border: 1px solid #dce7e2; border-radius: 8px; background: #fff; color: var(--ink-soft); font-size: 11px; }
.catalog-filter-toolbar .secondary-button { padding: 8px 11px; white-space: nowrap; }
.catalog-chip-row { display: flex; align-items: center; gap: 7px; padding: 10px 18px 11px; border-bottom: 1px solid #edf1ef; background: #fbfcfc; }
.filter-chip { padding: 5px 9px; border: 1px solid #e2eae6; border-radius: 999px; color: var(--muted); font-size: 10px; }
.filter-chip.active { border-color: #c8e5d8; background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; }
.catalog-library-panel .workspace-table table { min-width: 940px; }
.catalog-library-panel .workspace-table th { padding: 11px 12px; }
.catalog-library-panel .workspace-table td { padding: 13px 12px; }
.catalog-library-panel .workspace-table th:first-child, .catalog-library-panel .workspace-table td:first-child { width: 38px; }
.catalog-library-panel .workspace-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--teal); }
.catalog-library-panel .project-cover { width: 38px; height: 38px; margin-right: 8px; border-radius: 8px; }
.catalog-subline { display: block; margin: 3px 0 0 47px; color: var(--muted); font-size: 9px; }
.mini-waveform { display: inline-flex; align-items: center; gap: 2px; width: 132px; height: 26px; vertical-align: middle; }
.mini-waveform i { width: 3px; min-height: 4px; border-radius: 3px; background: #b6c4be; }
.mini-waveform i:nth-child(3n) { background: var(--teal); }
.catalog-timecode { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.catalog-song-drawer { position: sticky; top: 104px; min-height: 532px; padding: 18px; }
.catalog-song-drawer.is-collapsed { display: none; }
.catalog-song-drawer .catalog-art { margin: 16px 0; aspect-ratio: 1.55 / 1; }
.catalog-song-drawer .catalog-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.catalog-song-drawer .detail-actions { flex-wrap: wrap; }
.catalog-song-drawer .detail-actions .icon-action-button { margin-left: auto; }
.catalog-options-view { display: grid; gap: 14px; }
.catalog-options-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.catalog-options-list { display: grid; gap: 14px; min-width: 0; }
.catalog-option-group { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(28,57,59,.035); }
.catalog-option-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.catalog-option-group-head h3 { margin: 0; font-size: 16px; }
.catalog-option-group-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.catalog-option-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.catalog-option-cards .catalog-form { min-width: 0; border: 1px solid #e3ebe7; border-radius: 10px; background: #fbfcfc; overflow: hidden; }
.catalog-option-cards .product-title { min-height: 56px; padding: 12px 14px; }
.catalog-option-cards .catalog-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; padding: 0 14px 14px; }
.catalog-option-cards .catalog-fields .wide-field { grid-column: 1 / -1; }
.catalog-option-cards .settings-actions { padding: 11px 14px; }
.catalog-create { position: sticky; top: 104px; }
.catalog-create .catalog-form { border: 0; }
.catalog-create .catalog-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-create .catalog-fields .wide-field { grid-column: 1 / -1; }
.settings-intro-actions { display: flex; align-items: center; gap: 12px; }
.settings-last-saved { color: var(--muted); font-size: 11px; }
.settings-status-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.settings-status-item { display: flex; align-items: center; gap: 9px; min-height: 72px; padding: 13px 14px; background: #fff; }
.settings-status-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }
.settings-status-item.attention .settings-status-icon { background: var(--amber-soft); color: var(--amber); }
.settings-status-icon .ui-icon { width: 15px; height: 15px; }
.settings-status-item strong, .settings-status-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-status-item strong { color: var(--ink); font-size: 11px; }
.settings-status-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.settings-main .settings-panel { box-shadow: 0 10px 26px rgba(28,57,59,.045); }
.settings-side-panel { box-shadow: 0 8px 22px rgba(28,57,59,.035); }

@media (max-width: 1180px) {
  .catalog-library-layout, .catalog-options-layout { grid-template-columns: minmax(0, 1fr); }
  .catalog-song-drawer, .catalog-create { position: static; }
  .settings-status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .catalog-filter-toolbar { flex-wrap: wrap; }
  .catalog-filter-toolbar .filter-search-wrap { flex-basis: 100%; }
  .catalog-filter-toolbar select { flex: 1; min-width: 0; }
  .catalog-option-cards, .catalog-create .catalog-fields { grid-template-columns: 1fr; }
  .catalog-option-cards .catalog-fields .wide-field, .catalog-create .catalog-fields .wide-field { grid-column: auto; }
  .settings-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-intro-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
}

.toggle-field input[type="checkbox"], .announcement-toggle input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 42px !important;
  height: 24px !important;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #ccd8d2;
  box-shadow: none;
  cursor: pointer;
}
.toggle-field input[type="checkbox"]::after, .announcement-toggle input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 46, 37, .2);
  content: "";
  transition: transform .18s ease;
}
.toggle-field input[type="checkbox"]:checked, .announcement-toggle input[type="checkbox"]:checked { background: var(--teal); }
.toggle-field input[type="checkbox"]:checked::after, .announcement-toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* Page-level workbenches: each operational domain gets its own information hierarchy. */
.page-workbench { display: grid; gap: 16px; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 2px 2px 4px; }
.workspace-header h2 { margin: 0; color: var(--ink); font-size: 27px; letter-spacing: -.04em; }
.workspace-header p:not(.panel-kicker) { max-width: 68ch; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.workspace-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workspace-actions .primary-button { width: auto; }
.workspace-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.finance-workbench .workspace-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.workspace-stat { position: relative; min-height: 102px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.workspace-stat::after { position: absolute; right: -20px; bottom: -25px; width: 75px; height: 75px; border-radius: 50%; background: #edf4f1; content: ""; }
.workspace-stat.teal::after { background: var(--teal-soft); }
.workspace-stat.blue::after { background: var(--blue-soft); }
.workspace-stat.amber::after { background: var(--amber-soft); }
.workspace-stat.coral::after { background: var(--coral-soft); }
.workspace-stat span, .workspace-stat strong, .workspace-stat small { position: relative; z-index: 1; display: block; }
.workspace-stat span { color: var(--muted); font-size: 11px; font-weight: 700; }
.workspace-stat strong { margin-top: 13px; color: var(--ink); font-size: 25px; letter-spacing: -.04em; }
.workspace-stat small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.workbench-panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 24px rgba(28,57,59,.035); overflow: hidden; }
.workbench-panel > .workspace-header { padding: 18px 20px 14px; }
.workbench-panel > .workspace-header h2 { font-size: 16px; }
.workbench-panel > .workspace-header p:not(.panel-kicker) { margin-top: 4px; font-size: 11px; }
.workspace-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef; background: #fbfcfc; }
.workspace-toolbar .filter-search-wrap { flex: 1 1 320px; min-width: 180px; }
.workspace-toolbar .filter-search-wrap input { min-width: 0; width: 100%; padding-left: 34px; }
.workspace-toolbar select { min-width: 120px; padding: 9px 11px; border: 1px solid #dce7e2; border-radius: 9px; background: #fff; color: var(--ink-soft); }
.workspace-table { overflow: auto; }
.workspace-table table { min-width: 820px; }
.workspace-table th { position: static; text-transform: none; letter-spacing: 0; }
.workspace-table td { vertical-align: middle; }
.selectable-row { cursor: pointer; }
.selectable-row:hover, .risk-row-selected { background: #f0f8f5 !important; }
.table-link { border: 0; background: transparent; color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.table-link:hover { color: var(--teal); text-decoration: underline; }
.severity-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: #edf1f0; color: #607175; font-size: 10px; font-weight: 800; }
.severity-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.severity-badge.danger { color: var(--coral); background: var(--coral-soft); }
.severity-badge.warning { color: var(--amber); background: var(--amber-soft); }
.severity-badge.info { color: #3688c5; background: var(--blue-soft); }
.dot-label { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.dot-label::before { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); content: ""; }
.workspace-progress { position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 115px; }
.workspace-progress::before { width: 72px; height: 6px; border-radius: 999px; background: #e4ece9; content: ""; }
.workspace-progress i { position: absolute; width: 0; height: 6px; border-radius: 999px; background: var(--teal); }
.workspace-progress small { color: var(--muted); font-size: 10px; }
.bar-height-p0 { height: 0%; }
.bar-height-p5 { height: 5%; }
.bar-height-p10 { height: 10%; }
.bar-height-p15 { height: 15%; }
.bar-height-p20 { height: 20%; }
.bar-height-p25 { height: 25%; }
.bar-height-p30 { height: 30%; }
.bar-height-p35 { height: 35%; }
.bar-height-p40 { height: 40%; }
.bar-height-p45 { height: 45%; }
.bar-height-p50 { height: 50%; }
.bar-height-p55 { height: 55%; }
.bar-height-p60 { height: 60%; }
.bar-height-p65 { height: 65%; }
.bar-height-p70 { height: 70%; }
.bar-height-p75 { height: 75%; }
.bar-height-p80 { height: 80%; }
.bar-height-p85 { height: 85%; }
.bar-height-p90 { height: 90%; }
.bar-height-p95 { height: 95%; }
.bar-height-p100 { height: 100%; }
.progress-width-p0 { width: 0%; }
.progress-width-p5 { width: 5%; }
.progress-width-p10 { width: 10%; }
.progress-width-p15 { width: 15%; }
.progress-width-p20 { width: 20%; }
.progress-width-p25 { width: 25%; }
.progress-width-p30 { width: 30%; }
.progress-width-p35 { width: 35%; }
.progress-width-p40 { width: 40%; }
.progress-width-p45 { width: 45%; }
.progress-width-p50 { width: 50%; }
.progress-width-p55 { width: 55%; }
.progress-width-p60 { width: 60%; }
.progress-width-p65 { width: 65%; }
.progress-width-p70 { width: 70%; }
.progress-width-p75 { width: 75%; }
.progress-width-p80 { width: 80%; }
.progress-width-p85 { width: 85%; }
.progress-width-p90 { width: 90%; }
.progress-width-p95 { width: 95%; }
.progress-width-p100 { width: 100%; }
.risk-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .7fr); gap: 16px; align-items: stretch; }
.risk-list-panel { min-width: 0; }
.workbench-detail { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(28,57,59,.035); }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.detail-heading h3 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.03em; }
.detail-heading .panel-kicker { margin-bottom: 5px; }
.workbench-detail h4 { margin: 18px 0 4px; color: var(--ink); font-size: 14px; }
.detail-id { margin: 0; color: var(--muted); }
.detail-list { display: grid; gap: 1px; margin: 14px 0 0; }
.detail-list div { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #edf1ef; }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.detail-copy { padding: 8px 0; }
.detail-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.detail-note { min-height: 72px; margin-top: 8px; font-size: 11px; }
.detail-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.detail-actions .primary-button { width: auto; }
.tasks-panel { min-width: 0; }
.task-detail { padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task-tabs { display: flex; gap: 18px; margin-top: 13px; border-bottom: 1px solid var(--line); }
.task-tabs button { padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; }
.task-tabs button.active { border-color: var(--teal); color: var(--teal-dark); font-weight: 800; }
.task-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; padding-top: 17px; }
.task-detail-grid span, .task-detail-grid strong { display: block; }
.task-detail-grid span { color: var(--muted); font-size: 10px; }
.task-detail-grid strong { margin-top: 5px; color: var(--ink); font-size: 12px; }
.cost-breakdown { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.cost-breakdown strong { color: var(--ink); }
.projects-table-panel { overflow: hidden; }
.project-cover { display: inline-grid; width: 36px; height: 36px; margin-right: 9px; place-items: center; vertical-align: middle; border-radius: 8px; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 800; }
.cover-0 { background: #405661; }
.cover-1 { background: #17676a; }
.cover-2 { background: #c18b68; }
.cover-3 { background: #66518a; }
.cover-4 { background: #567187; }
.project-name { color: var(--ink); font-size: 12px; font-weight: 700; vertical-align: middle; }
.finance-ledger-panel, .finance-orders-panel, .finance-products-panel { min-width: 0; }
.finance-in { color: #168b68 !important; font-weight: 800; }
.finance-out { color: var(--coral) !important; font-weight: 800; }
.money-cell { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 800; }
.financial-user-cell strong, .financial-user-cell small { display: block; }
.financial-user-cell small { margin-top: 3px; }
.status-note.deleted { color: var(--coral); font-size: 10px; }
.health-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.health-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 88px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.health-card.is-warning { border-color: #f1dfbb; background: #fffdf7; }
.health-card-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--teal-soft); }
.health-card.is-warning .health-card-icon { background: var(--amber-soft); }
.health-card-icon .ui-icon { width: 17px; height: 17px; }
.health-card strong, .health-card small { display: block; }
.health-card strong { color: var(--ink); font-size: 12px; }
.health-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.health-card b { color: var(--teal-dark); font-size: 10px; }
.health-card.is-warning b { color: var(--amber); }
.runtime-signal-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr); gap: 16px; }
.signal-chart-panel, .alerts-panel { min-height: 260px; }
.signal-chart { position: relative; height: 192px; margin: 6px 20px 18px; border-top: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef; background: #fff; overflow: hidden; }
.signal-line { position: absolute; left: 0; right: 0; height: 45%; opacity: .9; clip-path: polygon(0 64%, 8% 57%, 18% 61%, 28% 44%, 38% 48%, 48% 36%, 58% 42%, 68% 28%, 78% 34%, 88% 18%, 100% 22%, 100% 28%, 88% 24%, 78% 40%, 68% 34%, 58% 48%, 48% 42%, 38% 54%, 28% 50%, 18% 67%, 8% 63%, 0 70%); }
.line-main { top: 27%; background: rgba(35,157,137,.28); }
.line-blue { top: 44%; transform: scaleY(.58); background: rgba(72,146,226,.3); }
.line-coral { top: 62%; transform: scaleY(.4); background: rgba(233,117,100,.35); }
.chart-axis { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; padding-top: 7px; color: var(--muted); font-size: 9px; }
.alerts-panel { padding-bottom: 8px; }
.alert-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) 15px; align-items: center; gap: 10px; width: calc(100% - 24px); margin: 0 12px 4px; padding: 11px 8px; border: 0; border-radius: 9px; background: #f8faf9; text-align: left; }
.alert-item:hover { background: #eef6f3; }
.alert-item > i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.alert-item.danger > i { background: var(--coral); }
.alert-item.warning > i { background: var(--amber); }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { color: var(--ink); font-size: 11px; }
.alert-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.alert-item .ui-icon { width: 14px; opacity: .5; }
.audit-panel { min-width: 0; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .62fr); gap: 16px; align-items: start; }
.catalog-main { display: grid; gap: 14px; min-width: 0; }
.catalog-preview { position: sticky; top: 110px; padding: 20px; }
.catalog-art { display: grid; width: 100%; aspect-ratio: 1.65 / 1; margin: 17px 0; place-items: center; border-radius: 12px; color: rgba(255,255,255,.9); font-size: 42px; font-weight: 800; }
.waveform { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 5px; }
.waveform i { width: 3px; min-height: 5px; border-radius: 4px; background: var(--teal); opacity: .75; }
.catalog-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 14px; margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); }
.catalog-meta-grid span, .catalog-meta-grid strong { display: block; }
.catalog-meta-grid span { color: var(--muted); font-size: 10px; }
.catalog-meta-grid strong { margin-top: 4px; color: var(--ink); font-size: 11px; }
.settings-workbench { gap: 18px; }
.settings-workbench .workbench-panel { min-height: 0; }
.settings-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.settings-section-title h3 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -.025em; }
.settings-section-title p:not(.panel-kicker) { max-width: 58ch; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-section-title.compact-title { margin-top: 8px; border-top: 1px solid var(--line); }
.announcement-state { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.announcement-state.on { color: var(--teal-dark); background: var(--teal-soft); }
.announcement-state.off { color: var(--muted); background: #edf1f0; }
.announcement-layout, .notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.announcement-form, .notes-form { min-width: 0; }
.announcement-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; padding: 22px 24px; }
.announcement-fields label, .notes-price-grid label { display: grid; gap: 7px; margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.announcement-fields label > span, .notes-price-grid label > span { color: var(--ink-soft); }
.announcement-fields label > small, .notes-price-grid label > small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.45; }
.announcement-fields input, .announcement-fields select, .announcement-fields textarea, .notes-price-grid input { min-height: 40px; border-color: var(--line-strong); border-radius: 8px; }
.announcement-fields textarea { min-height: 150px; resize: vertical; }
.announcement-wide { grid-column: 1 / -1; }
.announcement-toggle { grid-column: 1 / -1; display: flex !important; align-items: center; justify-content: space-between; min-height: 62px; padding: 13px 15px; border: 1px solid #d4e9df; border-radius: 9px; background: #f6fbf8; }
.announcement-toggle strong, .announcement-toggle small { display: block; }
.announcement-toggle small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.announcement-toggle input { width: 40px; height: 22px; accent-color: var(--teal); }
.announcement-preview, .notes-summary { position: sticky; top: 104px; padding: 20px; border: 1px solid #ead8c9; border-radius: 14px; background: #fffaf1; box-shadow: 0 10px 28px rgba(105,62,33,.08); }
.announcement-preview-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; margin-top: 14px; padding: 15px; border: 1px solid rgba(184,46,29,.22); border-radius: 11px; background: rgba(255,250,239,.82); }
.announcement-preview-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(184,46,29,.18); border-radius: 50%; background: rgba(255,255,255,.72); color: var(--coral); }
.announcement-preview-icon .ui-icon { width: 17px; height: 17px; }
.announcement-preview-card strong, .announcement-preview-card p, .announcement-preview-card small { display: block; }
.announcement-preview-card strong { color: var(--ink); font-size: 13px; }
.announcement-preview-card p { margin: 6px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.announcement-preview-card small { color: var(--teal-dark); font-size: 10px; }
.notes-price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; padding: 22px 24px; }
.guardrail-grid { padding-top: 8px; }
.notes-summary { display: grid; gap: 18px; }
.notes-balance-visual { display: grid; place-items: center; min-height: 160px; border-radius: 13px; background: #eaf7f1; color: var(--teal-dark); }
.notes-balance-visual span { font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.notes-balance-visual strong { margin-top: 6px; font-size: 35px; letter-spacing: -.08em; }
.notes-balance-visual small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.notes-summary h3 { margin: 0; color: var(--ink); font-size: 15px; }
.notes-summary ol { display: grid; gap: 12px; margin: 0; padding: 0 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.notes-summary li::marker { color: var(--teal); font-weight: 800; }

@media (max-width: 1120px) {
  .risk-layout, .runtime-signal-grid, .catalog-layout { grid-template-columns: 1fr; }
  .catalog-preview { position: static; }
  .health-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-workbench .workspace-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .announcement-layout, .notes-layout { grid-template-columns: 1fr; }
  .announcement-preview, .notes-summary { position: static; }
  .settings-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .settings-aside { display: none; }
}
@media (max-width: 720px) {
  .workspace-header { align-items: flex-start; flex-direction: column; gap: 13px; }
  .workspace-header h2 { font-size: 23px; }
  .workspace-actions { justify-content: flex-start; }
  .workspace-stats, .finance-workbench .workspace-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-stat { min-height: 92px; padding: 13px; }
  .workspace-stat strong { font-size: 21px; }
  .workspace-toolbar { align-items: stretch; flex-wrap: wrap; padding: 11px 14px; }
  .workspace-toolbar .filter-search-wrap { flex-basis: 100%; }
  .workspace-toolbar select { flex: 1; }
  .risk-layout { gap: 12px; }
  .workbench-detail, .task-detail, .catalog-preview { padding: 16px; }
  .task-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-card-grid { grid-template-columns: 1fr 1fr; }
  .catalog-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-section-title { padding: 18px 16px 15px; }
  .announcement-fields, .notes-price-grid { grid-template-columns: 1fr; gap: 15px; padding: 18px 16px; }
  .announcement-wide, .announcement-toggle { grid-column: auto; }
  .announcement-toggle { display: flex !important; }
}

/* Production operations theme extracted from design/reference/production-overview.png. */
:root {
  --ink: #161b18;
  --muted: #6f7772;
  --line: #e2e7e3;
  --surface: #fff;
  --soft: #f5f7f5;
  --green: #239b63;
  --green-dark: #17764a;
  --green-soft: #eaf7ef;
  --risk: #d64545;
  --warning: #c77a16;
  --red: var(--risk);
  --amber: var(--warning);
}
body { background: var(--soft); }
.login-panel, .brand-mark, .metric, .section-panel, .alert-row, .quick-action,
.runtime-row, .configuration-guide, .product-guide, .dialog, .drawer-row,
.drawer-metrics > div, .toast, input, textarea, select, button { border-radius: 6px; }
.login-panel { box-shadow: 0 18px 48px rgba(21, 31, 25, .12); }
.app-shell { grid-template-columns: 208px minmax(0, 1fr); }
.sidebar { padding: 18px 12px; background: #19201c; }
.sidebar-brand { padding: 0 8px 18px; }
#main-nav { gap: 2px; margin-top: 14px; overflow-y: auto; }
.nav-label { margin: 13px 10px 5px; color: #758079; font-size: 10px; }
.nav-item { min-height: 38px; padding: 8px 10px; border-radius: 4px; }
.nav-item > img { width: 17px; height: 17px; }
.nav-item > span { width: auto; height: auto; border: 0; color: inherit; }
.nav-item.active > span { border: 0; background: transparent; }
.topbar { min-height: 78px; padding: 17px 26px; background: #fff; backdrop-filter: none; }
.topbar h1 { font-size: 22px; }
.content { padding: 22px 26px 36px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 116px; padding: 17px; border-radius: 4px; box-shadow: 0 2px 9px rgba(28, 43, 34, .025); }
.metric strong { margin-top: 15px; font-size: 25px; }
.section-panel { margin-top: 14px; border-radius: 4px; }
.section-head { min-height: 62px; padding: 13px 17px; }
.table-wrap { max-height: calc(100vh - 252px); }
th { background: #f7f8f7; }
.status { border-radius: 4px; }
.cost-panel { min-height: 330px; }
.cost-list { display: grid; gap: 13px; padding: 22px; }
.cost-row { display: grid; grid-template-columns: 54px minmax(160px, 1fr) 90px; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.cost-row strong { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.cost-track { height: 10px; overflow: hidden; border-radius: 3px; background: #edf1ee; }
.cost-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.metric.danger strong, .metric.coral strong { color: var(--risk); }
.metric.warning strong, .metric.amber strong { color: var(--warning); }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-row { grid-template-columns: 44px minmax(80px, 1fr) 72px; gap: 8px; }
}

/* Operations console visual system v2 */
:root {
  --ink: #18272b;
  --ink-soft: #40535a;
  --muted: #718087;
  --line: #e3e8e6;
  --surface: #fff;
  --soft: #f3f6f5;
  --sidebar: #14262b;
  --sidebar-muted: #8ea0a4;
  --teal: #087f70;
  --teal-dark: #056457;
  --teal-soft: #e6f4f1;
  --blue: #5076bd;
  --blue-soft: #edf2fb;
  --coral: #c65c51;
  --coral-soft: #fff0ed;
  --amber: #a26c16;
  --amber-soft: #fff5df;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background: var(--soft);
  color: var(--ink);
  letter-spacing: 0;
}

button, input, textarea, select { letter-spacing: 0; }

.login-view {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: #eef3f1;
  isolation: isolate;
}
.login-view::before,
.login-view::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 999px;
  filter: blur(1px);
}
.login-view::before { width: 58vw; height: 58vw; left: -24vw; top: -28vw; background: #d9ece5; }
.login-view::after { width: 46vw; height: 46vw; right: -18vw; bottom: -20vw; background: #f2ddd4; }
.login-panel {
  width: min(460px, 100%);
  padding: 42px 44px 38px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 28px 80px rgba(20,44,48,.14);
  backdrop-filter: blur(18px);
}
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--sidebar); box-shadow: 0 10px 24px rgba(20,38,43,.18); }
.brand-mark img { width: 100%; height: 100%; filter: invert(1) sepia(.15) saturate(.6); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; }
.eyebrow { color: var(--teal); letter-spacing: .14em; font-size: 10px; }
.login-panel h1 { font-size: 30px; letter-spacing: -.03em; }
.login-copy { max-width: 33ch; color: var(--muted); line-height: 1.65; }
label { color: var(--ink-soft); }
input, textarea, select {
  border-color: #d7e0dd;
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(8,127,112,.12); }
.primary-button { border-radius: 10px; background: var(--teal); box-shadow: 0 8px 18px rgba(8,127,112,.16); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border-color: #d7e0dd; border-radius: 10px; background: #fff; color: var(--ink-soft); }
.secondary-button:hover { background: #f5f8f7; border-color: #c7d5d0; }
.danger-button { border: 0; border-radius: 10px; padding: 10px 18px; background: var(--coral-soft); color: var(--coral); font-weight: 700; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; }
.icon-button:hover { background: #edf2f0; }
.icon-button img, .ui-icon { width: 17px; height: 17px; object-fit: contain; }

.app-shell { grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  z-index: 8;
  top: 0;
  height: 100vh;
  padding: 22px 16px 16px;
  border-right: 1px solid rgba(255,255,255,.06);
  background: var(--sidebar);
  box-shadow: 9px 0 30px rgba(17,37,41,.04);
}
.sidebar-brand { padding: 0 8px 24px; border-bottom-color: rgba(255,255,255,.1); }
.sidebar-brand strong { font-size: 17px; letter-spacing: .03em; }
.sidebar-brand small { color: var(--sidebar-muted); letter-spacing: .06em; }
#main-nav { gap: 5px; margin-top: 24px; }
.nav-label { margin: 14px 10px 5px; color: #667c81; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { gap: 12px; padding: 10px 11px; border-radius: 11px; color: #a7b8ba; font-size: 13px; transition: background .18s, color .18s, transform .18s; }
.nav-item > img { width: 18px; height: 18px; filter: invert(72%) sepia(9%) saturate(407%) hue-rotate(145deg); }
.nav-item > span { width: auto; height: auto; border: 0; border-radius: 0; color: inherit; font-size: 13px; }
.nav-item:hover { color: #f3f8f6; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-item.active { color: #f6fffc; background: #294c3c; box-shadow: inset 3px 0 0 #53c8ae; }
.nav-item.active > img { filter: invert(81%) sepia(49%) saturate(486%) hue-rotate(119deg); }
.sidebar-foot { padding: 15px 8px 0; border-top-color: rgba(255,255,255,.1); color: #81959a; }
.sidebar-foot .text-button { color: #a7b8ba; }
.sidebar-foot .text-button:hover { color: #fff; }
.online-dot { background: #48c29b; box-shadow: 0 0 0 4px rgba(72,194,155,.12); }
.online-dot.degraded { background: #e1a84b; box-shadow: 0 0 0 4px rgba(225,168,75,.13); }

.main-content { min-width: 0; background: var(--soft); }
.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 92px;
  padding: 20px 42px;
  border-bottom: 1px solid rgba(214,225,221,.86);
  background: rgba(249,251,250,.88);
  backdrop-filter: blur(16px);
}
.topbar .eyebrow { margin: 0 0 7px; }
.topbar h1 { font-size: 25px; letter-spacing: -.035em; }
.topbar-actions { gap: 11px; }
.sidebar-toggle { display: none; }
.health-summary { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid #dce6e3; border-radius: 999px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 700; }
.health-summary.healthy { border-color: #cde9df; color: var(--teal-dark); background: var(--teal-soft); }
.health-summary.degraded { border-color: #f1dfbb; color: var(--amber); background: var(--amber-soft); }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: #a2b0b0; }
.health-summary.healthy .health-dot { background: #27a884; box-shadow: 0 0 0 4px rgba(39,168,132,.12); }
.health-summary.degraded .health-dot { background: #db9a2b; box-shadow: 0 0 0 4px rgba(219,154,43,.13); }
.admin-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border: 1px solid #dce6e3; border-radius: 999px; color: var(--ink-soft); background: #fff; font-size: 12px; font-weight: 700; }
.admin-avatar { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--sidebar); color: #d9f6ee; font-size: 11px; }
.content { max-width: 1600px; padding: 34px 42px 58px; }

.overview-intro, .runtime-intro, .settings-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.overview-intro h2, .runtime-intro h2, .settings-intro h2 { margin: 0; color: var(--ink); font-size: 26px; letter-spacing: -.04em; }
.overview-intro p:not(.panel-kicker), .runtime-intro p:not(.panel-kicker), .settings-intro p:not(.panel-kicker) { max-width: 58ch; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.panel-kicker { margin: 0 0 9px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.overview-meta { min-width: 170px; padding-left: 18px; border-left: 1px solid var(--line); }
.meta-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.overview-meta strong { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.readiness-score { display: grid; min-width: 116px; padding: 14px 16px; border: 1px solid #f1dfbb; border-radius: 14px; background: var(--amber-soft); color: var(--amber); text-align: right; }
.readiness-score.ready { border-color: #cde9df; background: var(--teal-soft); color: var(--teal-dark); }
.readiness-score strong { font-size: 25px; letter-spacing: -.04em; line-height: 1; }
.readiness-score span { margin-top: 6px; font-size: 11px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { position: relative; min-height: 142px; padding: 19px 20px 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 24px rgba(28,57,59,.035); overflow: hidden; }
.metric::after { position: absolute; right: -18px; bottom: -32px; width: 88px; height: 88px; border-radius: 50%; background: #f0f5f4; content: ""; }
.metric.accent::after { background: var(--coral-soft); }
.metric.blue::after { background: var(--blue-soft); }
.metric.teal::after { background: var(--teal-soft); }
.metric.warning::after { background: var(--amber-soft); }
.metric-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.metric-top p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-top .ui-icon { width: 18px; height: 18px; opacity: .8; }
.metric strong { position: relative; z-index: 1; margin-top: 20px; color: var(--ink); font-size: 30px; font-weight: 800; letter-spacing: -.045em; }
.metric small { position: relative; z-index: 1; color: var(--muted); font-size: 11px; }
.overview-grid, .overview-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; margin-top: 16px; }
.overview-bottom-grid { grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); }
.section-panel { margin-top: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 8px 24px rgba(28,57,59,.035); }
.section-head { min-height: 76px; padding: 18px 20px; border-bottom-color: #edf1ef; }
.section-head h2 { color: var(--ink); font-size: 16px; letter-spacing: -.02em; }
.section-head p { color: var(--muted); line-height: 1.5; }
.trend-panel { min-height: 335px; }
.period-chip { padding: 6px 9px; border: 1px solid #dbe8e4; border-radius: 999px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 700; }
.chart-legend { display: flex; gap: 15px; padding: 15px 20px 0; color: var(--muted); font-size: 11px; }
.legend-dot::before { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); content: ""; }
.legend-dot.users::before { background: var(--blue); }
.activity-bars { display: grid; grid-template-columns: repeat(14, minmax(18px, 1fr)); align-items: end; gap: 10px; height: 220px; padding: 30px 20px 18px; }
.activity-column { display: grid; grid-template-rows: 1fr auto; align-items: end; gap: 9px; height: 100%; min-width: 0; }
.activity-column small { color: #91a0a2; font-size: 10px; text-align: center; }
.activity-bar { position: relative; display: block; width: 100%; min-height: 12px; border-radius: 7px 7px 3px 3px; background: #e7efed; overflow: hidden; }
.activity-bar-fill { position: absolute; inset: auto 0 0; height: 64%; border-radius: inherit; background: var(--teal); }
.activity-column:nth-child(3n) .activity-bar-fill { background: var(--blue); }
.alert-panel { padding-bottom: 8px; }
.alert-panel > div:first-child { padding: 20px 20px 8px; }
.alert-panel h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.alert-panel > div:first-child > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.alert-list { display: grid; gap: 6px; padding: 9px 12px 13px; }
.alert-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) 16px; align-items: center; gap: 11px; width: 100%; padding: 12px 9px; border: 1px solid transparent; border-radius: 11px; background: #f8faf9; color: var(--ink); text-align: left; }
.alert-row:hover { border-color: var(--line); background: #fff; }
.alert-row > .ui-icon:first-child { width: 18px; height: 18px; padding: 4px; border-radius: 7px; background: var(--teal-soft); }
.alert-row.danger > .ui-icon:first-child { background: var(--coral-soft); }
.alert-row.warning > .ui-icon:first-child { background: var(--amber-soft); }
.alert-row strong, .alert-row small { display: block; }
.alert-row strong { font-size: 12px; }
.alert-row small { margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrow-icon { width: 15px; height: 15px; opacity: .5; }
.signal-panel, .quick-panel { min-height: 213px; }
.signal-list { display: grid; gap: 2px; padding: 6px 20px 16px; }
.signal-list > div { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.signal-list > div:last-child { border-bottom: 0; }
.signal-list strong, .signal-list small { display: block; }
.signal-list strong { font-size: 12px; }
.signal-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.signal-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; }
.signal-icon .ui-icon { width: 16px; height: 16px; }
.signal-icon.teal { background: var(--teal-soft); }
.signal-icon.coral { background: var(--coral-soft); }
.signal-icon.amber { background: var(--amber-soft); }
.quick-actions { display: grid; gap: 5px; padding: 7px 12px 12px; }
.quick-action { display: grid; grid-template-columns: 25px 1fr 15px; align-items: center; gap: 9px; padding: 11px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); text-align: left; }
.quick-action:hover { background: #f4f8f6; color: var(--teal-dark); }
.quick-action > .ui-icon:first-child { width: 18px; height: 18px; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #edf1ef; background: #fbfcfc; }
.filters { display: block; width: 100%; }
.filter-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-search-wrap { position: relative; display: inline-flex; align-items: center; min-width: min(330px, 100%); }
.filter-search-wrap .ui-icon { position: absolute; left: 12px; width: 15px; height: 15px; opacity: .55; }
.filter-search-wrap input { width: 100%; padding-left: 35px; }
.filters input, .filters select { width: auto; min-width: 128px; padding: 9px 11px; border-radius: 9px; }
.filters .filter-search-wrap input { min-width: 280px; }
.filter-submit { padding: 9px 13px; white-space: nowrap; }
.filter-reset { margin-top: 6px; color: var(--muted); font-size: 11px; }
.filter-reset:hover { color: var(--teal-dark); }
.result-count { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.table-wrap { max-height: calc(100vh - 300px); overflow: auto; }
table { min-width: 960px; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 16px; border-bottom: 1px solid #e4ebe8; background: #f7faf9; color: #7d8c8e; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
td { padding: 14px 16px; color: var(--ink-soft); }
tbody tr { transition: background .16s; }
tbody tr:hover { background: #f8fbfa; }
.clickable-row { cursor: pointer; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.user-cell > span:last-child, .user-cell strong, .user-cell small { display: block; }
.user-cell strong { color: var(--ink); font-size: 12px; }
.user-cell small { margin-top: 3px; color: var(--muted); }
.avatar-fallback { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #e6f2ef; color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.avatar-fallback.large { width: 48px; height: 48px; border-radius: 16px; font-size: 18px; }
.status { padding: 5px 8px; border-radius: 999px; background: #edf1f0; color: #617176; font-size: 10px; font-weight: 700; }
.status.success { background: var(--teal-soft); color: var(--teal-dark); }
.status.warning { background: var(--amber-soft); color: var(--amber); }
.status.danger { background: var(--coral-soft); color: var(--coral); }
.action-button { display: inline-grid; width: 31px; height: 31px; margin-right: 5px; place-items: center; padding: 0; border-color: #d8e5e0; border-radius: 9px; color: var(--teal-dark); }
.action-button .ui-icon { width: 15px; height: 15px; }
.action-button:hover { background: var(--teal-soft); }
.pagination { justify-content: flex-end; gap: 7px; padding: 13px 20px; border-top: 1px solid #edf1ef; }
.pagination button { border-radius: 9px; }

.runtime-intro, .settings-intro { margin-bottom: 20px; }
.runtime-panel { margin-top: 14px; }
.runtime-grid { gap: 10px; padding: 16px 20px 20px; }
.runtime-row { min-height: 56px; padding: 13px 14px; border: 1px solid #e5ece9; border-radius: 11px; background: #fbfcfc; }
.runtime-row.is-on { border-color: #d5ebe5; background: #f8fcfb; }
.runtime-row.is-off { border-color: #f2e1c4; background: #fffdf7; }
.runtime-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.runtime-label .ui-icon { width: 15px; height: 15px; opacity: .8; }
.switch-state { color: var(--coral); font-size: 11px; }
.switch-state.on { color: var(--teal); }
.numeric-row strong { color: var(--ink); font-size: 16px; letter-spacing: -.02em; }

.settings-stack { gap: 14px; }
.settings-panel { margin-top: 0; }
.settings-grid { gap: 4px 22px; padding: 8px 20px 20px; }
.setting-field { margin-top: 14px; }
.setting-field > span { margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.setting-field > small { color: var(--muted); line-height: 1.5; }
.toggle-field { min-height: 54px; margin-top: 14px; padding: 0 13px; border-radius: 11px; background: #fbfcfc; }
.toggle-field > span { margin-bottom: 0; }
.toggle-field input { width: 40px; height: 22px; }
.configuration-guide, .product-guide { margin: 0 20px 13px; border-color: #cde9df; border-radius: 12px; background: #f2faf7; }
.guide-title .ui-icon { width: 20px; height: 20px; }
.callback-address { border-radius: 9px; }
.settings-actions { padding: 14px 20px; border-top-color: #edf1ef; }
.product-stack { gap: 14px; }
.product-panel { overflow: hidden; }
.model-membership-workbench { gap: 18px; }
.model-config-list, .tier-config-list { display: grid; gap: 0; padding: 0 20px 8px; }
.model-config-row, .tier-config-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) 140px 120px 120px auto; align-items: end; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tier-config-row { grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(180px, 1.25fr) 110px 110px 110px 120px 120px 120px auto; }
.model-config-row > div:first-child, .tier-config-row > div:first-child { min-width: 0; align-self: center; }
.model-config-row strong, .model-config-row small, .tier-config-row strong, .tier-config-row small { display: block; }
.model-config-row strong, .tier-config-row strong { color: var(--ink); font-size: 13px; }
.model-config-row small, .tier-config-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.model-config-row label, .tier-config-row label { margin: 0; }
.model-config-row .wide-field { grid-column: 1 / -1; }
.model-config-row .wide-field textarea { min-height: 58px; max-height: 150px; resize: vertical; }
.tier-model-access { grid-column: 1 / -1; min-width: 0; margin: 2px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.wide-field { grid-column: 1 / -1; }
.wide-field textarea { box-sizing: border-box; width: 100%; min-height: 88px; resize: vertical; }
.tier-model-access legend { padding: 0 5px; color: var(--muted); font-size: 10px; }
.tier-model-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tier-model-option, .tier-english-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-soft); font-size: 11px; }
.tier-model-option input, .tier-english-toggle input { accent-color: var(--accent); }
.model-purpose-section + .model-purpose-section { border-top: 1px solid var(--line); }
.model-purpose-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 10px; background: #fbfdfc; }
.model-purpose-head strong, .model-purpose-head small { display: block; }
.model-purpose-head strong { color: var(--ink); font-size: 14px; }
.model-purpose-head small { max-width: 70ch; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.model-purpose-count { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #cde9df; border-radius: 999px; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 700; }
.model-purpose-empty { padding: 18px 20px 22px; color: var(--muted); font-size: 12px; }
.model-purpose-section .model-config-list { padding-bottom: 4px; }
.product-title { padding: 16px 20px; }
.product-fields { padding: 0 20px 20px; }
.catalog-section, .catalog-create { overflow: hidden; }
.catalog-list { padding: 0 20px 20px; }
.catalog-form { padding-top: 16px; }

.dialog { width: min(480px, calc(100% - 32px)); border-radius: 18px; box-shadow: 0 30px 90px rgba(13,34,38,.28); }
.dialog form { padding: 26px; }
.dialog-head { padding-bottom: 4px; }
.dialog h2 { font-size: 22px; letter-spacing: -.035em; }
.dialog-actions { margin-top: 22px; }
.model-create-dialog { width: min(720px, calc(100% - 32px)); }
.model-create-form { max-height: min(80vh, 720px); overflow-y: auto; }
.model-create-form .dialog-head { margin-bottom: 18px; }
.dialog-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.model-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.model-create-grid label { margin: 0; }
.model-create-grid .wide-field, .model-default-toggle { grid-column: 1 / -1; }
.model-create-grid .wide-field textarea { min-height: 92px; resize: vertical; }
.model-default-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.model-default-toggle span { margin: 0; }
.model-default-toggle strong, .model-default-toggle small { display: block; }
.model-default-toggle small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.model-create-error { min-height: 18px; margin: 12px 0 0; }
.toast { right: 28px; bottom: 28px; border-radius: 11px; background: var(--sidebar); }
.toast.error { background: var(--coral); }

.user-drawer { position: fixed; z-index: 30; top: 0; right: 0; width: min(460px, 100%); height: 100vh; padding: 24px; overflow-y: auto; border-left: 1px solid var(--line); background: #fff; box-shadow: -18px 0 60px rgba(22,45,48,.15); animation: drawer-in .24s ease both; }
.user-drawer::before { position: fixed; z-index: -1; top: 0; right: min(460px, 100%); width: 100vw; height: 100vh; background: rgba(17,34,37,.2); content: ""; pointer-events: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drawer-title h2 { margin: 0; color: var(--ink); font-size: 21px; letter-spacing: -.035em; }
.drawer-title p { margin: 0 0 5px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.drawer-title small { display: block; margin-top: 4px; color: var(--muted); }
.close-drawer { flex: 0 0 auto; }
.drawer-status-row, .drawer-quick-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.drawer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.drawer-metrics > div { padding: 11px 10px; border-radius: 11px; background: #f7faf9; }
.drawer-metrics small, .drawer-metrics strong { display: block; }
.drawer-metrics small { color: var(--muted); font-size: 10px; }
.drawer-metrics strong { margin-top: 7px; color: var(--ink); font-size: 16px; letter-spacing: -.02em; }
.drawer-quick-actions { justify-content: flex-start; color: var(--muted); font-size: 11px; }
.drawer-quick-actions .secondary-button { display: inline-flex; align-items: center; gap: 7px; }
.drawer-section { padding: 18px 0 0; }
.drawer-section h3 { margin: 0 0 10px; color: var(--ink); font-size: 13px; }
.drawer-list { display: grid; gap: 6px; }
.drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid #e8eeeb; border-radius: 10px; background: #fbfcfc; }
.drawer-row strong, .drawer-row small { display: block; }
.drawer-row strong { color: var(--ink-soft); font-size: 11px; }
.drawer-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.drawer-empty, .drawer-error, .drawer-loading { padding: 14px 0; color: var(--muted); font-size: 12px; }
.drawer-error { display: grid; gap: 8px; color: var(--coral); }
@keyframes drawer-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 1120px) {
  .content { padding-left: 28px; padding-right: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid, .overview-bottom-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, calc(100% - 52px)); height: 100vh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(15,34,37,.24); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-brand { padding-bottom: 18px; }
  #main-nav { display: grid; margin-top: 16px; overflow: visible; }
  .nav-item { width: 100%; }
  .nav-item > span { display: block; }
  .sidebar-foot { display: grid; }
  .topbar { min-height: 78px; padding: 16px 18px; }
  .sidebar-toggle { display: grid; flex: 0 0 auto; place-items: center; margin-right: 2px; }
  .topbar > div:first-of-type { min-width: 0; margin-right: auto; }
  .topbar h1 { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .eyebrow { font-size: 9px; }
  .health-summary { display: none; }
  .admin-badge { display: none; }
  .content { padding: 22px 16px 44px; }
  .overview-intro, .runtime-intro, .settings-intro { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .overview-intro h2, .runtime-intro h2, .settings-intro h2 { font-size: 23px; }
  .overview-meta { min-width: 0; padding-left: 0; border-left: 0; }
  .readiness-score { width: 100%; display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 122px; padding: 15px; border-radius: 13px; }
  .metric strong { margin-top: 16px; font-size: 23px; }
  .metric-top p { font-size: 10px; }
  .metric small { font-size: 10px; }
  .section-head { min-height: 68px; padding: 15px; }
  .activity-bars { gap: 5px; height: 178px; padding: 22px 14px 14px; }
  .activity-column small { font-size: 8px; }
  .overview-grid, .overview-bottom-grid { gap: 12px; margin-top: 12px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; padding: 12px 15px; }
  .filter-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .filter-search-wrap, .filters .filter-search-wrap input { min-width: 0; width: 100%; }
  .filter-controls select { width: 100%; min-width: 0; }
  .filter-controls select:nth-last-child(2), .filter-controls select:last-child { grid-column: span 1; }
  .filter-submit { width: auto; }
  .result-count { align-self: flex-end; }
  .table-wrap { max-height: none; }
  .settings-grid, .runtime-grid, .product-fields { grid-template-columns: 1fr; }
  .configuration-guide, .product-guide { margin-left: 15px; margin-right: 15px; }
  .settings-grid, .runtime-grid, .product-fields { padding-left: 15px; padding-right: 15px; }
  .settings-actions { align-items: flex-start; flex-direction: column; padding: 13px 15px; }
  .settings-actions .primary-button { width: 100%; }
  .callback-address { grid-template-columns: 1fr auto; }
  .callback-address span { grid-column: 1 / -1; }
  .callback-address code { grid-column: 1; }
  .callback-address button { grid-column: 2; grid-row: 2; }
  .dialog { width: calc(100% - 24px); }
  .dialog form { padding: 21px; }
  .user-drawer { width: 100%; padding: 18px; }
  .user-drawer::before { display: none; }
}

/* Model routing polish: keep editable model rows aligned and easy to scan. */
.model-membership-workbench {
  gap: 22px;
}

.model-membership-workbench > .workspace-header {
  align-items: flex-start;
  padding: 4px 2px 2px;
}

.model-membership-workbench > .workspace-header .workspace-actions {
  padding-top: 4px;
}

.model-membership-workbench > .workbench-panel {
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(28, 57, 59, 0.05);
}

.model-membership-workbench > .workbench-panel > .workspace-header {
  padding: 22px 24px 18px;
  background: #fbfdfc;
}

.model-membership-workbench > .workbench-panel > .workspace-header h2 {
  font-size: 18px;
}

.model-purpose-head {
  align-items: center;
  padding: 20px 24px 14px;
  background: #f7fbf9;
}

.model-purpose-head strong {
  font-size: 15px;
}

.model-purpose-count {
  min-width: 72px;
  padding: 6px 10px;
  text-align: center;
}

.model-config-list,
.tier-config-list {
  padding: 0 24px 10px;
}

.model-config-row {
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) repeat(9, minmax(92px, 0.72fr));
  align-items: end;
  gap: 14px;
  padding: 22px 0;
  border-bottom-color: #edf1ef;
}

.model-config-row:last-child,
.tier-config-row:last-child {
  border-bottom: 0;
}

.model-config-row > div:first-child {
  align-self: center;
  padding: 8px 0;
}

.model-config-row strong {
  font-size: 14px;
  line-height: 1.35;
}

.model-config-row small {
  line-height: 1.4;
}

.model-config-row label:not(.model-default-inline),
.tier-config-row label:not(.model-default-inline) {
  display: grid;
  align-content: end;
  gap: 7px;
}

.model-config-row label > span:first-child,
.tier-config-row label > span:first-child {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.model-config-row input,
.model-config-row select,
.model-config-row textarea,
.tier-config-row input,
.tier-config-row select,
.tier-config-row textarea {
  min-height: 42px;
}

.model-config-row .wide-field textarea {
  min-height: 82px;
  padding: 12px 13px;
  line-height: 1.55;
}

.model-config-row .model-default-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #dbe7e3;
  border-radius: 10px;
  background: #f8fbfa;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
}

.model-config-row .model-default-inline input {
  width: 17px;
  min-height: 17px;
  margin: 0 0 0 8px;
  accent-color: var(--teal);
}

.model-config-row > button {
  min-height: 42px;
  align-self: end;
  white-space: nowrap;
}

.model-config-row:hover {
  background: #f8fbf9;
}

.tier-config-row {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 0;
}

.tier-config-row > :nth-child(1) { grid-column: span 2; }
.tier-config-row > :nth-child(2) { grid-column: span 2; }
.tier-config-row > :nth-child(3) { grid-column: span 2; }
.tier-config-row > :nth-child(4),
.tier-config-row > :nth-child(5),
.tier-config-row > :nth-child(6),
.tier-config-row > :nth-child(7),
.tier-config-row > :nth-child(9) { grid-column: span 1; }
.tier-config-row > :nth-child(8),
.tier-config-row > :nth-child(10),
.tier-config-row > :nth-child(11) { grid-column: 1 / -1; }
.tier-config-row > :nth-child(12) { grid-column: span 2; }

.tier-config-row > fieldset {
  background: #f8fbfa;
}

@media (max-width: 1380px) {
  .model-config-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .model-config-row > :nth-child(1),
  .model-config-row > :nth-child(2),
  .model-config-row > :nth-child(4),
  .model-config-row > :nth-child(5),
  .model-config-row > :nth-child(6),
  .model-config-row > :nth-child(7),
  .model-config-row > :nth-child(8),
  .model-config-row > :nth-child(9),
  .model-config-row > :nth-child(10),
  .model-config-row > :nth-child(11),
  .model-config-row > :nth-child(12) {
    grid-column: span 1;
  }

  .model-config-row > :nth-child(1),
  .model-config-row > :nth-child(2),
  .model-config-row > :nth-child(4),
  .model-config-row > :nth-child(5),
  .model-config-row > :nth-child(6) {
    grid-column: span 2;
  }

  .model-config-row > :nth-child(3) {
    grid-column: 1 / -1;
  }

  .model-config-row > :nth-child(7),
  .model-config-row > :nth-child(8),
  .model-config-row > :nth-child(9),
  .model-config-row > :nth-child(10),
  .model-config-row > :nth-child(11),
  .model-config-row > :nth-child(12) {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  .model-membership-workbench > .workspace-header {
    gap: 14px;
  }

  .model-membership-workbench > .workbench-panel > .workspace-header,
  .model-purpose-head,
  .model-config-list,
  .tier-config-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .model-config-row,
  .tier-config-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .model-config-row > :nth-child(1),
  .model-config-row > :nth-child(2),
  .model-config-row > :nth-child(3),
  .model-config-row > :nth-child(4),
  .model-config-row > :nth-child(5),
  .model-config-row > :nth-child(6),
  .model-config-row > :nth-child(7),
  .model-config-row > :nth-child(8),
  .model-config-row > :nth-child(9),
  .model-config-row > :nth-child(10),
  .model-config-row > :nth-child(11),
  .model-config-row > :nth-child(12),
  .tier-config-row > :nth-child(1),
  .tier-config-row > :nth-child(2),
  .tier-config-row > :nth-child(3),
  .tier-config-row > :nth-child(4),
  .tier-config-row > :nth-child(5),
  .tier-config-row > :nth-child(6),
  .tier-config-row > :nth-child(7),
  .tier-config-row > :nth-child(9),
  .tier-config-row > :nth-child(12) {
    grid-column: span 1;
  }

  .model-config-row > :nth-child(3),
  .tier-config-row > :nth-child(8),
  .tier-config-row > :nth-child(10),
  .tier-config-row > :nth-child(11) {
    grid-column: 1 / -1;
  }
}
.product-panel {
  margin-top: 0;
}
.product-guide {
  margin: 0;
}
.product-warning {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dce8df;
}
.product-fields label > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.product-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.product-title strong,
.product-title small {
  display: block;
}
.product-title small {
  margin-top: 4px;
  color: var(--muted);
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.product-fields {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 1.4fr 0.7fr;
  gap: 14px;
  padding: 0 18px 18px;
}

.dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(20, 40, 28, 0.28);
}
.dialog::backdrop {
  background: rgba(23, 32, 26, 0.48);
  backdrop-filter: blur(3px);
}
.dialog form {
  padding: 24px;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.dialog-head .eyebrow {
  margin: 0 0 5px;
}
.dialog h2 {
  font-size: 20px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100% - 48px));
  padding: 12px 16px;
  border-radius: 6px;
  background: #1f2a23;
  color: #fff;
  box-shadow: 0 12px 30px rgba(22, 38, 27, 0.2);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  font-size: 13px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: #923e3e;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar,
  .content {
    padding-left: 22px;
    padding-right: 22px;
  }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px;
  }
  .sidebar-brand {
    padding-bottom: 12px;
  }
  #main-nav {
    display: flex;
    margin-top: 12px;
    overflow-x: auto;
  }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
  }
  .nav-item > span,
  .sidebar-foot {
    display: none;
  }
  .topbar {
    min-height: 92px;
    padding: 18px;
  }
  .content {
    padding: 18px;
  }
  .topbar-actions {
    gap: 7px;
  }
  .admin-badge {
    display: none;
  }
  .metric-grid,
  .runtime-grid,
  .settings-grid,
  .product-fields {
    grid-template-columns: 1fr;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .filters input {
    width: 100%;
    min-width: 0;
  }
  .filters select {
    grid-column: 1 / -1;
    width: 100%;
  }
  .filters button {
    white-space: nowrap;
  }
  .login-panel {
    padding: 30px 24px;
  }
}

/* Final mobile overrides for the original compact rules. */
@media (max-width: 720px) {
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    width: min(280px, calc(100% - 52px)) !important;
    height: 100vh !important;
    padding: 22px 16px 16px !important;
    transform: translateX(-102%);
  }
  .sidebar.is-open { transform: translateX(0); }
  #main-nav { display: grid !important; margin-top: 16px !important; overflow: visible !important; }
  .nav-item { width: 100% !important; flex: initial !important; }
  .nav-item > span { display: block !important; width: auto !important; height: auto !important; border: 0 !important; }
  .sidebar-foot { display: grid !important; }
  .topbar { min-height: 78px !important; padding: 16px 18px !important; }
  .sidebar-toggle { display: grid !important; }
  .health-summary, .admin-badge { display: none !important; }
  .content { padding: 22px 16px 44px !important; }
}

/* Final production geometry: compact, flat and consistent. */
.login-view::before,
.login-view::after,
.metric::after { display: none; }

.login-panel,
.brand-mark,
.brand-mark.small,
input,
textarea,
select,
.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.nav-item,
.readiness-score,
.metric,
.section-panel,
.alert-row,
.alert-row > .ui-icon:first-child,
.signal-icon,
.quick-action,
.filters input,
.filters select,
.action-button,
.pagination button,
.runtime-row,
.toggle-field,
.configuration-guide,
.product-guide,
.callback-address,
.dialog,
.toast,
.drawer-metrics > div,
.drawer-row { border-radius: 6px; }

.metric { box-shadow: 0 6px 18px rgba(28,57,59,.03); }
.section-panel { box-shadow: 0 6px 18px rgba(28,57,59,.03); }

@media (max-width: 720px) {
  .metric { border-radius: 6px; }
}

/* Enterprise operations console redesign. Keep view-specific rules above, and
   use this final layer to make spacing, hierarchy, and overflow consistent. */
:root {
  --ink: #183136;
  --ink-soft: #2c4547;
  --muted: #70807b;
  --line: #dce7e2;
  --line-strong: #cad9d1;
  --surface: #ffffff;
  --soft: #f2f6f4;
  --sidebar: #102b2d;
  --sidebar-2: #183b3b;
  --teal: #16836f;
  --teal-bright: #28b08b;
  --teal-soft: #e6f4ef;
  --blue: #4d76c9;
  --blue-soft: #edf2fb;
  --risk: #d64545;
  --risk-soft: #fceaea;
  --warning: #c77a16;
  --warning-soft: #fff2dc;
  --info: #4079a8;
  --info-soft: #eaf3f8;
  --radius: 8px;
  --control-height: 40px;
  --sidebar-width: 248px;
}

body { background: var(--soft); color: var(--ink); }
.app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { z-index: 25; padding: 24px 16px 18px; background: var(--sidebar); }
.sidebar-brand { padding: 0 8px 24px; border-bottom-color: rgba(220,247,233,.12); }
.sidebar-brand strong { font-size: 17px; letter-spacing: .02em; }
.sidebar-brand small { color: #8fa7a0; font-size: 11px; }
.brand-mark, .brand-mark.small { background: #0a2022; }
.nav-label { margin: 22px 9px 7px; color: #718b83; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
#main-nav { gap: 3px; margin-top: 2px; }
.nav-item { min-height: 40px; gap: 11px; padding: 9px 11px; border-radius: 7px; color: #b9cbc5; font-size: 13px; }
.nav-item > img { width: 17px; height: 17px; opacity: .74; filter: brightness(0) invert(1); }
.nav-item > span { width: auto; height: auto; border: 0; border-radius: 0; color: inherit; font-size: inherit; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--sidebar-2); color: #fff; box-shadow: inset 3px 0 0 var(--teal-bright); }
.nav-item.active > img { opacity: 1; }
.sidebar-foot { padding: 17px 9px 0; border-top-color: rgba(220,247,233,.12); }
.online-dot { background: var(--teal-bright); }
.sidebar-foot .text-button { color: #9db3ac; }
.sidebar-foot .text-button:hover { color: #fff; }
.main-content { min-width: 0; background: var(--soft); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 84px; padding: 18px 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); box-shadow: 0 1px 0 rgba(14,38,33,.03); backdrop-filter: blur(14px); }
.sidebar-toggle { display: none; }
.page-heading { min-width: 210px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #87958e; font-size: 10px; }
.breadcrumb strong { color: var(--teal); font-weight: 700; }
.topbar .eyebrow { display: none; }
.topbar h1 { font-size: 24px; letter-spacing: -.025em; }
.topbar-search { width: min(340px, 30vw); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #f7faf8; color: #87958e; }
.topbar-search > img { width: 16px; height: 16px; opacity: .7; }
.topbar-search input { min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font-size: 12px; }
.topbar-search kbd { flex: 0 0 auto; padding: 3px 5px; border: 1px solid #d8e3dc; border-radius: 4px; background: #fff; color: #85938c; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.topbar-actions { gap: 9px; }
.health-summary { padding: 7px 10px; border: 1px solid #c9e7da; border-radius: 999px; background: var(--teal-soft); color: #18765e; font-size: 11px; font-weight: 700; }
.health-summary.degraded { border-color: #f2d5a3; background: var(--warning-soft); color: #a46412; }
.health-dot { width: 7px; height: 7px; background: var(--teal-bright); }
.topbar-tool { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; }
.topbar-tool:hover { background: #edf3ef; }
.topbar-tool > img { width: 18px; height: 18px; opacity: .72; }
.todo-count { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; background: var(--risk); color: #fff; font-size: 9px; line-height: 15px; }
.admin-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px 7px 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); }
.admin-avatar { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--sidebar); color: #fff; font-size: 10px; }
.content { max-width: 1540px; margin: 0 auto; padding: 32px 38px 54px; }
.overview-intro, .runtime-intro, .settings-intro { align-items: flex-start; margin-bottom: 25px; }
.panel-kicker { margin: 0 0 8px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.overview-intro h2, .runtime-intro h2, .settings-intro h2 { font-size: 28px; letter-spacing: -.035em; }
.overview-intro p:not(.panel-kicker), .runtime-intro p:not(.panel-kicker), .settings-intro p:not(.panel-kicker) { max-width: 66ch; color: var(--muted); }
.overview-meta { min-width: 190px; padding-left: 22px; border-left: 1px solid var(--line); }
.meta-label { display: block; margin-bottom: 6px; color: #8a9891; font-size: 10px; }
.overview-meta strong { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.metric-grid { gap: 14px; }
.metric { min-height: 132px; padding: 20px; border-color: var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 15px rgba(20,57,46,.035); }
.metric-top p { color: var(--muted); font-size: 12px; }
.metric-top .ui-icon { width: 17px; height: 17px; opacity: .7; }
.metric strong { margin-top: 16px; color: var(--ink); font-size: 29px; letter-spacing: -.03em; }
.metric small { color: #819089; font-size: 11px; }
.metric.blue strong { color: var(--blue); }
.metric.teal strong { color: var(--teal); }
.metric.accent strong { color: #bd6d18; }
.metric.warning strong { color: var(--warning); }
.metric.danger strong { color: var(--risk); }
.section-panel { margin-top: 18px; border-color: var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 15px rgba(20,57,46,.035); }
.section-head { min-height: 74px; padding: 17px 20px; }
.section-head h2 { color: var(--ink); font-size: 16px; letter-spacing: -.01em; }
.section-head p { color: var(--muted); line-height: 1.5; }
.period-chip, .readiness-score { border: 1px solid #cce6dc; border-radius: 999px; background: var(--teal-soft); color: #19765e; }
.overview-grid, .overview-bottom-grid { gap: 18px; margin-top: 18px; }
.chart-legend { padding: 14px 20px 0; }
.activity-bars { height: 215px; padding: 30px 24px 18px; }
.alert-panel { padding: 22px; }
.alert-panel h2 { font-size: 19px; }
.alert-row { min-height: 58px; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; background: #f8faf9; }
.alert-row:hover { border-color: #cfe3d8; background: #f1f8f4; }
.alert-row > .ui-icon:first-child { width: 28px; height: 28px; padding: 6px; border-radius: 7px; }
.alert-row { display: flex; align-items: center; gap: 10px; }
.alert-row > span { min-width: 0; }
.alert-row > span:nth-child(2) { flex: 1; }
.alert-row > span strong, .alert-row > span small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row > .arrow-icon { flex: 0 0 auto; margin-left: auto; }
.quick-action { min-height: 49px; border-radius: 7px; }
.table-toolbar { padding: 14px 20px; border-bottom-color: var(--line); background: #fbfcfb; }
.filter-controls { gap: 8px; }
.filter-controls select, .filters input, .filter-search-wrap { min-height: var(--control-height); border-color: var(--line-strong); border-radius: 7px; }
.filters input { padding: 0 11px 0 35px; }
.filter-search-wrap .ui-icon { left: 11px; width: 15px; height: 15px; }
.filter-submit, .secondary-button, .action-button, .pagination button { min-height: 36px; border-radius: 7px; }
.primary-button, .danger-button { min-height: var(--control-height); border-radius: 7px; }
.data-table-shell { overflow-x: auto; }
.data-table-shell table { min-width: 960px; }
.reconciliation-workbench { gap: 18px; }
.reconciliation-meta { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #d9e6df; border-radius: 7px; background: #f7faf8; color: var(--muted); font-size: 11px; }
.reconciliation-preview { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #efd0c8; border-radius: 7px; background: #fff8f5; color: var(--ink); }
.reconciliation-preview > div { display: grid; gap: 5px; min-width: 0; }
.reconciliation-preview span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.reconciliation-preview .danger-button { flex: 0 0 auto; }
.reconciliation-meta .ui-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.reconciliation-panel { overflow: hidden; }
.reconciliation-panel-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.reconciliation-panel-head > div { min-width: 0; }
.reconciliation-panel-head h3 { margin: 0; color: var(--ink); font-size: 15px; }
.reconciliation-panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.reconciliation-panel-head .status { flex: 0 0 auto; }
.reconciliation-table { min-width: 1050px; }
table { font-size: 12px; }
th, td { height: 50px; padding: 12px 16px; border-bottom-color: #eaf0ec; }
th { position: sticky; top: 0; z-index: 1; background: #f7faf8; color: #74827b; letter-spacing: .02em; }
td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover { background: #f7fbf8; }
.status { min-height: 25px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status.success { background: var(--teal-soft); color: #19765e; }
.status.warning { background: var(--warning-soft); color: #a46412; }
.status.danger { background: var(--risk-soft); color: #b13c3c; }
.status.info { background: var(--info-soft); color: #356d96; }
.pagination { justify-content: space-between; padding: 14px 20px; border-top: 1px solid #edf2ef; }
.pagination button { padding: 0 12px; }
.runtime-grid, .settings-grid { gap: 12px 16px; padding: 18px 20px 20px; }
.runtime-row, .toggle-field { min-height: 58px; padding: 13px 14px; border-color: var(--line); border-radius: 7px; background: #fbfcfb; }
.runtime-label { display: inline-flex; align-items: center; gap: 8px; }
.runtime-label .ui-icon { width: 17px; height: 17px; }
.switch-state { color: var(--risk); }
.switch-state.on { color: var(--teal); }
.settings-stack, .product-stack, .catalog-list { gap: 18px; }
.settings-panel { overflow: hidden; }
.settings-panel .section-head { background: #fbfcfb; }
.settings-grid label > span, .product-fields label > span, .catalog-fields label > span { margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.settings-grid input, .settings-grid select, .settings-grid textarea, .product-fields input, .product-fields select, .catalog-fields input, .catalog-fields select, .catalog-fields textarea { min-height: var(--control-height); border-color: var(--line-strong); border-radius: 7px; }
.settings-actions { min-height: 62px; padding: 13px 20px; border-top-color: var(--line); }
.configuration-guide, .product-guide { margin: 0 20px 14px; border-color: #cce6dc; border-radius: 7px; background: #f3faf7; }
.guide-title strong { color: var(--ink); }
.guide-title p, .product-warning { line-height: 1.65; }
.product-panel, .catalog-section, .catalog-create { overflow: hidden; }
.product-title { min-height: 68px; padding: 15px 20px; }
.product-fields { padding: 0 20px 20px; }
.catalog-list { padding: 0 20px 20px; }
.todo-panel { position: fixed; z-index: 24; top: 72px; right: 26px; width: min(390px, calc(100vw - 32px)); padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 20px 50px rgba(15,48,42,.16); }
.todo-panel-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.todo-panel-head h2 { margin: 0; font-size: 18px; }
.todo-item { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; margin-top: 9px; padding: 11px 8px; border: 0; border-radius: 7px; background: #f8faf9; text-align: left; }
.todo-item:hover { background: #eef7f3; }
.todo-item > span:nth-child(2) { min-width: 0; }
.todo-item strong, .todo-item small { display: block; }
.todo-item strong { color: var(--ink-soft); font-size: 12px; }
.todo-item small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.todo-item > img { width: 15px; height: 15px; opacity: .6; }
.todo-item-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; }
.todo-item-icon img { width: 15px; height: 15px; }
.todo-item-icon.danger { background: var(--risk-soft); }
.todo-item-icon.warning { background: var(--warning-soft); }
.todo-item-icon.info { background: var(--blue-soft); }
.drawer-backdrop { position: fixed; z-index: 29; inset: 0; background: rgba(12,30,29,.28); }
.drawer { z-index: 30; }
.drawer.is-open { display: block; }
.user-drawer { border-left-color: var(--line); box-shadow: -18px 0 60px rgba(22,45,48,.18); }
.user-drawer::before { display: none; }
.drawer-metrics > div { border: 1px solid #e8efeb; background: #f8fbf9; }
.drawer-row { border-color: #e2ece7; border-radius: 7px; background: #fbfcfc; }
.drawer-tabs { display: flex; gap: 3px; padding: 13px 0 0; border-bottom: 1px solid var(--line); }
.drawer-tab { padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; }
.drawer-tab.active { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; }
.icon-action-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; }
.icon-action-button .ui-icon { width: 15px; height: 15px; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 250px; align-items: start; gap: 18px; }
.balance-workbench .settings-layout { grid-template-columns: minmax(420px, 1fr) minmax(320px, 1fr); }
.settings-nav, .settings-side-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.settings-nav { position: sticky; top: 104px; padding: 17px 10px 12px; }
.settings-nav > .panel-kicker { margin: 0 8px 6px; }
.settings-nav h3 { margin: 0 8px 12px; font-size: 16px; }
.settings-nav-list { min-width: 0; display: grid; gap: 3px; }
.settings-nav-item { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 10px 8px; border: 0; border-left: 2px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; }
.settings-nav-item:hover { background: #f4faf7; color: var(--ink-soft); }
.settings-nav-item.active { border-left-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.settings-nav-item > span { min-width: 0; }
.settings-nav-item strong, .settings-nav-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav-item strong { font-size: 11px; }
.settings-nav-item small { margin-top: 3px; color: inherit; opacity: .75; font-size: 9px; }
.settings-nav-item .status { flex: 0 0 auto; max-width: 56px; overflow: hidden; padding: 3px 5px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.financial-user-cell { display: grid; gap: 4px; min-width: 150px; }
.financial-user-cell .status-note { color: var(--muted); font-size: 11px; line-height: 1.35; }
.financial-user-cell .status-note.deleted { color: var(--coral); }

.table-page { display: grid; gap: 12px; }
.table-page-kicker { display: flex; align-items: center; gap: 10px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.table-page-rule { width: 56px; height: 1px; background: currentColor; opacity: .45; }
.table-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.table-summary article { min-height: 82px; display: grid; align-content: center; gap: 3px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.68); }
.table-summary span, .table-summary small { color: var(--muted); font-size: 11px; }
.table-summary strong { color: var(--ink); font-size: 22px; line-height: 1; }
.table-summary-orders strong, .table-summary-ledger strong { color: var(--teal); }
.table-summary-risk-events strong { color: var(--coral); }
.table-summary-audit-events strong { color: var(--blue); }
.table-page-users .table-summary article:nth-child(2) strong,
.table-page-orders .table-summary article:nth-child(3) strong { color: var(--coral); }

@media (max-width: 760px) {
  .table-summary { grid-template-columns: 1fr; }
  .table-summary article { min-height: 70px; }
}
.settings-main { min-width: 0; display: grid; gap: 18px; }
.settings-main .settings-panel { margin-top: 0; scroll-margin-top: 104px; }
.settings-aside { position: sticky; top: 104px; display: grid; gap: 14px; }
.settings-side-panel { padding: 17px; }
.settings-side-panel h3 { margin: 0; font-size: 15px; }
.settings-help-panel > p:not(.panel-kicker) { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-help-panel .secondary-button { width: 100%; }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-panel-head .status { flex: 0 0 auto; }
.settings-check-list { display: grid; gap: 10px; margin-top: 15px; }
.settings-check-item { display: flex; align-items: flex-start; gap: 8px; }
.settings-check-item > .ui-icon { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.settings-check-item strong, .settings-check-item small { display: block; }
.settings-check-item strong { color: var(--ink-soft); font-size: 11px; }
.settings-check-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.settings-all-ready { margin: 14px 0 0; color: var(--teal); font-size: 11px; }

@media (max-width: 1120px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  .content { padding-left: 28px; padding-right: 28px; }
  .topbar-search { width: 250px; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .topbar-search { display: none; }
  .page-heading { min-width: 0; }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .balance-workbench .settings-layout { grid-template-columns: 1fr; }
  .settings-aside { display: none; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed !important; inset: 0 auto 0 0; width: min(292px, calc(100% - 48px)) !important; transform: translateX(-105%); box-shadow: 18px 0 50px rgba(15,34,37,.24); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: grid !important; place-items: center; }
  .topbar { min-height: 76px; padding: 14px 16px; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .breadcrumb { font-size: 9px; }
  .health-summary, .admin-badge { display: none; }
  .content { padding: 22px 16px 44px; }
  .overview-intro h2, .runtime-intro h2, .settings-intro h2 { font-size: 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .metric { min-height: 118px; padding: 15px; }
  .metric strong { font-size: 23px; }
  .section-head { padding: 15px; }
  .section-head { align-items: flex-start; flex-wrap: wrap; }
  .section-head-actions { width: 100%; }
  .section-head-actions .primary-button { width: 100%; }
  .table-toolbar { padding: 12px 15px; }
  .reconciliation-panel-head { align-items: flex-start; padding: 14px 15px; }
  .filter-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%; }
  .filter-controls select { width: 100%; min-width: 0; grid-column: span 1; }
  .filter-search-wrap { width: 100%; min-width: 0; }
  .filters input { width: 100%; }
  .result-count { align-self: flex-end; }
  .runtime-grid, .settings-grid, .product-fields, .catalog-fields { grid-template-columns: 1fr; padding-left: 15px; padding-right: 15px; }
  .configuration-guide, .product-guide { margin-left: 15px; margin-right: 15px; }
  .settings-actions { align-items: flex-start; flex-direction: column; padding: 13px 15px; }
  .settings-actions .primary-button { width: 100%; }
  .todo-panel { top: 68px; right: 16px; }
  .user-drawer { width: 100%; padding: 18px; }
  .settings-layout { display: block; }
  .settings-nav { position: static; margin-bottom: 14px; padding: 12px 10px; overflow-x: auto; }
  .settings-nav > .panel-kicker, .settings-nav > h3 { display: none; }
  .settings-nav-list { display: flex; min-width: max-content; gap: 5px; }
  .settings-nav-item { width: 150px; min-height: 48px; border-left: 0; border-bottom: 2px solid transparent; }
  .settings-nav-item.active { border-bottom-color: var(--teal); }
  .settings-main .settings-panel { scroll-margin-top: 16px; }
}

/* Final responsive guardrails for the settings workbench. */
@media (max-width: 1120px) {
  .settings-layout { grid-template-columns: 210px minmax(0, 1fr) !important; }
  .settings-aside { display: none !important; }
}
@media (max-width: 720px) {
  .settings-layout { display: block !important; }
  .settings-nav { position: static !important; margin-bottom: 14px; overflow-x: auto; }
  .settings-main { display: block; }
}
