:root {
  --bg: #f4f5f6;
  --bg-accent: #eef1f2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.72);
  --line: rgba(20, 51, 59, 0.08);
  --text: #18323b;
  --text-soft: #6a7f87;
  --brand: #1f616c;
  --brand-dark: #153e46;
  --brand-soft: rgba(31, 97, 108, 0.08);
  --accent: #d6922e;
  --accent-soft: rgba(214, 146, 46, 0.14);
  --success: #1f7259;
  --danger: #a14835;
  --shadow: 0 24px 56px rgba(20, 51, 59, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(214, 146, 46, 0.12), transparent 18%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 240px);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

a {
  color: inherit;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 26px;
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.workspace-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 22px 18px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(21, 62, 70, 0.98), rgba(30, 79, 87, 0.94));
  color: #f7fbfb;
  box-shadow: var(--shadow);
}

.sidebar-brand {
  display: grid;
  gap: 6px;
}

.sidebar-kicker,
.panel-label,
.metric-label,
.eyebrow,
.field-label,
.header-chip,
.mini-chip,
.info-chip,
.pulse-label,
.table-head-line {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-kicker {
  color: rgba(247, 251, 251, 0.66);
}

.sidebar-title,
h1,
h2 {
  font-family: "Libre Baskerville", serif;
}

.sidebar-title {
  font-size: 1.3rem;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(247, 251, 251, 0.78);
  text-decoration: none;
  font-weight: 600;
}

.nav-link.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.sidebar-panel {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.panel-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(247, 251, 251, 0.64);
}

.sidebar-source {
  display: block;
  line-height: 1.45;
}

.sidebar-meta,
.sidebar-note {
  display: block;
  margin-top: 8px;
  color: rgba(247, 251, 251, 0.74);
  line-height: 1.5;
}

.sidebar-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sidebar-upload input {
  width: 100%;
  margin-top: 8px;
  color: rgba(247, 251, 251, 0.88);
}

.sidebar-button,
.sidebar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-button {
  border: 0;
  background: #f3f6f6;
  color: var(--brand-dark);
  cursor: pointer;
}

.sidebar-link {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.08);
}

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

.metric-label {
  display: block;
  color: rgba(247, 251, 251, 0.58);
}

.sidebar-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.workspace-main {
  min-width: 0;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 500;
}

.flash-error {
  background: rgba(161, 72, 53, 0.1);
  color: var(--danger);
}

.flash-success {
  background: rgba(31, 114, 89, 0.1);
  color: var(--success);
}

.flash-warning {
  background: rgba(214, 146, 46, 0.12);
  color: #8a5a10;
}

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

.compact-header {
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
}

h1,
h2 {
  margin: 0;
  color: var(--brand-dark);
}

h1 {
  font-size: clamp(1.85rem, 2.8vw, 2.5rem);
  line-height: 1.15;
}

h2 {
  font-size: 1.28rem;
  line-height: 1.28;
}

.page-copy,
.empty-state,
.review-details p,
.list-row span,
.field-hint {
  color: var(--text-soft);
}

.page-copy {
  margin: 10px 0 0;
  line-height: 1.55;
}

.header-chip,
.mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}

.header-chip {
  background: var(--accent-soft);
  color: #865611;
}

.mini-chip {
  background: var(--brand-soft);
  color: var(--brand);
}

.header-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  min-width: min(100%, 360px);
}

.header-stats div {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.header-stats span {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.dashboard-grid,
.content-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-grid {
  grid-template-columns: 1.3fr 0.9fr;
  align-items: start;
}

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

.content-grid-wide {
  grid-template-columns: 340px minmax(0, 1fr);
}

.tracker-panel {
  grid-row: span 2;
}

.dashboard-grid-premium {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.panel {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.soft-panel {
  background: var(--surface-soft);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field,
.file-field {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field input,
.field select,
.file-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(24, 50, 59, 0.05);
  color: var(--text);
  font: inherit;
}

.file-field input {
  padding: 12px 14px;
}

.field input:focus,
.field select:focus,
.file-field input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 97, 108, 0.12);
}

.actions,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-row {
  margin: 2px 0 4px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 50, 59, 0.05);
  color: var(--text-soft);
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  background: rgba(24, 50, 59, 0.06);
  color: var(--brand-dark);
}

.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--brand);
}

.text-button.danger {
  color: var(--danger);
}

.donut-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
}

.donut-chart {
  --pct: 100;
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), rgba(24, 50, 59, 0.08) 0);
  display: grid;
  place-items: center;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
}

.donut-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
}

.donut-core strong {
  font-size: 2.2rem;
  color: var(--brand-dark);
}

.donut-core span {
  color: var(--text-soft);
}

.chart-copy {
  display: grid;
  gap: 12px;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(24, 50, 59, 0.04);
}

.metric-line span {
  color: var(--text-soft);
}

.metric-line strong {
  color: var(--brand-dark);
}

.pulse-block + .pulse-block {
  margin-top: 18px;
}

.pulse-label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-soft);
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 150px;
}

.bar-column {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar-fill {
  width: 100%;
  max-width: 48px;
  min-height: 18px;
  border-radius: 16px 16px 8px 8px;
  align-self: end;
}

.import-bar {
  background: linear-gradient(180deg, rgba(214, 146, 46, 0.95), rgba(214, 146, 46, 0.35));
}

.run-bar {
  background: linear-gradient(180deg, rgba(31, 97, 108, 0.95), rgba(31, 97, 108, 0.32));
}

.bar-column small {
  color: var(--text-soft);
}

.tracker-premium-panel {
  background:
    radial-gradient(circle at top right, rgba(214, 146, 46, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
}

.tracker-stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.tracker-stat-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 50, 59, 0.045);
}

.tracker-stat-card strong {
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--brand-dark);
}

.insight-panel {
  background:
    radial-gradient(circle at top right, rgba(214, 146, 46, 0.18), transparent 22%),
    linear-gradient(160deg, rgba(20, 57, 63, 0.98), rgba(27, 86, 94, 0.94));
  color: #f4f8f8;
}

.insight-panel h2,
.insight-panel .eyebrow,
.insight-panel .pulse-label,
.insight-panel .metric-line span,
.insight-panel .chart-copy span,
.insight-panel .chart-copy strong,
.insight-panel .empty-state,
.insight-panel .bar-column small,
.insight-panel .metric-label,
.insight-panel .panel-head .eyebrow {
  color: inherit;
}

.insight-panel .eyebrow,
.insight-panel .pulse-label,
.insight-panel .metric-label {
  color: rgba(244, 248, 248, 0.7);
}

.chart-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff2d9;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.premium-donut-layout {
  align-items: stretch;
}

.premium-donut {
  background:
    conic-gradient(#f2b24d calc(var(--pct) * 1%), rgba(255, 255, 255, 0.12) 0),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 64%);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.08);
}

.premium-donut::after {
  background: rgba(20, 57, 63, 0.96);
}

.premium-donut .donut-core strong {
  color: #ffffff;
}

.premium-donut .donut-core span {
  color: rgba(244, 248, 248, 0.76);
}

.premium-chart-copy {
  gap: 10px;
}

.premium-metric-line {
  background: rgba(255, 255, 255, 0.07);
}

.premium-metric-line strong {
  color: #ffffff;
}

.health-rails {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.health-rail {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  color: rgba(244, 248, 248, 0.88);
}

.health-rail-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.health-rail-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2b24d, #f6d28d);
}

.health-rail-track.muted {
  background: rgba(255, 255, 255, 0.06);
}

.health-rail-fill.muted {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.16));
}

.premium-pulse-block {
  padding: 14px 0 0;
}

.pulse-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pulse-row-head strong {
  color: #ffffff;
  font-size: 1rem;
}

.premium-bar-chart {
  min-height: 168px;
  padding: 14px 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.premium-bar-chart .bar-fill {
  max-width: 42px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.sparkline-caption-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.sparkline-caption-row span {
  color: rgba(244, 248, 248, 0.66);
  font-size: 0.74rem;
  line-height: 1.35;
}

.recent-runs-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.86));
}

.premium-run-table {
  gap: 0;
}

.table-line-dashboard {
  grid-template-columns: minmax(0, 2.2fr) 120px 80px 80px 90px 70px;
}

.premium-run-row {
  border-bottom: 1px solid rgba(20, 51, 59, 0.06);
}

.dashboard-run-name {
  display: grid;
  gap: 4px;
}

.dashboard-run-name strong {
  color: var(--brand-dark);
}

.dashboard-run-name small {
  color: var(--text-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-ready,
.status-exported {
  background: rgba(31, 114, 89, 0.12);
  color: var(--success);
}

.status-needs_review {
  background: rgba(214, 146, 46, 0.16);
  color: #8a5a10;
}

.status-review {
  background: rgba(214, 146, 46, 0.16);
  color: #8a5a10;
}

.status-neutral {
  background: rgba(24, 50, 59, 0.08);
  color: var(--brand-dark);
}

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

.database-summary-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
}

.database-summary-card strong {
  font-size: 1.45rem;
  color: var(--brand-dark);
}

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

.database-table-panel,
.database-form-panel {
  min-height: 100%;
}

.database-form-panel {
  position: sticky;
  top: 18px;
}

.database-form-copy {
  margin-bottom: 16px;
}

.product-edit-focus {
  margin: 0 0 18px;
  border-color: rgba(197, 139, 56, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.98), rgba(248, 251, 250, 0.96)),
    #ffffff;
  box-shadow: 0 18px 46px rgba(120, 82, 25, 0.1);
  scroll-margin-top: 86px;
}

.product-edit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(5, minmax(120px, 1fr));
  align-items: end;
  gap: 12px;
}

.product-edit-actions {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.product-edit-focus .primary-button {
  width: fit-content;
}

.database-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.database-toolbar-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 50, 59, 0.05);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.database-toolbar-pill.is-active {
  background: rgba(31, 97, 108, 0.12);
  color: var(--brand);
}

.database-table {
  gap: 0;
}

.table-line-admin {
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.8fr) 90px 110px 100px 150px 110px 140px;
}

.admin-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.admin-table-row {
  border-bottom: 1px solid rgba(20, 51, 59, 0.06);
}

.admin-table-row:nth-child(odd) {
  background: rgba(24, 50, 59, 0.018);
}

.product-main-cell {
  display: grid;
  gap: 4px;
}

.product-main-cell strong {
  color: var(--brand-dark);
}

.product-main-cell small {
  color: var(--text-soft);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-pill-imported {
  background: rgba(31, 97, 108, 0.12);
  color: var(--brand);
}

.source-pill-manual {
  background: rgba(214, 146, 46, 0.14);
  color: #8a5a10;
}

.admin-actions {
  gap: 14px;
}

.database-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 18px 0 10px;
}

.database-search-field {
  flex: 1 1 360px;
  display: grid;
  gap: 8px;
}

.database-search-field input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(20, 51, 59, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand-dark);
  font: inherit;
}

.database-search-copy {
  margin: 0 0 16px;
  color: var(--text-soft);
}

.secondary-button-ghost {
  background: rgba(255, 255, 255, 0.68);
}

.inactive-products-panel {
  margin-top: 18px;
}

.data-table {
  display: grid;
}

.list-table {
  gap: 10px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row:first-child {
  padding-top: 0;
}

.list-row strong {
  display: block;
  margin-bottom: 4px;
}

.line-table {
  gap: 0;
}

.scroll-table {
  max-height: 620px;
  overflow: auto;
  padding-right: 6px;
}

.table-head-line {
  color: var(--text-soft);
  padding-top: 0;
}

.table-line {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

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

.table-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-line {
  grid-template-columns: minmax(0, 2.4fr) 110px 80px 80px 140px;
}

.table-line-restore {
  grid-template-columns: minmax(0, 2.2fr) 110px 90px;
}

.table-line-alias {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.8fr) 140px 100px;
}

.table-line-tally-map {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.8fr) minmax(0, 1.8fr) 110px minmax(180px, 0.8fr);
}

.table-line-rule {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.6fr) 90px;
}

.table-line-sales-order-preview {
  grid-template-columns: minmax(0, 1.3fr) 90px minmax(0, 1.8fr) minmax(0, 1.4fr) minmax(220px, 1.6fr) 100px 100px 110px;
}

.tally-proposal-cell {
  display: grid;
  gap: 8px;
}

.tally-proposal-cell form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tally-proposal-cell input {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  font: inherit;
}

.table-line-sku-register-preview {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.6fr) 90px 90px minmax(0, 1.3fr);
}

.database-rules-table {
  margin-top: 16px;
}

.database-rules-table strong {
  display: block;
  margin-bottom: 4px;
}

.database-rules-table small {
  color: var(--text-soft);
}

.table-line-run {
  grid-template-columns: minmax(0, 2.4fr) 70px minmax(0, 1.5fr);
}

.table-line-ignored {
  grid-template-columns: minmax(0, 2.2fr) 70px minmax(0, 1.6fr) 140px;
}

.row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.row-actions form {
  margin: 0;
}

.empty-state {
  margin: 0;
  padding: 8px 0;
}

.review-details {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.review-details p {
  margin: 0;
}

.review-form {
  display: grid;
  gap: 18px;
}

.review-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.review-summary-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  align-content: start;
}

.review-summary-card strong,
.review-actions-copy strong,
.review-meta-box strong {
  color: var(--brand-dark);
}

.review-summary-card strong {
  font-size: 1.2rem;
}

.review-subtle,
.review-meta-box small {
  color: var(--text-soft);
  line-height: 1.5;
}

.review-card-stack {
  display: grid;
  gap: 16px;
}

.review-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
}

.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.review-source-block h2 {
  font-size: 1.18rem;
  line-height: 1.45;
}

.review-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 50, 59, 0.06);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.review-meta-box {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 50, 59, 0.035);
}

.review-meta-box strong {
  font-size: 1.05rem;
}

.review-hints {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.suggestion-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 97, 108, 0.08);
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 500;
}

.review-select-field select {
  min-height: 52px;
  background: linear-gradient(180deg, rgba(24, 50, 59, 0.03), rgba(24, 50, 59, 0.055));
}

.review-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 51, 59, 0.08);
}

.review-actions-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.review-actions-copy {
  display: grid;
  gap: 6px;
}

@media (max-width: 1240px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
  }

  .content-grid-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .workspace-shell {
    width: min(100% - 18px, 1500px);
    padding-top: 18px;
  }

  .page-header,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-grid,
  .content-grid,
  .database-summary-grid,
  .field-row,
  .header-stats,
  .sidebar-stats,
  .donut-layout,
  .review-summary-grid,
  .review-meta-grid {
    grid-template-columns: 1fr;
  }

  .tracker-panel {
    grid-row: auto;
  }

  .list-row,
  .table-line,
  .table-line-restore,
  .table-line-run,
  .table-line-ignored,
  .table-line-admin,
  .table-line-dashboard,
  .health-rail,
  .tracker-stat-grid,
  .database-layout {
    grid-template-columns: 1fr;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .review-card-head,
  .review-actions-panel,
  .pulse-row-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.operations-hero {
  align-items: end;
}

.operations-badge {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(207, 160, 73, 0.18);
  color: #9b6415;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.operations-summary-grid,
.module-grid,
.day-card-grid,
.support-card-grid,
.batch-card-grid {
  display: grid;
  gap: 18px;
}

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

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

.summary-card strong {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--ink);
}

.module-card {
  display: grid;
  gap: 18px;
}

.module-card-accent {
  background: linear-gradient(160deg, rgba(16, 84, 96, 0.94), rgba(23, 59, 69, 0.96));
  color: #f2f6f5;
}

.module-card-accent h2,
.module-card-accent .module-copy,
.module-card-accent .metric-label,
.module-card-accent strong,
.module-card-accent .review-subtle {
  color: inherit;
}

.module-card-graph {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 247, 246, 0.9));
}

.module-copy {
  margin: 0;
  max-width: 62ch;
}

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

.module-kpis strong {
  display: block;
  margin-top: 6px;
}

.mini-bar-cluster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 12px;
  min-height: 180px;
}

.mini-bar-column {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.mini-bar-track {
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16, 84, 96, 0.08), rgba(16, 84, 96, 0.18));
}

.mini-bar-fill {
  width: 26px;
  min-height: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #cfa049, #105460);
}

.mini-bar-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.tracker-overview-stack {
  display: grid;
  gap: 12px;
}

.notification-stack,
.planner-line-stack {
  display: grid;
  gap: 12px;
}

.notification-card,
.planner-line-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(24, 50, 59, 0.04);
}

.notification-card strong,
.planner-line-head strong {
  display: block;
  margin-bottom: 6px;
}

.notification-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.planner-line-head,
.planner-line-meta,
.planner-line-body,
.planner-inline-form,
.planner-pending-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.planner-line-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.planner-line-head small,
.planner-line-meta {
  color: var(--text-soft);
}

.planner-line-body {
  justify-content: space-between;
}

.planner-inline-form,
.planner-pending-form {
  flex: 1 1 320px;
}

.planner-inline-input,
.planner-pending-form input,
.planner-pending-form select {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(24, 50, 59, 0.06);
  font: inherit;
  color: var(--text);
}

.planner-inline-input {
  width: 110px;
}

.planner-table .table-line {
  grid-template-columns: minmax(220px, 1.8fr) 110px 140px 110px;
}

.planner-count-line input {
  width: 100%;
}

.planner-negative {
  color: var(--danger);
  font-weight: 700;
}

.planner-positive {
  color: var(--success);
  font-weight: 700;
}

.inventory-day-block + .inventory-day-block {
  margin-top: 20px;
}

.tracker-overview-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 84, 96, 0.08);
}

.tracker-overview-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tracker-home-stats .summary-card strong {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.day-card-grid,
.support-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.day-card,
.support-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(16, 84, 96, 0.06);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.day-card:hover,
.support-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(20, 48, 57, 0.12);
}

.day-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tracker-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.tracker-day-link {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(16, 84, 96, 0.1);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.tracker-day-link.is-active {
  background: var(--teal);
  color: #f4f7f6;
}

.tracker-day-link.secondary {
  background: rgba(207, 160, 73, 0.18);
  color: #9b6415;
}

.batch-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.batch-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(16, 84, 96, 0.06);
}

.batch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.batch-card-metrics {
  display: grid;
  gap: 6px;
  justify-items: end;
  font-size: 0.84rem;
  color: var(--muted);
}

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

.batch-store-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.batch-store-row strong,
.batch-store-meta span {
  display: block;
}

.batch-store-row small {
  color: var(--muted);
}

.batch-store-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.ll-summary-stack {
  margin-bottom: 20px;
}

.support-card-grid {
  align-self: start;
}

@media (max-width: 1100px) {
  .operations-summary-grid,
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 940px) {
  .operations-summary-grid,
  .module-grid,
  .day-card-grid,
  .support-card-grid,
  .batch-card-grid,
  .module-kpis {
    grid-template-columns: 1fr;
  }

  .tracker-overview-row,
  .batch-card-head,
  .batch-store-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .batch-card-metrics,
  .batch-store-meta {
    justify-items: start;
  }
}

:root {
  --ink: #14343c;
  --muted: #68808a;
  --teal: #1d6670;
  --shell-bg:
    radial-gradient(circle at top left, rgba(205, 161, 77, 0.18), transparent 22%),
    linear-gradient(180deg, #edf1f1 0%, #f7f7f6 28%, #edf2f2 100%);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line-soft: rgba(20, 52, 60, 0.08);
  --shadow-premium: 0 30px 70px rgba(16, 34, 39, 0.08);
}

html {
  font-size: 16px;
}

body.app-frame {
  margin: 0;
  min-height: 100vh;
  background: var(--shell-bg);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

.premium-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 28px;
  width: min(1820px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.premium-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(214, 146, 46, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(10, 45, 52, 0.98), rgba(18, 66, 74, 0.95));
  box-shadow: 0 26px 60px rgba(8, 30, 35, 0.24);
  color: #f5fbfb;
}

.premium-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.sidebar-brand {
  display: grid;
  gap: 6px;
}

.sidebar-kicker,
.panel-label,
.metric-label,
.eyebrow,
.field-label {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-kicker {
  color: rgba(245, 251, 251, 0.62);
}

.sidebar-title,
h1,
h2,
h3 {
  font-family: "Fraunces", serif;
}

.sidebar-title {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.35rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  color: rgba(245, 251, 251, 0.75);
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

.sidebar-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-panel-strong {
  background: rgba(255, 255, 255, 0.075);
}

.sidebar-source {
  display: block;
  font-weight: 700;
  line-height: 1.45;
}

.sidebar-meta {
  color: rgba(245, 251, 251, 0.66);
  line-height: 1.5;
}

.sidebar-status-list,
.sidebar-pulse-grid {
  display: grid;
  gap: 12px;
}

.sidebar-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(245, 251, 251, 0.82);
}

.sidebar-status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sidebar-status-row strong {
  color: #ffffff;
  font-size: 0.92rem;
}

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

.sidebar-pulse-grid > div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-pulse-grid strong {
  font-size: 1.55rem;
  line-height: 1;
}

.hero-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  padding: 8px 2px 2px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(205, 161, 77, 0.16);
  color: #90601a;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
}

.premium-main .panel-label,
.premium-main .metric-label,
.premium-main .field-label {
  color: rgba(20, 52, 60, 0.68);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.02;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.15rem;
}

.page-copy,
.empty-state,
.field-hint,
.future-card small,
.planner-card p,
.stat-card small,
.future-point,
.pipeline-step span:last-child {
  color: var(--muted);
}

.page-copy {
  max-width: 66ch;
  margin: 12px 0 0;
  line-height: 1.65;
}

.glass-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(18px);
}

.stat-row,
.content-split,
.module-stage,
.future-grid,
.day-canvas,
.batch-card-grid {
  display: grid;
  gap: 18px;
}

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

.dashboard-metric-rail {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 8px 0 22px;
}

.premium-stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 118px;
  padding: 20px 24px;
  overflow: hidden;
  border: 1px solid rgba(23, 42, 48, 0.07);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 250, 0.94)),
    #ffffff;
  box-shadow: 0 18px 44px rgba(23, 42, 48, 0.075);
}

.premium-stat-card::after {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #e2b65f, var(--app-teal));
  opacity: 0.9;
}

.stat-index {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(23, 87, 99, 0.1);
  color: var(--app-teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.stat-card-copy {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(110px, 0.25fr) minmax(180px, 0.6fr);
  align-items: center;
  gap: 16px;
}

.premium-stat-card .panel-label {
  margin: 0;
}

.premium-stat-card strong {
  margin: 0;
  font-size: clamp(2.3rem, 3vw, 3.4rem);
}

.premium-stat-card small {
  color: var(--app-muted);
  font-size: 0.98rem;
  line-height: 1.35;
}

.content-split {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
}

.content-split-hero {
  align-items: start;
}

.module-stage {
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
}

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.module-head.compact {
  margin-bottom: 14px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
}

.tracker-metric-card strong {
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
  letter-spacing: -0.03em;
}

.tracker-metric-card-muted {
  background: linear-gradient(180deg, rgba(247, 243, 233, 0.96), rgba(255, 255, 255, 0.92));
}

.module-hero {
  display: grid;
  gap: 18px;
  min-height: 320px;
}

.module-hero-primary {
  background:
    radial-gradient(circle at top right, rgba(214, 146, 46, 0.12), transparent 30%),
    linear-gradient(160deg, rgba(18, 64, 72, 0.98), rgba(22, 83, 92, 0.95));
  color: #f7fbfb;
}

.module-hero-primary h2,
.module-hero-primary .eyebrow,
.module-hero-primary .module-copy,
.module-hero-primary strong,
.module-hero-primary .metric-label {
  color: inherit;
}

.mini-chip,
.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-chip {
  background: rgba(20, 52, 60, 0.08);
  color: var(--teal);
}

.module-hero-primary .mini-chip {
  background: rgba(255, 255, 255, 0.12);
  color: #fff1d5;
}

.module-hero-primary .actions {
  align-items: stretch;
}

.module-hero-primary .primary-button,
.module-hero-primary .secondary-button {
  min-width: 220px;
}

.module-hero-primary .primary-button {
  background: linear-gradient(135deg, #d59a37, #b67a1c);
  color: #fffdf7;
  box-shadow: 0 14px 32px rgba(76, 45, 5, 0.28);
}

.module-hero-primary .secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: #f7fbfb;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.module-copy {
  margin: 0;
  max-width: 56ch;
  line-height: 1.65;
}

.module-meta-grid,
.module-meters {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meter {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(20, 52, 60, 0.05);
}

.module-hero-primary .meter {
  background: rgba(255, 255, 255, 0.08);
}

.meter strong,
.module-meta-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.actions,
.chip-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, #1d6670, #184f58);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(28, 83, 92, 0.18);
}

.secondary-button {
  background: rgba(20, 52, 60, 0.07);
  color: var(--ink);
}

.secondary-button.danger-soft-button {
  background: rgba(161, 72, 53, 0.10);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(161, 72, 53, 0.12);
}

.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--teal);
}

.text-button.danger {
  color: #a14835;
}

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

.future-card,
.day-stage {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(20, 52, 60, 0.05);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.future-card:hover,
.day-stage:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(18, 44, 51, 0.1);
  background: rgba(20, 52, 60, 0.07);
}

.future-card-static,
.day-stage-static {
  cursor: default;
}

.future-card-static:hover,
.day-stage-static:hover {
  transform: none;
}

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

.pipeline-step {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(20, 52, 60, 0.05);
}

.pipeline-step span:first-child {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.tracker-overview-stack {
  display: grid;
  gap: 12px;
}

.tracker-overview-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.tracker-overview-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tracker-recovery-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(161, 72, 53, 0.06), rgba(161, 72, 53, 0.03));
  border: 1px solid rgba(161, 72, 53, 0.08);
}

.tracker-recovery-card h3 {
  margin: 6px 0 8px;
}

.import-progress-card {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(31, 97, 108, 0.12);
  background: linear-gradient(180deg, rgba(18, 64, 72, 0.96), rgba(24, 85, 93, 0.95));
  color: #f5fbfb;
}

.import-progress-card.is-hidden {
  display: none;
}

.import-progress-card .eyebrow,
.import-progress-card h3,
.import-progress-card strong,
.import-progress-card .subtle-note {
  color: inherit;
}

.import-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.import-progress-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.import-progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2b24d, #ffdca3);
  transition: width 0.35s ease;
}

.import-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.import-progress-meta strong {
  font-size: 1.05rem;
}

.import-progress-meta span {
  color: rgba(245, 251, 251, 0.76);
}

.day-canvas {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.day-stage-name {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.data-table {
  display: grid;
  gap: 0;
}

.table-line {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.table-head-line {
  padding-top: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-run-line {
  grid-template-columns: minmax(0, 2fr) 140px 80px 80px;
}

.two-col-line {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.ll-table-line {
  grid-template-columns: minmax(0, 1.8fr) repeat(5, 70px);
}

.inventory-line {
  grid-template-columns: minmax(0, 2fr) repeat(4, 100px);
}

.fees-line {
  grid-template-columns: minmax(0, 1.8fr) 1fr 90px 130px 120px;
}

.product-main-cell {
  display: grid;
  gap: 4px;
}

.product-main-cell small {
  color: var(--muted);
}

.planner-list {
  display: grid;
  gap: 14px;
}

.planner-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(20, 52, 60, 0.045);
}

.pending-card {
  background: rgba(205, 161, 77, 0.1);
}

.planner-card-top,
.batch-card-head,
.batch-store-row,
.tracker-overview-row,
.inline-move-form,
.warning-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.planner-card p {
  margin: 8px 0 0;
}

.planner-card-metrics {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.planner-sku-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-sku-list span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
}

.row-actions-stacked {
  align-items: center;
}

.inline-move-form select,
.field input,
.field select,
.file-field input,
.planner-textarea {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: rgba(20, 52, 60, 0.055);
  color: var(--ink);
  font: inherit;
}

.inline-move-form select,
.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.planner-textarea {
  padding: 14px;
  min-height: 230px;
  resize: vertical;
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field,
.file-field,
.form-stack {
  display: grid;
  gap: 8px;
}

.premium-file-field {
  padding: 16px;
  border-radius: 20px;
  background: rgba(20, 52, 60, 0.045);
}

.ll-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ll-total-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(20, 52, 60, 0.05);
}

.batch-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.batch-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(20, 52, 60, 0.05);
}

.batch-card-metrics,
.batch-store-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
}

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

.batch-store-row {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.warning-stack,
.future-points {
  display: grid;
  gap: 12px;
}

.warning-row,
.future-point {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(205, 161, 77, 0.12);
}

.inventory-form-card,
.row-form-layout {
  align-items: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-ready,
.status-exported,
.status-healthy {
  background: rgba(31, 114, 89, 0.12);
  color: #1f7259;
}

.status-needs_review,
.status-tight {
  background: rgba(205, 161, 77, 0.16);
  color: #9b6415;
}

.status-neutral {
  background: rgba(20, 52, 60, 0.08);
  color: var(--ink);
}

.invoice-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-reference {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.83rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.invoice-route-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20, 52, 60, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.invoice-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.invoice-pill-bp {
  background: rgba(205, 161, 77, 0.18);
  color: #966117;
  box-shadow: inset 0 0 0 1px rgba(205, 161, 77, 0.2);
}

.invoice-pill-bpvt {
  background: rgba(205, 161, 77, 0.18);
  color: #966117;
  box-shadow: inset 0 0 0 1px rgba(205, 161, 77, 0.2);
}

.invoice-pill-bpnv {
  background: rgba(205, 161, 77, 0.18);
  color: #966117;
  box-shadow: inset 0 0 0 1px rgba(205, 161, 77, 0.2);
}

.invoice-pill-vt {
  background: rgba(29, 102, 112, 0.14);
  color: #1b5b65;
  box-shadow: inset 0 0 0 1px rgba(29, 102, 112, 0.16);
}

.invoice-pill-nv {
  background: rgba(20, 52, 60, 0.12);
  color: #42535a;
  box-shadow: inset 0 0 0 1px rgba(20, 52, 60, 0.12);
}

.invoice-pill-pending {
  background: rgba(104, 128, 138, 0.14);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(104, 128, 138, 0.12);
}

.invoice-button {
  box-shadow: 0 12px 30px rgba(20, 52, 60, 0.16);
}

.invoice-button-bp {
  background: linear-gradient(135deg, #cfa14b, #b47e24);
  color: #fffdf7;
}

.invoice-button-bpvt {
  background: linear-gradient(135deg, #cfa14b, #b47e24);
  color: #fffdf7;
}

.invoice-button-bpnv {
  background: linear-gradient(135deg, #cfa14b, #b47e24);
  color: #fffdf7;
}

.invoice-button-vt {
  background: linear-gradient(135deg, #1d6670, #184f58);
  color: #ffffff;
}

.invoice-button-nv {
  background: linear-gradient(135deg, #596970, #425159);
  color: #ffffff;
}

.planner-sku-list .invoice-pill {
  min-height: 24px;
  padding: 0 8px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.delivery-run-layout {
  margin-top: 18px;
}

.delivery-run-hero {
  min-height: 0;
}

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

.delivery-run-actions-card,
.delivery-run-queue {
  display: grid;
  gap: 18px;
}

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

.delivery-category-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(20, 52, 60, 0.05);
  box-shadow: inset 0 0 0 1px rgba(20, 52, 60, 0.05);
}

.delivery-category-card-muted {
  background: rgba(20, 52, 60, 0.03);
}

.delivery-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.delivery-category-head strong {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1;
  color: var(--ink);
}

.delivery-category-copy {
  display: grid;
  gap: 8px;
}

.delivery-card-placeholder {
  width: 100%;
  justify-content: center;
  pointer-events: none;
  opacity: 0.7;
}

.delivery-run-empty {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(20, 52, 60, 0.04);
}

.tally-run-card,
.tally-artifact-group {
  gap: 16px;
}

.tally-run-card-main,
.tally-artifact-group-head,
.tally-artifact-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.tally-artifact-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.tally-artifact-card {
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(20, 52, 60, 0.045);
}

.tally-artifact-card .chip-row {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .tally-run-card-main,
  .tally-artifact-group-head,
  .tally-artifact-card {
    flex-direction: column;
  }

  .tally-artifact-card .chip-row {
    justify-content: flex-start;
  }
}

/* Keep the refreshed shell two-column on desktop and laptop widths.
   This must stay after the legacy responsive rules above. */
@media (min-width: 861px) {
  .premium-shell {
    display: grid;
    grid-template-columns: 282px minmax(0, 1fr);
    gap: 0;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
  }

  .premium-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .premium-main {
    display: block;
    min-width: 0;
  }
}

@media (min-width: 861px) {
  .premium-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
}

.topbar-logout {
  margin: 0;
}

.topbar-logout button {
  min-height: 30px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--app-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #eef1ed;
}

.login-shell {
  width: min(460px, calc(100vw - 32px));
}

.login-panel {
  padding: 28px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(23, 42, 48, 0.12);
}

.login-brand {
  margin-bottom: 24px;
}

.admin-workspace-layout {
  align-items: start;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

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

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-stack label span {
  display: block;
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.form-stack input,
.form-stack select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(23, 42, 48, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--app-ink);
  font: inherit;
}

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

/* DALA Operations shell refresh */
:root {
  --app-bg: #f6f7f4;
  --app-bg-2: #ecefed;
  --app-ink: #172a30;
  --app-muted: #66777f;
  --app-line: rgba(23, 42, 48, 0.1);
  --app-panel: #ffffff;
  --app-panel-soft: #f9faf8;
  --app-teal: #175763;
  --app-teal-dark: #0c3038;
  --app-amber: #c58b38;
  --app-shadow: 0 18px 46px rgba(23, 42, 48, 0.08);
  --app-radius: 14px;
}

body.app-frame {
  background:
    linear-gradient(180deg, rgba(236, 239, 237, 0.88), rgba(246, 247, 244, 1) 300px),
    var(--app-bg);
  color: var(--app-ink);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.premium-shell {
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.premium-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  gap: 18px;
  padding: 22px 16px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(12, 48, 56, 0.98), rgba(14, 59, 66, 0.98)),
    var(--app-teal-dark);
  box-shadow: 18px 0 44px rgba(23, 42, 48, 0.14);
}

.premium-sidebar::-webkit-scrollbar {
  width: 8px;
}

.premium-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.sidebar-brand {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 4px 6px;
}

.sidebar-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5d08c, var(--app-amber));
  color: #102f35;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(4, 20, 24, 0.24);
}

.sidebar-kicker {
  color: rgba(245, 251, 251, 0.56);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.sidebar-title {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  gap: 4px;
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  color: rgba(245, 251, 251, 0.72);
  font-size: 0.91rem;
  font-weight: 760;
}

.nav-link::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px -16px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: transparent;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: none;
}

.nav-link.is-active::before {
  background: var(--app-amber);
}

.nav-glyph {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 251, 251, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-link.is-active .nav-glyph {
  background: rgba(197, 139, 56, 0.22);
  color: #ffd995;
}

.sidebar-panel {
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-panel-strong {
  background: rgba(255, 255, 255, 0.065);
}

.panel-label,
.metric-label,
.eyebrow,
.field-label,
.topbar-label {
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.sidebar-status-list,
.sidebar-pulse-grid {
  gap: 8px;
}

.sidebar-status-row {
  padding: 7px 0;
  font-size: 0.78rem;
}

.sidebar-pulse-grid > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-pulse-grid strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 1.12rem;
  line-height: 1;
}

.premium-main {
  display: block;
  min-width: 0;
  padding: 18px 24px 42px;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  margin: -18px -24px 22px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(246, 247, 244, 0.88);
  backdrop-filter: blur(18px);
}

.workspace-topbar strong {
  display: block;
  margin-top: 2px;
  color: var(--app-ink);
  font-size: 0.98rem;
}

.topbar-label {
  display: block;
  color: var(--app-muted);
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.topbar-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-alert.has-alerts {
  border-color: rgba(196, 134, 37, 0.42);
  background: #fff7e6;
  color: var(--app-ink);
}

.topbar-alert strong {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #c48625;
  color: #fff;
  font-size: 0.72rem;
}

.topbar-alert em {
  font-style: normal;
}

h1,
h2,
h3 {
  color: var(--app-ink);
  letter-spacing: 0;
}

h1 {
  max-width: none;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(1.75rem, 2.1vw, 2.45rem);
  font-weight: 850;
  line-height: 1.08;
}

h2 {
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(1.12rem, 1.45vw, 1.55rem);
  font-weight: 820;
  line-height: 1.18;
}

h3 {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
}

.page-header,
.hero-band {
  margin-bottom: 16px;
}

.page-header {
  padding: 0 0 4px;
}

.hero-band {
  min-height: 0;
  padding: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--app-teal);
}

.page-copy,
.empty-state,
.field-hint,
.future-card small,
.planner-card p,
.stat-card small,
.future-point,
.pipeline-step span:last-child,
.review-subtle,
.subtle-note {
  color: var(--app-muted);
}

.panel,
.glass-card {
  border: 1px solid rgba(23, 42, 48, 0.08);
  border-radius: var(--app-radius);
  background: var(--app-panel);
  box-shadow: var(--app-shadow);
  backdrop-filter: none;
}

.panel {
  padding: 18px;
}

.glass-card {
  padding: 20px;
}

.soft-panel,
.tracker-metric-card-muted,
.recent-runs-panel {
  background: var(--app-panel-soft);
}

.database-summary-grid,
.stat-row {
  gap: 12px;
}

.database-summary-card,
.stat-card:not(.premium-stat-card) {
  min-height: 104px;
}

.database-summary-card strong,
.stat-card strong {
  color: var(--app-ink);
}

.content-grid,
.module-stage,
.content-split,
.dashboard-grid,
.future-grid,
.day-canvas,
.batch-card-grid {
  gap: 16px;
}

.database-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
}

.database-form-panel {
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.database-form-panel::-webkit-scrollbar,
.scroll-table::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.database-form-panel::-webkit-scrollbar-thumb,
.scroll-table::-webkit-scrollbar-thumb {
  background: rgba(23, 42, 48, 0.16);
  border-radius: 999px;
}

.table-line {
  padding: 12px 4px;
  border-color: rgba(23, 42, 48, 0.08);
  font-size: 0.9rem;
}

.table-head-line {
  color: var(--app-muted);
  font-size: 0.68rem;
}

.admin-table-head {
  background: rgba(255, 255, 255, 0.94);
}

.admin-table-row:nth-child(odd) {
  background: rgba(23, 42, 48, 0.018);
}

.primary-button,
.secondary-button,
.text-button,
.header-chip,
.mini-chip,
.info-chip,
.status-pill,
.database-toolbar-pill,
.source-pill,
.tracker-day-link,
.invoice-pill {
  letter-spacing: 0;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.primary-button {
  background: linear-gradient(135deg, var(--app-teal), #124953);
  box-shadow: 0 12px 26px rgba(23, 87, 99, 0.18);
}

.secondary-button {
  background: rgba(23, 42, 48, 0.065);
  color: var(--app-ink);
}

.header-chip,
.mini-chip,
.info-chip,
.database-toolbar-pill,
.status-pill,
.source-pill,
.chart-badge {
  border-radius: 999px;
}

.field input,
.field select,
.file-field input,
.database-search-field input,
.inline-pending-form select,
.inline-pending-form input,
.count-input,
.planner-textarea {
  border: 1px solid rgba(23, 42, 48, 0.11);
  border-radius: 10px;
  background: #ffffff;
}

.field input,
.field select,
.file-field input {
  min-height: 44px;
}

.delivery-run-empty,
.future-card,
.day-stage,
.pipeline-step,
.tracker-stat-card,
.meter,
.planner-card,
.batch-card,
.suggestion-card,
.bulk-action-shell {
  border-radius: 12px;
  background: rgba(23, 42, 48, 0.045);
}

.insight-panel,
.module-hero-primary,
.import-progress-card {
  background: linear-gradient(145deg, #103943, #175763);
}

@media (max-width: 1280px) {
  .premium-shell {
    grid-template-columns: 248px minmax(0, 1fr);
    width: 100%;
  }

  .premium-sidebar {
    padding-inline: 12px;
  }

  .sidebar-panel {
    display: none;
  }

  .database-layout {
    grid-template-columns: 1fr;
  }

  .database-form-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .premium-shell {
    display: block;
    width: 100%;
  }

  .premium-sidebar {
    position: relative;
    height: auto;
    padding: 14px;
  }

  .sidebar-brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .sidebar-mark {
    width: 38px;
    height: 38px;
  }

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

  .nav-link {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 40px;
    padding: 0 9px;
    font-size: 0.8rem;
  }

  .nav-glyph {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
  }

  .premium-main {
    padding: 14px 14px 30px;
  }

  .workspace-topbar {
    position: relative;
    margin: -14px -14px 16px;
    padding: 12px 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .panel,
  .glass-card {
    padding: 16px;
  }
}

.warning-row-rich {
  display: grid;
  gap: 12px;
}

.uom-review-decision {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
}

.audit-timeline-stack {
  display: grid;
  gap: 14px;
}

.audit-event-card {
  display: grid;
  gap: 10px;
}

.audit-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tracker-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tracker-day-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(20, 52, 60, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tracker-day-link.is-active {
  background: linear-gradient(135deg, #1d6670, #184f58);
  color: #ffffff;
}

.tracker-day-link.secondary {
  background: rgba(205, 161, 77, 0.14);
  color: #9b6415;
}

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

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 700;
}

.flash-error {
  background: rgba(161, 72, 53, 0.1);
  color: #a14835;
}

.flash-success {
  background: rgba(31, 114, 89, 0.1);
  color: #1f7259;
}

.flash-warning {
  background: rgba(205, 161, 77, 0.14);
  color: #9b6415;
}

.empty-state {
  margin: 0;
}

.subtle-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-pending-form {
  display: grid;
  gap: 10px;
  width: 100%;
}

.inline-pending-form select,
.inline-pending-form input,
.count-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 52, 60, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.pack-breaker-line {
  grid-template-columns: 1.1fr 2.4fr repeat(3, minmax(0, 0.8fr));
}

.count-line,
.count-entry-line {
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
}

.history-line {
  grid-template-columns: 1.1fr 1.2fr 0.7fr 1.4fr 2fr;
}

.count-entry-line {
  align-items: center;
}

.planner-suggestion-shell {
  margin-bottom: 18px;
}

.suggestion-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.suggestion-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(20, 52, 60, 0.04);
  border: 1px solid rgba(20, 52, 60, 0.08);
}

.suggestion-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.suggestion-card h3 {
  margin-top: 6px;
}

.bulk-action-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(20, 52, 60, 0.04);
  border: 1px solid rgba(20, 52, 60, 0.06);
}

.bulk-action-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bulk-action-grid-compact {
  grid-template-columns: minmax(0, 260px);
}

.planner-row-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.planner-row-toggle input {
  width: 16px;
  height: 16px;
}

@media (max-width: 1280px) {
  .premium-shell,
  .module-stage,
  .content-split,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .premium-shell {
    width: min(100%, calc(100vw - 24px));
  }
}

@media (max-width: 860px) {
  .premium-shell,
  .sidebar-stat-grid,
  .future-grid,
  .pipeline-strip,
  .delivery-run-meters,
  .delivery-category-grid,
  .field-row,
  .bulk-action-grid,
  .bulk-action-grid-compact,
  .ll-total-grid,
  .module-meta-grid,
  .module-meters,
  .day-canvas,
  .batch-card-grid,
  .stat-row,
  .content-split {
    grid-template-columns: 1fr;
  }

  .product-edit-grid {
    grid-template-columns: 1fr;
  }

  .hero-band,
  .module-head,
  .planner-card-top,
  .batch-card-head,
  .batch-store-row,
  .tracker-overview-row,
  .inline-move-form,
  .warning-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-run-line,
  .ll-table-line,
  .inventory-line,
  .fees-line,
  .two-col-line,
  .pack-breaker-line,
  .count-line,
  .count-entry-line,
  .history-line {
    grid-template-columns: 1fr;
  }
}

/* Keep the refreshed shell two-column on desktop and laptop widths.
   This must stay after the legacy responsive rules above. */
@media (min-width: 861px) {
  .premium-shell {
    display: grid;
    grid-template-columns: 282px minmax(0, 1fr);
    gap: 0;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
  }

  .premium-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .premium-main {
    display: block;
    min-width: 0;
  }
}

@media (min-width: 861px) and (max-width: 1280px) {
  .premium-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
}

/* =========================================================
   DALA Operations — Frontend Improvements (1-12)
   ========================================================= */

/* 1. Chart bar contrast in dark panels */
.insight-panel .bar-fill.import-bar,
.premium-bar-chart .bar-fill.import-bar {
  background: linear-gradient(180deg, rgba(242, 178, 77, 0.98), rgba(242, 178, 77, 0.65));
  box-shadow: 0 4px 14px rgba(242, 178, 77, 0.35);
}
.insight-panel .bar-fill.run-bar,
.premium-bar-chart .bar-fill.run-bar {
  background: linear-gradient(180deg, rgba(100, 200, 210, 0.98), rgba(100, 200, 210, 0.65));
  box-shadow: 0 4px 14px rgba(100, 200, 210, 0.25);
}

/* 2. File input styling */
input[type="file"],
.file-field input[type="file"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px dashed rgba(23, 42, 48, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--app-muted, var(--text-soft));
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
input[type="file"]:focus,
.file-field input[type="file"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 97, 108, 0.12);
  border-color: rgba(23, 42, 48, 0.28);
}
input[type="file"]::file-selector-button,
.file-field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--app-teal, var(--brand));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

/* 3. Mobile sidebar nav toggle */
.sidebar-nav-toggle {
  display: none;
}
@media (max-width: 860px) {
  .sidebar-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 38px;
    padding: 0 10px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 251, 251, 0.85);
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 2px;
  }
  .sidebar-nav-wrap {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 250ms ease, opacity 250ms ease;
  }
  .sidebar-nav-wrap.is-closed {
    grid-template-rows: 0fr;
    opacity: 0;
  }
  .sidebar-nav-wrap > nav {
    overflow: hidden;
  }
}

/* 4. Table horizontal scroll on mobile (override stacking) */
@media (max-width: 860px) {
  .data-table.scroll-table,
  .data-table.database-table,
  .data-table.premium-run-table,
  .data-table.line-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .data-table.scroll-table .table-line,
  .data-table.database-table .table-line,
  .data-table.premium-run-table .table-line,
  .data-table.line-table .table-line {
    min-width: 640px;
  }
  .data-table.scroll-table .table-line-dashboard,
  .data-table.premium-run-table .table-line-dashboard {
    grid-template-columns: minmax(0, 2.2fr) 120px 80px 80px 90px 70px;
  }
  .data-table.database-table .table-line-admin {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.8fr) 90px 110px 100px 150px 110px 140px;
  }
  /* Fade hint on right edge */
  .data-table.scroll-table::after,
  .data-table.database-table::after,
  .data-table.premium-run-table::after,
  .data-table.line-table::after {
    content: "";
    position: sticky;
    right: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(90deg, transparent, rgba(246, 247, 244, 0.9));
    pointer-events: none;
    float: right;
    margin-left: -24px;
    height: 100%;
  }
}

/* 5. Stat row horizontal scroll on mobile */
@media (max-width: 860px) {
  .dashboard-metric-rail {
    display: grid;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .premium-stat-card {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 112px;
    padding: 18px;
  }

  .stat-index {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .stat-card-copy {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .premium-stat-card strong {
    font-size: 2.45rem;
  }

  .stat-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .stat-row::-webkit-scrollbar {
    display: none;
  }
  .stat-row .stat-card,
  .stat-row .database-summary-card {
    flex: 0 0 78vw;
    max-width: 300px;
    scroll-snap-align: start;
  }

  .dashboard-metric-rail .premium-stat-card {
    flex: none;
    max-width: none;
  }
}

/* 6. Pipeline vertical connector on mobile */
@media (max-width: 860px) {
  .pipeline-strip {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    position: relative;
    padding-left: 26px;
  }
  .pipeline-strip::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(180deg, var(--app-teal, var(--brand)), var(--app-amber, var(--accent)));
    border-radius: 999px;
    opacity: 0.35;
  }
  .pipeline-step {
    position: relative;
    margin-bottom: 14px;
  }
  .pipeline-step::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--app-panel, #fff);
    border: 2px solid var(--app-teal, var(--brand));
    box-shadow: 0 0 0 4px rgba(23, 87, 99, 0.08);
  }
}

/* 7. Sidebar collapse on laptop (861px–1280px) */
.sidebar-collapse-toggle {
  display: none;
}
@media (min-width: 861px) and (max-width: 1280px) {
  .sidebar-collapse-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 10px auto 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: rgba(245,251,251,0.7);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  }
  .sidebar-collapse-toggle:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: translateY(-1px);
  }
  .premium-shell.is-collapsed {
    grid-template-columns: 78px minmax(0, 1fr) !important;
  }
  .premium-shell.is-collapsed .premium-sidebar {
    padding: 18px 10px;
    overflow: visible;
  }
  .premium-shell.is-collapsed .sidebar-brand {
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
    padding: 0;
  }
  .premium-shell.is-collapsed .sidebar-brand > div {
    display: none;
  }
  .premium-shell.is-collapsed .sidebar-mark {
    width: 44px;
    height: 44px;
  }
  .premium-shell.is-collapsed .sidebar-nav {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .premium-shell.is-collapsed .nav-link {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
    min-height: 44px;
  }
  .premium-shell.is-collapsed .nav-link span:not(.nav-glyph) {
    display: none;
  }
  .premium-shell.is-collapsed .sidebar-panel {
    display: none;
  }
  .premium-shell.is-collapsed .sidebar-collapse-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    margin-top: 12px;
    border-radius: 12px;
  }
  /* Tooltip on hover for collapsed nav */
  .premium-shell.is-collapsed .nav-link {
    position: relative;
  }
  .premium-shell.is-collapsed .nav-link::after {
    content: attr(aria-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(12, 48, 56, 0.98);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 100;
  }
  .premium-shell.is-collapsed .nav-link:hover::after {
    opacity: 1;
  }
}

/* 8. Empty state visuals */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
}
.empty-state::before {
  content: "📭";
  font-size: 2rem;
  line-height: 1;
  opacity: 0.5;
  filter: grayscale(0.25);
}
.insight-panel .empty-state::before {
  opacity: 0.7;
  filter: grayscale(0.5) brightness(1.4);
}

/* 9. Topbar actions fix — compact chips at medium widths */
@media (max-width: 1100px) {
  .workspace-topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }
}
@media (max-width: 860px) {
  .topbar-actions span {
    font-size: 0.72rem;
    padding: 0 8px;
    min-height: 26px;
  }
}

/* 10. Transitions with prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  .panel, .glass-card, .nav-link, .primary-button, .secondary-button,
  .sidebar-panel, .pipeline-step, .stat-card, .future-card, .module-hero,
  .tracker-stat-card, .meter, .bulk-action-shell, .suggestion-card {
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
  }
  .nav-link:hover {
    transform: translateX(2px);
  }
  .primary-button:hover, .secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(23, 42, 48, 0.12);
  }
  .glass-card:hover, .panel:hover {
    box-shadow: 0 12px 32px rgba(23, 42, 48, 0.1);
  }
  .future-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(23, 42, 48, 0.1);
  }
}

/* 11. Skeleton / loading states */
.skeleton {
  background: linear-gradient(90deg, rgba(23,42,48,0.06) 25%, rgba(23,42,48,0.11) 50%, rgba(23,42,48,0.06) 75%);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: skeleton-shimmer 1.4s infinite linear;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: rgba(23,42,48,0.08); }
}
form.is-loading {
  position: relative;
  pointer-events: none;
}
form.is-loading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(23,42,48,.06) 25%, rgba(23,42,48,.16) 50%, rgba(23,42,48,.06) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  pointer-events: none;
}
/* Saving a line never covers its quantity or prevents the next edit. */
form.is-loading[data-decision-form] { pointer-events: auto; }
form.is-loading[data-decision-form]::after { content: none; }
[data-decision-form].is-saving [data-save-status]::before {
  content: "";
  display: inline-block;
  width: 54px;
  height: 10px;
  margin-right: 8px;
  border-radius: 4px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(23,42,48,.06) 25%, rgba(23,42,48,.16) 50%, rgba(23,42,48,.06) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
}
@media (prefers-reduced-motion: reduce) {
  form.is-loading::after,
  [data-decision-form].is-saving [data-save-status]::before { animation: none; }
}

/* 12. Touch targets on mobile */
@media (max-width: 860px) {
  .mini-chip, .info-chip, .status-pill, .chart-badge, .database-toolbar-pill,
  .source-pill {
    min-height: 40px;
    padding: 0 14px;
  }
  .primary-button, .secondary-button, .sidebar-button {
    min-height: 48px;
  }
  .text-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .nav-link {
    min-height: 44px;
  }
  .tracker-day-link {
    min-height: 46px;
    padding: 0 18px;
  }
}

/* Print styles bonus */
@media print {
  .premium-sidebar, .workspace-topbar, .flash-stack, .sidebar-collapse-toggle,
  .sidebar-nav-toggle, .actions {
    display: none !important;
  }
  .premium-shell {
    display: block;
  }
  .premium-main {
    padding: 0;
    margin: 0;
  }
  .panel, .glass-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* =========================================================
   Premium cozy stat cards — no more vertical towers
   ========================================================= */

/* Compact stat cards everywhere */
body.app-frame .stat-card:not(.premium-stat-card) {
  padding: 16px 18px;
  min-height: 80px;
  border-radius: 16px;
}
body.app-frame .stat-card:not(.premium-stat-card) strong {
  font-size: clamp(1.5rem, 2.2vw, 2.4rem);
  margin-top: 4px;
}
body.app-frame .stat-card:not(.premium-stat-card) small {
  font-size: 0.8rem;
  margin-top: 2px;
}
body.app-frame .stat-card:not(.premium-stat-card) .panel-label {
  margin-bottom: 2px;
}

/* Laptop (861–1280px): 2×2 grid instead of vertical stack */
@media (min-width: 861px) and (max-width: 1280px) {
  .stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* =========================================================
   Cozy Premium System-wide Override
   Tighter, softer, more refined everywhere
   ========================================================= */

/* Softer background gradient */
body.app-frame {
  background:
    linear-gradient(180deg, rgba(236, 239, 237, 0.92), rgba(246, 247, 244, 1) 220px),
    var(--app-bg);
}

/* Panels & cards — tighter, softer, less round */
body.app-frame .panel,
body.app-frame .glass-card,
body.app-frame .module-hero,
body.app-frame .tracker-stat-card,
body.app-frame .suggestion-card,
body.app-frame .bulk-action-shell,
body.app-frame .database-summary-card,
body.app-frame .stat-card:not(.premium-stat-card),
body.app-frame .meter,
body.app-frame .planner-card,
body.app-frame .batch-card,
body.app-frame .insight-panel .panel,
body.app-frame .recent-runs-panel {
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(23, 42, 48, 0.05);
  border: 1px solid rgba(23, 42, 48, 0.05);
}

/* Tighter grid gaps everywhere */
body.app-frame .dashboard-grid,
body.app-frame .content-grid,
body.app-frame .module-stage,
body.app-frame .stat-row,
body.app-frame .content-split,
body.app-frame .future-grid,
body.app-frame .database-summary-grid,
body.app-frame .tracker-stat-grid {
  gap: 14px;
}

/* Section headers — less margin */
body.app-frame .page-header {
  margin-bottom: 14px;
  gap: 14px;
}
body.app-frame .compact-header {
  align-items: center;
}

/* Topbar — slimmer, more refined */
body.app-frame .workspace-topbar {
  min-height: 50px;
  margin: -18px -24px 18px;
  padding: 8px 24px;
}
body.app-frame .topbar-actions span {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.74rem;
  border-radius: 999px;
}
body.app-frame .topbar-actions {
  gap: 6px;
}

/* Sidebar — cozier, tighter */
body.app-frame .premium-sidebar {
  padding: 18px 14px;
  gap: 14px;
}
body.app-frame .sidebar-brand {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 0 2px 4px;
}
body.app-frame .sidebar-mark {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  border-radius: 10px;
}
body.app-frame .sidebar-title {
  font-size: 0.95rem;
}
body.app-frame .sidebar-kicker {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}
body.app-frame .nav-link {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  gap: 8px;
}
body.app-frame .nav-glyph {
  width: 24px;
  height: 24px;
  font-size: 0.6rem;
  border-radius: 6px;
}
body.app-frame .sidebar-panel {
  padding: 12px;
  border-radius: 10px;
  gap: 8px;
}
body.app-frame .sidebar-status-row {
  padding: 5px 0;
  font-size: 0.76rem;
}
body.app-frame .sidebar-pulse-grid > div {
  padding: 8px;
  border-radius: 8px;
}
body.app-frame .sidebar-pulse-grid strong {
  font-size: 1rem;
}

/* Typography — refined, smaller scale */
body.app-frame h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  line-height: 1.12;
}
body.app-frame h2 {
  font-size: 1.12rem;
  line-height: 1.25;
}
body.app-frame .eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
body.app-frame .panel-label,
body.app-frame .metric-label,
body.app-frame .field-label,
body.app-frame .topbar-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}
body.app-frame .page-copy {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Buttons — tighter, smaller radius */
body.app-frame .primary-button,
body.app-frame .secondary-button,
body.app-frame .sidebar-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 0.88rem;
}
body.app-frame .text-button {
  font-size: 0.88rem;
}

/* Forms — compact */
body.app-frame .field input,
body.app-frame .field select,
body.app-frame .file-field input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}
body.app-frame .database-search-field input {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
}
body.app-frame .form-stack {
  gap: 12px;
}
body.app-frame .field,
body.app-frame .file-field {
  gap: 6px;
}

/* Tables — tighter rows */
body.app-frame .table-line {
  padding: 10px 0;
}
body.app-frame .admin-table-head {
  padding-top: 10px;
  padding-bottom: 10px;
}
body.app-frame .admin-table-row {
  padding: 10px 0;
}
body.app-frame .premium-run-row {
  padding: 10px 0;
}
body.app-frame .list-row {
  padding: 12px 0;
  gap: 14px;
}

/* Chips — smaller, tighter */
body.app-frame .mini-chip,
body.app-frame .info-chip,
body.app-frame .status-pill,
body.app-frame .chart-badge,
body.app-frame .database-toolbar-pill,
body.app-frame .source-pill {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
}
body.app-frame .header-chip,
body.app-frame .mini-chip {
  min-height: 34px;
  padding: 0 12px;
}

/* Pipeline — compact */
body.app-frame .pipeline-step {
  padding: 12px;
  border-radius: 14px;
  gap: 10px;
}
body.app-frame .pipeline-strip {
  gap: 10px;
}

/* Metric rails — tighter */
body.app-frame .health-rail {
  gap: 8px;
  grid-template-columns: 110px minmax(0, 1fr) 100px;
  font-size: 0.88rem;
}
body.app-frame .health-rail-track {
  height: 8px;
}
body.app-frame .metric-line {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
}

/* Donut — slightly smaller, tighter */
body.app-frame .donut-chart {
  width: 140px;
  height: 140px;
}
body.app-frame .donut-chart::after {
  inset: 16px;
}
body.app-frame .donut-core strong {
  font-size: 1.7rem;
}
body.app-frame .donut-core span {
  font-size: 0.8rem;
}

/* Bar chart — tighter */
body.app-frame .bar-chart {
  min-height: 110px;
  gap: 8px;
}
body.app-frame .bar-fill {
  max-width: 40px;
  min-height: 14px;
  border-radius: 12px 12px 6px 6px;
}

/* Tracker stats — compact */
body.app-frame .tracker-stat-grid {
  gap: 10px;
  margin-bottom: 12px;
}
body.app-frame .tracker-stat-card {
  padding: 12px 14px;
  border-radius: 14px;
  gap: 6px;
}
body.app-frame .tracker-stat-card strong {
  font-size: 0.92rem;
}

/* Insight panel — softer padding */
body.app-frame .insight-panel {
  padding: 18px;
}
body.app-frame .insight-panel .panel-head {
  margin-bottom: 12px;
}
body.app-frame .premium-donut-layout {
  gap: 14px;
}
body.app-frame .health-rails {
  margin-top: 14px;
  gap: 10px;
}

/* Flash — compact */
body.app-frame .flash {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}
body.app-frame .flash-stack {
  gap: 8px;
  margin-bottom: 14px;
}

/* Future cards — cozier */
body.app-frame .future-card {
  padding: 14px;
  border-radius: 14px;
  gap: 8px;
}
body.app-frame .future-card strong {
  font-size: 0.95rem;
}
body.app-frame .future-card small {
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Module meters */
body.app-frame .module-meters {
  gap: 10px;
}
body.app-frame .meter {
  padding: 10px 12px;
  border-radius: 12px;
}
body.app-frame .meter span {
  font-size: 0.82rem;
}
body.app-frame .meter strong {
  font-size: 1.1rem;
  margin-top: 4px;
}

/* Module meta grid */
body.app-frame .module-meta-grid {
  gap: 10px;
}
body.app-frame .module-meta-grid > div {
  padding: 10px 12px;
  border-radius: 12px;
  gap: 4px;
}

/* Module copy */
body.app-frame .module-copy {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 8px 0 12px;
}

/* Hero band */
body.app-frame .hero-band {
  gap: 14px;
  margin-bottom: 14px;
}
body.app-frame .hero-chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.72rem;
}

/* Actions row */
body.app-frame .actions {
  gap: 8px;
}
body.app-frame .chip-row {
  gap: 8px;
  margin: 2px 0 4px;
}

/* Tracker overview */
body.app-frame .tracker-overview-row {
  padding: 10px 0;
  gap: 8px;
}
body.app-frame .tracker-overview-stack {
  gap: 10px;
}

/* Dashboard run name */
body.app-frame .dashboard-run-name strong {
  font-size: 0.9rem;
}
body.app-frame .dashboard-run-name small {
  font-size: 0.78rem;
}

/* Product main cell */
body.app-frame .product-main-cell strong {
  font-size: 0.9rem;
}
body.app-frame .product-main-cell small {
  font-size: 0.78rem;
}

/* Admin table */
body.app-frame .admin-table-row:nth-child(odd) {
  background: rgba(24, 50, 59, 0.012);
}

/* Data table general */
body.app-frame .data-table {
  gap: 0;
}
body.app-frame .table-head-line {
  padding: 10px 0;
  font-size: 0.68rem;
}

/* Header stats */
body.app-frame .header-stats div {
  padding: 12px 14px;
  border-radius: 14px;
}
body.app-frame .header-stats span {
  font-size: 0.72rem;
}
body.app-frame .header-stats strong {
  font-size: 1rem;
  margin-top: 6px;
}

/* Count inputs / inline forms */
body.app-frame .inline-pending-form select,
body.app-frame .inline-pending-form input,
body.app-frame .count-input {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

/* Planner / batch cards */
body.app-frame .planner-card,
body.app-frame .batch-card {
  padding: 14px;
  border-radius: 14px;
}
body.app-frame .batch-card-head {
  margin-bottom: 10px;
}
body.app-frame .batch-store-row {
  padding: 8px 0;
}

/* Suggestion cards */
body.app-frame .suggestion-card {
  padding: 14px;
  border-radius: 14px;
  gap: 10px;
}
body.app-frame .suggestion-card h3 {
  font-size: 1rem;
}

/* Day canvas / tracker day */
body.app-frame .day-canvas {
  gap: 14px;
}
body.app-frame .tracker-day-link {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.78rem;
}

/* Mobile cozy overrides */
@media (max-width: 860px) {
  body.app-frame .premium-main {
    padding: 14px 14px 30px;
  }
  body.app-frame .workspace-topbar {
    margin: -14px -14px 14px;
    padding: 10px 14px;
    min-height: 44px;
  }
  body.app-frame .topbar-actions span {
    font-size: 0.68rem;
    padding: 0 8px;
    min-height: 24px;
  }
  body.app-frame h1 {
    font-size: 1.45rem;
  }
  body.app-frame .stat-card:not(.premium-stat-card) {
    padding: 14px 16px;
    min-height: 72px;
  }
  body.app-frame .stat-card:not(.premium-stat-card) strong {
    font-size: 1.8rem;
  }
  body.app-frame .pipeline-step {
    padding: 10px 12px;
  }
  body.app-frame .panel,
  body.app-frame .glass-card {
    padding: 14px;
    border-radius: 14px;
  }
  body.app-frame .module-hero {
    padding: 16px;
  }
  body.app-frame .future-card {
    padding: 12px;
  }
}

/* Laptop 2x2 stat grid + cozy */
@media (min-width: 861px) and (max-width: 1280px) {
  body.app-frame .stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* =========================================================
   Perfect placement — stat cards that never truncate
   ========================================================= */

/* Cozy, flexible stat cards everywhere */
body.app-frame .premium-stat-card {
  min-height: 80px;
  padding: 14px 16px;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr);
  overflow: visible;
}
body.app-frame .premium-stat-card::after {
  inset: 8px auto 8px 0;
  width: 3px;
}
body.app-frame .stat-index {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 0.76rem;
}

/* Default copy layout: label on top, number + desc side-by-side */
body.app-frame .stat-card-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: baseline;
}
body.app-frame .stat-card-copy .panel-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.62rem;
}
body.app-frame .stat-card-copy strong {
  grid-column: 1;
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  margin: 0;
  line-height: 1;
}
body.app-frame .stat-card-copy small {
  grid-column: 2;
  font-size: 0.86rem;
  line-height: 1.3;
  align-self: center;
  color: var(--app-muted);
}

/* Wide desktop (>1280px): horizontal 3-col layout has room to breathe */
@media (min-width: 1281px) {
  body.app-frame .stat-card-copy {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
  }
  body.app-frame .stat-card-copy .panel-label {
    grid-column: auto;
  }
  body.app-frame .stat-card-copy strong {
    grid-column: auto;
    text-align: center;
    font-size: clamp(2rem, 2.6vw, 2.8rem);
  }
  body.app-frame .stat-card-copy small {
    grid-column: auto;
    text-align: right;
  }
}

/* Mobile: keep stacked but tighter */
@media (max-width: 860px) {
  body.app-frame .premium-stat-card {
    min-height: 68px;
    padding: 12px 14px;
    gap: 10px;
    grid-template-columns: 36px minmax(0, 1fr);
  }
  body.app-frame .stat-index {
    width: 34px;
    height: 34px;
    font-size: 0.7rem;
  }
  body.app-frame .stat-card-copy strong {
    font-size: 1.7rem;
  }
  body.app-frame .stat-card-copy small {
    font-size: 0.8rem;
  }
}

/* =========================================================
   Extra polish — buttons, chips, nav toggle icons
   ========================================================= */

/* Cleaner nav toggle icon */
.sidebar-nav-toggle {
  font-size: 1.2rem;
  line-height: 1;
}

/* Sidebar collapse icon */
.sidebar-collapse-toggle {
  font-size: 1.1rem;
  line-height: 1;
}

/* Module hero cozier */
body.app-frame .module-hero {
  padding: 18px;
}
body.app-frame .module-hero-primary {
  padding: 20px;
}
body.app-frame .module-head {
  gap: 8px;
  margin-bottom: 10px;
}
body.app-frame .module-head.compact {
  margin-bottom: 8px;
}

/* Pipeline softer */
body.app-frame .pipeline-step {
  padding: 12px 14px;
}

/* Future cards more contained */
body.app-frame .future-card {
  padding: 14px 16px;
}
body.app-frame .future-card strong {
  font-size: 0.92rem;
  line-height: 1.35;
}
body.app-frame .future-card small {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Content split panels tighter */
body.app-frame .content-split > .glass-card {
  padding: 16px;
}

/* Tracker day nav pills softer */
body.app-frame .tracker-day-link {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.76rem;
}

/* Database toolbar pills */
body.app-frame .database-toolbar {
  margin-bottom: 12px;
  gap: 8px;
}
body.app-frame .database-toolbar-pill {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.72rem;
}

/* Loading tracker meters */
body.app-frame .module-meters {
  gap: 8px;
}
body.app-frame .meter {
  padding: 8px 12px;
  gap: 4px;
}
body.app-frame .meter strong {
  font-size: 1.05rem;
}

/* Topbar logout button */
body.app-frame .topbar-logout button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.74rem;
  border-radius: 999px;
  border: 1px solid var(--app-line);
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
}
body.app-frame .topbar-logout button:hover {
  background: rgba(23, 42, 48, 0.04);
  color: var(--app-ink);
}

/* =========================================================
   Extra Premium — refined shadows, micro-interactions,
   focus rings, and cohesive polish system-wide
   ========================================================= */

/* Layered realistic shadows for depth */
body.app-frame .panel,
body.app-frame .glass-card,
body.app-frame .module-hero,
body.app-frame .stat-card,
body.app-frame .premium-stat-card,
body.app-frame .future-card,
body.app-frame .suggestion-card,
body.app-frame .meter,
body.app-frame .planner-card,
body.app-frame .batch-card,
body.app-frame .tracker-stat-card,
body.app-frame .tracker-day-link,
body.app-frame .database-toolbar-pill {
  box-shadow:
    0 1px 2px rgba(23, 42, 48, 0.04),
    0 4px 8px rgba(23, 42, 48, 0.04),
    0 8px 24px rgba(23, 42, 48, 0.04);
  transition: transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover lift for cards */
body.app-frame .panel:hover,
body.app-frame .glass-card:hover,
body.app-frame .stat-card:hover,
body.app-frame .premium-stat-card:hover,
body.app-frame .future-card:hover,
body.app-frame .suggestion-card:hover,
body.app-frame .meter:hover,
body.app-frame .planner-card:hover,
body.app-frame .batch-card:hover,
body.app-frame .tracker-stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(23, 42, 48, 0.05),
    0 8px 16px rgba(23, 42, 48, 0.05),
    0 16px 40px rgba(23, 42, 48, 0.06);
}

/* Module hero stronger shadow */
body.app-frame .module-hero {
  box-shadow:
    0 1px 2px rgba(23, 42, 48, 0.06),
    0 6px 12px rgba(23, 42, 48, 0.06),
    0 12px 32px rgba(23, 42, 48, 0.08);
}
body.app-frame .module-hero:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(23, 42, 48, 0.07),
    0 10px 20px rgba(23, 42, 48, 0.07),
    0 20px 48px rgba(23, 42, 48, 0.09);
}

/* Insight panel subtle inner glow */
body.app-frame .insight-panel {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(12, 48, 56, 0.15),
    0 12px 32px rgba(12, 48, 56, 0.12);
}

/* Beautiful focus rings */
body.app-frame .field input:focus,
body.app-frame .field select:focus,
body.app-frame .file-field input:focus,
body.app-frame .database-search-field input:focus,
body.app-frame .inline-pending-form input:focus,
body.app-frame .inline-pending-form select:focus,
body.app-frame .count-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 97, 108, 0.15), 0 0 0 1px rgba(31, 97, 108, 0.25);
  border-color: rgba(31, 97, 108, 0.35);
}

/* Button focus rings */
body.app-frame .primary-button:focus,
body.app-frame .secondary-button:focus,
body.app-frame .sidebar-button:focus,
body.app-frame .tracker-day-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 97, 108, 0.18);
}
body.app-frame .primary-button:focus {
  box-shadow: 0 0 0 3px rgba(31, 97, 108, 0.25), 0 4px 12px rgba(31, 97, 108, 0.15);
}

/* Nav link refined active state */
body.app-frame .nav-link.is-active {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}
body.app-frame .nav-link.is-active::before {
  box-shadow: 0 0 8px rgba(197, 139, 56, 0.45);
}

/* Table row hover — subtle and premium */
body.app-frame .admin-table-row,
body.app-frame .premium-run-row,
body.app-frame .list-row {
  transition: background 150ms ease;
}
body.app-frame .admin-table-row:hover,
body.app-frame .premium-run-row:hover {
  background: rgba(23, 42, 48, 0.025);
}
body.app-frame .list-row:hover {
  background: rgba(23, 42, 48, 0.02);
}

/* Text button hover underline effect */
body.app-frame .text-button {
  position: relative;
  transition: color 150ms ease;
}
body.app-frame .text-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease, opacity 200ms ease;
}
body.app-frame .text-button:hover::after {
  opacity: 0.5;
  transform: scaleX(1);
}

/* Sidebar collapse button refined */
body.app-frame .sidebar-collapse-toggle {
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
body.app-frame .sidebar-collapse-toggle:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  transform: scale(1.05);
}

/* Nav toggle refined */
body.app-frame .sidebar-nav-toggle {
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
body.app-frame .sidebar-nav-toggle:hover {
  background: rgba(255,255,255,0.14);
  transform: scale(1.05);
}

/* Status pills refined */
body.app-frame .status-pill {
  transition: transform 150ms ease, box-shadow 150ms ease;
}
body.app-frame .status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Chip hover */
body.app-frame .mini-chip:hover,
body.app-frame .info-chip:hover,
body.app-frame .header-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Future card image/icon placeholder refinement */
body.app-frame .future-card {
  position: relative;
  overflow: hidden;
}
body.app-frame .future-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-teal), var(--app-amber));
  opacity: 0;
  transition: opacity 200ms ease;
}
body.app-frame .future-card:hover::before {
  opacity: 0.6;
}

/* Pipeline desktop — horizontal connector line */
@media (min-width: 861px) {
  body.app-frame .pipeline-strip {
    position: relative;
    gap: 0;
  }
  body.app-frame .pipeline-strip::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 32px;
    height: 2px;
    background: linear-gradient(90deg, var(--app-teal), var(--app-amber));
    opacity: 0.18;
    border-radius: 999px;
    z-index: 0;
  }
  body.app-frame .pipeline-step {
    position: relative;
    z-index: 1;
    background: var(--app-panel);
    margin: 0 6px;
    box-shadow: 0 2px 8px rgba(23, 42, 48, 0.06);
  }
  body.app-frame .pipeline-step:first-child {
    margin-left: 0;
  }
  body.app-frame .pipeline-step:last-child {
    margin-right: 0;
  }
}

/* Empty state — more refined than emoji */
body.app-frame .empty-state::before {
  content: "";
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px dashed rgba(23, 42, 48, 0.12);
  background: rgba(23, 42, 48, 0.02);
  margin-bottom: 4px;
}
body.app-frame .insight-panel .empty-state::before {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* Tracker day link active glow */
body.app-frame .tracker-day-link.is-active {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 4px 12px rgba(29, 102, 112, 0.25);
}

/* Database search form refined */
body.app-frame .database-search-form {
  margin: 14px 0 8px;
}

/* Form stack refined */
body.app-frame .form-stack {
  gap: 14px;
}

/* File input refined hover */
body.app-frame input[type="file"]:hover,
body.app-frame .file-field input[type="file"]:hover {
  border-color: rgba(23, 42, 48, 0.28);
  background: rgba(255, 255, 255, 0.8);
}

/* Premium donut glow */
body.app-frame .premium-donut {
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.06), 0 0 40px rgba(242, 178, 77, 0.08);
}

/* Bar fill glow on hover */
body.app-frame .bar-fill {
  transition: opacity 200ms ease, transform 200ms ease;
}
body.app-frame .bar-chart:hover .bar-fill {
  opacity: 0.95;
}

/* Health rail fill shimmer */
body.app-frame .health-rail-fill {
  position: relative;
  overflow: hidden;
}
body.app-frame .health-rail-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  animation: rail-shimmer 2.5s infinite;
}
@keyframes rail-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  body.app-frame .health-rail-fill::after { animation: none; }
}

/* Flash messages entrance */
body.app-frame .flash {
  animation: flash-in 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  body.app-frame .flash { animation: none; }
}

/* Smooth page load for main content */
body.app-frame .premium-main {
  animation: main-fade-in 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes main-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  body.app-frame .premium-main { animation: none; }
}

/* Refined scrollbar for sidebar and tables */
.premium-sidebar::-webkit-scrollbar {
  width: 5px;
}
.premium-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.premium-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
.premium-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.data-table.scroll-table::-webkit-scrollbar,
.data-table.database-table::-webkit-scrollbar,
.data-table.line-table::-webkit-scrollbar,
.stat-row::-webkit-scrollbar {
  height: 5px;
}
.data-table.scroll-table::-webkit-scrollbar-track,
.data-table.database-table::-webkit-scrollbar-track,
.data-table.line-table::-webkit-scrollbar-track,
.stat-row::-webkit-scrollbar-track {
  background: transparent;
}
.data-table.scroll-table::-webkit-scrollbar-thumb,
.data-table.database-table::-webkit-scrollbar-thumb,
.data-table.line-table::-webkit-scrollbar-thumb,
.stat-row::-webkit-scrollbar-thumb {
  background: rgba(23, 42, 48, 0.12);
  border-radius: 999px;
}
.data-table.scroll-table::-webkit-scrollbar-thumb:hover,
.data-table.database-table::-webkit-scrollbar-thumb:hover,
.data-table.line-table::-webkit-scrollbar-thumb:hover,
.stat-row::-webkit-scrollbar-thumb:hover {
  background: rgba(23, 42, 48, 0.2);
}

/* Topbar refined shadow */
body.app-frame .workspace-topbar {
  box-shadow: 0 1px 3px rgba(23, 42, 48, 0.04);
}

/* Sidebar brand mark refined */
body.app-frame .sidebar-mark {
  box-shadow: 0 4px 12px rgba(4, 20, 24, 0.2);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
body.app-frame .sidebar-mark:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(4, 20, 24, 0.28);
}

/* Button press effect */
body.app-frame .primary-button:active,
body.app-frame .secondary-button:active,
body.app-frame .sidebar-button:active {
  transform: translateY(0) scale(0.98);
}

/* Tooltip for collapsed sidebar */
.premium-shell.is-collapsed .nav-link::after {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  background: rgba(12, 48, 56, 0.92);
  box-shadow: 0 8px 24px rgba(4, 20, 24, 0.3);
}

/* Rounded image/avatar placeholders */
body.app-frame .stat-index {
  box-shadow: inset 0 1px 2px rgba(23, 87, 99, 0.08);
}

/* Source pills refined */
body.app-frame .source-pill-imported {
  box-shadow: inset 0 1px 1px rgba(31, 97, 108, 0.08);
}
body.app-frame .source-pill-manual {
  box-shadow: inset 0 1px 1px rgba(214, 146, 46, 0.08);
}

/* Content split cards alignment */
body.app-frame .content-split > .glass-card {
  display: flex;
  flex-direction: column;
}

/* Module meta grid refined */
body.app-frame .module-meta-grid > div {
  box-shadow: inset 0 1px 2px rgba(23, 42, 48, 0.03);
}

/* Audit timeline refined */
body.app-frame .audit-event-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(23, 42, 48, 0.02);
  border: 1px solid rgba(23, 42, 48, 0.04);
  transition: background 150ms ease, transform 150ms ease;
}
body.app-frame .audit-event-card:hover {
  background: rgba(23, 42, 48, 0.035);
  transform: translateX(2px);
}

/* Planner suggestion cards */
body.app-frame .suggestion-card {
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
body.app-frame .suggestion-card:hover {
  border-color: rgba(23, 42, 48, 0.1);
}

/* Bulk action shell refined */
body.app-frame .bulk-action-shell {
  box-shadow: inset 0 1px 2px rgba(23, 42, 48, 0.03);
}

/* Chart badge refined */
body.app-frame .chart-badge {
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
}

/* Tracker stat card number refined */
body.app-frame .tracker-stat-card strong {
  letter-spacing: -0.01em;
}

/* Recent runs panel refined */
body.app-frame .recent-runs-panel {
  overflow: hidden;
}

/* Responsive pipeline step refinement */
@media (max-width: 860px) {
  body.app-frame .pipeline-step {
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(23, 42, 48, 0.05);
  }
}

/* Print styles improved */
/* ── Dashboard alert rail ────────────────────────────────────────── */
.dash-alerts-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.dash-alert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  text-decoration: none;
  flex: 1;
  min-width: 220px;
  transition: opacity 0.15s;
}
.dash-alert-card:hover { opacity: 0.85; }
.dash-alert-card strong { display: block; font-size: 14px; }
.dash-alert-card small { font-size: 12px; opacity: 0.8; }
.dash-alert-icon { font-size: 22px; flex-shrink: 0; }
.dash-alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
}
.dash-alert-blacklist {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
}

/* ── Inline blacklist badges ──────────────────────────────────────── */
.bl-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  margin-left: 2px;
  cursor: default;
}
.bl-inline-exact {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.bl-inline-likely {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

@media print {
  body.app-frame .premium-main {
    animation: none;
  }
  body.app-frame .panel,
  body.app-frame .glass-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ============================================================
   DALA REFRESH — consolidated overrides (appended last so it
   wins the cascade over earlier style generations). 2026-06.
   Scope: grouped navigation, SVG nav icons, KPI dashboard rail.
   ============================================================ */

/* --- Grouped sidebar navigation --- */
body.app-frame .sidebar-nav {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
body.app-frame .nav-section {
  display: grid;
  gap: 3px;
}
body.app-frame .nav-section-label {
  display: block;
  margin: 2px 0 4px;
  padding: 0 12px;
  color: rgba(245, 251, 251, 0.42);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
/* SVG icons inside the nav glyph chip */
body.app-frame .nav-glyph {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 251, 251, 0.78);
}
body.app-frame .nav-glyph svg {
  width: 17px;
  height: 17px;
  display: block;
}
body.app-frame .nav-link.is-active .nav-glyph {
  background: rgba(197, 139, 56, 0.22);
  color: #ffd995;
}
body.app-frame .nav-link:hover .nav-glyph {
  color: #ffffff;
}

/* Collapsed laptop sidebar: hide group labels, keep icon rail tidy */
@media (min-width: 861px) {
  body.app-frame .premium-shell.is-collapsed .nav-section-label {
    display: none;
  }
  body.app-frame .premium-shell.is-collapsed .sidebar-nav {
    gap: 6px;
  }
  body.app-frame .premium-shell.is-collapsed .nav-section {
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  body.app-frame .premium-shell.is-collapsed .nav-section:last-child {
    border-bottom: 0;
  }
}

/* Mobile: nav stacks in one clean column, labels kept for clarity */
@media (max-width: 860px) {
  body.app-frame .sidebar-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  body.app-frame .nav-section {
    gap: 4px;
  }
}

/* --- KPI dashboard rail: tidy multi-column cards --- */
body.app-frame .dashboard-metric-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 10px 0 24px;
}
body.app-frame .dashboard-metric-rail .premium-stat-card {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  min-height: 116px;
  padding: 18px;
}
/* Inside the rail, always stack copy vertically (label / number / note) */
body.app-frame .dashboard-metric-rail .stat-card-copy {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: start;
  text-align: left;
}
body.app-frame .dashboard-metric-rail .stat-card-copy .panel-label {
  grid-column: 1;
  font-size: 0.64rem;
}
body.app-frame .dashboard-metric-rail .stat-card-copy strong {
  grid-column: 1;
  text-align: left;
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  line-height: 1.05;
}
body.app-frame .dashboard-metric-rail .stat-card-copy small {
  grid-column: 1;
  text-align: left;
  font-size: 0.82rem;
  color: var(--app-muted);
}
@media (max-width: 560px) {
  body.app-frame .dashboard-metric-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  body.app-frame .dashboard-metric-rail .premium-stat-card {
    min-height: 104px;
    padding: 14px;
  }
}

/* --- Branded error pages (standalone, reuse login shell) --- */
.login-panel.error-panel {
  text-align: left;
  gap: 14px;
}
.error-panel .error-code {
  margin: 18px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--app-amber);
}
.error-panel .error-heading {
  margin: 0;
  font-size: 1.5rem;
}
.error-panel .error-message {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.55;
}
.error-panel .error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* Brand lockup on white panels (login + error) needs dark text */
.login-brand .sidebar-kicker {
  color: var(--app-muted);
}
.login-brand .sidebar-title {
  color: var(--app-ink);
}

/* --- Fix CSS grid blowout: the main column must be allowed to shrink,
   otherwise wide tables widen the whole page and cause horizontal scroll. --- */
@media (max-width: 1280px) {
  body.app-frame .premium-shell,
  body.app-frame .content-split,
  body.app-frame .content-split-hero,
  body.app-frame .dashboard-grid,
  body.app-frame .dashboard-grid-premium,
  body.app-frame .module-stage,
  body.app-frame .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 860px) {
  body.app-frame .premium-main {
    min-width: 0;
    max-width: 100%;
  }
  /* Layout containers and cards must be allowed to shrink so wide
     tables scroll inside them instead of widening the page. */
  body.app-frame .premium-main > *,
  body.app-frame .content-split > *,
  body.app-frame .dashboard-grid > *,
  body.app-frame .module-stage > *,
  body.app-frame .panel,
  body.app-frame .glass-card {
    min-width: 0;
  }
}

/* --- Robust mobile table scrolling (wins over earlier generations) --- */
@media (max-width: 860px) {
  /* Main product table: real column widths so the name column never collapses */
  body.app-frame .data-table.database-table .table-line-admin {
    grid-template-columns: 200px 150px 90px 110px 100px 150px 110px 140px;
  }
  body.app-frame .data-table.scroll-table,
  body.app-frame .data-table.database-table,
  body.app-frame .data-table.line-table,
  body.app-frame .data-table.premium-run-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  body.app-frame .data-table.scroll-table > .table-line,
  body.app-frame .data-table.database-table > .table-line,
  body.app-frame .data-table.line-table > .table-line,
  body.app-frame .data-table.premium-run-table > .table-line {
    min-width: 680px;
  }
  /* Headings in scrollable tables must never wrap to single letters */
  body.app-frame .data-table.scroll-table .table-head-line span,
  body.app-frame .data-table.database-table .table-head-line span,
  body.app-frame .data-table.line-table .table-head-line span,
  body.app-frame .data-table.premium-run-table .table-head-line span {
    white-space: nowrap;
  }
}

/* ============================================================
   Gated-pipeline pages (Finance / Inventory / LPO / checks / SE / Users)
   Utility classes matched to the existing design tokens.
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 12px; font: inherit; font-weight: 600; line-height: 1;
  background: rgba(24, 50, 59, 0.06); color: var(--brand-dark);
  text-decoration: none; cursor: pointer; transition: filter .15s ease;
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: var(--brand); color: #fff; border-color: transparent; }
.btn-danger { background: rgba(161, 72, 53, 0.12); color: var(--danger); border-color: transparent; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 0.82rem; border-radius: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand-dark);
}
.pill-ok { background: rgba(31, 114, 89, 0.14); color: var(--success); }
.pill-warn { background: rgba(214, 146, 46, 0.14); color: #8a5a10; }
.pill-danger { background: rgba(161, 72, 53, 0.14); color: var(--danger); }

.panel-kicker {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; font-weight: 700; color: var(--accent); margin-bottom: 6px;
}
.panel-sub { color: var(--text-soft); font-size: 0.9rem; margin: 4px 0 0; line-height: 1.5; }
.flash-warn { background: rgba(214, 146, 46, 0.12); color: #8a5a10; }

.stacked-form { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 8px 0 4px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 4px; }
.form-row > label, .stacked-form > label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-soft);
}
.form-row input, .form-row select, .form-row textarea,
.stacked-form input, .stacked-form select, .stacked-form textarea,
.inline-form input, .inline-form select {
  min-height: 38px; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text); font: inherit;
}
.inline-form input[type="text"] { min-width: 200px; }

.review-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  margin-bottom: 12px; background: var(--surface);
}
.review-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 1.02rem; }
.review-card-body { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 10px; line-height: 1.5; }

/* Keep wide tables from overflowing on small screens */
@media (max-width: 760px) {
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .form-row { gap: 10px; }
  .inline-form input[type="text"] { min-width: 140px; flex: 1 1 140px; }
}

/* ============================================================
   Daily Run cockpit (premium step ladder)
   ============================================================ */
.run-hero { background: linear-gradient(135deg, rgba(31,97,108,0.06), rgba(214,146,46,0.05)); }
.run-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.run-hero-title { margin: 0.2rem 0 0.4rem; }
.run-hero-copy { max-width: 48ch; }

.run-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 16px; font-weight: 700; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface);
}
.run-status small { font-weight: 500; color: var(--text-soft); margin-left: 4px; }
.run-status-dot { width: 10px; height: 10px; border-radius: 999px; }
.run-status--open { color: var(--success); }
.run-status--open .run-status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(31,114,89,.14); }
.run-status--closed { color: #8a5a10; }
.run-status--closed .run-status-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(214,146,46,.16); }

.run-alert {
  margin-top: 16px; padding: 14px 18px; border-radius: 14px;
  background: rgba(214,146,46,.1); color: #8a5a10; border-left: 3px solid var(--accent);
}

.run-ladder { list-style: none; margin: 24px 0 0; padding: 0; }
.run-step { position: relative; display: flex; gap: 18px; padding: 0 0 18px; }
.run-step::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: -2px; width: 2px; background: var(--line); }
.run-step:last-child::before { display: none; }
.run-step-marker {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; z-index: 1; background: var(--text-soft);
}
.run-step--done .run-step-marker { background: var(--success); }
.run-step--active .run-step-marker { background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.run-step--locked .run-step-marker { background: #c3ccce; }

.run-step-card {
  flex: 1; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.run-step--locked .run-step-card { background: var(--surface-soft); box-shadow: none; opacity: .9; }
.run-step--active .run-step-card { border-color: rgba(31,97,108,.3); }
.run-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.run-step-label { font-weight: 700; font-size: 1.02rem; color: var(--text); }
.run-step-detail { margin: .35rem 0 0; color: var(--text-soft); font-size: .92rem; }
.run-step-who { font-weight: 600; color: var(--brand-dark); }

@media (max-width: 600px) {
  .run-step::before { left: 15px; }
  .run-step-marker { flex-basis: 32px; width: 32px; height: 32px; }
}

/* ============================================================
   DALA SYSTEM — "Editorial Ivory" design language (new screens).
   Cream paper, Fraunces serif headings, airy, restrained, no jargon.
   ============================================================ */
.ds-ivory {
  --ivory: #f6f2e9; --ivory-card: #fffdf8; --ink: #292420; --ink-soft: #837a6c;
  --rule: rgba(41,36,32,.13); --gold: #9a7b43;
  background: radial-gradient(1200px 420px at 82% -8%, rgba(154,123,67,.06), transparent 60%), var(--ivory);
  color: var(--ink); padding: clamp(26px, 4.5vw, 64px); border-radius: 24px; border: 1px solid var(--rule);
}
.ds-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.ds-kicker { text-transform: uppercase; letter-spacing: .3em; font-size: .68rem; font-weight: 600; color: var(--gold); }
.ds-display { font-family: "Fraunces", Georgia, serif; font-weight: 600; color: var(--ink);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); line-height: 1.04; letter-spacing: -.015em; margin: .18em 0 .22em; }
.ds-lede { color: var(--ink-soft); max-width: 54ch; line-height: 1.75; font-size: 1.03rem; margin: 0; }
.ds-status { display: inline-flex; align-items: center; gap: 10px; font-family: "Fraunces", serif; font-size: 1.02rem; color: var(--ink-soft); white-space: nowrap; }
.ds-status .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ink-soft); }
.ds-status.is-open { color: #4f7a52; } .ds-status.is-open .dot { background: #4f7a52; box-shadow: 0 0 0 4px rgba(79,122,82,.14); }
.ds-status.is-wait { color: var(--gold); } .ds-status.is-wait .dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(154,123,67,.16); }
.ds-meta { color: var(--ink-soft); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 18px; }
.ds-rule { height: 1px; background: var(--rule); border: 0; margin: 26px 0 6px; }
.ds-note { background: rgba(154,123,67,.08); border-left: 2px solid var(--gold); padding: 14px 20px; margin-top: 22px; color: #6e5830; border-radius: 4px; line-height: 1.6; }
.ds-steps { list-style: none; margin: 6px 0 0; padding: 0; }
.ds-step { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: baseline; gap: 20px; padding: 24px 0; border-top: 1px solid var(--rule); }
.ds-step:first-child { border-top: 0; }
.ds-step-num { font-family: "Fraunces", serif; font-size: 1.55rem; font-weight: 600; color: var(--gold); }
.ds-step-title { font-family: "Fraunces", serif; font-size: 1.28rem; color: var(--ink); line-height: 1.25; }
.ds-step-sub { display: block; font-family: "Manrope", sans-serif; font-size: .9rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.6; }
.ds-step-tag { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.ds-step--active .ds-step-tag { color: var(--gold); font-weight: 700; }
.ds-step--done .ds-step-tag { color: #4f7a52; font-weight: 600; }
.ds-step--locked { opacity: .62; }
.ds-step--locked .ds-step-num, .ds-step--locked .ds-step-title { color: var(--ink-soft); }
@media (max-width: 600px) {
  .ds-step { grid-template-columns: 2.4rem 1fr; gap: 14px; }
  .ds-step-tag { grid-column: 2; margin-top: 6px; }
}

/* Editorial Ivory — "cases" (Finance approvals) */
.ds-case { padding: 26px 0; border-top: 1px solid var(--rule); }
.ds-ivory .ds-case:first-of-type { border-top: 0; }
.ds-case-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ds-case-name { font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 600; color: var(--ink); margin: 0; }
.ds-case-tag { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--gold); }
.ds-case--block .ds-case-tag { color: #9a4438; }
.ds-case-body { color: var(--ink-soft); line-height: 1.7; margin: 10px 0 16px; max-width: 60ch; }
.ds-case-body strong { color: var(--ink); }
.ds-case-order { font-size: .82rem; letter-spacing: .04em; }
.ds-case-form { display: flex; gap: 10px; flex-wrap: wrap; }
.ds-case-form input { flex: 1; min-width: 220px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--ivory-card); color: var(--ink); font: inherit; }
.ds-case-form input:focus { outline: none; border-color: var(--gold); }
.ds-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border: 0; border-radius: 12px; background: var(--ink); color: var(--ivory-card); font: inherit; font-weight: 600; letter-spacing: .02em; cursor: pointer; transition: filter .15s ease; }
.ds-btn:hover { filter: brightness(1.15); }

/* Editorial Ivory — purchase-order slots */
.ds-case-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ds-btn--quiet { background: transparent; color: var(--ink-soft); border: 1px solid var(--rule); }
.ds-btn--quiet:hover { filter: none; border-color: var(--gold); color: var(--ink); }
.ds-link { color: var(--gold); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(154,123,67,.4); }
.ds-link:hover { color: var(--ink); }
.ds-case-form input[type="file"] { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px dashed var(--rule); border-radius: 12px; background: var(--ivory-card); color: var(--ink-soft); font: inherit; }

/* Editorial Ivory — form controls, table, item lines */
.ds-ivory select, .ds-ivory input[type="text"] { padding: 9px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--ivory-card); color: var(--ink); font: inherit; }
.ds-ivory select:focus, .ds-ivory input:focus { outline: none; border-color: var(--gold); }
.ds-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.ds-hint { color: var(--ink-soft); font-size: .85rem; }
.ds-sub { font-family: "Fraunces", serif; font-size: 1.3rem; color: var(--ink); margin: 28px 0 10px; }
.ds-empty { color: var(--ink-soft); padding: 20px 0; }
.ds-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ds-table thead th { text-align: left; font-family: "Manrope", sans-serif; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; padding: 0 12px 12px; border-bottom: 1px solid var(--rule); }
.ds-table tbody td { padding: 16px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ds-table-raw { font-family: "Fraunces", serif; color: var(--ink); }
.ds-table-raw span { display: block; font-family: "Manrope", sans-serif; font-size: .82rem; color: var(--ink-soft); margin-top: 3px; }
.ds-tag-ok { color: #4f7a52; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.ds-tag-warn { color: var(--gold); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
@media (max-width: 700px) { .ds-table thead { display: none; } .ds-table tbody td { display: block; border: 0; padding: 8px 0; } .ds-table tbody tr { border-bottom: 1px solid var(--rule); padding: 12px 0; display: block; } }

/* ============================================================
   DALA SYSTEM — luxury operations shell ("Editorial Ivory").
   Warm ivory canvas, fine-stationery sidebar, Fraunces wordmark,
   muted-gold accent, hairline rules. Overrides the old shell.
   ============================================================ */
:root {
  --ds-canvas: #f4efe3; --ds-paper: #fcf9f2; --ds-paper-2: #f8f3e8;
  --ds-ink: #201c16; --ds-ink-2: #6b6253; --ds-ink-3: #948b79;
  --ds-line: rgba(40,32,22,0.10); --ds-line-2: rgba(40,32,22,0.16);
  --ds-gold: #9c7b3f; --ds-gold-soft: rgba(156,123,63,0.12); --ds-green: #4f7a52;
  --ds-shadow: 0 24px 60px -28px rgba(40,32,22,.30);
}
body.ds-app {
  margin: 0; min-height: 100vh; color: var(--ds-ink);
  font-family: "Manrope", system-ui, sans-serif; font-size: 15px; line-height: 1.55;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(156,123,63,.07), transparent 62%),
    radial-gradient(900px 480px at -6% 8%, rgba(156,123,63,.05), transparent 60%),
    var(--ds-canvas);
  -webkit-font-smoothing: antialiased;
}
.ds-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar (fine stationery) ---- */
.ds-sidebar {
  width: 272px; flex: 0 0 272px; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--ds-paper), var(--ds-paper-2));
  border-right: 1px solid var(--ds-line-2);
}
.ds-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.ds-brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  display: grid; place-items: center; text-decoration: none;
  font-family: "Fraunces", serif; font-weight: 600; font-size: 1.35rem; color: #fff;
  background: linear-gradient(150deg, #b8924d, #8a6d34); box-shadow: 0 6px 16px -6px rgba(138,109,52,.6);
}
.ds-brand-text { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; }
.ds-brand-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.32rem; color: var(--ds-ink); letter-spacing: .01em; }
.ds-brand-sub { font-size: .64rem; text-transform: uppercase; letter-spacing: .26em; color: var(--ds-gold); font-weight: 700; margin-top: 3px; }
.ds-nav-close, .ds-nav-open { display: none; }

.ds-nav { flex: 1; overflow-y: auto; padding: 6px 14px 18px; }
.ds-group {
  display: block; padding: 18px 12px 8px; font-size: .64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .2em; color: var(--ds-ink-3);
}
.ds-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 1px 0; border-radius: 11px;
  color: var(--ds-ink-2); text-decoration: none; font-weight: 500; font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}
.ds-link:hover { background: var(--ds-gold-soft); color: var(--ds-ink); }
.ds-link.is-active { background: var(--ds-paper); color: var(--ds-ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--ds-line); }
.ds-link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ds-gold);
}
.ds-ic { width: 18px; height: 18px; display: inline-flex; flex: 0 0 18px; color: currentColor; opacity: .82; }
.ds-ic svg { width: 100%; height: 100%; }
.ds-link.is-active .ds-ic { color: var(--ds-gold); opacity: 1; }

.ds-foot { padding: 14px 18px 18px; border-top: 1px solid var(--ds-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ds-user { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ds-user-name { font-weight: 600; color: var(--ds-ink); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-user-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--ds-ink-3); }
.ds-signout { background: transparent; border: 1px solid var(--ds-line-2); color: var(--ds-ink-2); padding: 8px 14px; border-radius: 10px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.ds-signout:hover { border-color: var(--ds-gold); color: var(--ds-ink); }

/* ---- Main + topbar ---- */
.ds-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ds-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 clamp(18px, 4vw, 44px);
  background: rgba(252,249,242,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ds-line);
}
.ds-topbar-mark { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.12rem; color: var(--ds-ink); text-decoration: none; letter-spacing: .01em; }
.ds-topbar-right { margin-left: auto; }
.ds-today { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ds-line-2); background: var(--ds-paper); font-size: .82rem; font-weight: 600; color: var(--ds-ink-2); }
.ds-today .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--ds-ink-3); }
.ds-today.is-open { color: var(--ds-green); } .ds-today.is-open .dot { background: var(--ds-green); }
.ds-today.is-wait { color: var(--ds-gold); } .ds-today.is-wait .dot { background: var(--ds-gold); }

.ds-content { padding: clamp(22px, 4vw, 46px); max-width: 1240px; width: 100%; margin: 0 auto; }

.ds-flash-stack { display: grid; gap: 10px; padding: 18px clamp(22px,4vw,46px) 0; max-width: 1240px; margin: 0 auto; width: 100%; }
.ds-flash { padding: 13px 18px; border-radius: 12px; font-weight: 500; border: 1px solid var(--ds-line-2); background: var(--ds-paper); }
.ds-flash--error { background: rgba(154,68,56,.08); color: #8c3a2c; border-color: rgba(154,68,56,.25); }
.ds-flash--success { background: rgba(79,122,82,.1); color: #3c6340; border-color: rgba(79,122,82,.25); }
.ds-flash--warning, .ds-flash--warn { background: rgba(156,123,63,.1); color: #7a5e28; border-color: rgba(156,123,63,.28); }

/* the editorial pages sit flush on the canvas now */
.ds-content > .ds-ivory { border: 1px solid var(--ds-line-2); box-shadow: var(--ds-shadow); }

/* ---- Mobile ---- */
@media (max-width: 900px) {
  .ds-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: var(--ds-shadow);
  }
  .ds-sidebar.is-open { transform: translateX(0); }
  .ds-nav-close { display: inline-flex; margin-left: auto; background: transparent; border: 0; font-size: 1.2rem; color: var(--ds-ink-2); cursor: pointer; }
  .ds-nav-open { display: inline-flex; background: transparent; border: 1px solid var(--ds-line-2); border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--ds-ink); cursor: pointer; }
}
@media (min-width: 901px) { .ds-nav-open { display: none; } }

/* Editorial Ivory — dashboard hero + stats */
.ds-cta { margin-top: 20px; }
.ds-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 22px; margin-top: 10px; }
.ds-stat-n { display: block; font-family: "Fraunces", serif; font-size: 2.3rem; font-weight: 600; color: var(--ink); line-height: 1; }
.ds-stat-l { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .15em; color: var(--ink-soft); margin-top: 8px; }

/* Editorial Ivory — planning (short-stock sharing) */
.ds-plan-item { padding: 22px 0; border-top: 1px solid var(--rule); }
.ds-ivory .ds-plan-item:first-of-type { border-top: 0; }
.ds-plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.ds-plan-name { font-family: "Fraunces", serif; font-size: 1.4rem; font-weight: 600; color: var(--ink); margin: 0; }
.ds-plan-stock { color: var(--ink-soft); font-size: .9rem; }
.ds-plan-stock strong { color: var(--gold); }

/* The "waiting for Finance" lock — full block + wandering emoji */
.ds-lock { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: rgba(28,24,18,.55); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.ds-lock-card { position: relative; z-index: 1; background: #fcf9f2; border: 1px solid rgba(40,32,22,.16);
  border-radius: 26px; padding: clamp(34px, 5vw, 58px); max-width: 540px; width: calc(100% - 40px);
  text-align: center; box-shadow: 0 50px 120px -34px rgba(0,0,0,.6); }
.ds-lock-kicker { text-transform: uppercase; letter-spacing: .28em; font-size: .68rem; font-weight: 700; color: #9c7b3f; }
.ds-lock-msg { font-family: "Fraunces", serif; font-weight: 600; font-size: clamp(1.55rem, 4vw, 2.3rem);
  color: #201c16; margin: 12px 0 14px; line-height: 1.18; min-height: 2.3em; transition: opacity .3s ease; }
.ds-lock-sub { color: #6b6253; line-height: 1.65; margin: 0 auto 24px; max-width: 42ch; }
.ds-lock-out { background: transparent; border: 1px solid rgba(40,32,22,.2); color: #6b6253;
  padding: 9px 20px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.ds-lock-out:hover { border-color: #9c7b3f; color: #201c16; }
.ds-lock-wanderer { position: fixed; left: 40px; top: 40px; font-size: 2.7rem; z-index: 2; pointer-events: none;
  transition: left 2.1s cubic-bezier(.45,0,.25,1), top 2.1s cubic-bezier(.45,0,.25,1), transform .4s ease;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.35)); }

/* ===== Premium "waiting for Finance" lock — doors that open into the app ===== */
.ds-lock { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow: hidden;
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.ds-lock-door { position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 1;
  background: linear-gradient(180deg, #fbf7ee, #efe7d5);
  transition: transform 1.05s cubic-bezier(.76,0,.18,1); }
.ds-lock-door--l { left: 0; box-shadow: inset -1px 0 0 rgba(156,123,63,.4), -30px 0 70px -34px rgba(0,0,0,.5); }
.ds-lock-door--r { right: 0; box-shadow: inset 1px 0 0 rgba(156,123,63,.4), 30px 0 70px -34px rgba(0,0,0,.5); }
.ds-lock.is-opening .ds-lock-door--l { transform: translateX(-101%); }
.ds-lock.is-opening .ds-lock-door--r { transform: translateX(101%); }

.ds-lock-card { position: relative; z-index: 3; background: #fffdf8; border: 1px solid rgba(156,123,63,.22);
  border-radius: 28px; padding: clamp(34px, 5vw, 56px); max-width: 540px; width: calc(100% - 40px);
  text-align: center; box-shadow: 0 50px 130px -36px rgba(40,32,22,.55);
  animation: dsLockIn .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes dsLockIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.ds-lock.is-opening .ds-lock-card { opacity: 0; transform: scale(.94); transition: opacity .5s ease, transform .5s ease; }
.ds-lock-mark { width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 15px; display: grid; place-items: center;
  font-family: "Fraunces", serif; font-weight: 600; font-size: 1.7rem; color: #fff;
  background: linear-gradient(150deg, #b8924d, #8a6d34); box-shadow: 0 10px 24px -10px rgba(138,109,52,.7); }
.ds-lock-kicker { text-transform: uppercase; letter-spacing: .3em; font-size: .66rem; font-weight: 700; color: #9c7b3f; }
.ds-lock-msg { font-family: "Fraunces", serif; font-weight: 600; font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  color: #201c16; margin: 12px 0 14px; line-height: 1.12; min-height: 1.25em; }
.ds-lock-sub { color: #6b6253; line-height: 1.7; margin: 0 auto 22px; max-width: 40ch; }
.ds-lock-ping { display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 999px;
  background: rgba(156,123,63,.1); color: #7a5e28; font-size: .82rem; font-weight: 600; margin-bottom: 24px; }
.ds-lock-ping-dot { width: 8px; height: 8px; border-radius: 99px; background: #9c7b3f; animation: dsPing 1.4s ease-in-out infinite; }
@keyframes dsPing { 0%,100% { box-shadow: 0 0 0 0 rgba(156,123,63,.55); } 50% { box-shadow: 0 0 0 8px rgba(156,123,63,0); } }
.ds-lock-ping.is-ready { background: rgba(79,122,82,.13); color: #3c6340; }
.ds-lock-ping.is-ready .ds-lock-ping-dot { background: #4f7a52; animation: none; }
.ds-lock-actions { display: flex; justify-content: center; }
.ds-lock-out { background: transparent; border: 1px solid rgba(40,32,22,.2); color: #6b6253; padding: 9px 20px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.ds-lock-out:hover { border-color: #9c7b3f; color: #201c16; }
.ds-lock-enter { background: #201c16; color: #fdf9ef; border: 0; padding: 13px 30px; border-radius: 14px; font: inherit; font-weight: 700; letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(40,32,22,.6); animation: dsEnterIn .5s both; }
@keyframes dsEnterIn { from { opacity: 0; transform: scale(.9); } }
.ds-lock-enter:hover { background: #9c7b3f; }
.ds-lock-wanderer { position: fixed; left: 40px; top: 40px; font-size: 2.6rem; z-index: 2; pointer-events: none;
  transition: left 2.05s cubic-bezier(.45,0,.25,1), top 2.05s cubic-bezier(.45,0,.25,1), transform .4s ease;
  filter: drop-shadow(0 7px 14px rgba(0,0,0,.4)); }
.ds-lock.is-opening .ds-lock-wanderer { opacity: 0; transition: opacity .35s ease; }

/* ===== Lock — emoji story, top-right sign out ===== */
.ds-lock-signout { position: fixed; top: 20px; right: 22px; z-index: 5; }
.ds-lock-signout button { background: rgba(255,253,248,.92); border: 1px solid rgba(40,32,22,.18); color: #6b6253; padding: 8px 16px; border-radius: 11px; font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer; box-shadow: 0 8px 20px -12px rgba(0,0,0,.4); }
.ds-lock-signout button:hover { border-color: #9c7b3f; color: #201c16; }
.ds-story { margin: 16px 0 20px; }
.ds-story-emoji { font-size: clamp(3.2rem, 9vw, 4.6rem); line-height: 1; display: inline-block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.18)); }
.ds-story-emoji.pop { animation: dsPop .6s cubic-bezier(.2,1.3,.4,1); }
@keyframes dsPop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.12) rotate(3deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.ds-story-text { font-family: "Fraunces", serif; font-size: clamp(1.15rem, 3vw, 1.5rem); color: #201c16; margin: 16px auto 0; max-width: 26ch; min-height: 2.4em; line-height: 1.3; }
.ds-story-text.slide { animation: dsSlide .5s ease both; }
@keyframes dsSlide { from { opacity: 0; transform: translateY(8px); } }

/* ===== Finance — incoming call + mystery box ===== */
.ds-call { position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center; background: rgba(28,24,18,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s ease; }
/* `display:grid` above overrides the UA `[hidden]{display:none}`, so without this the
   invisible (opacity:0) full-screen overlay still intercepts every click for Finance.
   Keep it truly hidden AND non-interactive until it is actually ringing. */
.ds-call[hidden] { display: none; }
.ds-call:not(.is-on) { pointer-events: none; }
.ds-call.is-on { opacity: 1; pointer-events: auto; }
.ds-call-card, .ds-box-base { background: #fffdf8; border: 1px solid rgba(156,123,63,.22); border-radius: 28px; padding: clamp(30px,4.5vw,50px); max-width: 460px; width: calc(100% - 40px); text-align: center; box-shadow: 0 50px 120px -36px rgba(40,32,22,.55); }
.ds-call-avatar { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 999px; display: grid; place-items: center; font-size: 2.1rem; background: linear-gradient(150deg,#fbf2e0,#f0e3cb); box-shadow: inset 0 0 0 1px rgba(156,123,63,.25); animation: dsShake 1.1s ease-in-out infinite; }
@keyframes dsShake { 0%,100%{ transform: rotate(0);} 20%{transform:rotate(-12deg);} 40%{transform:rotate(10deg);} 60%{transform:rotate(-8deg);} 80%{transform:rotate(6deg);} }
.ds-call-title { font-family: "Fraunces", serif; font-weight: 600; font-size: clamp(1.5rem,3.6vw,2rem); color: #201c16; margin: 8px 0; }
.ds-call-sub { color: #6b6253; line-height: 1.6; margin: 0 auto 22px; max-width: 34ch; }
.ds-call-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ds-call-pick { background: #4f7a52; color: #fff; border: 0; padding: 12px 26px; border-radius: 13px; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 12px 26px -12px rgba(79,122,82,.7); }
.ds-call-pick:hover { filter: brightness(1.08); }
.ds-call-decline { background: transparent; border: 1px solid rgba(40,32,22,.2); color: #6b6253; padding: 12px 22px; border-radius: 13px; font: inherit; font-weight: 600; cursor: pointer; }
.ds-box { position: relative; }
.ds-box-lid { position: absolute; left: 0; right: 0; top: 0; height: 56px; border-radius: 28px 28px 0 0; background: linear-gradient(180deg,#b8924d,#8a6d34); transform-origin: top center; z-index: 2; display: grid; place-items: center; }
.ds-box-spark { color: #fff5dd; font-size: 1.2rem; }
.ds-box.is-open .ds-box-lid { animation: dsLid 1s cubic-bezier(.5,0,.2,1) forwards; }
@keyframes dsLid { 0%{ transform: translateY(0) rotateX(0); } 40%{ transform: translateY(-20px); } 100%{ transform: translateY(-34px) rotateX(-110deg); opacity: 0; } }
.ds-box-base { position: relative; z-index: 1; padding-top: 66px; transform: scale(.92); opacity: 0; }
.ds-box.is-open .ds-box-base { animation: dsBoxIn .6s .35s cubic-bezier(.2,1,.3,1) forwards; }
@keyframes dsBoxIn { to { transform: scale(1); opacity: 1; } }
.ds-box-tasks { display: grid; gap: 12px; margin: 8px 0 18px; }
.ds-box-task { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 15px; border: 1px solid rgba(156,123,63,.25); background: #f8f3e8; color: #201c16; text-decoration: none; font-weight: 600; transition: transform .15s ease, border-color .15s ease; }
.ds-box-task:hover { transform: translateY(-2px); border-color: #9c7b3f; }
.ds-box-task-ic { font-size: 1.4rem; }
.ds-box-close { background: transparent; border: 0; color: #948b79; font: inherit; font-weight: 600; cursor: pointer; }

/* Interactive story emoji + tap burst */
.ds-story-emoji { background: none; border: 0; padding: 6px; cursor: pointer; transition: transform .15s ease; user-select: none; }
.ds-story-emoji:hover { transform: scale(1.06); }
.ds-story-emoji:active { transform: scale(.92); }
.ds-story-hint { display: block; margin-top: 8px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #b3a890; }
.ds-burst { position: fixed; z-index: 10001; font-size: 1.3rem; pointer-events: none; transform: translate(-50%, -50%);
  animation: dsBurst .9s ease-out forwards; }
@keyframes dsBurst { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.6); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); } }

/* Editorial Ivory — load planning line */
.ds-load-line { color: var(--ink-soft); font-size: .92rem; padding-top: 6px; border-top: 1px solid var(--rule); }
.ds-load-line strong { color: var(--ink); }

/* Editorial Ivory — Pack Breaker & Waybill sheets */
.ds-sheet-scroll { overflow-x: auto; margin: 6px 0 4px; }
.ds-pack th, .ds-pack td { white-space: nowrap; text-align: right; }
.ds-pack th:first-child, .ds-pack td:first-child { text-align: left; position: sticky; left: 0; background: var(--ivory); }
.ds-pack-totals td { border-top: 2px solid var(--rule); color: var(--ink); }
.ds-waybill-title { font-family: "Fraunces", serif; font-size: 1.05rem; color: var(--ink); margin: 18px 0 4px; }
.ds-waybill { max-width: 460px; }

/* Item Weights (v26) — admin upload of carton weights for load planning */
.ds-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
.ds-file { font-family: "Manrope", sans-serif; font-size: .92rem; color: var(--ink); padding: 10px 12px;
  background: var(--ivory); border: 1px solid var(--rule); border-radius: 10px; max-width: 360px; }
.ds-file::file-selector-button { font-family: "Manrope", sans-serif; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 7px 12px; margin-right: 12px; cursor: pointer; }
.ds-file::file-selector-button:hover { border-color: var(--gold); color: var(--gold); }
.ds-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ds-list li { padding: 8px 12px; background: var(--ivory); border: 1px solid var(--rule); border-radius: 8px; font-size: .9rem; }

/* Loads — adjust a load / move a store (v27) */
.ds-adjust { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; }
.ds-adjust > summary { cursor: pointer; font-family: "Manrope", sans-serif; font-weight: 600;
  font-size: .9rem; color: var(--gold); list-style: none; }
.ds-adjust > summary::-webkit-details-marker { display: none; }
.ds-adjust > summary::before { content: "＋ "; }
.ds-adjust[open] > summary::before { content: "－ "; }
.ds-adjust-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-top: 14px; }
.ds-field { display: flex; flex-direction: column; gap: 5px; min-width: 170px; }
.ds-field-wide { flex: 1 1 260px; }
.ds-field > span { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.ds-field input, .ds-field select { font-family: "Manrope", sans-serif; font-size: .92rem; color: var(--ink);
  padding: 9px 11px; background: var(--ivory); border: 1px solid var(--rule); border-radius: 9px; }
.ds-field input:focus, .ds-field select:focus { outline: none; border-color: var(--gold); }

/* Login — Editorial Ivory (v28) */
body.ds-login { background: var(--ivory, #f4efe3); color: var(--ink, #201c16);
  font-family: "Manrope", system-ui, sans-serif; min-height: 100vh; }
body.ds-login .login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body.ds-login .login-panel { background: #fbf8f1; border: 1px solid var(--rule, #e4dccb);
  border-radius: 22px; padding: 44px 40px; width: 100%; max-width: 440px;
  box-shadow: 0 30px 80px -40px rgba(32,28,22,.35); }
body.ds-login .login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
body.ds-login .sidebar-mark { display: grid; place-items: center; width: 46px; height: 46px;
  background: var(--gold, #9c7b3f); color: #fff; border-radius: 12px;
  font-family: "Fraunces", serif; font-size: 1.4rem; font-weight: 600; }
body.ds-login .sidebar-kicker { display: block; font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold, #9c7b3f); }
body.ds-login .sidebar-title { font-family: "Fraunces", serif; font-size: 1.55rem; font-weight: 600; color: var(--ink, #201c16); }
body.ds-login .form-stack { display: flex; flex-direction: column; gap: 16px; }
body.ds-login .form-stack label { display: flex; flex-direction: column; gap: 6px;
  font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: #7c7163; }
body.ds-login .form-stack input { font-family: "Manrope", sans-serif; font-size: 1rem; color: var(--ink, #201c16);
  padding: 13px 14px; background: var(--ivory, #f4efe3); border: 1px solid var(--rule, #e4dccb); border-radius: 11px; }
body.ds-login .form-stack input:focus { outline: none; border-color: var(--gold, #9c7b3f); }
body.ds-login .form-stack button { margin-top: 6px; font-family: "Manrope", sans-serif; font-weight: 600;
  font-size: 1rem; color: #fff; background: var(--ink, #201c16); border: none; border-radius: 11px; padding: 14px; cursor: pointer; }
body.ds-login .form-stack button:hover { background: #322c23; }
body.ds-login .flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; font-size: .9rem; }
body.ds-login .flash-error { background: #f7e9e6; color: #8f2d1c; border: 1px solid #e6c3ba; }

/* Load Map (v29) — Leaflet proximity view */
.ds-map { height: 560px; border-radius: 16px; border: 1px solid var(--rule); margin-top: 8px;
  box-shadow: 0 24px 60px -40px rgba(32,28,22,.4); z-index: 0; }
.ds-map-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.ds-map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.ds-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--ink-soft, #5e5446); }
.ds-legend-item i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.ds-pin span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; color: #fff; font: 600 11px/1 "Manrope", sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,.45); }

/* Phase 6/7 — delivery notes, POD, day report (v30) */
.ds-stat-row { display: flex; flex-wrap: wrap; gap: 22px; margin: 6px 0 18px; }
.ds-stat { font-size: .95rem; color: var(--ink-soft, #5e5446); }
.ds-stat b { font-family: "Fraunces", serif; font-size: 1.25rem; color: var(--ink, #201c16); margin-right: 4px; }
.ds-report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 8px; }
.ds-metric { background: #fbf8f1; border: 1px solid var(--rule, #e4dccb); border-radius: 14px;
  padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.ds-metric-n { font-family: "Fraunces", serif; font-size: 1.7rem; line-height: 1; color: var(--ink, #201c16); }
.ds-metric-l { font-size: .76rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft, #7c7163); }
.ds-metric-warn { border-color: #d9b27a; background: #fbf3e6; }
.ds-metric-warn .ds-metric-n { color: #9c6a1f; }

/* Areas — move an LGA to a corridor (v30) */
.ds-area-move { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.ds-area-move select { font-family: "Manrope", sans-serif; font-size: .88rem; padding: 6px 9px;
  background: var(--ivory); border: 1px solid var(--rule); border-radius: 8px; }
.ds-area-move .ds-btn { padding: 6px 12px; font-size: .82rem; }

/* Insights — two-column report layout */
.ds-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

/* --- Admin: System mode toggles --- */
.system-toggle-row { margin: 14px 0; }
.system-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  cursor: pointer;
}
.system-toggle input[type="checkbox"] { width: 20px; height: 20px; margin-top: 3px; cursor: pointer; }
.system-toggle strong { display: block; font-size: 1.02rem; }
.system-toggle small { display: block; margin-top: 4px; color: var(--app-muted, #66777f); line-height: 1.5; }

/* Sales Team row actions side by side */
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-actions form { margin: 0; }

/* Unclear / blurry LPO callout */
.ds-callout { padding: 12px 16px; border-radius: 8px; margin: 12px 0; font-size: .95rem; }
.ds-callout--warn { background: #fff4e5; border: 1px solid #f0b35b; color: #7a4a00; }

/* Rollouts */
.ds-badge { display:inline-block; min-width:18px; padding:0 6px; margin-left:auto; background:#8f000d; color:#fff; border-radius:10px; font-size:.72rem; font-weight:800; text-align:center; line-height:18px; }
.ds-rollout { font-weight:700; }
.rollout-list { display:flex; flex-direction:column; gap:14px; margin-top:8px; }
.rollout-card { display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap; border:1px solid #e3e3e1; border-radius:12px; padding:16px; background:#fff; }
.rollout-info h2 { margin:0 0 4px; font-size:1.1rem; }
.rollout-info p { margin:0; color:#555; font-size:.92rem; max-width:60ch; }

/* Rollouts — how-to guide */
.howto { background:#fbf7ef; border:1px solid #ecdcc0; border-radius:12px; padding:18px 20px; margin-top:6px; }
.howto-kicker { display:block; font-size:.72rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:#8f000d; margin-bottom:8px; }
.howto-steps { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:8px; }
.howto-steps li { font-size:.95rem; line-height:1.45; }
.howto-note { margin:12px 0 0; font-size:.85rem; color:#6b6b6b; }

/* -- Global Search (sidebar) -- */
.ds-search-form { padding: 0 14px 12px; }
.ds-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.04); border: 1px solid var(--ds-line-2);
  border-radius: 8px; padding: 7px 10px; transition: border-color 0.15s, box-shadow 0.15s;
}
.ds-search-wrap:focus-within {
  border-color: #8f000d; box-shadow: 0 0 0 2px rgba(143,0,13,0.15);
  background: var(--ds-paper);
}
.ds-search-icon { color: var(--ds-ink-2); flex-shrink: 0; }
.ds-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.82rem; color: var(--ds-ink); font-family: inherit; font-weight: 500;
}
.ds-search-input::placeholder { color: var(--ds-ink-3); }
