:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #edf4f2;
  --ink: #181f2a;
  --muted: #657386;
  --line: #d9e1e8;
  --line-strong: #c4cfd9;
  --nav: #ffffff;
  --nav-2: #f7f9fb;
  --teal: #0a8f7b;
  --teal-soft: #dff5f0;
  --blue: #2f6df6;
  --blue-soft: #e7efff;
  --orange: #dc7a19;
  --orange-soft: #fff0df;
  --rose: #c53c5c;
  --rose-soft: #fdeaf0;
  --green: #3c8f4d;
  --green-soft: #e7f5e9;
  --violet: #7058d8;
  --violet-soft: #eeeafd;
  --shadow: 0 12px 28px rgba(26, 35, 52, 0.08);
  --shadow-soft: 0 4px 14px rgba(26, 35, 52, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(24, 31, 42, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 31, 42, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--ink);
  font-family:
    "Inter",
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--nav);
  color: var(--ink);
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
}

.brand h1,
.brand p,
.workspace h2,
.panel h3,
.table-toolbar h3,
.dialog-heading h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  font-weight: 800;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.nav-tab {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
}

.nav-tab:hover,
.nav-tab:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  outline: none;
}

.nav-tab.is-active {
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
}

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

.mobile-filter-toggle {
  display: none;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
}

.sidebar .icon-button {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.toggle-row span:last-child {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.workspace .field span,
.entry-dialog .field span {
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.multi-field {
  position: relative;
}

.multi-select-trigger {
  position: relative;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 34px 8px 10px;
  outline: none;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-trigger::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
}

.multi-select-trigger[aria-expanded="true"] {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 143, 123, 0.12);
}

.multi-select-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(10, 24, 39, 0.26);
}

.check-list {
  max-height: 220px;
  overflow: auto;
  padding: 4px;
}

#anchorFilterPanel {
  position: static;
  width: 100%;
  min-width: 0;
}

#anchorFilterOptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
}

#anchorFilterOptions .check-row {
  min-width: 0;
  border-radius: 6px;
  padding: 8px;
}

#anchorFilterPanel .check-row input {
  flex: 0 0 16px;
  min-height: 16px;
}

#anchorFilterOptions .check-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink);
}

.check-row:hover {
  background: #eef5f4;
}

.check-row.is-all {
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.check-row input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  border: 0;
  padding: 0;
  accent-color: var(--teal);
}

.check-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field select option {
  color: var(--ink);
}

.workspace .field input,
.workspace .field select,
.entry-dialog .field input,
.entry-dialog .field select {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.toggle-row:has(input:focus-visible) .toggle-ui {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.toggle-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #dce5ed;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.toggle-row input:checked + .toggle-ui {
  border-color: var(--teal);
  background: var(--teal);
}

.toggle-row input:checked + .toggle-ui::after {
  transform: translateX(18px);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.workspace h2 {
  font-size: 24px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  filter: brightness(0.98);
}

.view {
  display: none;
}

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

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1.25fr) minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.hero-metric,
.selector-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.hero-metric {
  display: grid;
  align-content: center;
  padding: 24px 26px;
  background:
    linear-gradient(135deg, #1b2230 0%, #253245 58%, #204b44 100%);
  color: #ffffff;
}

.hero-kicker {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
}

.hero-value {
  margin-top: 10px;
  font-size: 48px;
  font-weight: 880;
  line-height: 1.04;
  font-variant-numeric: tabular-nums;
}

.hero-meta {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.hero-spark {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: flex;
  align-items: end;
  gap: 5px;
  height: 48px;
  opacity: 0.78;
}

.hero-spark span {
  width: 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
}

.hero-spark span:nth-child(1) {
  height: 15px;
}

.hero-spark span:nth-child(2) {
  height: 23px;
}

.hero-spark span:nth-child(3) {
  height: 18px;
}

.hero-spark span:nth-child(4) {
  height: 34px;
}

.hero-spark span:nth-child(5) {
  height: 42px;
  background: #7ee0cb;
}

.hero-spark span:nth-child(6) {
  height: 25px;
}

.selector-card {
  padding: 20px;
}

.selector-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.selector-heading h3 {
  margin: 0;
  font-size: 17px;
}

.selector-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-chip {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 14px;
  font-weight: 800;
}

.quick-chip:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.quick-chip.is-active {
  border-color: rgba(10, 143, 123, 0.22);
  background: var(--teal-soft);
  color: #075f53;
}

.month-grid .quick-chip.is-active {
  border-color: rgba(47, 109, 246, 0.2);
  background: var(--blue-soft);
  color: #1f56c5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card {
  min-height: 108px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.kpi-card[data-tone="teal"] {
  border-top: 4px solid var(--teal);
}

.kpi-card[data-tone="blue"] {
  border-top: 4px solid var(--blue);
}

.kpi-card[data-tone="orange"] {
  border-top: 4px solid var(--orange);
}

.kpi-card[data-tone="rose"] {
  border-top: 4px solid var(--rose);
}

.kpi-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.kpi-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
}

.kpi-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.dashboard-bottom-metrics {
  margin-top: 14px;
}

.dashboard-bottom-metrics .insight-strip {
  margin-bottom: 0;
}

.insight-item {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.insight-item strong {
  display: block;
  font-size: 14px;
}

.insight-item span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-grid,
.rank-grid,
.config-grid {
  display: grid;
  gap: 12px;
}

.analytics-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.9fr);
  margin-bottom: 14px;
}

.rank-grid {
  grid-template-columns: repeat(4, minmax(240px, 1fr));
}

.monthly-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(440px, 0.8fr);
}

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

.anchor-config-panel {
  order: 0;
}

.standardization-panel {
  order: 1;
}

.quality-panel {
  order: 2;
}

.product-config-panel {
  order: 3;
}

.mechanism-config-panel {
  order: 4;
}

.sales-strategy-config-panel {
  order: 5;
}

.source-config-panel {
  order: 6;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.panel-heading h3,
.table-toolbar h3,
.dialog-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}

.panel-heading span,
.table-toolbar p,
.toolbar-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-heading-actions,
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-heading-actions {
  flex: 0 0 auto;
}

.compact-icon,
.field-add-button {
  min-width: 28px;
  width: 28px;
  height: 28px;
  font-size: 17px;
}

.field-label-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.trend-panel canvas,
.monthly-layout canvas {
  min-height: 300px;
}

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

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

.legend-item {
  display: grid;
  grid-template-columns: 12px minmax(72px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

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

.rank-row {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) minmax(90px, auto);
  gap: 10px;
  align-items: center;
}

.rank-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rank-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf1f4;
}

.rank-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrap.compact {
  max-height: 430px;
  box-shadow: none;
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef5f4;
  color: #17324d;
  font-size: 12px;
  font-weight: 850;
}

.data-table th[data-sort] {
  cursor: pointer;
}

.data-table th[data-sort]::after {
  content: " ↕";
  color: var(--muted);
  font-weight: 600;
}

.data-table th.is-sorted-asc::after {
  content: " ↑";
  color: var(--teal);
}

.data-table th.is-sorted-desc::after {
  content: " ↓";
  color: var(--teal);
}

.data-table tbody tr:hover {
  background: #f7fbfa;
}

.row-action {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.row-action:hover,
.row-action:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--blue-soft);
  color: #1f4fba;
  font-size: 12px;
  font-weight: 800;
}

.pill.channel-public {
  background: var(--teal-soft);
  color: #0b5f59;
}

.pill.channel-private {
  background: var(--orange-soft);
  color: #9a5302;
}

.pill.channel-mixed {
  background: #e8eefc;
  color: #304c99;
}

.pill.channel-pending,
.pill.price-scene.is-pending {
  background: #eef1f4;
  color: #5d6875;
}

.pill.strategy {
  background: var(--rose-soft);
  color: #9e2743;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 4px 10px;
  font-weight: 750;
}

.editable-config-tag {
  gap: 5px;
  padding-right: 4px;
}

.config-edit-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 0;
  border-radius: 5px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.config-edit-button:hover,
.config-edit-button:focus-visible {
  color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

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

.mapping-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.mapping-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mapping-item-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mapping-sku-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapping-sku {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  border-radius: 5px;
  padding: 3px 4px 3px 7px;
  background: #f6f8f7;
  color: var(--muted);
}

.mapping-sku > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-state {
  display: grid;
  gap: 10px;
}

.source-state p {
  margin: 0;
  color: var(--muted);
}

.standardization-state {
  display: grid;
  gap: 12px;
}

.standardization-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.standardization-summary strong {
  font-size: 14px;
}

.standardization-summary span,
.standardization-list > span,
.standardization-list li span {
  color: var(--muted);
  font-size: 12px;
}

.standardization-list {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.standardization-list > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.standardization-list ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.standardization-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
}

.standardization-list li strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standardization-list li span {
  flex: none;
  text-align: right;
  white-space: normal;
}

.standardization-list.review {
  border-top-color: #f0cfad;
}

.quality-state {
  display: grid;
  gap: 14px;
}

.quality-empty {
  display: grid;
  gap: 3px;
}

.quality-empty strong,
.quality-heading strong {
  font-size: 14px;
}

.quality-empty span,
.quality-heading span {
  color: var(--muted);
  font-size: 12px;
}

.quality-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quality-heading > div:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quality-badge {
  flex: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.quality-badge.is-passed {
  border-color: #9ed6c9;
  background: #e7f6f1;
  color: #176b5a;
}

.quality-badge.is-review {
  border-color: #edc783;
  background: #fff4d9;
  color: #815719;
}

.quality-badge.is-attention {
  border-color: #e6a5b6;
  background: #fcebf0;
  color: #9d294b;
}

.quality-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  padding-block: 10px;
}

.quality-counts div {
  display: grid;
  gap: 2px;
  padding-inline: 10px;
  text-align: center;
}

.quality-counts div + div {
  border-left: 1px solid var(--line);
}

.quality-counts strong {
  font-size: 18px;
}

.quality-counts span {
  color: var(--muted);
  font-size: 11px;
}

.quality-checks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quality-check {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.quality-check-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e8d76;
}

.quality-check > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quality-check strong {
  font-size: 12px;
}

.quality-check span,
.quality-check em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.quality-check em {
  text-align: right;
}

.quality-check.is-warning .quality-check-dot {
  background: #d48a1d;
}

.quality-check.is-failed .quality-check-dot {
  background: #c53c5c;
}

.quality-check.is-info .quality-check-dot {
  background: #3178c6;
}

.entry-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(23, 32, 51, 0.28);
}

.entry-dialog::backdrop {
  background: rgba(23, 32, 51, 0.42);
}

.entry-dialog form {
  padding: 18px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.field.wide {
  grid-column: span 2;
}

.dialog-actions {
  justify-content: flex-end;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.upload-layout {
  display: grid;
  gap: 12px;
}

.upload-source-panel {
  max-width: 760px;
}

.upload-drop {
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.upload-drop:hover,
.upload-drop.is-dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.upload-drop strong {
  font-size: 15px;
}

.upload-drop span,
.upload-message {
  color: var(--muted);
  font-size: 12px;
}

.upload-message {
  min-height: 20px;
  margin-top: 9px;
}

.upload-message.is-success {
  color: var(--green);
}

.upload-message.is-error {
  color: var(--rose);
}

.upload-message.is-loading {
  color: var(--blue);
}

.upload-workspace {
  padding: 0;
  overflow: hidden;
}

.upload-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.upload-summary > div {
  display: grid;
  gap: 3px;
  min-height: 74px;
  align-content: center;
  padding: 12px 16px;
}

.upload-summary > div + div {
  border-left: 1px solid var(--line);
}

.upload-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.upload-summary strong {
  font-size: 20px;
}

.upload-summary [data-tone="ready"] strong {
  color: var(--green);
}

.upload-summary [data-tone="review"] strong {
  color: var(--orange);
}

.upload-summary [data-tone="blocked"] strong {
  color: var(--rose);
}

.batch-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.upload-fill-toggle {
  align-self: center;
  white-space: nowrap;
}

.upload-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
}

.upload-table-toolbar > div:first-child {
  display: grid;
  gap: 2px;
}

.upload-table-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.upload-actions,
.upload-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-table-wrap {
  max-height: 560px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.upload-table {
  min-width: 1540px;
}

.upload-table th:first-child,
.upload-table td:first-child {
  width: 42px;
  text-align: center;
}

.upload-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.upload-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-status.is-ready {
  background: var(--green-soft);
  color: var(--green);
}

.upload-status.is-review {
  background: var(--orange-soft);
  color: #94520e;
}

.upload-status.is-blocked {
  background: var(--rose-soft);
  color: var(--rose);
}

.upload-row.is-excluded td {
  opacity: 0.52;
}

.upload-row-dialog {
  width: min(820px, calc(100vw - 28px));
}

@media (max-width: 1280px) {
  .dashboard-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metric {
    grid-column: 1 / -1;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

  .rank-grid,
  .config-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .nav-tab {
    text-align: center;
  }

  .filter-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 340px;
    overflow: auto;
    padding-right: 2px;
  }

  .filter-title {
    grid-column: 1 / -1;
  }

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

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .insight-strip,
  .rank-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }

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

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

  #channelChart {
    max-width: 220px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .kpi-grid,
  .filter-stack,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-value {
    font-size: 36px;
  }

  .hero-metric,
  .selector-card {
    min-height: 148px;
    padding: 18px;
  }

  .quick-chip {
    min-height: 34px;
    padding: 7px 11px;
  }

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

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

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

  .upload-summary > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .upload-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .batch-toolbar {
    grid-template-columns: 1fr;
  }

  .upload-table-toolbar,
  .upload-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Authenticated data workspace */
[hidden] {
  display: none !important;
}

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

textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  letter-spacing: 0;
}

textarea:focus {
  border-color: var(--blue);
  outline: 2px solid var(--blue-soft);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(24, 31, 42, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 31, 42, 0.035) 1px, transparent 1px),
    #eef1f5;
  background-size: 32px 32px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.login-brand h1,
.login-brand p,
.login-heading h2,
.login-heading p {
  margin: 0;
}

.login-brand h1 {
  font-size: 18px;
}

.login-brand p,
.login-heading p {
  margin-top: 3px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: var(--surface-2);
}

.auth-mode-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-mode-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(26, 35, 52, 0.1);
}

.login-heading h2 {
  font-size: 20px;
}

.login-submit {
  width: 100%;
  min-height: 42px;
  justify-content: center;
}

.login-message {
  border: 1px solid #efc8d2;
  border-radius: 6px;
  padding: 9px 11px;
  color: #9b2744;
  background: #fff2f5;
}

.login-message[data-tone="info"] {
  border-color: #bdd0fb;
  color: #254f9e;
  background: #edf3ff;
}

.login-message[data-tone="success"] {
  border-color: #bcd8d0;
  color: #135d50;
  background: #edfaf6;
}

.user-identity {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.user-avatar,
.user-card-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #ffffff;
  background: #181f2a;
  font-weight: 800;
}

.user-copy {
  display: grid;
  min-width: 0;
}

.user-copy strong,
.user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy span {
  color: var(--muted);
  font-size: 12px;
}

.logout-button {
  width: 32px;
  height: 32px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-count {
  color: var(--blue);
  font-weight: 700;
}

.compact-button {
  min-height: 34px;
  padding: 7px 12px;
}

.select-cell {
  width: 40px;
  min-width: 40px;
  text-align: center !important;
}

.select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.action-cell {
  width: 112px;
  min-width: 112px;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -8px 0 14px rgba(24, 31, 42, 0.06);
}

thead .action-cell {
  z-index: 4;
  background: var(--surface-3);
}

.editable-row {
  cursor: pointer;
}

.editable-row:hover .action-cell {
  background: #f5f8fb;
}

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

.row-action.secondary {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface);
}

.entry-drawer {
  width: min(620px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
}

.entry-drawer-form {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: var(--surface);
}

.entry-drawer .dialog-heading {
  flex: 0 0 auto;
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.entry-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 24px;
}

.form-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.form-section-heading strong {
  font-size: 14px;
}

.form-section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.entry-drawer .form-grid {
  margin: 0;
}

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

.form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calculation-preview {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid #c8d8ef;
  border-radius: 6px;
  padding: 12px;
  background: #f3f7fd;
}

.calculation-preview > div {
  display: grid;
  gap: 2px;
}

.calculation-preview span {
  color: var(--muted);
  font-size: 12px;
}

.calculation-preview strong {
  font-size: 17px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.switch-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.manual-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--orange);
}

.compact-section {
  padding-bottom: 14px;
}

.change-reason-section {
  border-bottom: 0;
}

.entry-warning {
  margin-top: 14px;
  border: 1px solid #efc8d2;
  border-radius: 6px;
  padding: 10px 12px;
  color: #9b2744;
  background: #fff2f5;
}

.entry-drawer .dialog-actions {
  flex: 0 0 auto;
  min-height: 68px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.dialog-spacer {
  flex: 1;
}

.danger-button {
  min-height: 36px;
  border: 1px solid #e7b7c3;
  border-radius: 6px;
  padding: 8px 12px;
  color: #a92c4a;
  background: #fff2f5;
  font-weight: 700;
}

.compact-dialog {
  width: min(620px, calc(100vw - 28px));
}

.compact-dialog form {
  padding: 20px;
}

.settings-dialog {
  --teal: #315fae;
  width: min(440px, calc(100vw - 28px));
}

.device-trust-row {
  min-height: 48px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  cursor: pointer;
}

.device-trust-row .toggle-ui {
  flex: 0 0 42px;
}

.device-trust-row > span:last-child {
  color: var(--ink);
  font-size: 14px;
}

.device-trust-row:has(input:disabled) {
  opacity: 0.65;
  cursor: wait;
}

.device-trust-hint,
.device-trust-expiry,
.device-trust-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.device-trust-status {
  min-height: 20px;
  color: #315fae;
}

.device-trust-status.is-error {
  color: #a92c4a;
}

.config-rename-current {
  display: grid;
  gap: 4px;
  margin: 18px 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #f7f9f8;
}

.config-rename-current span,
.config-rename-impact {
  color: var(--muted);
  font-size: 12px;
}

.config-rename-current strong {
  overflow-wrap: anywhere;
}

.config-rename-impact {
  margin: 10px 0 0;
  line-height: 1.6;
}

.config-rename-actions {
  margin-top: 18px;
  flex-wrap: wrap;
}

.product-name-field {
  margin-top: 18px;
}

.product-sku-section {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.product-sku-heading,
.product-sku-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-sku-heading {
  justify-content: space-between;
}

.product-sku-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-sku-rows {
  display: grid;
  gap: 8px;
}

.product-sku-row input {
  min-width: 0;
  flex: 1;
}

.product-sku-remove {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
}

.product-dialog .entry-warning {
  margin: 0 0 16px;
}

.sales-person-actions {
  margin-top: 18px;
}

.batch-summary {
  margin: 14px 0 0;
  color: var(--muted);
}

.history-list,
.history-feed {
  display: grid;
}

.history-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.history-marker {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.history-content,
.history-heading > div {
  display: grid;
  gap: 4px;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-heading span,
.history-heading time,
.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-content p {
  margin: 8px 0;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.history-diff-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  border-left: 2px solid var(--line-strong);
  padding-left: 10px;
}

.history-diff-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.history-diff-row span,
.history-diff-row del {
  color: var(--muted);
}

.history-diff-row del,
.history-diff-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-diff-row i {
  color: var(--line-strong);
  font-style: normal;
  text-align: center;
}

.history-content .row-action {
  justify-self: start;
}

.history-feed {
  border-top: 1px solid var(--line);
}

.history-feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.history-feed-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.history-feed-main strong,
.history-feed-main p,
.history-feed-side strong,
.history-feed-side span {
  display: block;
  margin: 0;
}

.history-feed-main p,
.history-feed-side span {
  color: var(--muted);
  font-size: 12px;
}

.history-feed-side {
  flex: 0 0 auto;
  text-align: right;
}

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

.registration-section {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.section-heading-inline {
  margin-bottom: 10px;
}

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

.section-heading-inline h3 {
  font-size: 15px;
}

.section-heading-inline p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.registration-grid {
  display: grid;
  gap: 8px;
}

.registration-card {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) minmax(150px, 190px) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface);
}

.role-pending {
  color: #8a560d;
  background: var(--orange-soft);
}

.inline-role-field {
  display: grid;
  gap: 4px;
}

.inline-role-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inline-role-field select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--surface-2);
}

.registration-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-empty {
  min-height: 54px;
}

.user-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface);
}

.user-card.is-disabled {
  opacity: 0.58;
}

.user-card-avatar {
  width: 42px;
  height: 42px;
}

.user-card-copy > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-card-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.role-badge {
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
}

.role-admin {
  color: #9b2744;
  background: var(--rose-soft);
}

.role-editor {
  color: #2456b9;
  background: var(--blue-soft);
}

.role-viewer {
  color: #3f6950;
  background: var(--green-soft);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(390px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border: 1px solid #bcd8d0;
  border-radius: 6px;
  padding: 10px 12px;
  color: #135d50;
  background: #edfaf6;
  box-shadow: var(--shadow);
}

.toast.is-error {
  border-color: #efc8d2;
  color: #9b2744;
  background: #fff2f5;
}

.toast.is-warning {
  border-color: #f0d0a4;
  color: #945710;
  background: #fff8ee;
}

.toast button {
  border: 0;
  padding: 4px;
  color: inherit;
  background: transparent;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .calendar-mode .user-identity { grid-template-columns: 34px 32px 32px; }
  .user-copy {
    display: none;
  }

  .user-identity {
    grid-template-columns: 34px 32px;
    min-width: 82px;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }

  .registration-card {
    grid-template-columns: 42px minmax(0, 1fr) minmax(140px, 180px);
  }

  .registration-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 720px) {
  .entry-drawer {
    width: 100vw;
  }

  .form-grid.two-columns,
  .form-grid.three-columns,
  .manual-values,
  .user-grid {
    grid-template-columns: 1fr;
  }

  .registration-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .registration-card .inline-role-field,
  .registration-actions {
    grid-column: 1 / -1;
  }

  .registration-actions > button {
    flex: 1;
  }

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

  .calculation-preview {
    grid-template-columns: 1fr 1fr;
  }

  .calculation-preview .switch-row {
    grid-column: 1 / -1;
  }

  .history-feed-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-feed-side {
    text-align: left;
  }

  .topbar-actions > .ghost-button {
    display: none;
  }
}

/* Visual refresh: presentation and interaction only. */
:root {
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #edf5f1;
  --ink: #17211d;
  --muted: #68766f;
  --line: #dce4e0;
  --line-strong: #c6d1cb;
  --nav: #16211c;
  --nav-2: #1d2b25;
  --teal: #187d69;
  --teal-soft: #e2f3ed;
  --blue: #315fae;
  --blue-soft: #eaf0fb;
  --orange: #b8681b;
  --orange-soft: #fff0df;
  --rose: #b63e5a;
  --rose-soft: #fbe9ee;
  --green: #397d4b;
  --green-soft: #e8f3ea;
  --violet: #6654ad;
  --violet-soft: #eeebf8;
  --shadow: 0 10px 30px rgba(24, 41, 33, 0.07);
  --shadow-soft: 0 3px 12px rgba(24, 41, 33, 0.055);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #ffffff;
  background: var(--teal);
}

button,
input,
select,
textarea {
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(49, 95, 174, 0.2);
  outline-offset: 2px;
}

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

.sidebar {
  z-index: 20;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  background: var(--nav);
  color: #eef5f1;
  border-right: 0;
  padding: 20px 16px;
}

.sidebar::-webkit-scrollbar,
.check-list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.entry-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
}

.check-list::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.entry-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #c7d2cc;
}

.brand {
  min-height: 68px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  padding: 6px 4px 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #d9eee6;
  color: #173f35;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  font-size: 20px;
}

.brand h1 {
  color: #ffffff;
  font-size: 17px;
}

.brand p {
  color: #9eb2a9;
}

.nav-tabs {
  gap: 4px;
  margin: 18px 0 22px;
}

.nav-tab {
  position: relative;
  min-height: 42px;
  border-radius: 6px;
  color: #aebeb7;
  padding: 10px 13px 10px 16px;
  font-weight: 650;
}

.nav-tab::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: transparent;
  transform: translateY(-50%);
}

.nav-tab:hover,
.nav-tab:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-tab.is-active {
  background: #eef7f3;
  color: #143c32;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
}

.nav-tab.is-active::before {
  background: var(--teal);
}

.filter-stack {
  gap: 11px;
}

.filter-title,
.sidebar .field > span,
.sidebar .field-label-row > span {
  color: #9eb2a9;
}

.filter-title {
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
}

.sidebar .field input,
.sidebar .field select,
.sidebar .multi-select-trigger {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #1d2b25;
  color: #eef5f1;
}

.sidebar .field input::placeholder {
  color: #7f938a;
}

.sidebar .field input:hover,
.sidebar .field select:hover,
.sidebar .multi-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: #22332b;
}

.sidebar .field input:focus,
.sidebar .field select:focus,
.sidebar .multi-select-trigger[aria-expanded="true"] {
  border-color: #68b7a3;
  box-shadow: 0 0 0 3px rgba(104, 183, 163, 0.15);
}

.sidebar .multi-select-trigger::after {
  color: #9eb2a9;
}

.sidebar .icon-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #dce9e3;
}

.sidebar .icon-button:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
}

.sidebar select option {
  background: #ffffff;
  color: var(--ink);
}

.multi-select-panel {
  border-color: var(--line);
  box-shadow: 0 18px 46px rgba(16, 31, 25, 0.2);
}

.check-row:hover {
  background: #eef6f2;
}

.workspace {
  padding: 24px 28px 40px;
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  margin: -24px -28px 22px;
  border: 0;
  border-bottom: 1px solid rgba(198, 209, 203, 0.8);
  border-radius: 0;
  background: rgba(242, 245, 243, 0.94);
  padding: 17px 28px;
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 11px;
}

.workspace h2 {
  font-size: 23px;
}

.topbar-actions {
  gap: 9px;
}

.primary-button,
.ghost-button,
.row-action,
.danger-button,
.icon-button {
  font-weight: 750;
}

.primary-button {
  border-color: #176f5f;
  background: var(--teal);
  box-shadow: 0 5px 14px rgba(24, 125, 105, 0.18);
}

.primary-button:hover {
  background: #146f5e;
  filter: none;
  transform: translateY(-1px);
}

.ghost-button:hover,
.icon-button:hover,
.row-action:hover {
  filter: none;
  transform: translateY(-1px);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.row-action:active {
  transform: translateY(0);
}

#exportCsv::before {
  content: "\2193";
  margin-right: 7px;
}

#openEntry::before {
  content: "+";
  margin-right: 7px;
  font-size: 17px;
  line-height: 0;
}

.user-identity {
  border-left-color: var(--line-strong);
}

.user-avatar,
.user-card-avatar {
  background: #20332b;
}

.view.is-active {
  animation: view-arrive 220ms ease-out;
}

@keyframes view-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-hero {
  grid-template-columns: minmax(330px, 1.2fr) minmax(280px, 0.96fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-metric,
.selector-card,
.panel,
.kpi-card,
.insight-item {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-metric,
.selector-card {
  min-height: 190px;
}

.hero-metric {
  border-color: #213d33;
  background: #1a2923;
  padding: 26px 28px;
  box-shadow: 0 12px 32px rgba(20, 38, 30, 0.16);
}

.hero-metric::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #66b7a3;
}

.hero-kicker {
  color: #a9bdb4;
  font-size: 12px;
}

.hero-value {
  margin-top: 11px;
  font-size: 46px;
  font-weight: 800;
}

.hero-meta {
  color: #a9bdb4;
  font-weight: 600;
}

.hero-spark {
  opacity: 0.62;
}

.hero-spark span {
  background: #80978d;
}

.hero-spark span:nth-child(5) {
  background: #77cab5;
}

.selector-card {
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(24, 41, 33, 0.04);
}

.selector-heading {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1ef;
}

.selector-heading h3 {
  font-size: 16px;
}

.quick-chip-grid {
  gap: 8px;
}

.quick-chip {
  min-height: 34px;
  border-color: #edf1ef;
  border-radius: 6px;
  background: #f7f9f8;
  padding: 7px 12px;
  font-weight: 700;
}

.quick-chip:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(24, 41, 33, 0.06);
  transform: translateY(-1px);
}

.quick-chip.is-active {
  border-color: #add5c9;
  background: var(--teal-soft);
  color: #155f50;
}

.month-grid .quick-chip.is-active {
  border-color: #bdccef;
  background: var(--blue-soft);
  color: #274f9d;
}

.analytics-grid,
.rank-grid,
.config-grid {
  gap: 16px;
}

.analytics-grid {
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
  box-shadow: 0 1px 3px rgba(24, 41, 33, 0.04);
}

.panel-heading {
  align-items: center;
  margin-bottom: 16px;
}

.panel-heading h3,
.table-toolbar h3,
.dialog-heading h3 {
  font-size: 15px;
}

.rank-fill {
  background: var(--teal);
}

.rank-bar {
  height: 6px;
  background: #e9efec;
}

.rank-row {
  gap: 8px;
}

.kpi-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  min-height: 116px;
  padding: 16px;
}

.kpi-card[data-tone="teal"] {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--teal), var(--shadow-soft);
}

.kpi-card[data-tone="blue"] {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--blue), var(--shadow-soft);
}

.kpi-card[data-tone="orange"] {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--orange), var(--shadow-soft);
}

.kpi-card[data-tone="rose"] {
  border-top: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--rose), var(--shadow-soft);
}

.kpi-value {
  margin-top: 10px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.insight-strip {
  gap: 12px;
}

.insight-item {
  min-height: 72px;
  display: grid;
  align-content: center;
  padding: 12px 14px;
  box-shadow: none;
}

.table-toolbar {
  border-color: var(--line);
  background: var(--surface);
  padding: 15px 16px;
  box-shadow: 0 1px 3px rgba(24, 41, 33, 0.035);
}

.table-wrap {
  border-color: var(--line);
  box-shadow: 0 4px 18px rgba(24, 41, 33, 0.055);
}

.data-table th,
.data-table td {
  padding: 11px 12px;
}

.data-table th {
  background: #edf3f0;
  color: #354840;
  font-weight: 780;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfcfb;
}

.data-table tbody tr:hover,
.editable-row:hover .action-cell {
  background: #edf7f3;
}

.row-action {
  border-color: #b9cfc6;
  background: #ffffff;
  color: #176b5b;
}

.upload-drop {
  min-height: 150px;
  border-color: #aebeb6;
  background: #f6f9f7;
}

.upload-drop:hover,
.upload-drop.is-dragging {
  border-color: var(--teal);
  background: #edf7f3;
  box-shadow: inset 0 0 0 1px rgba(24, 125, 105, 0.12);
}

.batch-toolbar {
  background: #f4f7f5;
}

.entry-dialog,
.entry-drawer {
  border-color: var(--line);
  box-shadow: -16px 0 50px rgba(20, 36, 29, 0.16);
}

.entry-dialog::backdrop {
  background: rgba(17, 30, 24, 0.48);
  backdrop-filter: blur(2px);
}

.entry-drawer .dialog-heading,
.entry-drawer .dialog-actions {
  background: #fbfcfb;
}

.calculation-preview {
  border-color: #c7d7cf;
  background: #f0f6f3;
}

.history-card,
.history-feed-row {
  transition: background-color 150ms ease;
}

.history-card:hover,
.history-feed-row:hover {
  background: #f5f8f6;
}

.user-card,
.registration-card {
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(24, 41, 33, 0.03);
}

.toast {
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(20, 36, 29, 0.14);
}

.login-screen {
  min-height: 100dvh;
  background: #edf1ef;
  padding: 32px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(410px, 1.18fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: min(880px, 100%);
  min-height: 520px;
  border-color: #d3ddd8;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(22, 41, 32, 0.14);
}

.login-brand {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 100%;
  align-items: flex-start;
  align-content: center;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  overflow: hidden;
  border: 0;
  background: #192821;
  padding: 44px 38px;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 34px;
  width: 92px;
  height: 58px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.login-brand .brand-mark {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  font-size: 28px;
}

.login-brand h1 {
  color: #ffffff;
  font-size: 25px;
}

.login-brand p {
  margin-top: 7px;
  color: #9eb2a9;
  font-size: 13px;
}

.auth-mode-tabs {
  grid-column: 2;
  grid-row: 1;
  margin: 26px 32px 0;
  border-color: var(--line);
  background: #f1f4f2;
}

.auth-mode-tab {
  min-height: 38px;
}

.auth-mode-tab.is-active {
  box-shadow: 0 2px 7px rgba(24, 41, 33, 0.08);
}

.login-form {
  grid-column: 2;
  grid-row: 2;
  align-content: center;
  gap: 18px;
  padding: 32px 42px 48px;
}

.login-heading {
  margin-bottom: 6px;
}

.login-heading h2 {
  font-size: 23px;
}

.login-form .field input {
  min-height: 44px;
  background: #fbfcfb;
}

.login-submit {
  min-height: 44px;
  margin-top: 2px;
}

@media (max-width: 1200px) {
  .dashboard-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metric {
    grid-column: 1 / -1;
  }
}

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

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

  .brand {
    min-height: 58px;
    padding-bottom: 14px;
  }

  .nav-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 12px 0 16px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    width: auto;
    min-width: max-content;
    padding-right: 14px;
    text-align: center;
  }

  .mobile-filter-toggle {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #dce9e3;
    font-weight: 700;
  }

  .mobile-filter-toggle:hover {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.11);
  }

  .mobile-filter-toggle-icon {
    color: #9eb2a9;
    transition: transform 150ms ease;
  }

  .mobile-filter-toggle[aria-expanded="true"] .mobile-filter-toggle-icon {
    transform: rotate(180deg);
  }

  .filter-stack {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 245px;
    gap: 9px;
    margin-top: 10px;
    padding: 1px 5px 4px 1px;
  }

  .filter-stack.is-mobile-open {
    display: grid;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    position: sticky;
    margin: -18px -18px 18px;
    padding: 14px 18px;
  }

  .topbar,
  .table-toolbar {
    align-items: center;
    flex-direction: row;
  }

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

  .hero-metric {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .login-screen {
    align-items: start;
    padding: 18px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
  }

  .login-brand {
    grid-column: 1;
    grid-row: 1;
    min-height: 170px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 28px;
  }

  .login-brand::after {
    right: 24px;
    bottom: 22px;
    width: 64px;
    height: 38px;
  }

  .auth-mode-tabs {
    grid-column: 1;
    grid-row: 2;
    margin: 20px 22px 0;
  }

  .login-form {
    grid-column: 1;
    grid-row: 3;
    padding: 28px 28px 34px;
  }
}

@media (max-width: 640px) {
  .filter-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 12px 14px;
  }

  .topbar,
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .primary-button,
  .topbar-actions .ghost-button {
    flex: 1;
  }

  .user-identity {
    margin-left: auto;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-metric,
  .selector-card {
    min-height: 158px;
  }

  .hero-value {
    font-size: 34px;
  }

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

  .kpi-card {
    min-height: 108px;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 150px;
    padding: 24px;
  }

  .login-brand .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 23px;
  }

  .login-brand h1 {
    font-size: 21px;
  }

  .login-form {
    padding: 24px 22px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Login experience v3: structural redesign with a project-specific visual asset. */
.login-screen {
  min-height: 100dvh;
  place-items: center;
  padding: 32px;
  background: #e7e8e6;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(1220px, 100%);
  height: min(760px, calc(100dvh - 64px));
  min-height: 650px;
  overflow: hidden;
  border: 1px solid #c9cbc8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(19, 20, 19, 0.18);
}

.login-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #090909;
}

.login-visual-media {
  position: absolute;
  inset: 0;
  background-image: url("./assets/login-data-architecture-v2.jpg");
  background-position: center 62%;
  background-size: cover;
  transform: scale(1.01);
  transition: transform 900ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.login-panel:hover .login-visual-media {
  transform: scale(1.025);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.login-visual-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 38px 42px 34px;
  color: #ffffff;
}

.login-visual .login-brand {
  position: static;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  gap: 12px;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
}

.login-visual .login-brand::after {
  display: none;
}

.login-visual .login-brand .brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-color: rgba(255, 255, 255, 0.58);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.36);
  color: #ffffff;
  box-shadow: none;
  font-size: 20px;
}

.login-brand strong,
.login-brand span {
  display: block;
  letter-spacing: 0;
}

.login-brand strong {
  font-size: 12px;
  font-weight: 760;
}

.login-brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.login-visual-title {
  margin-top: auto;
  margin-bottom: 62px;
}

.login-visual-title p,
.login-visual-title h1 {
  margin: 0;
}

.login-visual-title p {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 650;
}

.login-visual-title h1 {
  max-width: 520px;
  color: #ffffff;
  font-size: 48px;
  font-weight: 720;
  line-height: 1.12;
}

.login-visual-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 700;
}

.login-visual-meta::before {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.24);
}

.login-access {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: auto;
  background: #ffffff;
}

.login-access .auth-mode-tabs {
  grid-column: auto;
  grid-row: auto;
  gap: 0;
  margin: 32px 42px 0;
  border: 0;
  border-bottom: 1px solid #dcdddb;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.login-access .auth-mode-tab {
  position: relative;
  min-height: 44px;
  border-radius: 0;
  background: transparent;
  color: #818581;
  box-shadow: none;
  font-size: 13px;
  font-weight: 680;
}

.login-access .auth-mode-tab::after {
  content: "";
  position: absolute;
  right: 22%;
  bottom: -1px;
  left: 22%;
  height: 2px;
  background: transparent;
  transform: scaleX(0);
  transition: transform 180ms ease, background-color 180ms ease;
}

.login-access .auth-mode-tab:hover {
  color: #111311;
}

.login-access .auth-mode-tab.is-active {
  color: #111311;
  background: transparent;
  box-shadow: none;
}

.login-access .auth-mode-tab.is-active::after {
  background: #315fae;
  transform: scaleX(1);
}

.login-access .login-form {
  grid-column: auto;
  grid-row: auto;
  width: min(100%, 440px);
  margin: auto;
  align-content: center;
  gap: 18px;
  padding: 38px 36px 42px;
  animation: auth-form-arrive 260ms ease-out;
}

.login-panel.is-register-mode .login-form {
  gap: 13px;
  padding-top: 24px;
  padding-bottom: 24px;
}

@keyframes auth-form-arrive {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-heading {
  margin-bottom: 10px;
}

.login-step {
  display: block;
  margin-bottom: 18px;
  color: #315fae;
  font-size: 9px;
  font-weight: 800;
}

.login-heading h2 {
  color: #101210;
  font-size: 32px;
  font-weight: 720;
  line-height: 1.18;
}

.login-heading p {
  margin-top: 8px;
  color: #777d78;
  font-size: 13px;
}

.login-form .field {
  gap: 8px;
}

.login-form .field > span:first-child {
  color: #555b56;
  font-size: 11px;
  font-weight: 700;
}

.login-form .field input {
  min-height: 50px;
  border: 1px solid #cfd2cf;
  border-radius: 6px;
  background: #fafbfa;
  color: #101210;
  padding: 11px 13px;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.025);
}

.login-form .field input:hover {
  border-color: #9da29e;
  background: #ffffff;
}

.login-form .field input:focus {
  border-color: #171917;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(49, 95, 174, 0.14);
  outline: none;
}

.password-control {
  position: relative;
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.login-form .password-control input {
  width: 100%;
  padding-right: 64px;
}

.password-control button {
  position: absolute;
  top: 50%;
  right: 9px;
  min-width: 44px;
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #737873;
  font-size: 11px;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-control button:hover,
.password-control button:focus-visible {
  background: #eceeec;
  color: #111311;
}

.login-access .login-submit {
  position: relative;
  min-height: 50px;
  margin-top: 4px;
  border-color: #101210;
  border-radius: 6px;
  background: #101210;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(14, 15, 14, 0.16);
  font-weight: 720;
}

.login-access .login-submit::after {
  content: "\2192";
  position: absolute;
  right: 16px;
  font-size: 16px;
  font-weight: 500;
}

.login-access .login-submit:hover {
  border-color: #282b28;
  background: #282b28;
  box-shadow: 0 11px 28px rgba(14, 15, 14, 0.2);
  transform: translateY(-1px);
}

.login-access .login-submit:disabled {
  transform: none;
}

.login-access .login-message {
  border: 0;
  border-left: 2px solid #b63e5a;
  border-radius: 0;
  padding: 9px 11px;
  background: #fbf2f4;
}

.login-access .login-message[data-tone="info"] {
  border-color: #315fae;
  background: #f0f3f9;
}

.login-access .login-message[data-tone="success"] {
  border-color: #397d4b;
  background: #eff6f0;
}

.login-access-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 42px;
  border-top: 1px solid #e2e3e1;
  padding: 18px 0 22px;
  color: #9a9e9a;
  font-size: 8px;
  font-weight: 760;
}

@media (max-width: 980px) {
  .login-panel {
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  }

  .login-visual-content {
    padding: 32px;
  }

  .login-visual-title h1 {
    font-size: 39px;
  }
}

@media (max-width: 760px) {
  .login-screen {
    display: block;
    min-height: 100dvh;
    padding: 0;
    background: #ffffff;
  }

  .login-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 260px auto;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-visual {
    min-height: 260px;
  }

  .login-visual-media {
    background-position: center 68%;
  }

  .login-visual-content {
    min-height: 260px;
    padding: 24px;
  }

  .login-visual-title {
    margin-top: auto;
    margin-bottom: 0;
  }

  .login-visual-title p {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .login-visual-title h1 {
    font-size: 31px;
  }

  .login-visual-meta {
    display: none;
  }

  .login-access {
    display: block;
    overflow: visible;
  }

  .login-access .auth-mode-tabs {
    margin: 20px 22px 0;
  }

  .login-access .login-form,
  .login-panel.is-register-mode .login-form {
    width: 100%;
    margin: 0;
    padding: 32px 24px 40px;
  }

  .login-heading h2 {
    font-size: 28px;
  }

  .login-access-footer {
    margin: 0 24px;
  }
}

@media (max-width: 420px) {
  .login-panel {
    grid-template-rows: 230px auto;
  }

  .login-visual,
  .login-visual-content {
    min-height: 230px;
  }

  .login-visual-content {
    padding: 20px;
  }

  .login-visual .login-brand .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 18px;
  }

  .login-visual-title h1 {
    font-size: 28px;
  }
}

/* Internal workspace v4: neutral executive interface with cobalt interaction states. */
#appShell {
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --surface-3: #eef1f5;
  --ink: #17191c;
  --muted: #6d7278;
  --line: #dfe2e5;
  --line-strong: #c9cdd2;
  --nav: #151617;
  --nav-2: #1c1d1f;
  --teal: #315fae;
  --teal-soft: #eaf0fa;
  --blue: #315fae;
  --blue-soft: #eaf0fa;
  --shadow: 0 10px 28px rgba(18, 20, 23, 0.065);
  --shadow-soft: 0 2px 9px rgba(18, 20, 23, 0.045);
  grid-template-columns: 248px minmax(0, 1fr);
  background: #f2f3f4;
  transition: grid-template-columns 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

#appShell.is-sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

#appShell .sidebar {
  scrollbar-color: #3b3d40 transparent;
  background: #151617;
  color: #f1f2f3;
  border-right: 1px solid #292b2e;
  padding: 18px 14px;
  transition: padding 220ms ease;
}

#appShell .brand {
  min-height: 70px;
  gap: 10px;
  border-bottom-color: #2b2d30;
  padding: 5px 2px 18px;
  transition: min-height 220ms ease, padding 220ms ease;
}

#appShell .brand-mark {
  border-color: #e5e7e8;
  background: #f2f3f3;
  color: #161719;
  box-shadow: none;
}

#appShell .brand-copy {
  min-width: 0;
}

#appShell .brand h1 {
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell .brand p {
  overflow: hidden;
  color: #898e94;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell .sidebar-toggle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin-left: auto;
  border-color: #34363a;
  background: #202225;
  color: #c8cbd0;
  font-size: 14px;
}

#appShell .sidebar-toggle:hover {
  border-color: #5d6268;
  background: #292b2f;
  color: #ffffff;
}

#appShell .nav-tabs {
  gap: 4px;
  margin: 16px 0 22px;
}

#appShell .nav-tab {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 12px;
  color: #a7abb0;
  font-weight: 650;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

#appShell .nav-tab::before {
  left: 2px;
  height: 14px;
  background: transparent;
}

#appShell .nav-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #7d8288;
  font-size: 16px;
  line-height: 1;
  transition: color 150ms ease, transform 150ms ease;
}

#appShell .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell .nav-tab:hover,
#appShell .nav-tab:focus-visible {
  border-color: transparent;
  background: #232528;
  color: #ffffff;
  transform: translateX(2px);
}

#appShell .nav-tab:hover .nav-icon {
  color: #c8d7f2;
  transform: scale(1.06);
}

#appShell .nav-tab.is-active {
  background: #f3f4f5;
  color: #161719;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
}

#appShell .nav-tab.is-active::before {
  background: #315fae;
}

#appShell .nav-tab.is-active .nav-icon {
  color: #315fae;
}

#appShell .filter-title,
#appShell .sidebar .field > span,
#appShell .sidebar .field-label-row > span {
  color: #888d93;
}

#appShell .filter-title {
  text-transform: none;
}

#appShell .sidebar .field input,
#appShell .sidebar .field select,
#appShell .sidebar .multi-select-trigger {
  border-color: #34363a;
  background: #1c1d1f;
  color: #f0f1f2;
}

#appShell .sidebar .field input:hover,
#appShell .sidebar .field select:hover,
#appShell .sidebar .multi-select-trigger:hover {
  border-color: #505359;
  background: #222427;
}

#appShell .sidebar .field input:focus,
#appShell .sidebar .field select:focus,
#appShell .sidebar .multi-select-trigger[aria-expanded="true"] {
  border-color: #6f91cb;
  box-shadow: 0 0 0 3px rgba(49, 95, 174, 0.22);
}

#appShell .sidebar .icon-button:not(.sidebar-toggle) {
  border-color: #34363a;
  background: #202225;
  color: #d6d8db;
}

#appShell .sidebar .icon-button:not(.sidebar-toggle):hover {
  border-color: #565a60;
  background: #292b2f;
}

#appShell.is-sidebar-collapsed .sidebar {
  padding-right: 10px;
  padding-left: 10px;
}

#appShell.is-sidebar-collapsed .brand {
  min-height: 106px;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 14px;
}

#appShell.is-sidebar-collapsed .brand-copy,
#appShell.is-sidebar-collapsed .filter-stack,
#appShell.is-sidebar-collapsed .mobile-filter-toggle,
#appShell.is-sidebar-collapsed .nav-label {
  display: none;
}

#appShell.is-sidebar-collapsed .sidebar-toggle {
  margin-left: 0;
}

#appShell.is-sidebar-collapsed .nav-tabs {
  margin-top: 14px;
}

#appShell.is-sidebar-collapsed .nav-tab {
  grid-template-columns: 1fr;
  min-height: 44px;
  place-items: center;
  padding: 8px;
}

#appShell.is-sidebar-collapsed .nav-tab:hover {
  transform: translateY(-1px);
}

#appShell.is-sidebar-collapsed .nav-icon {
  font-size: 18px;
}

#appShell .workspace {
  background: #f2f3f4;
}

#appShell .topbar {
  border-bottom-color: #dadddf;
  background: rgba(242, 243, 244, 0.94);
}

#appShell .eyebrow {
  color: #315fae;
}

#appShell .workspace h2 {
  color: #161719;
  font-size: 25px;
}

#appShell .primary-button {
  border-color: #17191c;
  background: #17191c;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(18, 20, 23, 0.16);
}

#appShell .primary-button:hover {
  border-color: #2b2e32;
  background: #2b2e32;
  box-shadow: 0 8px 20px rgba(18, 20, 23, 0.2);
}

#appShell .ghost-button,
#appShell .icon-button {
  border-color: #cfd3d7;
  background: #ffffff;
}

#appShell .ghost-button:hover,
#appShell .topbar .icon-button:hover {
  border-color: #9da3aa;
  background: #f8f9fa;
}

#appShell .user-avatar,
#appShell .user-card-avatar {
  background: #1b1d20;
}

#appShell .hero-metric {
  border-color: #232529;
  background: #181a1d;
  box-shadow: 0 12px 30px rgba(16, 18, 21, 0.16);
}

#appShell .hero-metric::before {
  background: #315fae;
}

#appShell .hero-kicker,
#appShell .hero-meta {
  color: #aeb2b7;
}

#appShell .hero-spark span {
  background: #747980;
}

#appShell .hero-spark span:nth-child(5) {
  background: #6f91cb;
}

#appShell .selector-card,
#appShell .panel,
#appShell .kpi-card,
#appShell .insight-item {
  border-color: #dfe2e5;
  background: #ffffff;
}

#appShell .selector-card,
#appShell .kpi-card,
#appShell .rank-grid .panel {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#appShell .selector-card:hover,
#appShell .kpi-card:hover,
#appShell .rank-grid .panel:hover {
  border-color: #c8cdd2;
  box-shadow: 0 9px 24px rgba(18, 20, 23, 0.085);
  transform: translateY(-2px);
}

#appShell .selector-heading {
  border-bottom-color: #eceef0;
}

#appShell .quick-chip {
  border-color: #e6e8ea;
  background: #f6f7f8;
}

#appShell .quick-chip:hover {
  border-color: #b9bec4;
  background: #ffffff;
}

#appShell .quick-chip.is-active {
  border-color: #202225;
  background: #202225;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(18, 20, 23, 0.13);
}

#appShell .month-grid .quick-chip.is-active {
  border-color: #aebfe0;
  background: #eaf0fa;
  color: #294f91;
  box-shadow: none;
}

#appShell .panel-heading h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: #315fae;
  vertical-align: -2px;
}

#appShell .rank-bar {
  background: #e7e9ec;
}

#appShell .rank-fill {
  background: #315fae;
}

#appShell .rank-grid .panel:nth-child(1) .rank-fill {
  background: #24272b;
}

#appShell .rank-grid .panel:nth-child(2) .rank-fill {
  background: #315fae;
}

#appShell .rank-grid .panel:nth-child(3) .rank-fill {
  background: #ad7929;
}

#appShell .rank-grid .panel:nth-child(4) .rank-fill {
  background: #667080;
}

#appShell .kpi-card[data-tone="teal"] {
  box-shadow: inset 0 3px 0 #24272b, var(--shadow-soft);
}

#appShell .kpi-card[data-tone="blue"] {
  box-shadow: inset 0 3px 0 #315fae, var(--shadow-soft);
}

#appShell .kpi-card[data-tone="orange"] {
  box-shadow: inset 0 3px 0 #ad7929, var(--shadow-soft);
}

#appShell .kpi-card[data-tone="rose"] {
  box-shadow: inset 0 3px 0 #b44e63, var(--shadow-soft);
}

#appShell .table-toolbar,
#appShell .table-wrap {
  border-color: #dfe2e5;
}

#appShell .data-table th {
  background: #eceef0;
  color: #34383d;
}

#appShell .data-table tbody tr:nth-child(even) {
  background: #fafafa;
}

#appShell .data-table tbody tr:hover,
#appShell .editable-row:hover .action-cell {
  background: #edf2fa;
}

#appShell .row-action {
  border-color: #c8cdd2;
  color: #31568f;
}

#appShell .row-action:hover,
#appShell .row-action:focus-visible {
  border-color: #6f91cb;
  background: #edf2fa;
}

#appShell .pill.channel-public {
  background: #eaf0fa;
  color: #31568f;
}

#appShell .pill.channel-private {
  background: #fff0df;
  color: #8d591d;
}

#appShell .pill.channel-mixed {
  background: #eceef3;
  color: #50586a;
}

#appShell .upload-drop:hover,
#appShell .upload-drop.is-dragging {
  border-color: #315fae;
  background: #edf2fa;
  box-shadow: inset 0 0 0 1px rgba(49, 95, 174, 0.12);
}

#appShell .mobile-filter-toggle {
  border-color: #34363a;
  background: #202225;
  color: #e0e2e4;
}

#appShell .mobile-filter-toggle:hover {
  border-color: #55595f;
  background: #292b2f;
}

#appShell .mobile-filter-toggle-icon {
  color: #a2a6ab;
}

#appShell .dashboard-hero > *,
#appShell .analytics-grid > *,
#appShell .rank-grid > * {
  animation: workspace-item-arrive 260ms ease-out both;
}

#appShell .dashboard-hero > :nth-child(2),
#appShell .analytics-grid > :nth-child(2),
#appShell .rank-grid > :nth-child(2) {
  animation-delay: 35ms;
}

#appShell .dashboard-hero > :nth-child(3),
#appShell .rank-grid > :nth-child(3) {
  animation-delay: 70ms;
}

#appShell .rank-grid > :nth-child(4) {
  animation-delay: 105ms;
}

@keyframes workspace-item-arrive {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  #appShell,
  #appShell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  #filterStack .multi-field:has(#anchorFilterTrigger) {
    grid-column: 1 / -1;
  }

  #appShell.is-sidebar-collapsed .sidebar {
    padding: 14px 16px 16px;
  }

  #appShell.is-sidebar-collapsed .brand {
    min-height: 58px;
    flex-direction: row;
    justify-content: flex-start;
    padding-bottom: 14px;
  }

  #appShell.is-sidebar-collapsed .brand-copy,
  #appShell.is-sidebar-collapsed .nav-label {
    display: block;
  }

  #appShell .sidebar-toggle {
    display: none;
  }

  #appShell.is-sidebar-collapsed .nav-tabs {
    margin: 12px 0 16px;
  }

  #appShell.is-sidebar-collapsed .nav-tab,
  #appShell .nav-tab {
    display: grid;
    width: auto;
    min-width: max-content;
    grid-template-columns: 20px auto;
    gap: 7px;
    padding: 9px 12px;
  }

  #appShell.is-sidebar-collapsed .filter-stack.is-mobile-open {
    display: grid;
  }

  #appShell.is-sidebar-collapsed .mobile-filter-toggle {
    display: flex;
  }
}
.detail-group-note {
  margin: 4px 0 0;
  color: #667487;
  font-size: 12px;
}

#appShell .data-table tbody tr.detail-group-row {
  background: #edf3fa;
  font-weight: 600;
}

#appShell .data-table tbody tr.detail-group-child {
  background: #f8fafc;
}

.detail-group-toggle {
  border: 0;
  padding: 5px 2px;
  color: #315fae;
  background: transparent;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.detail-group-toggle:focus-visible {
  outline: 2px solid #315fae;
  outline-offset: 2px;
}

/* Give both selectors the full available row, with more room for month labels. */
#appShell .dashboard-hero {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

#appShell .dashboard-hero .hero-metric {
  grid-column: 1 / -1;
}

#appShell .dashboard-hero .selector-card {
  min-width: 0;
  min-height: 0;
  align-self: start;
}

@media (max-width: 760px) {
  #appShell .dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}
.product-search-results {
  display: grid;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(20, 30, 45, 0.1);
}

.product-search-results[hidden] {
  display: none;
}

.product-search-result {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #17202d;
  text-align: left;
  cursor: pointer;
}

.product-search-result:hover,
.product-search-result:focus-visible {
  background: #eaf1fb;
  outline: none;
}

.product-search-empty {
  padding: 10px 12px;
  color: #667487;
  font-size: 13px;
}
.product-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.product-search-controls input,
.product-search-controls select {
  width: 100%;
  min-width: 0;
}

.product-search-controls .product-search-results {
  grid-column: 1 / -1;
}
#calendarView {
  --cal-ink: #202328;
  --cal-muted: #636a74;
  --cal-line: #e1e4e8;
  --cal-paper: #ffffff;
  --cal-accent: #315fae;
  --cal-soft: #f5f6f8;
  color: var(--cal-ink);
  font-variant-numeric: tabular-nums;
}
.calendar-mode #filterStack, .calendar-mode #mobileFilterToggle { display: none; }
.sales-calendar-toolbar { display: flex; gap: 12px; padding-bottom: 24px; }
.sales-calendar-toolbar .field { margin: 0; min-width: 0; width: 130px; }
.sales-calendar-toolbar .field:first-child { width: 210px; }
.calendar-report-summary { display: grid; grid-template-columns: minmax(220px, 1.5fr) .65fr .65fr minmax(150px, 1fr); align-items: center; padding: 24px 0 28px; border-top: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); margin-bottom: 28px; }
.sales-calendar-total, .calendar-report-stat, .calendar-report-context { display: grid; gap: 8px; min-width: 0; }
.sales-calendar-total > span, .calendar-report-stat > span { font-size: 12px; color: var(--cal-muted); }
.sales-calendar-total strong { font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-size: 32px; font-weight: 600; line-height: 1.15; }
.sales-calendar-total small { font-size: 11px; color: var(--cal-muted); }
.calendar-report-stat { padding-left: 24px; border-left: 1px solid var(--cal-line); }
.calendar-report-stat strong { font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-size: 28px; font-weight: 500; }
.calendar-report-stat small { margin-left: 6px; font-family: inherit; color: var(--cal-muted); font-size: 12px; font-weight: 400; }
.calendar-report-context { justify-items: end; text-align: right; }
.calendar-report-context strong { font-size: 14px; }
.calendar-report-context span { color: var(--cal-muted); font-size: 11px; }
.sales-calendar-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); gap: 32px; align-items: start; }
.sales-calendar-main, .sales-calendar-list { min-width: 0; }
.sales-calendar-heading, .sales-calendar-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 58px; margin-bottom: 16px; }
.sales-calendar-heading h3 { margin: 0; font-size: 24px; font-weight: 650; }
.sales-calendar-heading p { margin: 4px 0 0; color: var(--cal-muted); font-size: 11px; }
.calendar-month-nav { display: flex; gap: 6px; }
.calendar-month-nav button { width: 36px; height: 36px; box-shadow: none; background: var(--cal-paper); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: var(--cal-muted); font-size: 11px; text-align: right; padding: 0 0 10px; }
.calendar-weekdays span { padding-right: 12px; }
.calendar-weekdays span:nth-last-child(-n+2) { color: #946839; }
.calendar-grid { gap: 1px; background: var(--cal-line); border: 1px solid var(--cal-line); }
.calendar-day, .calendar-day-placeholder { min-width: 0; height: 112px; background: var(--cal-paper); }
.calendar-day-placeholder { background: var(--cal-soft); }
.calendar-day { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 7px; border: 0; padding: 10px; text-align: left; color: var(--cal-muted); cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.calendar-day-top { display: flex; justify-content: space-between; align-items: center; }
.calendar-day-number { font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 500; }
.calendar-day-dot { width: 4px; height: 4px; border-radius: 50%; background: #be8542; }
.calendar-day.has-sales { color: var(--cal-ink); }
.calendar-day:hover { background: #edf1f6; }
.calendar-day:focus-visible { outline: 2px solid var(--cal-accent); outline-offset: -3px; z-index: 1; }
.calendar-day.is-selected { background: var(--cal-ink); color: #fff; }
.calendar-day-total { font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-size: 13px; white-space: nowrap; font-weight: 600; }
.calendar-day-products { min-width: 0; color: var(--cal-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-day.is-selected .calendar-day-products { color: #d0d3da; }
.calendar-day-meter { position: absolute; bottom: 10px; left: 10px; right: 10px; height: 2px; background: #edf0f4; }
.calendar-day-meter i { display: block; height: 100%; background: var(--cal-accent); }
.calendar-day.is-selected .calendar-day-meter { background: #444952; }
.calendar-day.is-selected .calendar-day-meter i { background: #a7bde5; }
.sales-calendar-list { padding-left: 26px; border-left: 1px solid var(--cal-line); }
.sales-calendar-list-heading h3 { margin: 0 0 5px; font-size: 16px; }
.sales-calendar-list-heading span { color: var(--cal-muted); font-size: 11px; }
.calendar-all-button { min-width: 48px; min-height: 36px; border: 1px solid #ced3db; border-radius: 5px; background: #fff; color: var(--cal-ink); cursor: pointer; }
.calendar-all-button:disabled { color: var(--cal-muted); background: var(--cal-soft); cursor: default; }
.calendar-all-button:focus-visible { outline: 2px solid var(--cal-accent); outline-offset: 2px; }
#calendarList { max-height: 610px; overflow-y: auto; scrollbar-width: thin; padding-right: 10px; }
.calendar-list-date { padding: 16px 0 20px; border-top: 1px solid var(--cal-line); }
.calendar-list-date-heading, .calendar-list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-list-date-heading { margin-bottom: 4px; }
.calendar-list-date-heading button { display: flex; align-items: baseline; gap: 5px; border: 0; padding: 0; min-width: 44px; min-height: 40px; background: transparent; color: var(--cal-ink); font-family: "Avenir Next", sans-serif; font-size: 25px; font-weight: 500; cursor: pointer; }
.calendar-list-date-heading button:focus-visible { outline: 2px solid var(--cal-accent); }
.calendar-list-date-heading small { color: var(--cal-muted); font-size: 11px; }
.calendar-list-date-heading > span { color: var(--cal-muted); font-size: 12px; }
.calendar-list-item { padding: 10px 0; font-size: 13px; align-items: baseline; }
.calendar-list-item div { min-width: 0; display: grid; gap: 5px; }
.calendar-list-item strong { font-weight: 550; overflow-wrap: anywhere; }
.calendar-list-item small { font-size: 10px; color: var(--cal-muted); }
.calendar-list-item b { white-space: nowrap; font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 600; }
.calendar-empty { padding: 52px 12px; text-align: center; color: var(--cal-muted); font-size: 13px; }
@media (max-width: 1100px) {
  .calendar-report-context { display: none; }
  .calendar-report-summary { grid-template-columns: minmax(200px, 1.5fr) .7fr .7fr; }
  .sales-calendar-layout { gap: 20px; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); }
  .calendar-day { padding: 7px; }
  .calendar-day-total { font-size: 11px; }
  .sales-calendar-list { padding-left: 18px; }
}
@media (max-width: 800px) {
  .sales-calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .sales-calendar-list { padding-left: 0; border-left: 0; border-top: 1px solid var(--cal-line); }
  #calendarList { max-height: none; padding-right: 0; }
}
@media (max-width: 600px) {
  .calendar-mode .topbar { flex-direction: row; align-items: center; }
  .calendar-mode .topbar-actions { width: auto; margin-left: auto; }
  .sales-calendar-toolbar { gap: 8px; padding-bottom: 18px; }
  .sales-calendar-toolbar .field { flex: 1; width: auto; }
  .sales-calendar-toolbar .field:first-child { flex: 1.4; width: auto; }
  .sales-calendar-toolbar select { padding-left: 8px; padding-right: 22px; font-size: 13px; }
  .calendar-report-summary { grid-template-columns: minmax(0, 1.6fr) .65fr .65fr; padding: 20px 0; margin-bottom: 16px; }
  .sales-calendar-total strong { font-size: 23px; }
  .sales-calendar-total small { font-size: 9px; }
  .calendar-report-stat { padding-left: 10px; }
  .calendar-report-stat strong { font-size: 23px; }
  .calendar-report-stat small { margin-left: 3px; font-size: 10px; }
  .calendar-day, .calendar-day-placeholder { height: 76px; }
  .calendar-day { padding: 6px 4px; gap: 8px; }
  .calendar-day-number { font-size: 12px; }
  .calendar-day-total { font-size: 9px; }
  .calendar-day-products { display: none; }
  .calendar-day-meter { left: 4px; right: 4px; bottom: 8px; }
  .calendar-weekdays span { padding-right: 7px; }
  .sales-calendar-heading h3 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .calendar-day { transition: none; } }
.config-category-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.category-dialog { width: min(800px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); }
.category-dialog-body { padding: 22px; }
.category-dialog .dialog-heading { margin-bottom: 20px; align-items: flex-start; }
.category-dialog h3 { margin: 0 0 6px; font-size: 19px; }
.category-dialog #categoryMeta { font-size: 12px; color: #626b78; }
.category-dialog .category-products { max-height: min(400px, 50dvh); }
.rhythm-scope { margin: -8px 0 16px; color: #626b78; font-size: 11px; }
.category-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.category-toolbar input, .category-toolbar select { width: auto; min-width: 120px; }
.category-toolbar input, .category-toolbar select { min-height: 40px; padding: 8px 10px; border: 1px solid #d0d5dc; border-radius: 6px; background: #fff; color: #202328; font: inherit; font-size: 13px; }
.category-toolbar input:focus-visible, .category-toolbar select:focus-visible { outline: 2px solid #315fae; outline-offset: 1px; }
.category-toolbar input { flex: 1; }
#categoryStatus { min-height: 18px; margin: 10px 0; font-size: 12px; color: #315fae; }
.category-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 260px; overflow-y: auto; border-top: 1px solid #e1e4e8; }
.category-product { display: flex; gap: 9px; align-items: center; min-width: 0; min-height: 44px; padding: 8px 12px 8px 0; border-bottom: 1px solid #e1e4e8; cursor: pointer; }
.category-product input { width: 16px; height: 16px; flex: 0 0 auto; }
.category-product > span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.category-badge { margin-left: auto; flex-shrink: 0; padding: 2px 6px; background: #eceef1; border-radius: 4px; color: #626b78; font-size: 10px; }
.category-badge.is-main { color: #294f8d; background: #e4edfb; }
.category-badge.is-regular { color: #715422; background: #f3eedf; }
.rhythm-filters { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr; gap: 12px; margin-bottom: 18px; }
.rhythm-filters .field { min-width: 0; }
.monthly-layout { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.main-product-rhythm .data-table { min-width: 510px; }
.main-product-rhythm .data-table th, .main-product-rhythm .data-table td { padding: 12px 8px; font-size: 12px; }
.rhythm-date { display: block; color: #626b78; font-size: 12px; }
.rhythm-amount { display: block; margin-top: 5px; font-size: 15px; }
#rhythmTable small { display: block; margin-top: 5px; color: #626b78; font-size: 10px; }
.rhythm-missing { color: #7c8591; font-size: 12px; }
.monthly-trend-bottom { margin-top: 24px; padding-top: 24px; border-top: 1px solid #dadddf; }
@media (max-width: 1100px) { .monthly-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) { .category-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .category-products { grid-template-columns: minmax(0, 1fr); }
  .rhythm-filters { grid-template-columns: minmax(0, 1fr); }
}
.config-product-search {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #d0d5dc;
  border-radius: 6px;
  background: #fff;
  color: #202328;
  font: inherit;
  font-size: 13px;
}
.config-product-search:focus-visible { outline: 2px solid #315fae; outline-offset: 1px; }
.feedback-mode #filterStack, .feedback-mode #mobileFilterToggle { display: none; }
.feedback-compose { max-width: 820px; padding: 4px 0 20px; }
.feedback-compose textarea { width: 100%; min-height: 160px; resize: vertical; padding: 12px; border: 1px solid #cbd1d9; border-radius: 6px; background: #fff; color: #202328; font: inherit; font-size: 14px; line-height: 1.65; }
.feedback-compose textarea:focus-visible { outline: 2px solid #315fae; outline-offset: 1px; }
.feedback-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
#feedbackLength { color: #626b78; font-size: 12px; }
.feedback-status { min-height: 20px; font-size: 13px; color: #315fae; overflow-wrap: anywhere; }
.feedback-admin { max-width: 1000px; border-top: 1px solid #dadddf; padding-top: 24px; margin-top: 10px; }
.feedback-item { padding: 18px 0; border-top: 1px solid #e0e3e7; }
.feedback-item-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; font-size: 13px; }
.feedback-item-meta span, .feedback-item-meta time { color: #626b78; font-size: 12px; }
.feedback-item-meta time { margin-left: auto; }
.feedback-item p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 14px; margin: 10px 0 0; }
