body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  display: none;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --surface3: #eef2f7;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --text: #111827;
  --text2: #334155;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-end: #0891b2;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --violet: #7c3aed;
  --radius: 8px;
  --sidebar-w: 260px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 10px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
}

.card,
.sidebar,
.topbar,
.hero,
.quick-hero,
.clean-hero,
.stock-hero,
.product-card,
.login-card,
.login-preview {
  border-radius: 8px;
}

.logo,
.circle,
.kpi-icon,
.thumb,
.quick-product img,
.smart-row img,
.drawer-product img {
  border-radius: 8px;
}

.logo {
  background: #111827;
  font-size: 14px;
  font-weight: 800;
}

.sidebar nav a span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.sidebar nav a.active span {
  color: var(--blue);
}

.primary,
.circle {
  background: var(--blue);
  color: #fff !important;
  border-color: var(--blue);
  box-shadow: none;
}

.primary:hover,
.circle:hover {
  background: #1d4ed8;
  color: #fff !important;
  border-color: #1d4ed8;
  box-shadow: var(--shadow);
}

.primary:visited,
.circle:visited,
a.primary,
a.circle,
button.primary {
  color: #fff !important;
}

.ghost,
.theme-btn,
.table-actions a:not(.primary),
.actions a:not(.primary) {
  color: var(--blue);
}

.ghost:hover,
.theme-btn:hover,
.table-actions a:not(.primary):hover,
.actions a:not(.primary):hover {
  background: var(--surface3);
  color: var(--text);
}

.ref-finance-grid > div {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.drawer-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.drawer-note {
  margin-top: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.drawer-note p {
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0;
}

.hidden-extra {
  display: none;
}

.quick-products {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.quick-product {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 72px;
  padding: 10px 14px;
  padding-right: 18px;
  column-gap: 12px;
  row-gap: 4px;
}

.quick-product img {
  grid-row: 1 / 3;
}

.quick-product > span {
  grid-column: 2;
  min-width: 0;
  padding-right: 8px;
}

.quick-product strong {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  min-width: 92px;
  text-align: right;
  font-size: 18px;
  line-height: 1.1;
}

.quick-product .stock-dot {
  position: static;
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  align-self: start;
  margin-top: 0;
}

.quick-product small {
  max-width: 100%;
}

.smart-row {
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
}

.stock-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.stock-buy-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--blue);
}

.stock-buy-btn:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.check {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
  white-space: nowrap;
}

.check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  accent-color: var(--blue);
}

.price-sync-toggle {
  grid-column: span 2;
  align-self: end;
  min-height: 58px;
  padding: 10px 12px !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  white-space: normal;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.price-sync-toggle:has(input:checked) {
  background: rgba(37, 99, 235, .08);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.price-sync-toggle span {
  display: block;
  line-height: 1.25;
}

.price-sync-toggle b {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.price-sync-toggle:has(input:checked) b {
  color: var(--blue);
}

.price-sync-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-filter {
  margin-bottom: 16px;
}

.purchase-filter form {
  width: 100%;
}

.ad-import-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 14px;
  align-items: end;
}

.ad-import-form input[type="file"] {
  height: auto;
  padding: 10px;
}

.import-note {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.import-summary > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}

.import-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.import-summary b {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
}

.row-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.row-check input {
  position: absolute;
  opacity: 0;
}

.row-check span {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--surface);
}

.row-check input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
}

.muted-row {
  opacity: .55;
}

.purchase-filter-top {
  margin-top: -4px;
  margin-bottom: 18px;
}

.price-switch {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.price-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .16s ease;
}

.switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .16s ease;
}

.switch-copy b {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.switch-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.price-switch:has(input:checked) {
  border-color: #16a34a;
  background: rgba(22, 163, 74, .08);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.price-switch:has(input:checked) .switch-track {
  background: #16a34a;
}

.price-switch:has(input:checked) .switch-track i {
  transform: translateX(20px);
}

.price-switch:has(input:checked) .switch-copy b {
  color: #15803d;
}

.purchase-hint {
  grid-column: 1 / -1;
  margin: -2px 0 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  font-size: 13px;
}

@media (max-width: 720px) {
  .quick-products {
    grid-template-columns: 1fr;
  }

  .quick-product {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .quick-product strong,
  .quick-product .stock-dot {
    grid-column: 2;
    justify-self: start;
    text-align: left;
    min-width: 0;
  }

  .smart-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .stock-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
/* Sales and ads workbench */
.sales-workbench,
.ads-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.sales-header h1,
.ads-head h1 {
  margin: 0 0 6px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: .95;
  color: #061a45;
}

.sales-header p,
.ads-head p {
  margin: 0;
  color: #55709c;
}

.sales-kpis,
.ads-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 320px;
}

.sales-kpis div,
.ads-kpis div {
  background: rgba(255,255,255,.86);
  border: 1px solid #cfe0f6;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(21, 68, 132, .08);
}

.sales-kpis span,
.ads-kpis span {
  display: block;
  font-size: 12px;
  color: #5b7297;
  font-weight: 800;
  margin-bottom: 4px;
}

.sales-kpis b,
.ads-kpis b {
  color: #061a45;
  font-size: 18px;
}

.sales-filter,
.ads-filter {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .7fr) minmax(160px, .7fr) auto auto;
  gap: 10px;
}

.ads-filter {
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) minmax(140px, .6fr) minmax(150px, .65fr) auto auto;
}

.sales-form-card {
  margin-bottom: 20px;
}

.sale-row {
  grid-template-columns: minmax(280px, 1fr) 96px 120px 72px 42px;
  align-items: center;
}

.sale-stock-pill {
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #cfe0f6;
  color: #31537f;
  background: #eef6ff;
  white-space: nowrap;
}

.sale-stock-pill.good {
  background: #e7f8ef;
  border-color: #a8e3be;
  color: #0b7a38;
}

.sale-stock-pill.low {
  background: #fff4d8;
  border-color: #f5d27c;
  color: #946200;
}

.sale-stock-pill.bad {
  background: #ffe8ee;
  border-color: #f3b5c4;
  color: #c7143d;
}

.sale-row.stock-warning {
  border-color: #f3b5c4;
  background: #fff5f7;
}

.ad-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #cfe0f6;
  background: #eef6ff;
  color: #0b5ed7;
}

.ad-score.good {
  background: #e7f8ef;
  border-color: #a8e3be;
  color: #0b7a38;
}

.ad-score.warn,
.ad-score.lead {
  background: #fff4d8;
  border-color: #f5d27c;
  color: #946200;
}

.ad-score.bad {
  background: #ffe8ee;
  border-color: #f3b5c4;
  color: #c7143d;
}

.warn-text {
  color: #946200;
}

.ads-table td,
.sales-table td {
  vertical-align: top;
}

@media (max-width: 860px) {
  .sales-workbench,
  .ads-head {
    grid-template-columns: 1fr;
  }

  .sales-kpis,
  .ads-kpis,
  .sales-filter,
  .ads-filter,
  .sale-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}
