/* Dashboard + cascarón del personal: que quepa en celular sin cortar. */

html.staff-dash-min .dashboard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

html.staff-dash-min .dashboard,
html.staff-dash-min .dashboard * {
  box-sizing: border-box;
}

html.staff-dash-min .dash-welcome-hero {
  overflow: visible !important;
  min-width: 0 !important;
  width: 100% !important;
  flex-wrap: wrap !important;
  row-gap: 12px !important;
}

html.staff-dash-min .dash-welcome-text,
html.staff-dash-min .dash-welcome-pills {
  min-width: 0 !important;
  max-width: 100%;
}

html.staff-dash-min .dash-welcome-title,
html.staff-dash-min .dash-welcome-name {
  overflow-wrap: anywhere;
}

html.staff-dash-min .dashboard-header,
html.staff-dash-min .dashboard-header-title {
  min-width: 0;
  max-width: 100%;
}

html.staff-dash-min .dashboard-top-cards-row {
  display: grid !important;
  grid-template-columns: 1.35fr 1fr 1fr !important;
  grid-template-rows: minmax(118px, auto) minmax(118px, auto) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  flex-wrap: unset !important;
}

html.staff-dash-min .pre-tax-income-card {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

html.staff-dash-min .dashboard-top-cards-row > * {
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  flex: none !important;
  overflow: visible !important;
  height: auto !important;
}

html.staff-dash-min .dashboard-top-cards-row > * * {
  min-width: 0 !important;
}

html.staff-dash-min .dashboard-top-cards-row h2,
html.staff-dash-min .dashboard-top-cards-row h3,
html.staff-dash-min .dashboard-top-cards-row p,
html.staff-dash-min .dashboard-top-cards-row span,
html.staff-dash-min .dashboard-top-cards-row strong {
  min-width: 0;
  max-width: 100%;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

html.staff-dash-min .dash-hero-visual {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

html.staff-dash-min .dash-hero-charts-row {
  display: grid !important;
  grid-template-columns: 1.45fr 1fr 0.9fr !important;
  gap: 14px !important;
  width: 100% !important;
}

html.staff-dash-min .dash-hero-chart-card {
  min-width: 0 !important;
  width: auto !important;
  max-width: 100%;
  overflow: hidden;
}

html.staff-dash-min .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

html.staff-dash-min .stat-card {
  min-width: 0 !important;
  width: auto !important;
  overflow: visible !important;
}

html.staff-dash-min .stat-card h2,
html.staff-dash-min .stat-card h3,
html.staff-dash-min .stat-card p,
html.staff-dash-min .stat-card span {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

html.staff-dash-min .revenue-section,
html.staff-dash-min .growth-section {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

html.staff-dash-min .revenue-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

html.staff-dash-min .revenue-grid > :first-child {
  grid-column: 1 / span 2 !important;
}

html.staff-dash-min .revenue-card {
  min-width: 0 !important;
  width: auto !important;
  overflow: visible !important;
}

html.staff-dash-min .last-month-summary {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1200px) {
  html.staff-dash-min .dashboard-top-cards-row {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
  }

  html.staff-dash-min .pre-tax-income-card {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    min-height: 150px !important;
  }

  html.staff-dash-min .dash-hero-charts-row {
    grid-template-columns: 1fr 1fr !important;
  }

  html.staff-dash-min .dash-hero-charts-row > :first-child {
    grid-column: 1 / -1 !important;
  }

  html.staff-dash-min .revenue-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  html.staff-dash-min .revenue-grid > :first-child {
    grid-column: 1 / -1 !important;
  }

  html.staff-dash-min .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html.staff-dash-min .dash-welcome-hero {
    flex-direction: column;
    align-items: flex-start !important;
  }

  html.staff-dash-min .dash-welcome-pills {
    width: 100%;
  }
}

/* Celular: riel a cajón, todo el ancho para el contenido */
@media (max-width: 820px) {
  html.staff-shell-min .staff-app,
  html.staff-shell-min .staff-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html.staff-shell-min .staff-main {
    flex: 1 1 auto !important;
  }

  html.staff-shell-min .staff-rail {
    display: none !important;
  }

  html.staff-shell-min.staff-rail-open .staff-rail {
    display: flex !important;
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 80;
    width: 76px !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }

  html.staff-shell-min .staff-rail-backdrop {
    display: none;
  }

  html.staff-shell-min.staff-rail-open .staff-rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 70;
  }

  html.staff-shell-min .staff-mobile-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    flex: 0 0 auto;
  }

  html.staff-shell-min .staff-topbar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    min-height: 56px;
    overflow: hidden;
  }

  html.staff-shell-min .staff-topbar-left {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  html.staff-shell-min .staff-breadcrumb-root,
  html.staff-shell-min .staff-breadcrumb-sep {
    display: none !important;
  }

  html.staff-shell-min .staff-breadcrumb-current {
    font-size: 0.92rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html.staff-shell-min .staff-datetime,
  html.staff-shell-min .staff-user-meta {
    display: none !important;
  }

  html.staff-shell-min .staff-topbar-right {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
  }

  html.staff-shell-min .staff-canvas {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px 20px !important;
  }

  html.staff-dash-min .dashboard {
    padding: 0 !important;
  }

  html.staff-dash-min .dash-welcome-hero {
    padding: 14px 14px 12px !important;
    margin-bottom: 12px !important;
  }

  html.staff-dash-min .dash-welcome-title {
    font-size: 1.28rem !important;
    line-height: 1.25 !important;
  }

  html.staff-dash-min .dash-welcome-pills {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  html.staff-dash-min .dash-welcome-pill {
    min-width: 0 !important;
    width: 100% !important;
    justify-content: center;
    text-align: center;
    padding: 8px 4px !important;
  }

  html.staff-dash-min .dash-welcome-pill-label {
    font-size: 0.62rem !important;
    white-space: normal !important;
    overflow: visible;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
  }

  html.staff-dash-min .dashboard-header-title,
  html.staff-dash-min .dashboard-header-subtitle,
  html.staff-dash-min .dashboard-header-title p {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  html.staff-dash-min .dashboard-top-cards-row {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    gap: 10px !important;
  }

  html.staff-dash-min .pre-tax-income-card {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    min-height: 148px !important;
    padding: 18px 16px !important;
  }

  html.staff-dash-min .dash-hero-charts-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html.staff-dash-min .dash-hero-charts-row > :first-child {
    grid-column: 1 / -1 !important;
  }

  html.staff-dash-min .revenue-section {
    padding: 4px 0 8px !important;
    overflow: visible !important;
  }

  html.staff-dash-min .revenue-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  html.staff-dash-min .revenue-grid > :first-child {
    grid-column: 1 / -1 !important;
  }

  html.staff-dash-min .revenue-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 16px !important;
    gap: 6px !important;
  }

  html.staff-dash-min .revenue-card h3,
  html.staff-dash-min .revenue-card h2,
  html.staff-dash-min .revenue-card p,
  html.staff-dash-min .revenue-card span,
  html.staff-dash-min .revenue-card strong {
    white-space: normal !important;
    overflow: visible !important;
    max-width: 100% !important;
  }

  html.staff-dash-min .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  html.staff-dash-min .dashboard-top-cards-row > * {
    padding: 14px !important;
  }

  html.staff-dash-min .dash-hero-chart-card {
    height: 200px !important;
  }

  html.staff-dash-min .dash-hero-charts-row > :first-child {
    height: 230px !important;
  }
}

@media (max-width: 640px) {
  html.staff-dash-min .income-after-expenses-card,
  html.staff-dash-min .month-profit-card {
    grid-column: 1 / -1 !important;
  }
}
