/* Legacy styles replaced by the dashboard redesign below.
:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-muted: #f0f4f3;
  --text: #17201d;
  --muted: #5f6d68;
  --line: #dce4e1;
  --primary: #1f7a5c;
  --primary-dark: #155c45;
  --accent: #2b6f9e;
  --warning: #a16207;
  --danger: #b42318;
  --shadow: 0 16px 34px rgba(23, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

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

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 28px 24px;
  color: #ffffff;
  background: #173c35;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #f2c94c;
  color: #173c35;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.filters {
  display: grid;
  gap: 22px;
}

.filter-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-group legend,
.input-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  font-weight: 700;
}

.radio-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.radio-option:has(input:checked) {
  border-color: #f2c94c;
  background: rgba(242, 201, 76, 0.16);
  color: #ffffff;
}

.radio-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.radio-option input {
  width: 16px;
  height: 16px;
  accent-color: #f2c94c;
}

#minVentas {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

#minVentas:focus {
  border-color: #f2c94c;
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2);
}

.data-status {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.dashboard {
  display: grid;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  line-height: 1.16;
}

h2 {
  font-size: 1.85rem;
}

h3 {
  font-size: 1.05rem;
}

.snapshot-pill {
  flex: 0 0 auto;
  max-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.notice.warning {
  border-color: rgba(161, 98, 7, 0.28);
  background: #fff8e6;
  color: var(--warning);
}

.notice.error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff0ee;
  color: var(--danger);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.kpi {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.kpi strong {
  align-self: end;
  min-width: 0;
  font-size: 1.75rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.chart-list {
  display: grid;
  gap: 12px;
  max-height: 472px;
  padding: 18px;
  overflow: auto;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.bar-label {
  min-width: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  background: var(--panel-muted);
  overflow: hidden;
}

.bar-fill {
  width: var(--bar-width);
  min-width: 4px;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

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

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
}

td.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.empty-row td {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.chart-list .empty-row {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

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

  .sidebar {
    position: static;
    min-height: auto;
    padding: 22px;
  }

  .filters {
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.7fr);
    align-items: start;
  }

  .data-status {
    margin-top: 0;
  }

  .dashboard {
    padding: 22px;
  }
}

@media (max-width: 680px) {
  .filters,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .panel-header {
    align-items: start;
    flex-direction: column;
  }

  .snapshot-pill {
    max-width: 100%;
  }

  .bar-row {
    grid-template-columns: 1fr 72px;
    gap: 8px;
  }

  .bar-label {
    white-space: normal;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
*/

:root {
  color-scheme: dark;
  --bg: #0f1117;
  --sidebar: #282a33;
  --surface: #151821;
  --surface-soft: #1b1f2a;
  --text: #f6f7f9;
  --muted: #c8ccd4;
  --subtle: #8e95a3;
  --line: #343946;
  --input: #0f1117;
  --input-line: #232733;
  --bar: #93c5fd;
  --bar-hover: #bfdbfe;
  --warning-bg: #2a2110;
  --warning-text: #facc15;
  --error-bg: #2a1313;
  --error-text: #fca5a5;
  --shadow: none;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --sidebar: #eef1f6;
  --surface: #ffffff;
  --surface-soft: #f1f4f8;
  --text: #111827;
  --muted: #374151;
  --subtle: #6b7280;
  --line: #d7dde7;
  --input: #ffffff;
  --input-line: #cfd6e2;
  --bar: #2563eb;
  --bar-hover: #1d4ed8;
  --warning-bg: #fff7d6;
  --warning-text: #8a5a00;
  --error-bg: #fff1f2;
  --error-text: #be123c;
  --shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Source Sans Pro", Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  padding: 40px 18px;
  background: var(--sidebar);
  color: var(--text);
}

.sidebar h2 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.2;
}

.filters {
  display: grid;
  gap: 22px;
}

.filter-field {
  display: grid;
  gap: 10px;
}

.filter-field label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

select,
.stepper {
  min-height: 46px;
  border: 1px solid var(--input-line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
}

select {
  width: 100%;
  padding: 0 46px 0 16px;
  appearance: none;
  outline: none;
  font-weight: 600;
}

select:focus,
.stepper:focus-within {
  border-color: var(--bar);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.22);
}

.stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px;
  overflow: hidden;
}

.stepper input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--input-line);
  outline: none;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.stepper-button {
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--input-line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
}

.stepper-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.data-status {
  color: var(--subtle);
  font-size: 0.9rem;
}

.dashboard {
  display: grid;
  gap: 22px;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 20px 54px 44px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--bar);
}

.theme-toggle-icon {
  width: 18px;
  text-align: center;
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(1.78rem, 2.85vw, 2.9rem);
  font-weight: 700;
  line-height: 1.05;
}

.hero p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 5.4vw, 96px);
  padding: 2px 0 42px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.metric {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.metric strong {
  color: var(--text);
  font-size: clamp(1.48rem, 2.35vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.notice.warning {
  border-color: rgba(250, 204, 21, 0.35);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.notice.error {
  border-color: rgba(252, 165, 165, 0.35);
  background: var(--error-bg);
  color: var(--error-text);
}

.notice.empty {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  max-width: 620px;
  padding: 18px;
  border-color: color-mix(in srgb, var(--line), var(--bar) 22%);
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 48%);
  color: var(--text);
}

.notice.empty .notice-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--bar), transparent 40%);
  border-radius: 999px;
  color: var(--bar);
  font-weight: 600;
}

.notice.empty strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.28rem, 1.75vw, 1.72rem);
  font-weight: 700;
  line-height: 1.12;
}

.section-header span {
  color: var(--subtle);
  font-weight: 600;
}

.chart-shell {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart {
  min-height: 450px;
}

.chart-canvas {
  display: grid;
  grid-template-columns: 40px minmax(720px, 1fr);
  min-width: var(--chart-width);
  height: 450px;
}

.y-axis,
.plot-area {
  height: 280px;
}

.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.plot-area {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.grid-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}

.bars {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  align-items: stretch;
  gap: 42px;
  padding: 0 28px;
}

.bar-item {
  position: relative;
  min-width: 76px;
  height: 100%;
}

.bar-column {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.bar-value {
  position: absolute;
  bottom: calc(var(--bar-height) + 8px);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.bar {
  width: min(100%, 110px);
  min-height: 0;
  height: var(--bar-height);
  background: var(--bar);
}

.bar-item:hover .bar {
  background: var(--bar-hover);
}

.bar-item:hover .bar-value {
  opacity: 1;
  transform: translateY(0);
}

.x-label {
  position: absolute;
  top: calc(100% + 22px);
  right: 50%;
  left: auto;
  width: max-content;
  max-width: none;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: left;
  text-transform: uppercase;
  transform: rotate(-90deg);
  transform-origin: top right;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--subtle);
  text-align: center;
}

.detail-section {
  padding-top: 10px;
}

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

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

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

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 0.84rem;
}

td.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.empty-row td {
  padding: 28px 18px;
  color: var(--subtle);
  text-align: center;
}

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

  .dashboard {
    padding: 20px 28px 38px;
  }

  .bars {
    gap: 34px;
  }
}

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

  .sidebar {
    position: static;
    min-height: auto;
    padding: 24px;
  }

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

  .sidebar-footer {
    margin-top: 0;
  }

  .dashboard {
    padding: 22px;
  }

  .metrics {
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .filters,
  .metrics {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

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

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

  .chart-canvas {
    grid-template-columns: 38px minmax(620px, 1fr);
  }
}

.sidebar h2 {
  font-weight: 600;
}

.filter-field {
  gap: 8px;
}

.filter-field label {
  color: var(--subtle);
  font-size: 0.86rem;
  font-weight: 400;
}

select,
.stepper {
  min-height: 42px;
  border-color: color-mix(in srgb, var(--input-line), transparent 28%);
}

select {
  font-weight: 400;
}

.select-wrap::after {
  width: 7px;
  height: 7px;
  border-right-width: 1px;
  border-bottom-width: 1px;
}

.stepper {
  grid-template-columns: minmax(0, 1fr) 36px 36px;
}

.stepper input {
  border-right-color: color-mix(in srgb, var(--input-line), transparent 36%);
  font-weight: 400;
}

.stepper-button {
  border-left-color: color-mix(in srgb, var(--input-line), transparent 36%);
  font-size: 1rem;
  font-weight: 500;
}

:root {
  --sidebar-width: 280px;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  overflow-y: auto;
}

.dashboard {
  grid-column: 2;
}

.sidebar-footer,
.data-status {
  display: none;
}

@media (max-width: 1040px) {
  :root {
    --sidebar-width: 255px;
  }
}

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

  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    overflow: visible;
  }

  .dashboard {
    grid-column: 1;
  }
}

.top-actions {
  align-items: center;
  min-height: 32px;
}

.theme-toggle {
  flex: 0 0 auto;
  width: auto;
  max-width: max-content;
  height: 32px;
  min-height: 0;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  line-height: 1;
}

.theme-toggle-icon {
  width: 14px;
  font-size: 0.86rem;
  line-height: 1;
}

.notice {
  align-self: start;
}

.notice.empty {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  width: min(440px, 100%);
  max-width: 440px;
  min-height: 0;
  height: auto;
  padding: 10px 12px;
  border-radius: 7px;
}

.notice.empty .notice-icon {
  width: 22px;
  height: 22px;
  font-size: 0.78rem;
}

.notice.empty strong {
  margin: 0 0 2px;
  font-size: 0.86rem;
  line-height: 1.2;
}

.notice.empty p {
  font-size: 0.8rem;
  line-height: 1.3;
}

.notice.empty {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  padding: 16px 20px;
  border: 0;
  border-radius: 8px;
  background: #3f4422;
  color: #fff8c8;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
}

body[data-theme="light"] .notice.empty {
  background: #fff3bf;
  color: #594900;
}

.notice.empty .notice-icon,
.notice.empty strong,
.notice.empty p {
  display: none;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.tabs {
  display: flex;
  align-items: end;
  gap: 34px;
  width: 100%;
  margin-top: 4px;
  border-bottom: 2px solid var(--line);
}

.tab-button {
  position: relative;
  min-height: 44px;
  padding: 0 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 500;
}

.tab-button::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.tab-button.is-active {
  color: #ff5c5c;
}

.tab-button.is-active::after {
  background: #ff5c5c;
}

.tab-panel {
  display: grid;
  gap: 24px;
}

.tab-panel[hidden] {
  display: none !important;
}

.dash-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 28px;
}

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

.mini-panel {
  min-width: 0;
}

.mini-panel h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
}

.mini-chart {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface), transparent 24%);
}

.mini-bar {
  display: grid;
  grid-template-columns: minmax(88px, 0.9fr) minmax(0, 1.5fr) 42px;
  align-items: center;
  gap: 10px;
}

.mini-bar-label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mini-bar-track {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 38%);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--bar);
}

.mini-bar-value {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mini-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-table {
  min-width: 0;
}

.mini-table table {
  min-width: 0;
}

caption {
  padding: 12px 14px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
}

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

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

@media (max-width: 640px) {
  .tabs {
    gap: 20px;
    overflow-x: auto;
  }

  .tab-button {
    flex: 0 0 auto;
    font-size: 1rem;
  }

  .dash-metrics {
    grid-template-columns: 1fr;
  }
}

body.is-empty-state .dashboard {
  align-content: start;
  gap: 20px;
  padding-top: 70px;
}

body.is-empty-state .top-actions {
  position: absolute;
  top: 24px;
  right: 54px;
}

body.is-empty-state .hero {
  gap: 18px;
}

body.is-empty-state .notice.empty {
  margin-top: 8px;
}

@media (max-width: 820px) {
  body.is-empty-state .dashboard {
    padding-top: 22px;
  }

  body.is-empty-state .top-actions {
    position: static;
  }
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.dashboard,
.tab-panel,
.section-card,
.chart-shell,
.chart,
.chart-canvas,
.plot-area {
  min-width: 0;
}

.chart-shell {
  overflow-x: hidden;
}

.chart-canvas {
  grid-template-columns: 40px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.bars {
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  grid-template-columns: repeat(var(--bar-count, 1), minmax(0, 1fr));
  gap: var(--bar-gap, 42px);
  padding: 0 16px;
}

.bar-item {
  min-width: 0;
}

.bar {
  width: min(100%, var(--bar-max-width, 110px));
}

.x-label {
  font-size: var(--x-label-size, 0.76rem);
}

.detail-section .table-wrap {
  max-height: 430px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

@media (max-width: 640px) {
  .chart-canvas {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .bars {
    padding: 0 10px;
  }
}

:root {
  --sidebar: #24262f;
  --scroll-thumb: color-mix(in srgb, var(--muted), transparent 45%);
  --scroll-thumb-hover: color-mix(in srgb, var(--muted), transparent 26%);
  --scroll-track: transparent;
}

body[data-theme="dark"] {
  --sidebar: #24262f;
}

body[data-theme="light"] {
  --sidebar: #e7ebf2;
  --scroll-thumb: color-mix(in srgb, var(--subtle), transparent 48%);
  --scroll-thumb-hover: color-mix(in srgb, var(--subtle), transparent 30%);
}

* {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 999px;
  background-color: var(--scroll-thumb);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scroll-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar {
  background: var(--sidebar);
}

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

.dash-chart-grid .mini-panel-wide {
  grid-column: 1 / -1;
}

.mini-chart {
  display: block;
  min-height: 288px;
  overflow: hidden;
  padding: 14px 12px 16px;
}

.mini-bar-plot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--mini-bar-count, 1), minmax(0, 1fr));
  align-items: end;
  gap: var(--mini-bar-gap, 18px);
  height: 258px;
  padding: 18px 10px 72px;
}

.mini-bar-plot::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 72px;
  left: 0;
  height: 1px;
  background: var(--line);
}

.mini-bar {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
}

.mini-bar-column {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
}

.mini-bar-fill {
  width: min(100%, 64px);
  height: var(--mini-bar-height);
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--bar);
}

.mini-bar-value {
  position: absolute;
  bottom: calc(var(--mini-bar-height) + 7px);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.mini-bar:hover .mini-bar-value {
  opacity: 1;
  transform: translateY(0);
}

.mini-bar-label {
  position: absolute;
  top: calc(100% + 13px);
  right: 50%;
  width: max-content;
  max-width: 72px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--mini-label-size, 0.68rem);
  font-weight: 600;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: rotate(-90deg);
  transform-origin: top right;
  white-space: nowrap;
}

.mini-chart.is-dense .mini-bar-fill {
  width: min(100%, 44px);
}

@media (max-width: 1100px) {
  .dash-chart-grid {
    grid-template-columns: 1fr;
  }
}

#dashCronContent .detail-section {
  margin-top: 42px;
}

.mini-chart-frame {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  height: 272px;
  min-width: 0;
}

.mini-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 194px;
  padding: 0 10px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}

.mini-bar-plot {
  display: block;
  height: 272px;
  min-width: 0;
  padding: 0 8px 78px 0;
}

.mini-bar-plot::before {
  display: none;
}

.mini-value-area {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--mini-bar-count, 1), minmax(0, 1fr));
  align-items: end;
  gap: var(--mini-bar-gap, 18px);
  height: 100%;
  min-width: 0;
}

.mini-grid-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 0;
  height: 1px;
  background: color-mix(in srgb, var(--line), transparent 12%);
}

.mini-bar {
  z-index: 1;
}

.mini-bar-value {
  z-index: 2;
}

#dashCronContent .detail-section .dash-grid {
  align-items: start;
}

#dashCronContent .mini-table {
  align-self: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto;
}

#dashCronContent .mini-table table {
  table-layout: fixed;
  width: 100%;
}

#salesDetailSection .table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto;
}

#salesDetailSection table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
