﻿:root {
  --green-900: #003f22;
  --green-800: #00552b;
  --green-700: #087039;
  --green-500: #77bf1f;
  --green-300: #cceb77;
  --cream: #fbfaf2;
  --line: #dfe8d0;
  --ink: #061a2c;
  --muted: #516276;
  --danger: #d93025;
  --warning: #ffbd22;
  --card: rgba(255, 255, 255, 0.9);
  --shadow: 0 16px 45px rgba(16, 48, 28, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body.is-authenticated #login {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(183, 225, 86, 0.24), transparent 26rem),
    linear-gradient(115deg, #fffdf5, #f8fbef 48%, #ffffff);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(0, 63, 34, 0.84), rgba(0, 63, 34, 0.72)),
    url("/static/assets/logo-isotipo.png") center 8% / 520px auto no-repeat,
    var(--green-900);
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.login-logo {
  display: block;
  width: min(260px, 90%);
  margin: 0 auto 28px;
}

.login-card h1 {
  margin: 0;
  color: var(--green-900);
  font-size: 2rem;
  line-height: 1.05;
}

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

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

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--green-900);
  font-weight: 800;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink);
  background: #fff;
  outline-color: var(--green-500);
}

.login-card button,
.soft-button {
  border: 0;
  border-radius: 8px;
  padding: 14px 18px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
  box-shadow: 0 10px 22px rgba(0, 85, 43, 0.22);
}

#login-error {
  min-height: 18px;
  color: var(--danger);
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 142px;
  padding: 24px clamp(18px, 4vw, 56px);
  background:
    linear-gradient(135deg, rgba(0, 63, 34, 0.98), rgba(0, 85, 43, 0.94)),
    var(--green-900);
  border-bottom-right-radius: 42px;
  box-shadow: 0 18px 45px rgba(0, 63, 34, 0.22);
}

.topbar img {
  width: min(330px, 62vw);
  max-height: 88px;
  object-fit: contain;
}

.icon-button {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 6px;
  background: rgba(245, 250, 231, 0.9);
}

.icon-button span {
  width: 28px;
  height: 4px;
  border-radius: 20px;
  background: var(--green-800);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1220px, calc(100% - 36px));
  margin: 34px auto 22px;
}

.hero > div:first-child {
  display: flex;
  align-items: center;
  gap: 22px;
}

.back-button {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  color: var(--green-900);
  font-size: 42px;
  line-height: 0;
  background: var(--green-300);
}

.hero h1 {
  margin: 0;
  color: var(--green-900);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero p {
  margin: 10px 0 0;
  color: #1c2f42;
  font-size: 1.08rem;
  font-weight: 700;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 0 24px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  white-space: nowrap;
}

.period-panel {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.period-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-filters,
.chart-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.quick-filters button,
.chart-toolbar button,
.custom-range button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--green-900);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 900;
}

.quick-filters button.active,
.chart-toolbar button.active,
.quick-filters button:hover,
.chart-toolbar button:hover,
.custom-range button {
  color: #fff;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
}

.custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.custom-range input {
  width: 138px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  color: var(--green-900);
  background: #f8fbef;
  font-size: 0.74rem;
  font-weight: 850;
}

.custom-range span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

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

.card-heading h2 {
  margin: 0;
}

.chart-toolbar span {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.calendar-icon,
.nav-icon,
.kpi-icon {
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.calendar-icon {
  width: 23px;
  height: 23px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.calendar-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  border-top: 3px solid currentColor;
}

.content {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

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

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

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

.card,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card {
  padding: 24px;
}

.kpi-card {
  min-height: 150px;
  padding: 24px;
  display: grid;
  align-content: space-between;
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--green-900);
  font-weight: 900;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef8d0, var(--green-300));
}

.kpi-card strong {
  display: block;
  color: var(--green-900);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.kpi-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.card h2 {
  margin: 0 0 18px;
  color: var(--green-900);
  font-size: clamp(1.24rem, 2vw, 1.55rem);
}

.chart-card {
  min-height: 360px;
}

.line-chart,
.bar-chart {
  width: 100%;
  min-height: 260px;
}

.chart-caption {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: -8px;
  color: var(--green-900);
  font-weight: 900;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 26px;
}

.donut {
  --a: 40%;
  --b: 72%;
  --c: 88%;
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green-800) 0 var(--a), var(--green-500) var(--a) var(--b), #bde46d var(--b) var(--c), #e3f3b7 var(--c) 100%);
}

.donut::before {
  content: attr(data-total) "\A" attr(data-label);
  white-space: pre;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--green-900);
  text-align: center;
  font-weight: 950;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.legend {
  display: grid;
  gap: 13px;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 10px;
  color: #203044;
  font-weight: 700;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-800);
}

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

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

th {
  padding: 14px 16px;
  color: #fff;
  text-align: left;
  background: linear-gradient(90deg, var(--green-900), var(--green-700));
  font-size: 0.92rem;
}

th:first-child {
  border-top-left-radius: 8px;
}

th:last-child {
  border-top-right-radius: 8px;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1e4;
  font-weight: 650;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--green-900);
  background: #e8f7d7;
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status.low {
  color: #6d4b00;
  background: #fff0a8;
}

.status.critical,
.status.end {
  color: var(--danger);
  background: #ffe0dc;
}
/* Clientes statement layout v38 */
.dashboard-clients {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-template-areas: "statement" !important;
  align-items: stretch !important;
}

.dashboard-clients > .clients-statement-card {
  grid-area: statement !important;
  min-height: 0 !important;
  height: 100% !important;
}

.dashboard-clients .clients-statement-card .table-wrap {
  max-height: none !important;
  min-height: 0 !important;
}

.dashboard-clients .clients-statement-card table {
  table-layout: fixed;
}

.dashboard-clients .clients-statement-card th:nth-child(1),
.dashboard-clients .clients-statement-card td:nth-child(1) {
  width: 130px;
}

.dashboard-clients .clients-statement-card th:nth-child(2),
.dashboard-clients .clients-statement-card td:nth-child(2) {
  width: 120px;
}

.dashboard-clients .clients-statement-card th:nth-child(3),
.dashboard-clients .clients-statement-card td:nth-child(3) {
  width: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.dashboard-clients .clients-statement-card th:nth-child(4),
.dashboard-clients .clients-statement-card td:nth-child(4),
.dashboard-clients .clients-statement-card th:nth-child(5),
.dashboard-clients .clients-statement-card td:nth-child(5),
.dashboard-clients .clients-statement-card th:nth-child(6),
.dashboard-clients .clients-statement-card td:nth-child(6) {
  width: 112px;
}

@media (max-width: 900px) {
  .dashboard-clients {
    grid-template-rows: auto !important;
    height: auto !important;
  }

  .dashboard-clients > .clients-statement-card {
    height: auto !important;
    min-height: 640px !important;
  }

  .dashboard-clients .clients-statement-card table {
    min-width: 720px;
  }

  .dashboard-clients .clients-statement-card th:nth-child(1),
  .dashboard-clients .clients-statement-card td:nth-child(1) {
    width: 108px;
  }

  .dashboard-clients .clients-statement-card th:nth-child(2),
  .dashboard-clients .clients-statement-card td:nth-child(2) {
    width: 90px;
  }

  .dashboard-clients .clients-statement-card th:nth-child(4),
  .dashboard-clients .clients-statement-card td:nth-child(4),
  .dashboard-clients .clients-statement-card th:nth-child(5),
  .dashboard-clients .clients-statement-card td:nth-child(5),
  .dashboard-clients .clients-statement-card th:nth-child(6),
  .dashboard-clients .clients-statement-card td:nth-child(6) {
    width: 88px;
  }
}

.simulate-mobile .dashboard-clients {
  grid-template-rows: auto !important;
  height: auto !important;
}

.simulate-mobile .dashboard-clients > .clients-statement-card {
  height: auto !important;
  min-height: 640px !important;
}

.simulate-mobile .dashboard-clients .clients-statement-card table {
  min-width: 720px;
}



/* Devoluciones layout v36 */
.dashboard-waste {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
  grid-template-areas:
    "destination credit"
    "returns returns" !important;
  gap: 10px;
}

.dashboard-waste .returns-destination-card {
  grid-area: destination !important;
  min-height: 0;
  height: 100%;
}

.dashboard-waste .returns-credit-card {
  grid-area: credit !important;
  min-height: 0;
  height: 100%;
}

.dashboard-waste .returns-detail-card {
  grid-area: returns !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.dashboard-waste .returns-destination-card .donut-wrap {
  height: calc(100% - 34px);
  align-items: center;
}

.dashboard-waste .returns-destination-card .inventory-total-ref {
  margin: 8px 0 4px;
}

.dashboard-waste .returns-destination-card .bar-chart {
  height: calc(100% - 72px);
  min-height: 130px;
}

.dashboard-waste .returns-credit-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px 12px;
}

.dashboard-waste .returns-credit-card h2 {
  grid-column: 1 / -1;
}

.dashboard-waste .returns-credit-summary {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 86px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(231, 247, 211, 0.9), rgba(255, 255, 255, 0.78));
  color: var(--green);
}

.dashboard-waste .returns-credit-summary span,
.dashboard-waste .returns-credit-summary small {
  font-size: 0.66rem;
  font-weight: 800;
  color: #304962;
}

.dashboard-waste .returns-credit-summary strong {
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  line-height: 1;
}

.dashboard-waste .returns-credit-card .bar-chart {
  height: 100%;
  min-height: 0;
}

.dashboard-waste .returns-detail-card .table-title-row {
  flex: 0 0 auto;
}

.dashboard-waste .returns-detail-card .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.dashboard-waste .returns-detail-card th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.dashboard-waste .returns-detail-card table {
  min-width: 1040px;
}

.dashboard-waste .returns-search input {
  min-width: 230px;
}

@media (max-width: 900px) {
  .dashboard-waste {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "destination"
      "credit"
      "returns" !important;
  }

  .dashboard-waste .returns-destination-card {
    height: 250px;
  }

  .dashboard-waste .returns-credit-card {
    display: block;
    height: 250px;
  }

  .dashboard-waste .returns-credit-summary {
    min-height: 0;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .dashboard-waste .returns-credit-card .bar-chart {
    height: calc(100% - 96px);
  }

  .dashboard-waste .returns-detail-card {
    height: 410px;
  }

  .dashboard-waste .returns-detail-card .table-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-waste .returns-detail-card .returns-search {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dashboard-waste .returns-detail-card .returns-search input {
    width: 100%;
    min-width: 0;
  }

  .dashboard-waste .returns-detail-card table {
    min-width: 900px;
    width: max-content;
  }

  .dashboard-waste .returns-detail-card th,
  .dashboard-waste .returns-detail-card td {
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
  }
}

.simulate-mobile .dashboard-waste {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "destination"
    "credit"
    "returns" !important;
}

.simulate-mobile .dashboard-waste .returns-destination-card {
  height: 250px;
}

.simulate-mobile .dashboard-waste .returns-credit-card {
  display: block;
  height: 250px;
}

.simulate-mobile .dashboard-waste .returns-credit-summary {
  min-height: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.simulate-mobile .dashboard-waste .returns-credit-card .bar-chart {
  height: calc(100% - 96px);
}

.simulate-mobile .dashboard-waste .returns-detail-card {
  height: 410px;
}

.simulate-mobile .dashboard-waste .returns-detail-card .table-title-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.simulate-mobile .dashboard-waste .returns-detail-card .returns-search {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .dashboard-waste .returns-detail-card .returns-search input {
  width: 100%;
  min-width: 0;
}

.simulate-mobile .dashboard-waste .returns-detail-card table {
  min-width: 900px;
  width: max-content;
}

.simulate-mobile .dashboard-waste .returns-detail-card th,
.simulate-mobile .dashboard-waste .returns-detail-card td {
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 8px;
  color: var(--green-900);
  background: linear-gradient(90deg, #e8f7d7, #fbfaf2);
  font-weight: 850;
}

.status-bar {
  width: min(1220px, calc(100% - 36px));
  margin: 22px auto 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  width: min(980px, 100%);
  transform: translateX(-50%);
  padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background: linear-gradient(135deg, #004925, #002d19);
  box-shadow: 0 -18px 44px rgba(0, 63, 34, 0.22);
}

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

.clients-statement-card {
  display: flex;
  flex-direction: column;
  min-height: min(620px, calc(100vh - 250px));
}

.client-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}

.client-picker {
  display: grid;
  gap: 6px;
  max-width: 520px;
}

.client-picker label,
.client-statement-title small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.client-picker select,
.client-search input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 850;
  outline-color: var(--green-500);
}

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

.soft-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--green-900);
  background: #f8fbef;
  font-size: 0.82rem;
  font-weight: 900;
}

.soft-action:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
}

.client-statement-title {
  align-items: end;
  margin-bottom: 10px;
}

.client-statement-title h2 {
  margin-bottom: 2px;
}

.client-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.client-filter-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--green-900);
  background: #f8fbef;
  font-size: 0.8rem;
  font-weight: 900;
}

.client-filter-row button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
  box-shadow: 0 10px 24px rgba(0, 85, 43, 0.18);
}

.clients-statement-card .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.clients-statement-card table {
  min-width: 900px;
}

.clients-statement-card th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.clients-statement-card th:nth-child(3),
.clients-statement-card td:nth-child(3) {
  width: 36%;
  min-width: 300px;
  white-space: normal;
}

.clients-statement-card td:nth-child(4),
.clients-statement-card td:nth-child(5),
.clients-statement-card td:nth-child(6) {
  text-align: right;
  white-space: nowrap;
}

.clients-statement-card th:nth-child(4),
.clients-statement-card th:nth-child(5),
.clients-statement-card th:nth-child(6) {
  text-align: right;
}

@media (max-width: 900px) {
  .client-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .client-actions {
    justify-content: stretch;
  }

  .client-actions .soft-action {
    flex: 1 1 0;
  }

  .client-statement-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .client-search {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .client-search input {
    width: 100%;
    min-width: 0;
  }

  .client-filter-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .client-filter-row button {
    min-height: 30px;
    padding: 0 4px;
    font-size: 0.68rem;
  }

  .clients-statement-card {
    min-height: 620px;
  }

  .clients-statement-card table {
    min-width: 720px;
  }

  .clients-statement-card th,
  .clients-statement-card td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .clients-statement-card th:nth-child(3),
  .clients-statement-card td:nth-child(3) {
    min-width: 220px;
  }
}

.simulate-mobile .client-toolbar {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.simulate-mobile .client-actions {
  justify-content: stretch;
}

.simulate-mobile .client-actions .soft-action {
  flex: 1 1 0;
}

.simulate-mobile .client-statement-title {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.simulate-mobile .client-search {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .client-search input {
  width: 100%;
  min-width: 0;
}

.simulate-mobile .client-filter-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.simulate-mobile .client-filter-row button {
  min-height: 30px;
  padding: 0 4px;
  font-size: 0.68rem;
}

.simulate-mobile .clients-statement-card {
  min-height: 620px;
}

.simulate-mobile .clients-statement-card table {
  min-width: 720px;
}

.simulate-mobile .clients-statement-card th,
.simulate-mobile .clients-statement-card td {
  padding-left: 8px;
  padding-right: 8px;
}

.simulate-mobile .clients-statement-card th:nth-child(3),
.simulate-mobile .clients-statement-card td:nth-child(3) {
  min-width: 220px;
}



.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
}

.bottom-nav button.active {
  background: linear-gradient(135deg, rgba(119, 191, 31, 0.96), rgba(71, 139, 31, 0.82));
}

.nav-icon {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
}

.nav-icon.home {
  transform: rotate(45deg);
  border-bottom-color: transparent;
  border-right-color: transparent;
}

.nav-icon.chart {
  border-top: 0;
  border-right: 0;
}

.nav-icon.users {
  border-radius: 50%;
}

.nav-icon.box {
  transform: rotate(45deg);
}

.nav-icon.warn {
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 17px solid currentColor;
  background: transparent;
}

.empty {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 900px) {
  .topbar {
    min-height: 116px;
    border-bottom-right-radius: 28px;
  }

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

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

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-bottom: 64px;
  }

  .topbar {
    min-height: 92px;
    padding: 14px 18px;
  }

  .topbar img {
    width: 230px;
  }

  .icon-button {
    width: 52px;
    height: 52px;
  }

  .hero,
  .content,
  .status-bar {
    width: calc(100% - 26px);
  }

  .hero > div:first-child {
    gap: 14px;
  }

  .back-button {
    width: 48px;
    height: 48px;
    font-size: 34px;
  }

  .date-pill {
    width: 100%;
    justify-content: center;
    min-height: 56px;
    padding: 0 14px;
    white-space: normal;
    text-align: center;
  }

  .card,
  .kpi-card {
    padding: 18px;
  }

  .chart-card {
    min-height: 300px;
  }

  .bottom-nav {
    gap: 3px;
    padding-inline: 5px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }

  .bottom-nav button {
    min-height: 42px;
    font-size: 0.66rem;
  }

  .nav-icon {
    width: 15px;
    height: 15px;
  }
}

.simulate-mobile body {
  background: #dfe5dc;
}

.simulate-mobile .app-shell,
.simulate-mobile .login-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 63, 34, 0.1), 0 30px 90px rgba(0, 0, 0, 0.24);
}

.simulate-mobile .topbar {
  min-height: 92px;
  padding: 14px 18px;
  border-bottom-right-radius: 28px;
}

.simulate-mobile .topbar img {
  width: 230px;
}

.simulate-mobile .icon-button {
  width: 52px;
  height: 52px;
}

.simulate-mobile .hero,
.simulate-mobile .content,
.simulate-mobile .status-bar {
  width: calc(100% - 26px);
}

.simulate-mobile .hero {
  align-items: flex-start;
  flex-direction: column;
}

.simulate-mobile .hero > div:first-child {
  gap: 14px;
}

.simulate-mobile .hero h1 {
  font-size: 2.35rem;
}

.simulate-mobile .back-button {
  width: 48px;
  height: 48px;
  font-size: 34px;
}

.simulate-mobile .date-pill {
  width: 100%;
  justify-content: center;
  min-height: 56px;
  padding: 0 14px;
  white-space: normal;
  text-align: center;
}

.simulate-mobile .grid.four,
.simulate-mobile .grid.two {
  grid-template-columns: 1fr;
}

.simulate-mobile .card,
.simulate-mobile .kpi-card {
  padding: 18px;
}

.simulate-mobile .chart-card {
  min-height: 300px;
}

.simulate-mobile .donut-wrap {
  grid-template-columns: 1fr;
  justify-items: center;
}

.simulate-mobile .legend {
  width: 100%;
}

.simulate-mobile .bottom-nav {
  width: min(430px, 100%);
  gap: 3px;
  padding-inline: 5px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.simulate-mobile .bottom-nav button {
  min-height: 42px;
  font-size: 0.66rem;
}

.simulate-mobile .nav-icon {
  width: 15px;
  height: 15px;
}

/* Compact dashboard pass */
.app-shell {
  padding-bottom: 60px;
}

.topbar {
  min-height: 74px;
  padding: 10px clamp(16px, 2.6vw, 42px);
  border-bottom-right-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 63, 34, 0.2);
}

.topbar img {
  width: min(250px, 55vw);
  max-height: 54px;
  padding: 7px 12px;
  border-radius: 10px;
  background: radial-gradient(circle at 45% 48%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74) 58%, rgba(255, 255, 255, 0.16) 100%);
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.2);
}

.icon-button {
  width: 42px;
  height: 42px;
}

.icon-button span {
  width: 20px;
  height: 3px;
}

.hero,
.content,
.status-bar {
  width: min(1460px, calc(100% - 34px));
}

.hero {
  gap: 14px;
  margin: 18px auto 14px;
}

.hero > div:first-child {
  gap: 14px;
}

.back-button {
  width: 38px;
  height: 38px;
  font-size: 28px;
}

.hero h1 {
  font-size: clamp(1.75rem, 3vw, 3rem);
}

.hero p {
  margin-top: 4px;
  font-size: 0.9rem;
}

.date-pill {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.84rem;
}

.calendar-icon {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.calendar-icon::before {
  top: 4px;
  border-top-width: 2px;
}

.content {
  gap: 14px;
}

.grid {
  gap: 12px;
}

.card {
  padding: 16px;
  overflow: hidden;
}

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

.kpi-top {
  gap: 10px;
  font-size: 0.82rem;
}

.kpi-icon {
  width: 30px;
  height: 30px;
}

.kpi-card strong {
  font-size: clamp(1.45rem, 2.4vw, 2.35rem);
  overflow-wrap: anywhere;
}

.kpi-card small {
  margin-top: 3px;
  font-size: 0.76rem;
}

.card h2 {
  margin-bottom: 12px;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
}

.chart-card {
  min-height: 265px;
}

.line-chart,
.bar-chart {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 190px;
}

.chart-caption {
  gap: 14px;
  margin-top: -4px;
  font-size: 0.78rem;
}

.donut-wrap {
  grid-template-columns: minmax(150px, 190px) 1fr;
  gap: 16px;
}

.donut {
  width: min(190px, 100%);
}

.legend {
  gap: 9px;
}

.legend-row {
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  font-size: 0.86rem;
}

.dot {
  width: 12px;
  height: 12px;
}

th {
  padding: 10px 12px;
  font-size: 0.8rem;
}

td {
  padding: 10px 12px;
  font-size: 0.84rem;
}

.status {
  min-width: 70px;
  padding: 5px 9px;
  font-size: 0.68rem;
}

.notice {
  padding: 10px 14px;
}

.status-bar {
  margin-top: 14px;
  font-size: 0.8rem;
}

@media (min-width: 1180px) {
  .content {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    align-items: start;
  }

  .content > .grid.four,
  .content > .chart-card,
  .content > .notice {
    grid-column: 1 / -1;
  }

  .content > .grid.two {
    grid-column: 1 / -1;
  }

  .content > .card:last-of-type {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 68px;
    padding: 9px 14px;
    border-bottom-right-radius: 14px;
  }

  .topbar img {
    width: min(210px, 58vw);
    max-height: 48px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .icon-button span {
    width: 18px;
    height: 3px;
  }

  .hero,
  .content,
  .status-bar {
    width: min(100% - 20px, 520px);
  }

  .hero {
    gap: 10px;
    margin: 14px auto 10px;
  }

  .hero h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .hero p {
    font-size: 0.78rem;
  }

  .back-button {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }

  .date-pill {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .period-panel {
    width: 100%;
    justify-items: stretch;
  }

  .period-controls {
    justify-content: stretch;
  }

  .quick-filters,
  .custom-range,
  .chart-toolbar {
    width: 100%;
  }

  .quick-filters,
  .chart-toolbar {
    justify-content: space-between;
  }

  .quick-filters button,
  .chart-toolbar button,
  .custom-range button {
    padding: 0 7px;
    font-size: 0.62rem;
  }

  .custom-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
  }

  .custom-range input {
    width: 100%;
    min-width: 0;
    font-size: 0.62rem;
  }

  .card-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

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

  .kpi-card {
    min-height: 78px;
    padding: 11px;
  }

  .kpi-top {
    gap: 7px;
    font-size: 0.66rem;
  }

  .kpi-icon {
    width: 24px;
    height: 24px;
  }

  .kpi-card strong {
    font-size: clamp(1.02rem, 5.2vw, 1.34rem);
  }

  .kpi-card small {
    font-size: 0.62rem;
  }

  .card {
    padding: 12px;
  }

  .card h2 {
    font-size: 0.94rem;
  }

  .chart-card {
    min-height: 0;
  }

  .line-chart,
  .bar-chart {
    width: 100% !important;
    height: auto;
    min-height: 0;
  }

  .line-chart {
    aspect-ratio: 640 / 210;
  }

  .bar-chart {
    aspect-ratio: 640 / 190;
  }

  .chart-caption {
    display: none;
  }

  .donut-wrap {
    grid-template-columns: 126px 1fr;
    gap: 10px;
    justify-items: stretch;
  }

  .donut {
    width: 126px;
  }

  .legend-row {
    font-size: 0.68rem;
  }

  .dot {
    width: 9px;
    height: 9px;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 8px 9px;
    font-size: 0.72rem;
  }
}

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

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend {
    width: 100%;
  }
}

.simulate-mobile .app-shell,
.simulate-mobile .login-shell {
  width: min(390px, 100%);
}

.simulate-mobile .topbar {
  min-height: 68px;
  padding: 9px 14px;
  border-bottom-right-radius: 14px;
}

.simulate-mobile .topbar img {
  width: min(210px, 58vw);
  max-height: 48px;
}

.simulate-mobile .icon-button {
  width: 38px;
  height: 38px;
}

.simulate-mobile .hero,
.simulate-mobile .content,
.simulate-mobile .status-bar {
  width: min(100% - 20px, 520px);
}

.simulate-mobile .hero {
  gap: 10px;
  margin: 14px auto 10px;
}

.simulate-mobile .hero h1 {
  font-size: clamp(1.45rem, 8vw, 2rem);
}

.simulate-mobile .hero p {
  font-size: 0.78rem;
}

.simulate-mobile .back-button {
  width: 30px;
  height: 30px;
  font-size: 22px;
}

.simulate-mobile .date-pill {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.68rem;
}

.simulate-mobile .period-panel {
  width: 100%;
  justify-items: stretch;
}

.simulate-mobile .period-controls {
  justify-content: stretch;
}

.simulate-mobile .quick-filters,
.simulate-mobile .custom-range,
.simulate-mobile .chart-toolbar {
  width: 100%;
}

.simulate-mobile .quick-filters,
.simulate-mobile .chart-toolbar {
  justify-content: space-between;
}

.simulate-mobile .quick-filters button,
.simulate-mobile .chart-toolbar button,
.simulate-mobile .custom-range button {
  padding: 0 7px;
  font-size: 0.62rem;
}

.simulate-mobile .custom-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
}

.simulate-mobile .custom-range input {
  width: 100%;
  min-width: 0;
  font-size: 0.62rem;
}

.simulate-mobile .card-heading {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

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

.simulate-mobile .kpi-card {
  min-height: 78px;
  padding: 11px;
}

.simulate-mobile .kpi-top {
  gap: 7px;
  font-size: 0.66rem;
}

.simulate-mobile .kpi-icon {
  width: 24px;
  height: 24px;
}

.simulate-mobile .kpi-card strong {
  font-size: clamp(1.02rem, 5.2vw, 1.34rem);
}

.simulate-mobile .kpi-card small {
  font-size: 0.62rem;
}

.simulate-mobile .card {
  padding: 12px;
}

.simulate-mobile .chart-card {
  min-height: 0;
}

.simulate-mobile .line-chart,
.simulate-mobile .bar-chart {
  width: 100% !important;
  height: auto;
  min-height: 0;
}

.simulate-mobile .line-chart {
  aspect-ratio: 640 / 210;
}

.simulate-mobile .chart-caption {
  display: none;
}

.simulate-mobile .donut-wrap {
  grid-template-columns: 126px 1fr;
  gap: 10px;
  justify-items: stretch;
}

.simulate-mobile .donut {
  width: 126px;
}

.simulate-mobile .legend-row {
  font-size: 0.68rem;
}

.simulate-mobile .bottom-nav {
  width: min(390px, 100%);
}

/* Single-screen dashboard redesign */
body.is-authenticated {
  overflow: hidden;
}

body.is-authenticated .app-shell {
  height: 100dvh;
  min-height: 0;
  padding-bottom: 48px;
  overflow: hidden;
}

body.is-authenticated .topbar {
  min-height: 54px;
  padding-block: 6px;
}

body.is-authenticated .topbar img {
  width: 210px;
  max-height: 42px;
  padding: 5px 10px;
}

body.is-authenticated .icon-button {
  width: 34px;
  height: 34px;
}

body.is-authenticated .icon-button span {
  width: 17px;
  height: 2px;
}

body.is-authenticated .hero {
  min-height: 58px;
  margin: 8px auto;
}

body.is-authenticated .back-button {
  width: 28px;
  height: 28px;
  font-size: 20px;
}

body.is-authenticated .hero h1 {
  font-size: clamp(1.45rem, 2.45vw, 2.25rem);
}

body.is-authenticated .hero p {
  font-size: 0.72rem;
}

body.is-authenticated .period-panel {
  gap: 5px;
}

body.is-authenticated .date-pill {
  min-height: 32px;
  padding-inline: 12px;
  font-size: 0.68rem;
}

body.is-authenticated .custom-range {
  padding: 3px;
}

body.is-authenticated .custom-range input {
  width: 118px;
  min-height: 24px;
  font-size: 0.62rem;
}

body.is-authenticated .content {
  height: calc(100dvh - 54px - 74px - 52px);
  gap: 10px;
  overflow: hidden;
}

.dashboard-view {
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.82fr);
  grid-template-areas:
    "kpis kpis"
    "main side"
    "lower lower";
}

.dashboard-view > .grid.four {
  grid-area: kpis;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-view > .chart-card {
  grid-area: main;
}

.dashboard-view > .grid.two {
  grid-area: side;
  grid-template-columns: 1fr;
  min-height: 0;
}

.dashboard-view > .grid.two > .card {
  min-height: 0;
}

.dashboard-view > .card:last-of-type {
  grid-area: lower;
  min-height: 0;
}

.dashboard-view > .notice {
  display: none;
}

.dashboard-view .card,
.dashboard-view .kpi-card {
  box-shadow: 0 9px 26px rgba(16, 48, 28, 0.08);
}

.dashboard-view .kpi-card {
  min-height: 72px;
  padding: 10px 12px;
}

.dashboard-view .kpi-top {
  gap: 7px;
  font-size: 0.65rem;
}

.dashboard-view .kpi-icon {
  width: 22px;
  height: 22px;
}

.dashboard-view .kpi-card strong {
  font-size: clamp(1.16rem, 2vw, 1.8rem);
}

.dashboard-view .kpi-card small {
  font-size: 0.58rem;
}

.dashboard-view .card {
  padding: 11px 12px;
}

.dashboard-view .card h2 {
  font-size: 0.86rem;
}

.dashboard-view .chart-card {
  min-height: 0;
}

.dashboard-view .card-heading {
  margin-bottom: 7px;
}

.dashboard-view .chart-toolbar {
  padding: 2px;
}

.dashboard-view .chart-toolbar span,
.dashboard-view .chart-toolbar button {
  min-height: 22px;
  font-size: 0.58rem;
}

.dashboard-view .line-chart {
  height: calc(100% - 42px);
  min-height: 0;
}

.dashboard-view .bar-chart {
  min-height: 0;
}

.dashboard-view .chart-caption {
  display: none;
}

.dashboard-view .donut-wrap {
  grid-template-columns: 132px 1fr;
  gap: 10px;
}

.dashboard-view .donut {
  width: 132px;
}

.dashboard-view .legend {
  gap: 5px;
}

.dashboard-view .legend-row {
  grid-template-columns: 9px 1fr auto;
  gap: 6px;
  font-size: 0.62rem;
}

.dashboard-view .dot {
  width: 9px;
  height: 9px;
}

.dashboard-view .table-wrap {
  max-height: calc(100% - 28px);
  overflow: auto;
}

.dashboard-view table {
  min-width: 0;
}

.dashboard-view th {
  padding: 7px 8px;
  font-size: 0.64rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.dashboard-view td {
  padding: 6px 8px;
  font-size: 0.68rem;
}

.dashboard-view .status {
  min-width: 56px;
  padding: 3px 6px;
  font-size: 0.54rem;
}

body.is-authenticated .bottom-nav {
  width: min(820px, 100%);
  padding: 5px 9px max(5px, env(safe-area-inset-bottom));
}

body.is-authenticated .bottom-nav button {
  min-height: 34px;
  font-size: 0.62rem;
}

body.is-authenticated .nav-icon {
  width: 13px;
  height: 13px;
}

body.is-authenticated .nav-icon.warn {
  border-left-width: 7px;
  border-right-width: 7px;
  border-bottom-width: 13px;
}

body.is-authenticated .status-bar {
  display: none;
}

@media (min-width: 1180px) {
  .dashboard-summary {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.72fr);
    grid-template-areas:
      "kpis kpis"
      "main side"
      "lower side";
  }

  .dashboard-summary > .card:last-of-type {
    grid-area: lower;
  }
}

@media (max-width: 900px) {
  body.is-authenticated .app-shell {
    padding-bottom: 42px;
  }

  body.is-authenticated .topbar {
    min-height: 48px;
    padding: 5px 10px;
  }

  body.is-authenticated .topbar img {
    width: 174px;
    max-height: 38px;
  }

  body.is-authenticated .icon-button {
    width: 32px;
    height: 32px;
  }

  body.is-authenticated .hero {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 76px;
    gap: 5px;
    margin: 6px auto;
  }

  body.is-authenticated .hero > div:first-child {
    gap: 8px;
  }

  body.is-authenticated .hero h1 {
    font-size: clamp(1.25rem, 6vw, 1.58rem);
  }

  body.is-authenticated .hero p {
    font-size: 0.62rem;
  }

  body.is-authenticated .period-panel {
    gap: 3px;
  }

  body.is-authenticated .date-pill {
    min-height: 28px;
    font-size: 0.58rem;
  }

  body.is-authenticated .custom-range {
    grid-template-columns: 1fr auto 1fr;
  }

  body.is-authenticated .custom-range span {
    font-size: 0.55rem;
  }

  body.is-authenticated .custom-range input {
    width: 100%;
    min-height: 22px;
    font-size: 0.56rem;
  }

  body.is-authenticated .content {
    width: calc(100% - 12px);
    height: calc(100dvh - 48px - 88px - 50px);
    gap: 7px;
  }

  .dashboard-view {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.58fr);
    grid-template-areas:
      "kpis kpis"
      "main main"
      "side lower";
  }

  .dashboard-view > .grid.four {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-view > .grid.two {
    gap: 7px;
  }

  .dashboard-view .kpi-card {
    min-height: 48px;
    padding: 7px;
  }

  .dashboard-view .kpi-top {
    gap: 4px;
    font-size: 0.48rem;
  }

  .dashboard-view .kpi-icon {
    width: 16px;
    height: 16px;
  }

  .dashboard-view .kpi-card strong {
    font-size: clamp(0.86rem, 4.8vw, 1.12rem);
  }

  .dashboard-view .kpi-card small {
    display: none;
  }

  .dashboard-view .card {
    padding: 8px;
  }

  .dashboard-view .card h2 {
    font-size: 0.72rem;
  }

  .dashboard-view .card-heading {
    gap: 5px;
    margin-bottom: 5px;
  }

  .dashboard-view .chart-toolbar {
    gap: 2px;
  }

  .dashboard-view .chart-toolbar span {
    display: none;
  }

  .dashboard-view .chart-toolbar button {
    min-height: 20px;
    padding: 0 5px;
    font-size: 0.5rem;
  }

  .dashboard-view .line-chart {
    height: calc(100% - 34px);
  }

  .dashboard-view .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
  }

  .dashboard-view .donut {
    width: min(90px, 100%);
  }

  .dashboard-view .legend {
    width: 100%;
    gap: 3px;
  }

  .dashboard-view .legend-row {
    font-size: 0.48rem;
  }

  .dashboard-view .table-wrap {
    max-height: calc(100% - 20px);
  }

  .dashboard-view th,
  .dashboard-view td {
    padding: 4px 5px;
    font-size: 0.5rem;
  }

  body.is-authenticated .bottom-nav button {
    min-height: 31px;
    font-size: 0.54rem;
  }
}

@media (max-width: 520px) {
  body.is-authenticated .hero {
    min-height: 104px;
  }

  body.is-authenticated .period-controls {
    display: block;
  }

  body.is-authenticated .custom-range {
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
  }

  body.is-authenticated .content {
    height: calc(100dvh - 48px - 116px - 45px);
  }

  .dashboard-view .card h2 {
    font-size: 0.66rem;
  }

  .dashboard-view .chart-toolbar button {
    padding-inline: 4px;
  }
}

.simulate-mobile body.is-authenticated .content {
  height: calc(100dvh - 48px - 116px - 45px);
}

.simulate-mobile body.is-authenticated .bottom-nav {
  width: min(390px, 100%);
}

.simulate-mobile .dashboard-view {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.58fr);
  grid-template-areas:
    "kpis kpis"
    "main main"
    "side lower";
}

.simulate-mobile .dashboard-view > .grid.four {
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simulate-mobile .dashboard-view .kpi-card {
  min-height: 48px;
  padding: 7px;
}

.simulate-mobile .dashboard-view .kpi-top {
  gap: 4px;
  font-size: 0.48rem;
}

.simulate-mobile .dashboard-view .kpi-icon {
  width: 16px;
  height: 16px;
}

.simulate-mobile .dashboard-view .kpi-card strong {
  font-size: clamp(0.86rem, 4.8vw, 1.12rem);
}

.simulate-mobile .dashboard-view .kpi-card small {
  display: none;
}

/* Force phone layout inside desktop simulator */
.simulate-mobile body.is-authenticated {
  overflow: auto;
}

.simulate-mobile body.is-authenticated .app-shell {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
  padding-bottom: 48px;
}

.simulate-mobile body.is-authenticated .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title period"
    "filters filters"
    "kpis kpis";
  align-items: start;
  min-height: 0;
  gap: 5px;
}

.simulate-mobile body.is-authenticated .hero-title {
  grid-area: title;
}

.simulate-mobile body.is-authenticated .period-panel {
  display: contents;
}

.simulate-mobile body.is-authenticated .date-pill {
  grid-area: period;
  align-self: center;
  width: auto;
  min-width: 138px;
  padding-inline: 8px;
}

.simulate-mobile body.is-authenticated .period-controls {
  grid-area: filters;
  display: block;
  margin-top: 4px;
}

.simulate-mobile body.is-authenticated .custom-range {
  grid-template-columns: 1fr auto 1fr;
  width: 100%;
}

.simulate-mobile body.is-authenticated .hero-kpis {
  display: grid;
  grid-area: kpis;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.simulate-mobile body.is-authenticated .mini-kpi {
  padding: 7px 8px;
}

.simulate-mobile body.is-authenticated .mini-kpi strong {
  font-size: clamp(0.95rem, 5vw, 1.2rem);
}

.simulate-mobile body.is-authenticated .content {
  display: grid;
  width: calc(100% - 12px);
  height: auto;
  overflow: visible;
}

.simulate-mobile .dashboard-summary {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto !important;
  grid-template-areas: none !important;
  gap: 8px;
}

.simulate-mobile .dashboard-summary > * {
  grid-area: auto !important;
}

.simulate-mobile .dashboard-summary .summary-main-grid,
.simulate-mobile .dashboard-summary .summary-tables-grid {
  grid-template-columns: 1fr !important;
  gap: 8px;
  width: 100%;
}

.simulate-mobile .dashboard-summary .summary-sales-chart {
  height: 230px;
}

.simulate-mobile .dashboard-summary .summary-box-chart {
  height: 190px;
}

.simulate-mobile .dashboard-summary .summary-sales-chart .line-chart,
.simulate-mobile .dashboard-summary .summary-box-chart .bar-chart {
  height: calc(100% - 42px);
}

/* v11 refinements */
.dashboard-summary {
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr) !important;
}

body.is-authenticated .bottom-nav {
  transform: translate(-50%, calc(100% - 7px));
  opacity: 0.35;
  transition: transform 180ms ease, opacity 180ms ease;
}

body.is-authenticated .bottom-nav:hover,
body.nav-visible .bottom-nav {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (hover: none) {
  body.is-authenticated .bottom-nav {
    transform: translate(-50%, calc(100% + 2px));
    opacity: 0;
  }

  body.nav-visible .bottom-nav {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  body.is-authenticated .hero h1 {
    font-size: clamp(1rem, 4.4vw, 1.24rem);
    line-height: 1;
  }

  body.is-authenticated .hero p {
    font-size: 0.54rem;
  }

  body.is-authenticated .back-button {
    width: 24px;
    height: 24px;
    font-size: 18px;
  }

  body.is-authenticated .hero-title {
    gap: 6px;
  }

  body.is-authenticated .date-pill {
    min-width: 120px;
    min-height: 25px;
    font-size: 0.5rem;
  }

  body.is-authenticated .hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-summary {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "sales"
      "boxes"
      "inventory"
      "clients" !important;
  }

  .dashboard-summary .summary-box-chart,
  .dashboard-summary .summary-inventory-card {
    height: 176px;
  }
}

.simulate-mobile body.is-authenticated .hero h1 {
  font-size: clamp(1rem, 4.4vw, 1.24rem);
  line-height: 1;
}

.simulate-mobile body.is-authenticated .hero p {
  font-size: 0.54rem;
}

.simulate-mobile body.is-authenticated .back-button {
  width: 24px;
  height: 24px;
  font-size: 18px;
}

.simulate-mobile body.is-authenticated .hero-title {
  gap: 6px;
}

.simulate-mobile body.is-authenticated .date-pill {
  min-width: 120px;
  min-height: 25px;
  font-size: 0.5rem;
}

.simulate-mobile .dashboard-summary {
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "sales"
    "boxes"
    "inventory"
    "clients" !important;
}

.simulate-mobile .dashboard-summary .summary-box-chart,
.simulate-mobile .dashboard-summary .summary-inventory-card {
  height: 176px;
}

.simulate-mobile .summary-table-card {
  height: 260px;
}

/* Resumen v10 exact layout */
.mini-kpi {
  display: grid;
  align-content: space-between;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(16, 48, 28, 0.08);
}

.mini-kpi-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--green-900);
  font-size: 0.58rem;
  font-weight: 950;
}

.mini-kpi .kpi-icon {
  width: 18px;
  height: 18px;
}

.mini-kpi-ok .kpi-icon {
  background: linear-gradient(145deg, #0b7a32, #6fbd1f);
}

.mini-kpi-warn .kpi-icon {
  background: linear-gradient(145deg, #ffd43b, #f59f00);
}

.mini-kpi-danger .kpi-icon {
  background: linear-gradient(145deg, #e03131, #ff6b6b);
}

.mini-kpi strong {
  display: block;
  color: var(--green-900);
  font-size: clamp(0.98rem, 1.55vw, 1.34rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.mini-kpi small {
  display: block;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 900;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr) !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-areas:
    "sales inventory"
    "clients boxes" !important;
  gap: 10px;
}

.dashboard-summary > * {
  grid-area: auto;
}

.dashboard-summary .summary-sales-chart {
  grid-area: sales !important;
}

.dashboard-summary .summary-clients-card {
  grid-area: clients !important;
}

.dashboard-summary .summary-inventory-card {
  grid-area: inventory !important;
}

.dashboard-summary .summary-box-chart {
  grid-area: boxes !important;
}

.dashboard-summary .summary-sales-chart,
.dashboard-summary .summary-box-chart,
.dashboard-summary .summary-clients-card,
.dashboard-summary .summary-inventory-card {
  min-height: 0;
  height: 100%;
}

.dashboard-summary .summary-sales-chart .line-chart,
.dashboard-summary .summary-box-chart .bar-chart {
  height: calc(100% - 34px);
  min-height: 0;
}

.dashboard-summary .summary-sales-chart,
.dashboard-summary .summary-box-chart {
  padding-left: 8px;
  padding-right: 8px;
}

.dashboard-summary .summary-sales-chart .card-heading,
.dashboard-summary .summary-box-chart h2 {
  padding-left: 4px;
  padding-right: 4px;
}

.dashboard-summary .summary-table-card .table-wrap {
  height: calc(100% - 28px);
  max-height: none;
  overflow-y: auto;
}

.dashboard-summary .summary-clients-card .table-wrap {
  height: calc(100% - 36px);
}

.table-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.table-title-row h2 {
  margin: 0;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.table-actions span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.table-actions button {
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  color: var(--green-900);
  background: #edf6d9;
  font-size: 0.58rem;
  font-weight: 950;
}

.table-actions button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
}

.dashboard-summary .summary-table-card table {
  min-width: 0;
}

@media (max-width: 900px) {
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto auto auto !important;
    grid-template-areas:
      "sales sales"
      "boxes inventory"
      "clients clients" !important;
    gap: 8px;
  }

  .dashboard-summary .summary-sales-chart {
    height: 230px;
  }

  .dashboard-summary .summary-box-chart,
  .dashboard-summary .summary-inventory-card {
    height: 190px;
  }

  .dashboard-summary .summary-clients-card {
    height: 280px;
  }

  .dashboard-summary .summary-sales-chart .line-chart,
  .dashboard-summary .summary-box-chart .bar-chart {
    height: calc(100% - 42px);
  }

  .dashboard-summary .summary-table-card .table-wrap {
    height: calc(100% - 25px);
  }

  .mini-kpi {
    min-height: 62px;
    padding: 8px;
  }

  .mini-kpi-top {
    font-size: 0.58rem;
  }

  .mini-kpi .kpi-icon {
    width: 18px;
    height: 18px;
  }

  .mini-kpi strong {
    font-size: clamp(1rem, 5.2vw, 1.24rem);
  }

  .mini-kpi small {
    font-size: 0.5rem;
  }
}

.simulate-mobile .dashboard-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "sales sales"
    "boxes inventory"
    "clients clients" !important;
  gap: 8px;
}

.simulate-mobile .dashboard-summary .summary-sales-chart {
  height: 230px;
}

.simulate-mobile .dashboard-summary .summary-box-chart,
.simulate-mobile .dashboard-summary .summary-inventory-card {
  height: 190px;
}

.simulate-mobile .dashboard-summary .summary-clients-card {
  height: 280px;
}

.simulate-mobile .dashboard-summary .summary-sales-chart .line-chart,
.simulate-mobile .dashboard-summary .summary-box-chart .bar-chart {
  height: calc(100% - 42px);
}

/* Step layout: Resumen */
body.is-authenticated .hero {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(420px, 1fr) minmax(280px, auto);
  align-items: center;
}

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

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(95px, 1fr));
  gap: 8px;
  min-width: 0;
}

.mini-kpi {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(16, 48, 28, 0.07);
}

.mini-kpi span,
.mini-kpi small {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.mini-kpi strong {
  display: block;
  margin-top: 2px;
  color: var(--green-900);
  font-size: clamp(0.92rem, 1.45vw, 1.28rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.dashboard-summary {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: none;
}

.dashboard-summary > * {
  grid-area: auto !important;
}

.summary-main-grid,
.summary-tables-grid {
  display: grid;
  min-height: 0;
  gap: 10px;
}

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

.summary-tables-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.summary-main-grid .card,
.summary-tables-grid .card {
  min-height: 0;
}

.summary-main-grid .chart-card {
  height: 100%;
}

.summary-sales-chart .line-chart,
.summary-box-chart .bar-chart {
  height: calc(100% - 40px);
  min-height: 0;
}

.summary-table-card .table-wrap {
  height: calc(100% - 28px);
  max-height: none;
  overflow-y: auto;
}

.summary-table-card table {
  min-width: 0;
}

@media (max-width: 900px) {
  body.is-authenticated {
    overflow: auto;
  }

  body.is-authenticated .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding-bottom: 48px;
  }

  body.is-authenticated .hero {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title period"
      "filters filters"
      "kpis kpis";
    align-items: start;
    min-height: 0;
  }

  body.is-authenticated .hero-title {
    grid-area: title;
  }

  body.is-authenticated .period-panel {
    display: contents;
  }

  body.is-authenticated .date-pill {
    grid-area: period;
    align-self: center;
    width: auto;
    min-width: 138px;
    padding-inline: 8px;
  }

  body.is-authenticated .period-controls {
    grid-area: filters;
    margin-top: 4px;
  }

  body.is-authenticated .hero-kpis {
    display: grid;
    grid-area: kpis;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
  }

  body.is-authenticated .mini-kpi {
    padding: 7px 8px;
  }

  body.is-authenticated .mini-kpi strong {
    font-size: clamp(0.95rem, 5vw, 1.2rem);
  }

  body.is-authenticated .content {
    height: auto;
    overflow: visible;
  }

  .dashboard-summary {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 8px;
  }

  .dashboard-summary::before {
    content: "";
    display: none;
  }

  .dashboard-summary .summary-main-grid,
  .dashboard-summary .summary-tables-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-summary .summary-main-grid {
    grid-template-rows: auto auto;
  }

  .dashboard-summary .summary-sales-chart {
    height: 230px;
  }

  .dashboard-summary .summary-box-chart {
    height: 190px;
  }

  .dashboard-summary .summary-sales-chart .line-chart,
  .dashboard-summary .summary-box-chart .bar-chart {
    height: calc(100% - 42px);
  }

  .summary-table-card {
    height: 260px;
  }

  .summary-table-card .table-wrap {
    height: calc(100% - 26px);
    overflow-y: auto;
  }
}

/* Final overrides v11 */
.dashboard-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-areas:
    "sales inventory"
    "clients boxes" !important;
}

.dashboard-summary .summary-sales-chart {
  grid-area: sales !important;
}

.dashboard-summary .summary-clients-card {
  grid-area: clients !important;
}

.dashboard-summary .summary-inventory-card {
  grid-area: inventory !important;
}

.dashboard-summary .summary-box-chart {
  grid-area: boxes !important;
}

@media (max-width: 900px) {
  .dashboard-summary {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto auto !important;
    grid-template-areas:
      "sales"
      "boxes"
      "inventory"
      "clients" !important;
  }
}

.simulate-mobile .dashboard-summary {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto auto !important;
  grid-template-areas:
    "sales"
    "boxes"
    "inventory"
    "clients" !important;
}

/* Ventas layout */
.dashboard-sales {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 0.95fr) minmax(0, 1.05fr) !important;
  grid-template-areas:
    "line boxes"
    "detail detail" !important;
  gap: 10px;
}

.dashboard-sales .sales-line-card {
  grid-area: line !important;
}

.dashboard-sales .sales-box-card {
  grid-area: boxes !important;
}

.dashboard-sales .sales-detail-card {
  grid-area: detail !important;
  min-height: 0;
}

.dashboard-sales .sales-line-card,
.dashboard-sales .sales-box-card {
  min-height: 0;
  height: 100%;
  padding-left: 8px;
  padding-right: 8px;
}

.dashboard-sales .sales-line-card .line-chart,
.dashboard-sales .sales-box-card .bar-chart {
  height: calc(100% - 38px);
  min-height: 0;
}

.dashboard-sales .sales-line-card {
  padding-left: 5px;
  padding-right: 5px;
}

.dashboard-sales .sales-line-card .card-heading {
  padding-left: 7px;
  padding-right: 7px;
}

.dashboard-sales .sales-detail-card .table-wrap {
  height: calc(100% - 40px);
  max-height: none;
  overflow: auto;
  scrollbar-width: thin;
}

.dashboard-sales .sales-detail-card table {
  min-width: 720px;
}

.dashboard-sales .sales-detail-card th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.type-short {
  display: none;
}

.sales-search input {
  width: min(260px, 28vw);
  min-height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--green-900);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  outline-color: var(--green-500);
}

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

th.sortable span:first-child {
  display: inline-block;
  margin-right: 5px;
}

.sort-mark {
  color: #dff4a8;
  font-size: 0.54rem;
  font-weight: 950;
}

@media (max-width: 900px) {
  .dashboard-sales {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "line"
      "boxes"
      "detail" !important;
  }

  .dashboard-sales .sales-line-card {
    height: 230px;
  }

  .dashboard-sales .sales-box-card {
    height: 190px;
  }

  .dashboard-sales .sales-detail-card {
    height: min(320px, 46dvh);
  }

  .dashboard-sales .sales-detail-card .table-wrap {
    height: calc(100% - 54px);
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .dashboard-sales .sales-detail-card .table-wrap::-webkit-scrollbar {
    height: 8px;
  }

  .dashboard-sales .sales-detail-card .table-wrap::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: rgba(0, 85, 43, 0.45);
  }

  .dashboard-sales .sales-detail-card table {
    min-width: 560px;
  }

  .type-full {
    display: none;
  }

  .type-short {
    display: inline;
  }

  .sales-search {
    width: 100%;
    justify-content: space-between;
  }

  .sales-search input {
    width: min(170px, 48vw);
  }
}

.simulate-mobile .dashboard-sales {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "line"
    "boxes"
    "detail" !important;
}

/* Ventas mobile table stability v18 */
.dashboard-sales .sales-detail-card {
  overflow: hidden;
}

.dashboard-sales .sales-detail-card .table-title-row,
.dashboard-sales .sales-detail-card .sales-search {
  min-width: 0;
}

.dashboard-sales .sales-detail-card .table-wrap {
  max-width: 100%;
  overscroll-behavior: contain;
}

.dashboard-sales .sales-detail-card table {
  width: max-content;
}

@media (max-width: 900px) {
  .dashboard-sales .sales-detail-card {
    display: flex;
    flex-direction: column;
    height: 350px;
    padding: 8px;
  }

  .dashboard-sales .sales-detail-card .table-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    flex: 0 0 auto;
    margin-bottom: 6px;
  }

  .dashboard-sales .sales-detail-card .table-title-row h2 {
    font-size: 0.86rem;
    line-height: 1;
    white-space: nowrap;
  }

  .dashboard-sales .sales-detail-card .sales-search {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dashboard-sales .sales-detail-card .sales-search span {
    align-self: center;
    font-size: 0.56rem;
  }

  .dashboard-sales .sales-detail-card .sales-search input {
    width: 100%;
    min-width: 0;
    height: 26px;
  }

  .dashboard-sales .sales-detail-card .table-wrap {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: auto;
  }

  .dashboard-sales .sales-detail-card table {
    min-width: 620px;
  }
}

.simulate-mobile .dashboard-sales .sales-detail-card {
  display: flex;
  flex-direction: column;
  height: 350px;
  padding: 8px;
  overflow: hidden;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-title-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  flex: 0 0 auto;
  margin-bottom: 6px;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-title-row h2 {
  font-size: 0.86rem;
  line-height: 1;
  white-space: nowrap;
}

.simulate-mobile .dashboard-sales .sales-detail-card .sales-search {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .dashboard-sales .sales-detail-card .sales-search span {
  align-self: center;
  font-size: 0.56rem;
}

.simulate-mobile .dashboard-sales .sales-detail-card .sales-search input {
  width: 100%;
  min-width: 0;
  height: 26px;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: auto;
}

.simulate-mobile .dashboard-sales .sales-detail-card table {
  min-width: 620px;
}

/* Ventas table segmentation layout v20 */
.dashboard-sales {
  grid-template-areas:
    "line boxes"
    "detail detail" !important;
}

.dashboard-sales .sales-controls-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.dashboard-sales .sales-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px;
  height: 100%;
}

.dashboard-sales .sales-table-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.dashboard-sales .sales-detail-card .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: auto;
}

.dashboard-sales .sales-detail-card table {
  min-width: 0;
  width: 100%;
}

.controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.controls-head h2,
.control-group h3 {
  margin: 0;
}

.controls-head span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.control-group {
  display: grid;
  gap: 6px;
  order: 2;
}

.control-group h3 {
  color: var(--green-900);
  font-size: 0.72rem;
  line-height: 1;
}

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

.chip-row button {
  min-height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green-900);
  background: #f7fbef;
  font-size: 0.64rem;
  font-weight: 950;
  cursor: pointer;
}

.chip-row button.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--green-800), var(--green-500));
  box-shadow: 0 8px 16px rgba(0, 85, 43, 0.16);
}

.sales-control-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  order: 1;
}

.sales-control-summary div {
  min-width: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: linear-gradient(135deg, #f3f8e9, #fff);
}

.sales-control-summary span,
.sales-control-summary strong {
  display: block;
}

.sales-control-summary span {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 900;
}

.sales-control-summary strong {
  color: var(--green-900);
  font-size: 0.74rem;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .dashboard-sales {
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "line"
      "boxes"
      "detail" !important;
  }

  .dashboard-sales .sales-detail-card {
    display: flex;
    flex-direction: column;
  }

  .dashboard-sales .sales-controls-card {
    order: -1;
    height: auto;
    gap: 4px;
    padding: 0 0 5px;
    overflow: visible;
  }

  .dashboard-sales .sales-controls-card .controls-head h2,
  .dashboard-sales .sales-controls-card .sales-control-summary {
    display: none;
  }

  .dashboard-sales .sales-controls-card .control-group h3 {
    display: none;
  }

  .dashboard-sales .sales-controls-card .chip-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .dashboard-sales .sales-controls-card .chip-row button {
    min-height: 24px;
    padding: 0 4px;
    font-size: 0.58rem;
  }

  .dashboard-sales .sales-detail-card table {
    min-width: 620px;
    width: max-content;
  }
}

.simulate-mobile .dashboard-sales {
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "line"
    "boxes"
    "detail" !important;
}

.simulate-mobile .dashboard-sales .sales-detail-card {
  display: flex;
  flex-direction: column;
}

.simulate-mobile .dashboard-sales .sales-controls-card {
  order: -1;
  height: auto;
  gap: 4px;
  padding: 0 0 5px;
  overflow: visible;
}

.simulate-mobile .dashboard-sales .sales-controls-card .controls-head h2,
.simulate-mobile .dashboard-sales .sales-controls-card .sales-control-summary {
  display: none;
}

.simulate-mobile .dashboard-sales .sales-controls-card .control-group h3 {
  display: none;
}

.simulate-mobile .dashboard-sales .sales-controls-card .chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.simulate-mobile .dashboard-sales .sales-controls-card .chip-row button {
  min-height: 24px;
  padding: 0 4px;
  font-size: 0.58rem;
}

.simulate-mobile .dashboard-sales .sales-detail-card table {
  min-width: 620px;
  width: max-content;
}

/* Ventas mobile overlap fix v22 */
@media (max-width: 900px) {
  .dashboard-sales .sales-detail-card {
    height: 520px;
    gap: 8px;
    overflow: hidden;
  }

  .dashboard-sales .sales-table-area,
  .dashboard-sales .sales-detail-card .table-title-row {
    display: contents;
  }

  .dashboard-sales .sales-controls-card {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    width: 100%;
    margin: 0 0 4px;
    padding: 0;
    order: 2;
  }

  .dashboard-sales .sales-controls-card .controls-head {
    display: none;
  }

  .dashboard-sales .sales-control-summary {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    order: 1;
  }

  .dashboard-sales .sales-control-summary div {
    padding: 6px;
  }

  .dashboard-sales .sales-control-summary span {
    font-size: 0.48rem;
  }

  .dashboard-sales .sales-control-summary strong {
    font-size: 0.68rem;
  }

  .dashboard-sales .sales-controls-card .control-group {
    display: block;
  }

  .dashboard-sales .sales-controls-card .control-group + .control-group {
    margin-top: 6px;
  }

  .dashboard-sales .sales-controls-card .chip-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-sales .sales-controls-card .chip-row button {
    width: 100%;
    min-height: 28px;
    padding: 0 4px;
    font-size: 0.62rem;
    pointer-events: auto;
  }

  .dashboard-sales .sales-table-area {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    gap: 6px;
  }

  .dashboard-sales .sales-detail-card .table-title-row h2 {
    order: 1;
    font-size: 0.9rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .dashboard-sales .sales-detail-card .sales-search {
    order: 3;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dashboard-sales .sales-detail-card .sales-search input {
    width: 100%;
    min-width: 0;
  }

  .dashboard-sales .sales-detail-card .table-wrap {
    order: 4;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: auto;
  }
}

.simulate-mobile .dashboard-sales .sales-detail-card {
  height: 520px;
  gap: 8px;
  overflow: hidden;
}

.simulate-mobile .dashboard-sales .sales-table-area,
.simulate-mobile .dashboard-sales .sales-detail-card .table-title-row {
  display: contents;
}

.simulate-mobile .dashboard-sales .sales-controls-card {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  order: 2;
}

.simulate-mobile .dashboard-sales .sales-controls-card .controls-head {
  display: none;
}

.simulate-mobile .dashboard-sales .sales-control-summary {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  order: 1;
}

.simulate-mobile .dashboard-sales .sales-control-summary div {
  padding: 6px;
}

.simulate-mobile .dashboard-sales .sales-control-summary span {
  font-size: 0.48rem;
}

.simulate-mobile .dashboard-sales .sales-control-summary strong {
  font-size: 0.68rem;
}

.simulate-mobile .dashboard-sales .sales-controls-card .control-group {
  display: block;
}

.simulate-mobile .dashboard-sales .sales-controls-card .control-group + .control-group {
  margin-top: 6px;
}

.simulate-mobile .dashboard-sales .sales-controls-card .chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.simulate-mobile .dashboard-sales .sales-controls-card .chip-row button {
  width: 100%;
  min-height: 28px;
  padding: 0 4px;
  font-size: 0.62rem;
  pointer-events: auto;
}

.simulate-mobile .dashboard-sales .sales-table-area {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  gap: 6px;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-title-row {
  margin: 0;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-title-row h2 {
  order: 1;
  font-size: 0.9rem;
  line-height: 1.05;
  white-space: nowrap;
}

.simulate-mobile .dashboard-sales .sales-detail-card .sales-search {
  order: 3;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .dashboard-sales .sales-detail-card .sales-search input {
  width: 100%;
  min-width: 0;
}

.simulate-mobile .dashboard-sales .sales-detail-card .table-wrap {
  order: 4;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: auto;
}

/* Cobranza layout v26 */
.dashboard-credits {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 0.92fr) minmax(0, 1.08fr) !important;
  grid-template-areas:
    "abonos clients"
    "history history" !important;
  gap: 10px;
}

.dashboard-credits .credits-abonos-card {
  grid-area: abonos !important;
  min-height: 0;
  height: 100%;
  padding-left: 8px;
  padding-right: 8px;
}

.dashboard-credits .credits-clients-card {
  grid-area: clients !important;
  min-height: 0;
  height: 100%;
}

.dashboard-credits .credits-abonos-table-card {
  grid-area: history !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.dashboard-credits .credits-abonos-card .line-chart {
  height: calc(100% - 38px);
  min-height: 0;
}

.dashboard-credits .credits-clients-card .table-wrap {
  height: calc(100% - 36px);
  max-height: none;
  overflow-y: auto;
}

.dashboard-credits .credits-abonos-table-card .table-title-row {
  flex: 0 0 auto;
}

.dashboard-credits .credits-abonos-table-card .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.dashboard-credits .credits-abonos-table-card th {
  position: sticky;
  top: 0;
  z-index: 2;
}

@media (max-width: 900px) {
  .dashboard-credits {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "abonos"
      "clients"
      "history" !important;
  }

  .dashboard-credits .credits-abonos-card {
    height: 230px;
  }

  .dashboard-credits .credits-clients-card {
    height: 280px;
  }

  .dashboard-credits .credits-abonos-table-card {
    height: 360px;
  }

  .dashboard-credits .credits-abonos-card .line-chart {
    height: calc(100% - 42px);
  }

  .dashboard-credits .credits-abonos-table-card .table-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-credits .credits-abonos-table-card .sales-search {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dashboard-credits .credits-abonos-table-card .sales-search input {
    width: 100%;
    min-width: 0;
  }

  .dashboard-credits .credits-abonos-table-card table {
    min-width: 500px;
    width: max-content;
  }

  .dashboard-credits .credits-abonos-table-card th,
  .dashboard-credits .credits-abonos-table-card td {
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
  }

  .dashboard-credits .credits-abonos-table-card th:nth-child(1),
  .dashboard-credits .credits-abonos-table-card td:nth-child(1) {
    min-width: 96px;
  }

  .dashboard-credits .credits-abonos-table-card th:nth-child(2),
  .dashboard-credits .credits-abonos-table-card td:nth-child(2) {
    min-width: 116px;
  }

  .dashboard-credits .credits-abonos-table-card th:nth-child(3),
  .dashboard-credits .credits-abonos-table-card td:nth-child(3) {
    min-width: 82px;
  }

  .dashboard-credits .credits-abonos-table-card th:nth-child(4),
  .dashboard-credits .credits-abonos-table-card td:nth-child(4) {
    min-width: 78px;
  }

  .dashboard-credits .credits-abonos-table-card th:nth-child(5),
  .dashboard-credits .credits-abonos-table-card td:nth-child(5) {
    min-width: 92px;
  }
}

.simulate-mobile .dashboard-credits {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "abonos"
    "clients"
    "history" !important;
}

.simulate-mobile .dashboard-credits .credits-abonos-card {
  height: 230px;
}

.simulate-mobile .dashboard-credits .credits-clients-card {
  height: 280px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card {
  height: 360px;
}

.simulate-mobile .dashboard-credits .credits-abonos-card .line-chart {
  height: calc(100% - 42px);
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card .table-title-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card .sales-search {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card .sales-search input {
  width: 100%;
  min-width: 0;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card table {
  min-width: 500px;
  width: max-content;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th,
.simulate-mobile .dashboard-credits .credits-abonos-table-card td {
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th:nth-child(1),
.simulate-mobile .dashboard-credits .credits-abonos-table-card td:nth-child(1) {
  min-width: 96px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th:nth-child(2),
.simulate-mobile .dashboard-credits .credits-abonos-table-card td:nth-child(2) {
  min-width: 116px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th:nth-child(3),
.simulate-mobile .dashboard-credits .credits-abonos-table-card td:nth-child(3) {
  min-width: 82px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th:nth-child(4),
.simulate-mobile .dashboard-credits .credits-abonos-table-card td:nth-child(4) {
  min-width: 78px;
}

.simulate-mobile .dashboard-credits .credits-abonos-table-card th:nth-child(5),
.simulate-mobile .dashboard-credits .credits-abonos-table-card td:nth-child(5) {
  min-width: 92px;
}

/* Inventario layout v29 */
.dashboard-inventory {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
  grid-template-areas:
    "donut summary"
    "detail detail" !important;
  gap: 10px;
}

.dashboard-inventory .inventory-donut-card {
  grid-area: donut !important;
  min-height: 0;
  height: 100%;
}

.dashboard-inventory .inventory-report-card {
  grid-area: summary !important;
  min-height: 0;
  height: 100%;
}

.dashboard-inventory .inventory-detail-card {
  grid-area: detail !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.dashboard-inventory .inventory-donut-card .donut-wrap {
  height: calc(100% - 34px);
  align-items: center;
}

.dashboard-inventory .inventory-bar-desktop {
  display: grid;
  grid-template-columns: minmax(110px, 0.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: calc(100% - 34px);
}

.dashboard-inventory .inventory-donut-mobile {
  display: none;
}

.dashboard-inventory .inventory-total-ref {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 86px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(231, 247, 211, 0.9), rgba(255, 255, 255, 0.78));
  color: var(--green);
}

.dashboard-inventory .inventory-total-ref span,
.dashboard-inventory .inventory-total-ref small {
  font-size: 0.66rem;
  font-weight: 800;
  color: #304962;
}

.dashboard-inventory .inventory-total-ref strong {
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  line-height: 1;
}

.dashboard-inventory .inventory-donut-card .bar-chart {
  height: 100%;
  min-height: 0;
}

.dashboard-inventory .inventory-detail-card .table-title-row {
  flex: 0 0 auto;
}

.dashboard-inventory .inventory-detail-card .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.dashboard-inventory .inventory-detail-card th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.dashboard-inventory .inventory-detail-card table {
  min-width: 880px;
}

.dashboard-inventory .inventory-search input {
  min-width: 210px;
}

.dashboard-inventory .inventory-report-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}

.inventory-report-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.inventory-report-heading h2 {
  margin: 0;
}

.inventory-report-heading span {
  display: block;
  margin-top: 2px;
  color: #516276;
  font-size: 0.72rem;
  font-weight: 800;
}

.inventory-report-card .soft-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d7e5c5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbef, #ffffff);
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.warehouse-report-totals,
.warehouse-type-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.warehouse-type-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.warehouse-report-totals article,
.warehouse-type-kpis article,
.warehouse-count-grid article {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(231, 247, 211, 0.92), rgba(255, 255, 255, 0.78));
}

.warehouse-report-totals span,
.warehouse-type-kpis span,
.warehouse-count-grid span {
  display: block;
  color: #516276;
  font-size: 0.62rem;
  font-weight: 900;
}

.warehouse-report-totals strong,
.warehouse-type-kpis strong {
  display: block;
  color: var(--green);
  font-size: 1rem;
  line-height: 1.05;
}

.warehouse-report-totals small,
.warehouse-type-kpis small,
.warehouse-count-grid small {
  display: block;
  color: #516276;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
}

.inventory-report-card h3 {
  margin: 1px 0 0;
  color: var(--green);
  font-size: 0.78rem;
  line-height: 1;
}

.warehouse-sold-table-wrap {
  flex: 1 1 auto;
  min-height: 70px;
  overflow: auto;
  border: 1px solid #e0ead2;
  border-radius: 8px;
}

.warehouse-returns-table-wrap {
  flex: 0 1 auto;
  max-height: 112px;
  min-height: 0;
}

.warehouse-incoming-table-wrap {
  flex: 0 1 auto;
  max-height: 104px;
  min-height: 0;
}

.warehouse-sold-table {
  width: 100%;
  min-width: 360px;
  border-collapse: separate;
  border-spacing: 0;
}

.warehouse-sold-table th,
.warehouse-sold-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e7eddf;
  text-align: right;
  white-space: nowrap;
  font-size: 0.7rem;
}

.warehouse-returns-table {
  min-width: 500px;
}

.warehouse-incoming-table {
  min-width: 430px;
}

.warehouse-sold-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--green);
  color: #fff;
}

.warehouse-sold-table th:first-child,
.warehouse-sold-table td:first-child {
  text-align: left;
}

.warehouse-sold-table .warehouse-day-row td {
  background: #e0f6d5;
  color: var(--green);
  font-weight: 900;
}

.warehouse-sold-table .warehouse-client-row td:first-child {
  padding-left: 20px;
}

.warehouse-sold-table .warehouse-missing-row td {
  background: #ffe5e5;
  color: #a51f24;
  font-weight: 900;
}

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

.warehouse-count-grid strong {
  display: block;
  color: var(--green);
  font-size: 0.82rem;
  line-height: 1.1;
}

@media (max-width: 900px) {
  .dashboard-inventory {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "donut"
      "summary"
      "detail" !important;
  }

  .dashboard-inventory .inventory-donut-card {
    height: 250px;
  }

  .dashboard-inventory .inventory-bar-desktop {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
  }

  .dashboard-inventory .inventory-donut-mobile {
    display: none;
  }

  .dashboard-inventory .inventory-donut-mobile .donut-wrap {
    grid-template-columns: 132px minmax(130px, 150px);
    justify-content: center;
    justify-items: stretch;
    align-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .dashboard-inventory .inventory-donut-mobile .legend {
    width: 100%;
  }

  .dashboard-inventory .inventory-donut-mobile .legend-row {
    grid-template-columns: 9px minmax(72px, 1fr) auto;
    column-gap: 6px;
  }

  .dashboard-inventory .inventory-report-card {
    height: auto;
    min-height: 330px;
  }

  .dashboard-inventory .inventory-detail-card {
    height: 390px;
  }

  .dashboard-inventory .inventory-detail-card .table-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-inventory .inventory-detail-card .inventory-search {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dashboard-inventory .inventory-detail-card .inventory-search input {
    width: 100%;
    min-width: 0;
  }

  .dashboard-inventory .inventory-detail-card table {
    min-width: 720px;
    width: max-content;
  }

  .dashboard-inventory .inventory-detail-card th,
  .dashboard-inventory .inventory-detail-card td {
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
  }

  .dashboard-inventory .inventory-detail-card th:nth-child(1),
  .dashboard-inventory .inventory-detail-card td:nth-child(1) {
    min-width: 74px;
    max-width: 86px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.08;
  }

  .dashboard-inventory .inventory-detail-card th:nth-child(2),
  .dashboard-inventory .inventory-detail-card td:nth-child(2) {
    min-width: 78px;
  }

  .dashboard-inventory .inventory-detail-card th:nth-child(3),
  .dashboard-inventory .inventory-detail-card td:nth-child(3) {
    min-width: 70px;
  }
}

.simulate-mobile .dashboard-inventory {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto auto !important;
  grid-template-areas:
    "donut"
    "summary"
    "detail" !important;
}

.simulate-mobile .dashboard-inventory .inventory-donut-card {
  height: 250px;
}

.simulate-mobile .dashboard-inventory .inventory-bar-desktop {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
}

.simulate-mobile .dashboard-inventory .inventory-donut-mobile {
  display: none;
}

.simulate-mobile .dashboard-inventory .inventory-donut-mobile .donut-wrap {
  grid-template-columns: 132px minmax(130px, 150px);
  justify-content: center;
  justify-items: stretch;
  align-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.simulate-mobile .dashboard-inventory .inventory-donut-mobile .legend {
  width: 100%;
}

.simulate-mobile .dashboard-inventory .inventory-donut-mobile .legend-row {
  grid-template-columns: 9px minmax(72px, 1fr) auto;
  column-gap: 6px;
}

.simulate-mobile .dashboard-inventory .inventory-report-card {
  height: auto;
  min-height: 330px;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card {
  height: 390px;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card .table-title-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card .inventory-search {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card .inventory-search input {
  width: 100%;
  min-width: 0;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card table {
  min-width: 720px;
  width: max-content;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card th,
.simulate-mobile .dashboard-inventory .inventory-detail-card td {
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card th:nth-child(1),
.simulate-mobile .dashboard-inventory .inventory-detail-card td:nth-child(1) {
  min-width: 74px;
  max-width: 86px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.08;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card th:nth-child(2),
.simulate-mobile .dashboard-inventory .inventory-detail-card td:nth-child(2) {
  min-width: 78px;
}

.simulate-mobile .dashboard-inventory .inventory-detail-card th:nth-child(3),
.simulate-mobile .dashboard-inventory .inventory-detail-card td:nth-child(3) {
  min-width: 70px;
}

/* Inventory status color adjustment v31 */
.status.critical {
  color: #6d4b00;
  background: #fff0a8;
}

.status.end {
  color: var(--danger);
  background: #ffe0dc;
}

@media (max-width: 720px) {
  .client-actions [data-client-print] {
    display: none;
  }
}

.simulate-mobile .client-actions [data-client-print] {
  display: none;
}

/* Client statement print layout v49 */
.print-only {
  display: none;
}

@page {
  size: letter;
  margin: 0;
}

@media print {
  html,
  body {
    width: 21.59cm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #061a2c !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-client-statement .topbar,
  body.printing-client-statement .bottom-nav,
  body.printing-client-statement .status-bar,
  body.printing-client-statement .hero,
  body.printing-client-statement .period-panel,
  body.printing-client-statement .back-button,
  body.printing-client-statement .dashboard-view > :not(.clients-statement-card),
  body.printing-client-statement .clients-statement-card > :not(.client-print-pages) {
    display: none !important;
  }

  body.printing-client-statement .app-shell,
  body.printing-client-statement .content,
  body.printing-client-statement .dashboard-clients,
  body.printing-client-statement .clients-statement-card,
  body.printing-client-statement .client-print-pages {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.printing-client-statement .client-print-page {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 21.59cm !important;
    height: 27.94cm !important;
    min-height: 27.94cm !important;
    margin: 0 !important;
    padding: 2.75cm 2.5cm 1.95cm 3cm !important;
    overflow: hidden !important;
    background: #fff !important;
    page-break-after: always !important;
    break-after: page !important;
  }

  body.printing-client-statement .client-print-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  body.printing-client-statement .client-print-header {
    position: absolute !important;
    top: 0.72cm !important;
    left: 3cm !important;
    right: 2.5cm !important;
    display: grid !important;
    grid-template-columns: 4.7cm minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 1.15cm !important;
    margin: 0 !important;
    padding: 0 0 0.28cm !important;
    border-bottom: 2px solid #00552b !important;
    background: #fff !important;
  }

  body.printing-client-statement .client-print-header img {
    justify-self: start !important;
    width: 4.25cm !important;
    max-height: 1.35cm !important;
    object-fit: contain !important;
  }

  body.printing-client-statement .client-print-header > div {
    text-align: right !important;
  }

  body.printing-client-statement .client-print-header h1 {
    margin: 0 0 0.12cm !important;
    color: #003f22 !important;
    font-size: 16px !important;
    line-height: 1.14 !important;
    font-weight: 950 !important;
    text-transform: none !important;
  }

  body.printing-client-statement .client-print-header p {
    margin: 0.04cm 0 !important;
    color: #304962 !important;
    font-size: 9.5px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
  }

  body.printing-client-statement .client-print-body {
    display: block !important;
    width: 100% !important;
    height: 23.24cm !important;
    max-height: 23.24cm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.printing-client-statement .client-print-footer {
    position: absolute !important;
    left: 3cm !important;
    right: 2.5cm !important;
    bottom: 0.72cm !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 0.4cm !important;
    margin: 0 !important;
    padding-top: 0.18cm !important;
    border-top: 1px solid #dfe8d0 !important;
    background: #fff !important;
    color: #516276 !important;
    font-size: 8.5px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
  }

  body.printing-client-statement .client-print-summary {
    margin: 0 0 0.35cm !important;
    padding: 0 !important;
  }

  body.printing-client-statement .client-print-summary h2,
  body.printing-client-statement .client-print-title {
    margin: 0 0 0.18cm !important;
    color: #003f22 !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    text-align: left !important;
  }

  body.printing-client-statement .client-print-title {
    width: 100% !important;
    margin-top: 0.28cm !important;
    padding-top: 0.22cm !important;
    border-top: 1px solid #dfe8d0 !important;
  }

  body.printing-client-statement .client-print-title-continued {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: 0 !important;
  }

  body.printing-client-statement .client-print-summary > div {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.25cm !important;
  }

  body.printing-client-statement .client-print-summary article {
    min-height: 1.15cm !important;
    box-sizing: border-box !important;
    padding: 0.22cm 0.28cm !important;
    border: 1px solid #dfe8d0 !important;
    border-radius: 4px !important;
    background: #fbfaf2 !important;
  }

  body.printing-client-statement .client-print-summary span {
    display: block !important;
    margin: 0 0 0.08cm !important;
    color: #516276 !important;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
    font-weight: 850 !important;
  }

  body.printing-client-statement .client-print-summary strong {
    display: block !important;
    color: #003f22 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
  }

  body.printing-client-statement .client-print-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: #fff !important;
  }

  body.printing-client-statement .client-print-table .print-col-date {
    width: 2.45cm !important;
  }

  body.printing-client-statement .client-print-table .print-col-type {
    width: 1.65cm !important;
  }

  body.printing-client-statement .client-print-table .print-col-money {
    width: 1.75cm !important;
  }

  body.printing-client-statement .client-print-table th {
    padding: 0.11cm 0.12cm !important;
    color: #fff !important;
    background: #00552b !important;
    border: 0 !important;
    border-radius: 0 !important;
    font-size: 8.2px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-align: left !important;
  }

  body.printing-client-statement .client-print-table td {
    padding: 0.09cm 0.12cm !important;
    border-bottom: 1px solid #e7eddf !important;
    color: #061a2c !important;
    background: #fff !important;
    font-size: 8.1px !important;
    line-height: 1.18 !important;
    font-weight: 700 !important;
    vertical-align: top !important;
  }

  body.printing-client-statement .client-print-table th:nth-child(3),
  body.printing-client-statement .client-print-table td:nth-child(3) {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body.printing-client-statement .client-print-table th:nth-child(4),
  body.printing-client-statement .client-print-table td:nth-child(4),
  body.printing-client-statement .client-print-table th:nth-child(5),
  body.printing-client-statement .client-print-table td:nth-child(5),
  body.printing-client-statement .client-print-table th:nth-child(6),
  body.printing-client-statement .client-print-table td:nth-child(6) {
    text-align: right !important;
    white-space: nowrap !important;
  }

  body.printing-client-statement .client-print-table td:nth-child(5) {
    color: #00552b !important;
  }

  body.printing-client-statement .client-print-table td:nth-child(6) {
    font-weight: 900 !important;
  }
}

