* {
  box-sizing: border-box;
}

:root {
  --primary: #0b63ce;
  --primary-dark: #084fa6;
  --primary-soft: #eaf3ff;

  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --sidebar: #17263b;
  --sidebar-hover: #223752;

  --text: #202b3c;
  --muted: #748196;
  --border: #dfe5ec;

  --green: #198754;
  --green-soft: #e9f8f0;

  --yellow: #d28b00;
  --yellow-soft: #fff6dd;

  --red: #dc3545;
  --red-soft: #ffedef;

  --shadow:
    0 1px 2px rgba(16,24,40,.05),
    0 5px 18px rgba(16,24,40,.06);

  --radius: 12px;
}

body.dark {
  --bg: #101722;
  --surface: #182231;
  --surface-soft: #202d3d;
  --text: #eef3fa;
  --muted: #9daabd;
  --border: #304055;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}


/* TEST */

.test-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 3000;

  background: #f59e0b;
  color: white;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: .7px;
}


/* LAYOUT */

.app-layout {
  min-height: 100vh;
  padding-top: 28px;
}

.sidebar {
  position: fixed;

  top: 28px;
  bottom: 0;
  left: 0;

  width: 225px;

  display: flex;
  flex-direction: column;

  background: var(--sidebar);
  color: white;

  z-index: 1200;

  transition:
    transform .22s ease,
    width .2s ease;
}

.main-content {
  min-height: calc(100vh - 28px);

  margin-left: 225px;

  padding:
    22px
    clamp(14px, 2vw, 28px)
    30px;
}


/* BRAND */

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

  height: 74px;

  padding: 0 18px;

  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  border-radius: 10px;

  background: var(--primary);

  font-size: 20px;
}

.brand-text {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.brand-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 13px;
}

.brand-text span {
  margin-top: 2px;

  color: #a9b7ca;
  font-size: 11px;
}


/* NAV */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;

  padding: 15px 10px;
}

.nav-item,
.sidebar-action {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 11px;

  min-height: 43px;

  padding: 9px 12px;

  border: 0;
  border-radius: 8px;

  background: transparent;
  color: #cbd6e4;

  cursor: pointer;

  text-align: left;

  transition:
    background .15s ease,
    color .15s ease,
    transform .15s ease;
}

.nav-item:hover,
.sidebar-action:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  width: 20px;

  text-align: center;

  font-size: 16px;
}

.nav-count {
  margin-left: auto;

  min-width: 21px;

  padding: 2px 6px;

  border-radius: 20px;

  background: rgba(255,255,255,.14);

  font-size: 10px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;

  padding: 10px;

  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-select {
  width: 100%;

  margin-top: 5px;
  padding: 9px;

  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;

  background: var(--sidebar-hover);
  color: white;
}


/* HEADER */

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  margin-bottom: 18px;
}

.section-kicker {
  color: var(--primary);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.header-title h1 {
  margin: 3px 0;

  font-size: clamp(24px, 3vw, 31px);
  letter-spacing: -.7px;
}

.header-title p {
  margin: 0;

  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 7px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 7px;

  min-height: 40px;

  padding: 8px 12px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--text);

  cursor: pointer;

  font-size: 12px;
  font-weight: 650;

  transition:
    transform .15s ease,
    box-shadow .15s ease;
}

.header-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.header-btn.primary {
  border-color: var(--primary);

  background: var(--primary);
  color: white;
}


/* SYNC */

.sync-bar {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 15px;

  padding: 9px 13px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.sync-dot {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: #23b26d;

  box-shadow: 0 0 0 5px rgba(35,178,109,.10);
}

.sync-text {
  display: flex;
  align-items: center;
  gap: 5px;

  font-size: 11px;
}

.sync-text span {
  color: var(--muted);
}

.sync-text strong {
  font-weight: 650;
}

.sync-separator {
  height: 19px;

  border-left: 1px solid var(--border);
}


/* KPI */

.kpi-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 11px;

  margin-bottom: 14px;
}

.kpi-card {
  min-height: 105px;

  display: flex;
  align-items: center;
  gap: 13px;

  padding: 16px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);

  transition:
    transform .15s ease,
    box-shadow .15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-icon {
  width: 43px;
  height: 43px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 11px;

  font-size: 19px;
}

.kpi-icon.blue {
  background: var(--primary-soft);
}

.kpi-icon.green {
  background: var(--green-soft);
}

.kpi-icon.yellow {
  background: var(--yellow-soft);
}

.kpi-icon.red {
  background: var(--red-soft);
}

.kpi-body {
  display: flex;
  flex-direction: column;
}

.kpi-body span {
  margin-bottom: 4px;

  color: var(--muted);
  font-size: 11px;
}

.kpi-body strong {
  font-size: 27px;
  line-height: 1;
}

.kpi-body small {
  margin-top: 6px;

  color: var(--muted);
  font-size: 10px;
}


/* PANELS */

.dashboard-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.panel {
  min-width: 0;

  padding: 17px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;

  margin-bottom: 15px;
}

.panel-header h2 {
  margin: 0;

  font-size: 15px;
}

.panel-header p {
  margin: 3px 0 0;

  color: var(--muted);
  font-size: 10px;
}

.text-btn {
  border: 0;

  background: transparent;
  color: var(--primary);

  cursor: pointer;

  font-size: 11px;
}


/* CHART */

.stock-chart {
  display: flex;
  flex-direction: column;
  gap: 17px;

  padding: 4px 0;
}

.chart-row {
  display: grid;

  grid-template-columns: 100px 1fr;

  align-items: center;
  gap: 12px;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 11px;
}

.chart-label strong {
  font-size: 12px;
}

.chart-track {
  height: 10px;

  overflow: hidden;

  border-radius: 20px;

  background: var(--surface-soft);
}

.chart-bar {
  height: 100%;
  width: 0;

  border-radius: 20px;

  transition: width .7s ease;
}

.chart-bar.green {
  background: #24a86a;
}

.chart-bar.yellow {
  background: #e5a21a;
}

.chart-bar.red {
  background: #df4753;
}


/* QUICK */

.quick-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 8px;
}

.quick-card {
  display: grid;

  grid-template-columns: 31px 1fr;

  align-items: center;

  min-height: 62px;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: var(--surface-soft);
  color: var(--text);

  cursor: pointer;

  text-align: left;

  transition:
    border-color .15s ease,
    transform .15s ease;
}

.quick-card:hover {
  border-color: var(--primary);

  transform: translateY(-1px);
}

.quick-icon {
  grid-row: 1 / span 2;

  font-size: 18px;
}

.quick-card strong {
  font-size: 11px;
}

.quick-card small {
  color: var(--muted);
  font-size: 9px;
}


/* EMPTY / LIST */

.empty-state {
  min-height: 120px;

  display: grid;
  place-items: center;

  align-content: center;

  color: var(--muted);

  text-align: center;
}

.empty-state span {
  font-size: 24px;
}

.empty-state p {
  margin: 7px 0 0;

  font-size: 11px;
}

.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  padding: 8px 2px;

  border-bottom: 1px solid var(--border);

  font-size: 11px;
}

.mini-list-item:last-child {
  border-bottom: 0;
}

.mini-list-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-list-item span {
  color: var(--muted);
}


/* BUSINESS */

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  margin: 25px 0 10px;
}

.section-heading h2 {
  margin: 0;

  font-size: 18px;
}

.section-heading p {
  margin: 4px 0 0;

  color: var(--muted);
  font-size: 11px;
}

.business-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 10px;
}

.business-card {
  min-height: 118px;

  padding: 14px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.business-card-icon {
  margin-bottom: 11px;

  font-size: 20px;
}

.business-card-content {
  display: flex;
  flex-direction: column;
}

.business-card-content span {
  color: var(--muted);
  font-size: 10px;
}

.business-card-content strong {
  margin: 4px 0;

  font-size: 15px;
}

.business-card-content small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}


/* INVENTORY */

.inventory-heading {
  margin-top: 28px;
}

.result-count {
  color: var(--muted);
  font-size: 11px;
}

.inventory-toolbar {
  position: sticky;

  top: 28px;

  z-index: 100;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 0;

  background: var(--bg);
}

.search-wrapper {
  position: relative;

  flex: 1;
}

.search-icon {
  position: absolute;

  left: 13px;
  top: 50%;

  transform: translateY(-50%);

  color: var(--muted);
}

#searchBox {
  width: 100%;
  height: 43px;

  padding:
    0
    38px
    0
    38px;

  border: 1px solid var(--border);
  border-radius: 9px;

  outline: none;

  background: var(--surface);
  color: var(--text);

  font-size: 13px;
}

#searchBox:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px
    rgba(11,99,206,.1);
}

.clear-search {
  position: absolute;

  right: 9px;
  top: 50%;

  transform: translateY(-50%);

  border: 0;

  background: transparent;
  color: var(--muted);

  cursor: pointer;
}

.filter-scroll {
  display: flex;
  gap: 5px;

  overflow-x: auto;

  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  min-height: 36px;

  padding: 7px 11px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--text);

  cursor: pointer;

  font-size: 10px;
  white-space: nowrap;
}

.filter-btn.active {
  border-color: var(--primary);

  background: var(--primary);
  color: white;
}


/* TABLE */

.inventory-panel {
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

table {
  width: 100%;

  border-collapse: collapse;
}

thead {
  background: var(--surface-soft);
}

th {
  padding: 10px 12px;

  color: var(--muted);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 9px 12px;

  border-top: 1px solid var(--border);
}

.product-row {
  cursor: pointer;

  transition: background .12s ease;
}

.product-row:hover {
  background: var(--surface-soft);
}

.favorite-column {
  width: 45px;

  text-align: center;
}

.favorite-btn {
  border: 0;

  background: transparent;

  cursor: pointer;

  font-size: 19px;
}

.favorite-btn.on {
  color: #f3b300;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-avatar {
  width: 35px;
  height: 35px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 8px;

  background: var(--surface-soft);

  font-size: 17px;
}

.product-main {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.product-main strong {
  overflow: hidden;
  text-overflow: ellipsis;

  font-size: 12px;
  white-space: nowrap;
}

.product-main small {
  margin-top: 2px;

  color: var(--muted);
  font-size: 9px;
}

.status-column {
  width: 115px;
}

.status-badge {
  display: inline-flex;

  padding: 4px 7px;

  border-radius: 20px;

  font-size: 9px;
  font-weight: 700;
}

.status-badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.status-badge.low {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.status-badge.zero {
  background: var(--red-soft);
  color: var(--red);
}

.stock-column {
  width: 75px;

  text-align: right;
}

.stock-value {
  font-size: 16px;
  font-weight: 800;
}

.stock-ok {
  color: var(--green);
}

.stock-low {
  color: var(--yellow);
}

.stock-zero {
  color: var(--red);
}


/* DRAWER */

.product-overlay {
  position: fixed;

  inset: 28px 0 0 0;

  z-index: 2000;

  background: rgba(14,25,40,.40);

  backdrop-filter: blur(1px);

  opacity: 1;

  transition: opacity .2s ease;
}

.product-drawer {
  position: fixed;

  top: 28px;
  right: 0;
  bottom: 0;

  z-index: 2100;

  width: min(440px, 96vw);

  overflow-y: auto;

  padding: 18px;

  background: var(--surface);

  box-shadow:
    -15px 0 40px
    rgba(0,0,0,.14);

  transform: translateX(102%);

  transition: transform .23s ease;
}

.product-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding-bottom: 14px;

  border-bottom: 1px solid var(--border);
}

.drawer-label {
  color: var(--primary);

  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.drawer-header h2 {
  margin: 4px 0 0;

  font-size: 20px;
}

.drawer-close {
  border: 0;

  background: transparent;
  color: var(--text);

  cursor: pointer;

  font-size: 23px;
}

.drawer-content {
  padding-top: 16px;
}

.product-photo-card {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-bottom: 12px;

  padding: 12px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface-soft);
}

.product-photo {
  width: 76px;
  height: 76px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 10px;

  background: var(--surface);

  font-size: 32px;
}

.photo-info {
  display: flex;
  flex-direction: column;
}

.photo-info strong {
  font-size: 12px;
}

.photo-info small {
  margin-top: 4px;

  color: var(--muted);
  font-size: 9px;
}

.drawer-stock-card {
  display: flex;
  flex-direction: column;

  margin-bottom: 12px;

  padding: 15px;

  border-radius: 11px;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      #3986df
    );

  color: white;
}

.drawer-stock-card span {
  font-size: 10px;
}

.drawer-stock-card strong {
  margin: 4px 0;

  font-size: 34px;
}

.drawer-stock-card small {
  opacity: .85;

  font-size: 9px;
}

.details-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 8px;

  margin-bottom: 17px;
}

.detail-item {
  display: flex;
  flex-direction: column;

  min-height: 67px;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 9px;
}

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

.detail-item strong {
  margin-top: 4px;

  font-size: 11px;
}

.detail-item small {
  margin-top: 3px;

  color: var(--muted);
  font-size: 8px;
}

.pending-data {
  color: var(--yellow);
}

.drawer-section {
  margin-top: 18px;
}

.drawer-section-header h3 {
  margin: 0 0 8px;

  font-size: 13px;
}

.integration-placeholder {
  display: grid;
  place-items: center;

  padding: 19px;

  border: 1px dashed var(--border);
  border-radius: 10px;

  background: var(--surface-soft);

  text-align: center;
}

.integration-placeholder span {
  font-size: 24px;
}

.integration-placeholder strong {
  margin-top: 7px;

  font-size: 11px;
}

.integration-placeholder p {
  max-width: 300px;

  margin: 5px 0 0;

  color: var(--muted);

  font-size: 9px;
  line-height: 1.4;
}

.drawer-actions {
  display: flex;
  gap: 8px;
}

.drawer-action {
  flex: 1;

  min-height: 42px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--text);

  cursor: pointer;
}


/* FOOTER */

.app-footer {
  display: flex;
  justify-content: center;
  gap: 7px;

  padding: 22px;

  color: var(--muted);

  font-size: 9px;
}


/* MODALS */

.print-modal,
.scanner-modal {
  position: fixed;

  inset: 0;

  z-index: 5000;

  display: grid;
  place-items: center;

  padding: 15px;

  background: rgba(10,18,30,.72);
}

.print-modal.hidden,
.scanner-modal.hidden {
  display: none;
}

.print-dialog,
.scanner-box {
  width: min(470px, 100%);

  padding: 17px;

  border-radius: 13px;

  background: var(--surface);
  color: var(--text);

  box-shadow:
    0 30px 80px
    rgba(0,0,0,.25);
}

.print-dialog-header,
.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 12px;
}

#printModalClose,
#closeScanner {
  border: 0;

  background: transparent;
  color: var(--text);

  cursor: pointer;

  font-size: 21px;
}

.print-question {
  color: var(--muted);

  font-size: 11px;
}

.print-option {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 3px;

  border-bottom: 1px solid var(--border);

  cursor: pointer;

  font-size: 11px;
}

.print-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;

  margin-top: 14px;
}

.primary-btn,
.action-btn {
  min-height: 38px;

  padding: 8px 11px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--text);

  cursor: pointer;
}

.primary-btn {
  border-color: var(--primary);

  background: var(--primary);
  color: white;
}

#scannerVideo {
  width: 100%;

  max-height: 65vh;

  border-radius: 9px;

  background: black;
}


/* MOBILE MENU */

.mobile-menu-btn {
  display: none;

  position: fixed;

  top: 36px;
  left: 8px;

  z-index: 1600;

  width: 38px;
  height: 38px;

  border: 0;
  border-radius: 8px;

  background: var(--sidebar);
  color: white;

  font-size: 18px;
}


/* PRINT */

#printDocument {
  display: none;
}

@media print {

  @page {
    size: A4 portrait;
    margin: 7mm;
  }

  body > * {
    display: none !important;
  }

  #printDocument {
    display: block !important;

    width: 100% !important;

    background: white !important;
    color: black !important;

    font-family: Arial, sans-serif !important;
  }

  #printDocument .print-header {
    display: flex;
    justify-content: space-between;

    margin-bottom: 4mm;
    padding-bottom: 2mm;

    border-bottom: 1px solid #444;
  }

  #printDocument .print-title {
    font-size: 15pt;
    font-weight: 700;
  }

  #printDocument .print-subtitle,
  #printDocument .print-date {
    font-size: 7.5pt;
  }

  #printDocument table {
    width: 100%;

    border-collapse: collapse;
  }

  #printDocument thead {
    display: table-header-group;
  }

  #printDocument tr {
    break-inside: avoid;
  }

  #printDocument th {
    padding: 1.8mm;

    border-bottom: 1px solid #333;

    color: black !important;

    font-size: 8pt;
  }

  #printDocument td {
    padding: 1.2mm 1.8mm;

    border-bottom: .2pt solid #bbb;

    color: black !important;

    font-size: 7.5pt;
  }

  #printDocument .print-stock {
    width: 22mm;

    text-align: right;
    font-weight: 700;
  }

  #printDocument .print-footer {
    margin-top: 3mm;

    font-size: 7.5pt;
  }

}


/* TABLET */

@media (max-width: 1050px) {

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

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

}


/* MOBILE */

@media (max-width: 760px) {

  .mobile-menu-btn {
    display: grid;
    place-items: center;
  }

  .sidebar {
    width: min(280px, 85vw);

    transform: translateX(-102%);

    box-shadow:
      18px 0 50px
      rgba(0,0,0,.22);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;

    padding:
      61px
      9px
      20px;
  }

  .main-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;

    overflow-x: auto;

    padding-bottom: 2px;

    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-btn {
    flex: 0 0 auto;
  }

  .sync-bar {
    align-items: flex-start;
    flex-direction: column;

    gap: 6px;
  }

  .sync-separator {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;

    gap: 7px;
  }

  .kpi-card {
    min-height: 88px;

    padding: 11px;
  }

  .kpi-icon {
    width: 34px;
    height: 34px;

    font-size: 16px;
  }

  .kpi-body strong {
    font-size: 22px;
  }

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

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

  .inventory-toolbar {
    align-items: stretch;
    flex-direction: column;

    top: 28px;
  }

  .filter-scroll {
    width: 100%;
  }

  .status-column {
    display: none;
  }

  th.status-column {
    display: none;
  }

  td,
  th {
    padding:
      9px
      6px;
  }

  .product-main strong {
    max-width: 190px;

    white-space: normal;
  }

  .product-main small {
    display: none;
  }

  .product-avatar {
    width: 30px;
    height: 30px;
  }

  .stock-column {
    width: 57px;
  }

  .product-drawer {
    top: 28px;

    width: 100%;
  }

}


/* SMALL MOBILE */

@media (max-width: 430px) {

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

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

  .chart-row {
    grid-template-columns: 84px 1fr;
  }

  .favorite-column {
    width: 35px;
  }

}

/* ===== PRODUCT V4 ===== */

#drawerImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
}

.product-photo {
  overflow: hidden;
}

.movements-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.movement-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;

  padding: 9px 10px;

  border-bottom: 1px solid var(--border);
}

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

.movement-main {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.movement-main strong {
  font-size: 10px;
}

.movement-main small {
  margin-top: 2px;

  color: var(--muted);
  font-size: 8px;
}

.movement-quantity {
  font-size: 13px;
  font-weight: 800;
}

.movement-positive {
  color: var(--green);
}

.movement-negative {
  color: var(--red);
}

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

.movement-empty,
.movement-loading {
  padding: 18px;

  color: var(--muted);

  font-size: 10px;
  text-align: center;
}

.drawer-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.product-flash {
  animation: productFoundFlash .8s ease;
}

@keyframes productFoundFlash {

  0% {
    background: rgba(35,178,109,.28);
  }

  100% {
    background: transparent;
  }

}

/* ===== COMMERCIAL V5 ===== */

.business-list {
  display: flex;
  flex-direction: column;
  gap: 0;

  margin-top: 8px;
}

.business-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;

  padding: 6px 0;

  border-top: 1px solid var(--border);

  font-size: 9px;
}

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

.business-list-row strong {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 9px;
}

.business-list-row span {
  color: var(--muted);

  font-size: 9px;
  white-space: nowrap;
}

.movement-type {
  display: inline-flex;

  width: fit-content;

  margin-top: 3px;
  padding: 2px 5px;

  border-radius: 4px;

  font-size: 7px;
  font-weight: 800;
}

.movement-type.sale {
  background: var(--red-soft);
  color: var(--red);
}

.movement-type.purchase {
  background: var(--primary-soft);
  color: var(--primary);
}

.movement-type.receipt {
  background: var(--green-soft);
  color: var(--green);
}

.movement-type.other {
  background: var(--surface-soft);
  color: var(--muted);
}

@media (min-width: 1100px) {

  .business-card.business-wide {
    min-height: 170px;
  }

}

/* ===== MONTHLY V6 ===== */

.monthly-summary-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0,1fr));

  gap: 10px;

  margin: 12px 0 18px;
}

.monthly-card {
  min-height: 100px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 15px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.monthly-card.mag-value {
  border-color: rgba(25,135,84,.3);

  background:
    linear-gradient(
      135deg,
      var(--surface),
      var(--green-soft)
    );
}

.monthly-label {
  color: var(--muted);

  font-size: 11px;
}

.monthly-card strong {
  margin: 7px 0 5px;

  font-size: 23px;
}

.monthly-card small {
  color: var(--muted);

  font-size: 9px;
}


/* STOCK MÁS GRANDE */

.stock-value {
  font-size: 21px !important;
  font-weight: 900 !important;
}

.product-main strong {
  font-size: 14px !important;
}


/* FICHA */

.drawer-stock-card strong {
  font-size: 40px !important;
}


/* MOBILE */

@media (max-width: 760px) {

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

  .monthly-card {
    min-height: 88px;
    padding: 11px;
  }

  .monthly-card strong {
    font-size: 19px;
  }

  .product-main strong {
    font-size: 15px !important;
    line-height: 1.25;
  }

  .stock-value {
    font-size: 23px !important;
  }

  .stock-column {
    width: 70px !important;
  }

  .drawer-stock-card strong {
    font-size: 44px !important;
  }

}


@media (max-width: 430px) {

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

}

/* ===== WZ CONTROL V7 ===== */

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

.wz-kpi {
  min-height: 92px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 14px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface);

  box-shadow: var(--shadow);
}

.wz-kpi.warning {
  border-color: rgba(210,139,0,.35);
  background:
    linear-gradient(
      135deg,
      var(--surface),
      var(--yellow-soft)
    );
}

.wz-kpi span {
  color: var(--muted);
  font-size: 10px;
}

.wz-kpi strong {
  margin: 5px 0;
  font-size: 24px;
}

.wz-kpi small {
  color: var(--muted);
  font-size: 8px;
}

.wz-panel {
  padding: 0;
  overflow: hidden;
}

.wz-panel .panel-header {
  padding: 15px;
  margin: 0;
}

.wz-table-wrap {
  overflow-x: auto;
}

#wzTable {
  min-width: 900px;
}

#wzTable th,
#wzTable td {
  white-space: nowrap;
}

.wz-status {
  display: inline-flex;

  padding: 4px 7px;

  border-radius: 20px;

  font-size: 9px;
  font-weight: 750;
}

.wz-status.pending {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.wz-status.settled {
  background: var(--green-soft);
  color: var(--green);
}

.wz-status.unknown {
  background: var(--surface-soft);
  color: var(--muted);
}

.wz-customer-grid {
  display: grid;

  grid-template-columns:
    repeat(3,minmax(0,1fr));

  gap: 9px;
}

.wz-customer-card {
  padding: 13px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--surface);

  box-shadow: var(--shadow);
}

.wz-customer-card strong {
  display: block;

  margin-bottom: 7px;

  font-size: 12px;
}

.wz-customer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 5px;

  font-size: 9px;
}

.wz-customer-stats span {
  color: var(--muted);
}

.wz-customer-stats b {
  display: block;

  margin-top: 2px;

  color: var(--text);

  font-size: 11px;
}


.product-sales-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 7px;
}

.product-sales-item {
  min-height: 66px;

  display: flex;
  flex-direction: column;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface-soft);
}

.product-sales-item span {
  color: var(--muted);
  font-size: 9px;
}

.product-sales-item strong {
  margin-top: 4px;

  font-size: 18px;
}

.product-sales-item small {
  margin-top: 3px;

  color: var(--muted);
  font-size: 7px;
}


@media (max-width: 900px) {

  .wz-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wz-customer-grid {
    grid-template-columns: 1fr 1fr;
  }

}


@media (max-width: 550px) {

  .wz-kpi-grid {
    grid-template-columns: 1fr;
  }

  .wz-customer-grid {
    grid-template-columns: 1fr;
  }

}
