/* Seelaz dashboard system
   Calm white surfaces, raised information, and strictly semantic color. */
:root {
  --ds-canvas: #f6f8f7;
  --ds-surface: #faf6ee;
  --ds-surface-soft: #f9fbfa;
  --ds-surface-muted: #f1f5f3;
  --ds-text: #171d1a;
  --ds-muted: #727d77;
  --ds-faint: #9aa39e;
  --ds-line: rgba(25, 43, 34, 0.09);
  --ds-line-strong: rgba(25, 43, 34, 0.15);
  --ds-copper: #b15a2f;
  --ds-copper-soft: #fff1eb;
  --ds-green: #657956;
  --ds-green-soft: #eaf6f0;
  --ds-amber: #9a6408;
  --ds-amber-soft: #fff7dd;
  --ds-red: #b42318;
  --ds-red-soft: #fff0ee;
  --ds-blue: #3568b8;
  --ds-blue-soft: #eef4ff;
  --ds-radius: 18px;
  --ds-radius-small: 12px;
  --ds-shadow: 0 18px 48px rgba(30, 47, 38, 0.07), 0 2px 8px rgba(30, 47, 38, 0.035);
  --ds-shadow-hover: 0 22px 58px rgba(30, 47, 38, 0.1), 0 4px 12px rgba(30, 47, 38, 0.04);
  --dashboard-bg: var(--ds-canvas);
  --dashboard-surface: var(--ds-surface);
  --dashboard-subtle: var(--ds-surface-soft);
  --dashboard-line: var(--ds-line);
  --dashboard-text: var(--ds-text);
  --dashboard-muted: var(--ds-muted);
  --dashboard-copper: var(--ds-copper);
  --dashboard-green: var(--ds-green);
  --dashboard-green-soft: var(--ds-green-soft);
}

html[data-theme="dark"] {
  --ds-canvas: #111512;
  --ds-surface: #1a1f1c;
  --ds-surface-soft: #202622;
  --ds-surface-muted: #252c28;
  --ds-text: #f2f5f3;
  --ds-muted: #a1aaa5;
  --ds-faint: #7e8983;
  --ds-line: rgba(255, 255, 255, 0.08);
  --ds-line-strong: rgba(255, 255, 255, 0.14);
  --ds-copper: #e27850;
  --ds-copper-soft: #38251d;
  --ds-green: #77d4b1;
  --ds-green-soft: #193129;
  --ds-amber: #efc25e;
  --ds-amber-soft: #342a14;
  --ds-red: #ff9b92;
  --ds-red-soft: #3a1b18;
  --ds-blue: #9ab9ff;
  --ds-blue-soft: #19253a;
  --ds-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  --ds-shadow-hover: 0 24px 60px rgba(0, 0, 0, 0.3);
}

html,
body {
  background: var(--ds-canvas);
  color: var(--ds-text);
}

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

::selection {
  background: rgba(205, 92, 50, 0.18);
}

:focus-visible {
  outline: 3px solid rgba(53, 104, 184, 0.2);
  outline-offset: 2px;
}

.app-shell {
  grid-template-columns: 226px minmax(0, 1fr);
}

.sidebar {
  padding: 17px 13px 14px;
  border-right: 1px solid var(--ds-line);
  background: color-mix(in srgb, var(--ds-surface) 94%, transparent);
  box-shadow: none;
}

.brand {
  min-height: 48px;
  padding: 3px 6px 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-color: rgba(205, 92, 50, 0.16);
  border-radius: 11px;
  background: var(--ds-copper-soft);
  color: var(--ds-copper);
}

.brand-name {
  color: var(--ds-text);
  font-size: 18px;
  font-weight: 790;
}

.brand-sub {
  color: var(--ds-muted);
  font-size: 11px;
}

.sidebar-search {
  min-height: 40px;
  border-color: var(--ds-line);
  border-radius: 12px;
  background: var(--ds-surface-soft);
}

.sidebar-search input {
  color: var(--ds-text);
  font-size: 11px;
}

.nav-section-label {
  margin-top: 2px;
  color: var(--ds-faint);
  font-size: 11px;
}

.nav-list a {
  min-height: 37px;
  border-radius: 10px;
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 700;
}

.nav-list a:hover {
  background: var(--ds-surface-muted);
  color: var(--ds-text);
}

.nav-list a.active {
  border-color: transparent;
  background: var(--ds-copper-soft);
  color: var(--ds-copper);
  box-shadow: inset 2px 0 0 var(--ds-copper);
}

.nav-list a.active .nav-icon {
  color: var(--ds-copper);
  background: transparent;
}

.side-note {
  border-color: color-mix(in srgb, var(--ds-green) 18%, transparent);
  border-radius: 12px;
  background: var(--ds-green-soft);
  color: var(--ds-green);
}

.main {
  padding: 0 30px 34px;
}

.topbar {
  min-height: 88px;
  margin-bottom: 22px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--ds-line);
  background: color-mix(in srgb, var(--ds-canvas) 86%, transparent);
  box-shadow: none;
}

.top-kicker,
.eyebrow {
  color: var(--ds-green);
  font-size: 11px;
  font-weight: 820;
}

.topbar h1 {
  color: var(--ds-text);
  font-size: 26px;
  font-weight: 760;
}

.topbar p:not(.top-kicker) {
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 600;
}

.top-live,
.theme-mode-control {
  border-color: var(--ds-line);
  background: color-mix(in srgb, var(--ds-surface) 86%, transparent);
}

.top-live {
  border-radius: 999px;
  color: var(--ds-green);
}

.theme-mode-control {
  border-radius: 12px;
}

.theme-mode-control button {
  border-radius: 9px;
  color: var(--ds-muted);
}

.theme-mode-control button.active {
  background: var(--ds-surface);
  color: var(--ds-copper);
  box-shadow: 0 3px 12px rgba(31, 45, 37, 0.08);
}

.button,
.icon-button {
  border-radius: 10px;
  font-weight: 760;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--ds-copper);
  background: var(--ds-copper);
  color: #faf6ee;
  box-shadow: 0 10px 22px rgba(205, 92, 50, 0.18);
}

.button.primary:hover {
  background: color-mix(in srgb, var(--ds-copper) 88%, #000);
  box-shadow: 0 13px 28px rgba(205, 92, 50, 0.23);
}

.button.ghost,
.icon-button {
  border-color: var(--ds-line);
  background: var(--ds-surface);
  color: var(--ds-text);
  box-shadow: 0 4px 14px rgba(31, 45, 37, 0.035);
}

.button.ghost:hover,
.icon-button:hover {
  border-color: var(--ds-line-strong);
  background: var(--ds-surface-soft);
}

.page.active {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.metrics-grid {
  gap: 13px;
  margin-bottom: 22px;
}

.metric-card,
.panel,
.module-card,
.entity-list-panel,
.entity-editor-panel,
.detail-section,
.detail-grid > div,
.integration-card,
.inventory-card,
.structured-row,
.schedule-row,
.ranking-row,
.dispatch-card,
.modifier-group-editor,
.modifier-choice-row,
.permission-matrix > div {
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow);
}

.metric-card {
  --metric-tone: var(--ds-blue);
  --metric-wash: var(--ds-blue-soft);
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 17px 18px;
  border-left: 1px solid var(--ds-line);
}

.metric-card::before {
  display: block;
  content: "" !important;
  position: absolute;
  top: -35px;
  right: -28px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--metric-wash);
  opacity: 0.8;
}

.metric-card::after {
  display: block;
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--metric-tone);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--metric-tone) 13%, transparent);
}

.metric-card.metric-success { --metric-tone: var(--ds-green); --metric-wash: var(--ds-green-soft); }
.metric-card.metric-warning { --metric-tone: var(--ds-amber); --metric-wash: var(--ds-amber-soft); }
.metric-card.metric-danger { --metric-tone: var(--ds-red); --metric-wash: var(--ds-red-soft); }
.metric-card.metric-info { --metric-tone: var(--ds-blue); --metric-wash: var(--ds-blue-soft); }
.metric-card.metric-neutral { --metric-tone: var(--ds-muted); --metric-wash: var(--ds-surface-muted); }

.metric-card span,
.metric-card small {
  position: relative;
  z-index: 1;
  color: var(--ds-muted);
  text-transform: none;
}

.metric-card span {
  font-size: 11px;
  font-weight: 700;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: var(--ds-text);
  font-size: 28px;
  font-weight: 650;
}

.metric-card small {
  font-size: 11px;
}

.panel {
  padding: 18px;
}

.panel-head {
  margin-bottom: 15px;
}

.panel-head h2 {
  color: var(--ds-text);
  font-size: 16px;
  font-weight: 760;
}

.panel-copy,
.empty-state {
  color: var(--ds-muted);
}

.status-pill,
.count-pill,
.chip {
  border-color: var(--ds-line);
  border-radius: 999px;
  background: var(--ds-surface-soft);
  box-shadow: none;
  font-size: 11px;
}

.chip-success {
  border-color: color-mix(in srgb, var(--ds-green) 22%, transparent);
  background: var(--ds-green-soft);
  color: var(--ds-green);
}

.chip-warning {
  border-color: color-mix(in srgb, var(--ds-amber) 22%, transparent);
  background: var(--ds-amber-soft);
  color: var(--ds-amber);
}

.chip-danger {
  border-color: color-mix(in srgb, var(--ds-red) 22%, transparent) !important;
  background: var(--ds-red-soft);
  color: var(--ds-red) !important;
}

.chip-info {
  border-color: color-mix(in srgb, var(--ds-blue) 20%, transparent);
  background: var(--ds-blue-soft);
  color: var(--ds-blue);
}

.workspace-toolbar {
  top: 92px;
  min-height: 58px;
  gap: 9px;
  margin-bottom: 16px;
  padding: 9px;
  border: 1px solid var(--ds-line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--ds-surface) 88%, transparent);
  box-shadow: 0 12px 35px rgba(30, 47, 38, 0.055);
}

.workspace-search,
.toolbar-select,
.inline-select select {
  border-color: var(--ds-line);
  border-radius: 10px;
  background: var(--ds-surface-soft);
}

.workspace-search input,
.toolbar-select,
.inline-select select {
  color: var(--ds-text);
}

.workspace-tabs,
.saved-view-tabs,
.campaign-view-tabs,
.app-studio-view-tabs,
.editor-tabs {
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background: var(--ds-surface-muted);
}

.workspace-tab,
.saved-view-tabs button,
.campaign-view-tabs button,
.app-studio-view-tabs button,
.editor-tab {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ds-muted);
  box-shadow: none;
}

.workspace-tab.active,
.saved-view-tabs button.active,
.campaign-view-tabs button.active,
.app-studio-view-tabs button.active,
.editor-tab.active {
  border-color: transparent;
  background: var(--ds-surface);
  color: var(--ds-copper);
  box-shadow: 0 3px 12px rgba(31, 45, 37, 0.08);
}

.management-shell {
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 16px;
}

.entity-list-panel,
.entity-editor-panel {
  border-radius: var(--ds-radius);
}

.entity-list-panel {
  top: 102px;
  padding: 10px;
  background: color-mix(in srgb, var(--ds-surface) 96%, var(--ds-surface-soft));
}

.entity-list-head {
  padding: 7px 8px 12px;
}

.entity-list-head h2 {
  color: var(--ds-text);
  font-size: 15px;
}

.entity-list-item {
  min-height: 62px;
  margin-bottom: 3px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.entity-list-item:hover {
  border-color: transparent;
  background: var(--ds-surface-muted);
}

.entity-list-item.active,
.entity-list-item.active:hover {
  border-color: rgba(205, 92, 50, 0.13);
  background: var(--ds-copper-soft);
  color: var(--ds-text);
  box-shadow: inset 2px 0 0 var(--ds-copper);
}

.entity-avatar,
.entity-product-image {
  border-radius: 11px;
  background: var(--ds-surface-muted);
  color: var(--ds-copper);
}

.entity-list-copy strong {
  color: var(--ds-text);
  font-size: 11px;
}

.entity-list-copy small {
  color: var(--ds-muted);
  font-size: 11px;
}

.entity-editor-panel {
  padding: 18px;
}

.editor-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 17px;
  padding: 18px;
  border: 1px solid var(--ds-line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--ds-green-soft) 80%, transparent), transparent 30%),
    linear-gradient(135deg, var(--ds-surface) 0%, var(--ds-surface-soft) 100%);
  box-shadow: none;
}

.editor-hero h2 {
  color: var(--ds-text);
  font-size: 21px;
  font-weight: 740;
}

.editor-hero p,
.editor-hero small {
  color: var(--ds-muted);
}

.editor-mode-actions {
  align-self: flex-start;
}

.control-field label,
.control-field > span,
.field label {
  margin-bottom: 6px;
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 760;
}

.control-field input,
.control-field textarea,
.control-field select,
.field input,
.field textarea,
.field select {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--ds-line);
  border-radius: 10px;
  background: var(--ds-surface-soft);
  color: var(--ds-text);
  box-shadow: none;
}

.control-field textarea,
.field textarea {
  min-height: 92px;
  padding-top: 10px;
}

.control-field input:hover,
.control-field textarea:hover,
.control-field select:hover,
.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: var(--ds-line-strong);
}

.control-field input:focus,
.control-field textarea:focus,
.control-field select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--ds-blue) 48%, transparent);
  background: var(--ds-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-blue) 12%, transparent);
}

.editor-locked .control-field :is(input, select, textarea):disabled {
  border-color: transparent;
  background: transparent;
  color: var(--ds-text);
  opacity: 1;
}

.detail-grid {
  gap: 10px;
}

.detail-grid > div,
.detail-section {
  border-radius: 14px;
  background: var(--ds-surface-soft);
  box-shadow: none;
}

.detail-grid span,
.detail-grid small {
  color: var(--ds-muted);
  font-size: 11px;
}

.detail-grid strong {
  color: var(--ds-text);
  font-size: 13px;
}

.table-wrap,
.order-commerce-wrap {
  overflow: auto;
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: var(--ds-surface);
  box-shadow: none;
}

table,
.order-commerce-table {
  color: var(--ds-text);
}

thead,
.order-commerce-table thead {
  background: var(--ds-surface-soft);
}

th,
.order-commerce-table th {
  border-bottom: 1px solid var(--ds-line);
  color: var(--ds-muted);
  font-size: 11px;
  font-weight: 760;
}

td,
.order-commerce-row td {
  border-bottom-color: var(--ds-line);
}

tbody tr,
.order-commerce-row {
  transition: background 140ms ease;
}

tbody tr:hover,
.order-commerce-row:hover {
  background: var(--ds-surface-soft);
}

.order-commerce-row.selected,
.order-commerce-row.selected:hover {
  background: var(--ds-copper-soft);
}

.order-commerce-row.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--ds-copper);
}

.order-detail-drawer {
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow);
}

.ranking-row,
.structured-row,
.schedule-row,
.integration-card,
.inventory-card,
.dispatch-card,
.modifier-group-editor,
.modifier-choice-row {
  border-radius: var(--ds-radius-small);
  background: var(--ds-surface-soft);
  box-shadow: none;
}

.ranking-row:hover,
.structured-row:hover {
  border-color: var(--ds-line-strong);
  background: var(--ds-surface);
}

.bar-chart .bar,
.funnel-bar,
.progress-fill {
  background: var(--ds-green);
}

.presence-total,
.presence-row.online {
  color: var(--ds-green);
}

.toast {
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ds-surface) 92%, transparent);
  color: var(--ds-text);
  box-shadow: var(--ds-shadow-hover);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  backdrop-filter: blur(22px) saturate(130%);
}

html[data-theme="dark"] :is(.sidebar, .panel, .metric-card, .module-card, .entity-list-panel, .entity-editor-panel, .detail-section, .detail-grid > div, .integration-card, .inventory-card, .structured-row, .schedule-row, .ranking-row, .dispatch-card, .modifier-group-editor, .modifier-choice-row, .permission-matrix > div, .order-detail-drawer) {
  border-color: var(--ds-line);
  background-color: var(--ds-surface);
  color: var(--ds-text);
}

html[data-theme="dark"] :is(.workspace-toolbar, .theme-mode-control, .sidebar-search) {
  border-color: var(--ds-line);
  background: color-mix(in srgb, var(--ds-surface) 88%, transparent);
}

html[data-theme="dark"] .button.ghost,
html[data-theme="dark"] .icon-button {
  border-color: var(--ds-line);
  background: var(--ds-surface-soft);
  color: var(--ds-text);
}

@media (max-width: 1260px) {
  .management-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand {
    justify-content: center;
  }

  .brand > div:last-child,
  .sidebar-search input,
  .nav-list a span:last-child,
  .nav-section-label,
  .side-note strong,
  .side-note .label {
    display: none;
  }

  .sidebar-search,
  .nav-list a {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
  }

  .nav-list a.active {
    box-shadow: inset 0 -2px 0 var(--ds-copper);
  }

  .side-note {
    min-height: 34px;
    display: grid;
    place-items: center;
  }

  .side-note::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-green);
  }

  .management-shell,
  .orders-workspace-grid,
  .control-tower-grid {
    grid-template-columns: 1fr;
  }

  .entity-list-panel {
    position: relative;
    top: 0;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .nav-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .nav-group {
    display: contents;
  }

  .main {
    padding: 0 14px 24px;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .metrics-grid,
  .content-grid,
  .form-grid,
  .detail-grid,
  .notification-metrics {
    grid-template-columns: 1fr;
  }
}

/* --- Generated copy editor -------------------------------------------------------------
   The wording panel is built from the copy registry, so it has as many groups as the app has
   screens. Collapsed by default: a flat list of sixty-odd fields is not an editor, it is a wall. */
.studio-copy-group {
  border: 1px solid var(--line, rgba(15, 23, 42, 0.1));
  border-radius: 12px;
  margin-top: 10px;
  overflow: hidden;
}
.studio-copy-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.studio-copy-group > summary::-webkit-details-marker { display: none; }
.studio-copy-group > summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 140ms ease;
}
.studio-copy-group[open] > summary::before { transform: rotate(90deg); }
.studio-copy-group > summary small {
  margin-inline-start: auto;
  opacity: 0.6;
  font-weight: 500;
}
.studio-copy-group .studio-field-grid { padding: 0 14px 14px; }
/* A field that differs from the shipped wording is worth spotting at a glance. */
.copy-changed {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent, #b15a2f);
  margin-inline-start: 6px;
}
