:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e5e9ee;
  --text: #18222f;
  --muted: #6b7686;
  --brand: #1557ff;
  --brand-soft: #eaf0ff;
  --success: #16845b;
  --warning: #b7791f;
  --danger: #c33c3c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, #eaf0ff 0, transparent 35%),
    radial-gradient(circle at 85% 80%, #f7edff 0, transparent 30%),
    var(--bg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #1557ff, #0e3bb8);
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 18px rgba(21, 87, 255, 0.28);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 17px;
}

.login-card h1 {
  margin: 4px 0 0;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

.login-card button,
.toolbar button {
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  padding: 11px 14px;
  font-weight: 700;
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: #101a2b;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
}

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

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  color: #a7b1c2;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  color: #c7d0df;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: #d5dce8;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dark-ghost {
  border-color: #dbe1ea;
  color: var(--brand);
  background: white;
}

.dark-ghost:hover {
  background: #f5f8ff;
}

.main {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

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

.sync-status {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-balances {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.view {
  display: none;
  animation: fade-in 0.2s ease;
}

.view.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #101a2b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 14px;
  z-index: 31;
  border: 6px solid transparent;
  border-top-color: #101a2b;
  pointer-events: none;
}

.metric-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1px;
  background: var(--line);
  margin-bottom: 20px;
  overflow: visible;
}

.metric-cell {
  padding: 14px 16px;
  background: var(--surface);
}

.metric-strip .metric-value {
  font-size: 21px;
  line-height: 1.15;
}

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.chart-card {
  margin-bottom: 20px;
}

.chart-card .section-title {
  margin-top: 0;
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid-line {
  stroke: #eef1f5;
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-axis-label.right {
  fill: #7f8b9c;
}

.chart-bar {
  fill: #dbe7ff;
}

.chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--brand);
  stroke: white;
  stroke-width: 1.5;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-swatch.revenue {
  background: var(--brand);
}

.legend-swatch.orders {
  background: #dbe7ff;
}

.coverage-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.section-subtitle {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.attention-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}

.attention-level {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.attention-level.attention {
  background: #fdecec;
  color: var(--danger);
}

.attention-level.warning {
  background: #fff4df;
  color: var(--warning);
}

.attention-level.positive {
  background: #e9f8f0;
  color: var(--success);
}

.acquisition-bars {
  display: grid;
  gap: 16px;
}

.acquisition-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.acquisition-bar-head span:last-child {
  color: var(--text);
  white-space: nowrap;
}

.acquisition-bar-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.cost-panel {
  margin-bottom: 20px;
}

.cost-panel .section-title {
  margin-top: 0;
}

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

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #fafbfc;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  background: #f2f5f9;
  color: var(--text);
}

th.sortable.sorted {
  color: var(--brand);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: #aab3bf;
  font-size: 10px;
}

.sort-indicator.active {
  color: var(--brand);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcff;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.toolbar label {
  min-width: 150px;
}

.toolbar label.wide {
  flex: 1;
  min-width: 220px;
}

.toolbar .search-row {
  flex: 1 0 100%;
  order: 2;
  min-width: 0;
}

.toolbar .grow {
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.paid,
.pill.fulfilled {
  background: #e6f6ef;
  color: var(--success);
}

.pill.unfulfilled {
  background: #fff4dd;
  color: var(--warning);
}

.pill.refunded,
.pill.cancelled {
  background: #fdeaea;
  color: var(--danger);
}

.pill.partially_refunded,
.pill.partial {
  background: #eef0f4;
  color: var(--muted);
}

.pill-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: 145px;
}

.status-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-badge-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

.status-badge-value {
  text-transform: capitalize;
}

.status-badge.payment {
  background: #1f2a44;
  color: #ffffff;
  border-radius: 7px;
  padding: 7px 9px;
}

.status-badge.payment.paid {
  background: #16845b;
}

.status-badge.payment.refunded,
.status-badge.payment.partially_refunded,
.status-badge.payment.cancelled,
.status-badge.payment.voided,
.status-badge.payment.pending {
  background: #b33d3d;
}

.status-badge.fulfilment {
  background: #ffffff;
  color: #42506b;
  border: 1.5px dashed #a8b3c4;
  border-radius: 999px;
  padding: 6px 9px;
}

.status-badge.fulfilment.fulfilled {
  color: #0e7250;
  border-color: #37a67a;
  background: #f0faf6;
}

.status-badge.fulfilment.unfulfilled,
.status-badge.fulfilment.partial {
  color: #9a650c;
  border-color: #d9a441;
  background: #fff8ea;
}

.pill.payment {
  border: 1px solid transparent;
  background: #eef1f7;
  color: #42506b;
}

.pill.payment.paid {
  background: #e6f6ef;
  border-color: #b7e4cf;
  color: var(--success);
}

.pill.payment.refunded,
.pill.payment.partially_refunded,
.pill.payment.cancelled,
.pill.payment.voided {
  background: #fdeaea;
  border-color: #f3c1c1;
  color: var(--danger);
}

.pill.fulfilment {
  background: #ffffff;
  border: 1px solid #cbd3df;
  color: #42506b;
}

.pill.fulfilment.fulfilled {
  background: #f0faf6;
  border-color: #9edbc2;
  color: var(--success);
}

.pill.fulfilment.unfulfilled,
.pill.fulfilment.partial {
  background: #fff8ea;
  border-color: #ecd29a;
  color: var(--warning);
}

.store-badge {
  display: inline-flex;
  margin: 1px 3px 1px 0;
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.order-item-list {
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.order-item {
  border-left: 4px solid #a8b3c4;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 8px 9px;
}

.order-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.order-item-qty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-item-title {
  font-weight: 700;
  color: var(--text);
}

.order-item-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.order-item-meta.sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.product-line {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #eef1f7;
  color: #42506b;
}

.order-item-electric,
.product-line-electric {
  border-color: #1d4ed8;
}

.order-item-electric {
  background: #f5f8ff;
}

.product-line-electric {
  background: #e4edff;
  color: #1d4ed8;
}

.order-item-original,
.product-line-original {
  border-color: #0f8a67;
}

.product-line-original {
  background: #e4f7ef;
  color: #0f8a67;
}

.order-item-original {
  background: #f2fbf7;
}

.order-item-featherforme,
.product-line-featherforme {
  border-color: #b15a9f;
}

.product-line-featherforme {
  background: #fbeaf6;
  color: #9d3f8b;
}

.order-item-featherforme {
  background: #fff5fc;
}

.order-item-wedge,
.product-line-wedge {
  border-color: #d97706;
}

.product-line-wedge {
  background: #fff1d6;
  color: #b45309;
}

.order-item-wedge {
  background: #fff9ef;
}

.order-item-vehicle-wedge,
.product-line-vehicle-wedge {
  border-color: #7c3aed;
}

.product-line-vehicle-wedge {
  background: #f1eaff;
  color: #6d28d9;
}

.order-item-vehicle-wedge {
  background: #faf8ff;
}

.order-item-accessory,
.product-line-accessory {
  border-color: #64748b;
}

.product-line-accessory {
  background: #eef2f7;
  color: #475569;
}

.order-item-accessory {
  background: #f8fafc;
}

.order-item-admin,
.product-line-admin {
  border-color: #b45309;
}

.product-line-admin {
  background: #fef3e6;
  color: #92400e;
}

.order-item-admin {
  background: #fffaf3;
}

.order-item-other,
.product-line-other {
  border-color: #a8b3c4;
}

.order-item-other {
  background: #fbfcfe;
}

.muted {
  color: var(--muted);
}

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

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pagination select {
  width: auto;
  padding: 7px 9px;
}

.pagination-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  background: white;
  color: var(--brand);
  font-weight: 700;
}

.pagination-btn:disabled {
  color: #aab3bf;
  cursor: not-allowed;
}

.page-indicator {
  font-weight: 700;
  color: var(--text);
}

.field-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}

.field-picker summary {
  cursor: pointer;
  padding: 11px 14px;
  font-weight: 800;
  color: var(--text);
}

.field-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 2px 14px 14px;
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.field-check input {
  width: auto;
}

.customer-state {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.customer-state.enabled {
  background: #e6f6ef;
  color: var(--success);
}

.customer-state.invited {
  background: #eaf0ff;
  color: var(--brand);
}

.customer-state.disabled,
.customer-state.declined {
  background: #eef0f4;
  color: var(--muted);
}

.store-spend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  color: var(--text);
}

.store-spend span {
  color: var(--muted);
}

.marketing-subscribed,
.marketing-not-subscribed {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.marketing-subscribed {
  background: #e6f6ef;
  color: var(--success);
}

.marketing-not-subscribed {
  background: #eef0f4;
  color: var(--muted);
}

.customer-row {
  cursor: pointer;
}

.customer-ordering-filter {
  align-items: center;
  align-self: end;
  min-width: auto;
  color: var(--text);
}

.customer-ordering-filter input {
  width: auto;
}

.customer-detail {
  display: grid;
  gap: 16px;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-start;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.5fr);
  gap: 18px;
  align-items: start;
}

.detail-identity h3 {
  margin: 0 0 6px;
  font-size: 26px;
}

.detail-identity p {
  margin: 0 0 10px;
  color: var(--muted);
}

.detail-store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-summary-item {
  background: var(--surface);
  padding: 13px 14px;
}

.detail-summary-item > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}

.detail-summary-item > div {
  font-size: 16px;
  font-weight: 800;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.detail-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-row dd {
  margin: 0;
  color: var(--text);
}

.store-spend-list,
.store-account-list {
  display: grid;
  gap: 5px;
}

.store-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-detail-cols {
  align-items: start;
}

.stock-summary {
  display: flex;
  gap: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.stock-summary strong {
  color: var(--text);
}

.compact-table table {
  min-width: 560px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 80px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1557ff, #55a7ff);
  min-width: 2px;
}

.bar-fill.contribution {
  background: linear-gradient(90deg, #16845b, #45c295);
}

.performance-group {
  display: grid;
  gap: 7px;
}

.contribution-row .bar-track {
  background: #e9f5ef;
}

.store-performance-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

.loading {
  color: var(--muted);
  padding: 24px;
}

.management-grid {
  display: grid;
  gap: 18px;
}

.management-subtitle {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-form,
.integration-form {
  display: grid;
  gap: 10px;
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.inline-form button,
.form-actions button {
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  padding: 9px 12px;
  font-weight: 700;
}

.inline-form button:hover,
.form-actions button:hover {
  background: #0d44c4;
}

.integration-form {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.integration-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
}

.check-label input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 2px;
}

.form-actions button[type='button'] {
  background: white;
  color: var(--brand);
  border: 1px solid #cbd3df;
}

.pill.admin {
  background: #eae4ff;
  color: #5b3bc4;
}

.pill.ops {
  background: #eaf0ff;
  color: var(--brand);
}

.cogs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.cogs-form {
  display: grid;
  gap: 12px;
}

.cogs-form .form-actions {
  margin-top: 0;
}

.cogs-note-field {
  min-width: 0;
}

.cogs-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.cogs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.cogs-toolbar label {
  min-width: 220px;
}

.cogs-toolbar .cogs-search-label {
  flex: 1;
  min-width: 280px;
}

.cogs-bulk-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.cogs-bulk-toolbar button {
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  padding: 9px 12px;
  font-weight: 700;
}

.cogs-bulk-toolbar button:hover {
  background: #0d44c4;
}

.cogs-bulk-table input,
.cogs-bulk-table select {
  min-width: 110px;
}

.cogs-bulk-table td {
  vertical-align: middle;
}

.cogs-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
  padding: 14px;
  margin-bottom: 12px;
}

.cogs-group:last-child {
  margin-bottom: 0;
}

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

.cogs-product-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 3px;
}

.cogs-current {
  display: grid;
  gap: 3px;
  text-align: right;
  white-space: nowrap;
}

.cogs-current strong {
  font-size: 15px;
}

.cogs-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cogs-status.current {
  background: #e6f6ef;
  color: var(--success);
}

.cogs-status.future {
  background: #eaf0ff;
  color: var(--brand);
}

.cogs-status.historical {
  background: #eef0f4;
  color: var(--muted);
}

.cogs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cogs-actions button {
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 6px 9px;
  font-weight: 700;
}

.cogs-actions button:hover {
  background: #dbe5ff;
}

.cogs-actions button.danger-link {
  background: #fdeaea;
  color: var(--danger);
}

.cogs-actions button.danger-link:hover {
  background: #f7d2d2;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-card .section-title {
  margin-top: 0;
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .sidebar-foot {
    margin-top: 0;
    flex-direction: row;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
  }

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

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

  .two-col {
    grid-template-columns: 1fr;
  }

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

  .store-performance-grid {
    grid-template-columns: 1fr;
  }

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

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

  .cogs-group-head {
    flex-direction: column;
    align-items: stretch;
  }

  .cogs-current {
    text-align: left;
  }
}
