:root {
  --app-bg: #eef2f7;
  --app-ink: #2a2c2d;
  --app-accent: #c45c26;
  --app-sidebar: #2a2c2d;
  --app-sidebar-hover: #363839;
  --app-card: #ffffff;
  --shell-border: #d9dfe5;
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
}

body.bg-app,
body.app-body {
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: "DM Sans", system-ui, sans-serif;
}

/* —— Shell tipo panel de alquiler (layout lateral + topbar) —— */
.app-body--auth {
  overflow-x: hidden;
}

.sidebar-app {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--app-sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  transition: width 0.2s ease, min-width 0.2s ease;
  z-index: 1020;
}

.sidebar-app--collapsed {
  width: var(--sidebar-w-collapsed);
  min-width: var(--sidebar-w-collapsed);
}

.sidebar-app__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--topbar-h);
  padding: 0 0.5rem 0 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-app__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.sidebar-app__brand-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--app-accent) 0%, #e8945c 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: -0.03em;
}

.sidebar-app__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.sidebar-app--collapsed .sidebar-app__brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-app__brand-title {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sidebar-app__brand-sub {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-app__pin {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.sidebar-app__pin:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
}

.sidebar-app__pin-ico {
  transition: transform 0.2s ease;
  font-size: 1.1rem;
}

.sidebar-app--collapsed .sidebar-app__pin-ico {
  transform: rotate(180deg);
}

.sidebar-app__nav {
  padding: 0.5rem 0.4rem;
  overflow-y: auto;
}

.sidebar-app__foot {
  padding: 0.5rem 0.4rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-app--collapsed .sidebar-app__user,
.sidebar-app--collapsed .sidebar-link--logout .sidebar-link__text {
  display: none;
}

.sidebar-app--collapsed .sidebar-app__user-role {
  display: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(255, 255, 255, 0.82) !important;
  border-radius: 8px;
  padding: 0.45rem 0.65rem !important;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-link:hover {
  background: var(--app-sidebar-hover) !important;
  color: #fff !important;
}

.sidebar-link--sub {
  font-size: 0.82rem;
  padding-left: 0.5rem !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

.sidebar-link__ico {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 1.05rem;
  opacity: 0.9;
}

.sidebar-app--collapsed .sidebar-link__text,
.sidebar-app--collapsed .sidebar-section__text {
  display: none;
}

.sidebar-app--collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.sidebar-section {
  padding: 0.65rem 0.65rem 0.25rem !important;
  margin-top: 0.25rem;
}

.sidebar-app--collapsed .sidebar-section {
  height: 1px;
  padding: 0 !important;
  margin: 0.5rem 0.35rem !important;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border: 0;
}

.sidebar-section__text {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.38);
}

.topbar-app {
  min-height: var(--topbar-h);
  padding: 0.5rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--shell-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  z-index: 1010;
}

.topbar-app__title {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  color: var(--app-ink);
}

.app-content {
  padding: 1rem 1.25rem 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.card-app {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Dashboard widgets (rejilla tipo panel) */
.dash-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 1200px) {
  .dash-grid {
    grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
    align-items: start;
  }
}

.dash-widget {
  background: var(--app-card);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dash-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--shell-border);
  background: #fafbfc;
}

.dash-widget__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #626565;
  margin: 0;
}

.dash-widget__body {
  padding: 0.75rem 1rem 1rem;
  flex: 1;
  min-height: 0;
}

.dash-widget__body--flush {
  padding: 0;
}

.dash-widget__body--scroll {
  max-height: 320px;
  overflow-y: auto;
}

.dash-kpi-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .dash-kpi-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dash-kpi {
  background: var(--app-card);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dash-kpi__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7c7e7e;
  margin-bottom: 0.25rem;
}

.dash-kpi__value {
  font-family: "Outfit", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--app-ink);
}

.dash-kpi__value a {
  color: inherit;
}

.dash-kpi__value--accent {
  color: var(--app-accent);
}

.dash-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--shell-border);
  font-size: 0.9rem;
}

.dash-list__item:last-child {
  border-bottom: none;
}

.dash-alert-strip {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .dash-alert-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dash-alert-card {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.dash-alert-card__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c7e7e;
  font-weight: 600;
}

.dash-alert-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
}

.dash-meta {
  font-size: 0.8rem;
  color: #626565;
}

.text-app {
  color: var(--app-ink);
}

/* .sidebar legacy retirado: usar .sidebar-app */

.btn-accent {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: #fff;
}

.btn-accent:hover {
  filter: brightness(1.05);
  color: #fff;
}

.table thead {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

/* Calendario de eventos (vista tipo panel de planificación) */
.cal-shell {
  max-width: 100%;
}

.cal-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0;
}

@media (max-width: 767.98px) {
  .cal-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .cal-toolbar__center {
    order: -1;
  }
}

.cal-toolbar__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cal-toolbar__month-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--app-ink);
  min-width: 10rem;
  text-align: center;
}

.cal-toolbar__nav-btn,
.cal-toolbar__icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.cal-toolbar__icon-btn {
  width: auto;
  min-height: 2.25rem;
  padding: 0 0.65rem;
}

.cal-toolbar__select {
  max-width: 11rem;
}

.cal-card {
  border-radius: 12px;
}

.cal-table-wrap {
  max-height: min(78vh, 900px);
  overflow: auto;
}

.cal-table {
  table-layout: fixed;
  border-color: var(--shell-border) !important;
}

.cal-th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #626565;
  background: #f6f8f9 !important;
  padding: 0.5rem 0.25rem !important;
  border-color: var(--shell-border) !important;
}

.cal-th--weekend {
  color: #8b4000;
  background: #fff8f0 !important;
}

.cal-cell {
  min-height: 108px;
  width: 14.28%;
  border-color: var(--shell-border) !important;
  vertical-align: top;
  cursor: pointer;
  transition: background 0.12s ease;
  background: #fff;
}

.cal-cell--muted {
  background: #f4f6f8 !important;
  cursor: default;
  min-height: 48px;
}

.cal-cell:not(.cal-cell--muted):hover {
  background: #f0f7ff !important;
}

.cal-cell--today .cal-cell__inner {
  box-shadow: inset 0 0 0 2px var(--app-accent);
  border-radius: 6px;
  min-height: 100%;
}

.cal-cell__inner {
  padding: 0.35rem 0.4rem 0.5rem;
  min-height: 104px;
}

.cal-cell__num {
  font-size: 0.8rem;
  font-weight: 700;
  color: #363839;
  margin-bottom: 0.25rem;
}

.cal-cell--today .cal-cell__num {
  color: var(--app-accent);
}

.cal-cell__events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-cell__more {
  padding-left: 2px;
  font-size: 0.65rem;
}

.cal-event-chip {
  display: block;
  font-size: 0.65rem;
  line-height: 1.25;
  padding: 3px 5px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  color: var(--app-ink) !important;
  background: #f2f4f7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cal-event-chip:hover {
  filter: brightness(0.97);
}

.cal-event-chip__time {
  font-weight: 700;
  margin-right: 3px;
  opacity: 0.85;
}

.cal-event-chip--programado {
  border-left-color: #137cfb;
  background: #e7f2ff;
}

.cal-event-chip--en_curso {
  border-left-color: #fd7400;
  background: #fff1e6;
}

.cal-event-chip--cerrado {
  border-left-color: #2a7a4b;
  background: #eafaf1;
}

.cal-event-chip--cancelado {
  border-left-color: #b32548;
  background: #ffebf0;
  text-decoration: line-through;
  opacity: 0.85;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cal-legend__sw {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  border-left-width: 3px;
  border-left-style: solid;
  background: #f2f4f7;
}

.cal-legend__sw.cal-event-chip--programado {
  border-left-color: #137cfb;
  background: #e7f2ff;
}

.cal-legend__sw.cal-event-chip--en_curso {
  border-left-color: #fd7400;
  background: #fff1e6;
}

.cal-legend__sw.cal-event-chip--cerrado {
  border-left-color: #2a7a4b;
  background: #eafaf1;
}

.cal-legend__sw.cal-event-chip--cancelado {
  border-left-color: #b32548;
  background: #ffebf0;
}

.badge-estado {
  font-weight: 600;
  font-size: 0.7rem;
}

.estado-badge {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.35em 0.65em;
}

.estado-disponible {
  background: #0d6e3c !important;
  color: #fff;
}

.estado-en_evento {
  background: #1e4d8c !important;
  color: #fff;
}

.estado-mantenimiento {
  background: #b45309 !important;
  color: #fff;
}

.estado-perdido {
  background: #6b2c2c !important;
  color: #fff;
}

.estado-programado {
  background: #137cfb !important;
  color: #fff;
}

.estado-en_curso {
  background: #e66a00 !important;
  color: #fff;
}

.estado-cerrado {
  background: #219150 !important;
  color: #fff;
}

.estado-cancelado {
  background: #b32548 !important;
  color: #fff;
}

/* Bolsa de trabajo (lista + detalle) */
.job-board__row {
  align-items: stretch;
  min-height: min(70vh, 720px);
}

.job-board__sidebar {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  max-height: min(78vh, 820px);
}

.job-board__sidebar-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.job-board__list {
  overflow-y: auto;
  flex: 1;
}

.job-board__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--shell-border);
  color: inherit;
  transition: background 0.12s ease;
}

.job-board__item:hover {
  background: #f0f7ff;
}

.job-board__item--active {
  background: #e7f2ff;
  box-shadow: inset 3px 0 0 var(--app-accent);
}

.job-board__item-body {
  flex: 1;
  min-width: 0;
}

.job-board__item-title {
  font-family: Outfit, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--app-ink);
}

.job-board__item-chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.job-board__main {
  min-height: min(70vh, 720px);
  display: flex;
  flex-direction: column;
}

.job-board__main .card-body {
  flex: 1;
}

.job-board__empty {
  min-height: 360px;
}

/* Equipos: vista almacén (lista + detalle) */
.eq-almacen__scroll {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.eq-almacen__detail {
  min-height: 280px;
}

@media (min-width: 992px) {
  .eq-almacen__detail {
    position: sticky;
    top: 0.75rem;
    align-self: flex-start;
  }
}

.eq-almacen-row--active > td {
  background-color: rgba(196, 92, 38, 0.08) !important;
}

.eq-almacen-row--active {
  box-shadow: inset 3px 0 0 var(--app-accent);
}

.eq-almacen__dl dt {
  font-weight: 500;
}

.xdock-period .btn-group .btn {
  min-width: 3.25rem;
}

.xdock-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c5f60;
}

.xdock-event-list__item:last-child {
  border-bottom: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.tracklog-page .tracklog-filters {
  position: sticky;
  top: 0.75rem;
}

@media (max-width: 991.98px) {
  .tracklog-page .tracklog-filters {
    position: static;
  }
}

.tracklog-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c5f60;
}

.tracklog-dl dt {
  font-weight: 500;
}

.tracklog-table-wrap {
  max-height: min(70vh, 720px);
}

/* Logística: panel tipo tablero por día */
.logi-toolbar__title {
  color: var(--app-ink);
}

.logi-board {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

.logi-board__column {
  flex: 1 1 0;
  min-width: 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.logi-board__column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.35rem 0.75rem;
  border-bottom: 2px solid var(--shell-border);
  margin-bottom: 0.5rem;
}

.logi-board__column-title {
  font-family: Outfit, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a4d4e;
}

.logi-board__column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 120px;
}

.logi-board__empty {
  font-style: italic;
  padding: 0.5rem;
}

.logi-card__title {
  color: var(--app-ink);
}

.logi-card__badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.logi-card__badge--pendiente {
  background: #e3e7eb !important;
  color: #363839 !important;
}

.logi-card__badge--en_ruta {
  background: #e7f2ff !important;
  color: #0d58b2 !important;
}

.logi-card__badge--montaje,
.logi-card__badge--en_evento {
  background: #fff1e6 !important;
  color: #b45200 !important;
}

.logi-card__badge--desmontaje,
.logi-card__badge--retorno {
  background: #f2f1ff !important;
  color: #5752b2 !important;
}

.logi-card__badge--completado {
  background: #eafaf1 !important;
  color: #19703e !important;
}

.equipo-check {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  border-color: #e8e4de !important;
}

.equipo-check:hover {
  border-color: var(--app-accent) !important;
  box-shadow: 0 0 0 1px rgba(196, 92, 38, 0.2);
}

.equipo-check:has(input:checked) {
  border-color: var(--app-accent) !important;
  background: #fff8f3 !important;
}

.equipo-picker {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.equipos-table tbody tr:hover {
  background: rgba(196, 92, 38, 0.04);
}

.font-monospace {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}

/* Vista Proyectos (lista + detalle) */
.proyectos-page__split {
  align-items: stretch;
}

.proyectos-page__table-card {
  min-height: 280px;
}

.proyectos-page__detail {
  position: sticky;
  top: calc(var(--topbar-h, 52px) + 0.5rem);
}

@media (max-width: 991.98px) {
  .proyectos-page__detail {
    position: static;
  }
}

.proyectos-table__dot {
  width: 1.5rem;
  padding-left: 0.5rem !important;
  padding-right: 0 !important;
}

.proj-estado-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
}

.proj-estado--programado {
  background: #14b4ec;
}

.proj-estado--en_curso {
  background: #ff6729;
}

.proj-estado--cerrado {
  background: #6c757d;
}

.proj-estado--cancelado {
  background: #dc3545;
}

.proyectos-table__row--muted td:not(:last-child) {
  opacity: 0.78;
  text-decoration: line-through;
}

.proyectos-detail-dl dt {
  font-weight: 500;
}

/* Planificador de personal (semana × empleados) */
.planner-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 992px) {
  .planner-shell {
    flex-direction: row;
    align-items: flex-start;
  }

  .planner-sidebar {
    flex: 0 0 15rem;
    max-width: 18rem;
    max-height: min(78vh, 900px);
    display: flex;
    flex-direction: column;
  }

  .planner-sidebar .card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
  }

  .planner-main {
    flex: 1;
    min-width: 0;
  }
}

.planner-sidebar__scroll {
  overflow: auto;
  max-height: min(62vh, 720px);
  padding-right: 2px;
}

.planner-sidebar__group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.25rem;
  padding-top: 0.35rem;
}

.planner-sidebar__link {
  display: block;
  font-size: 0.8125rem;
  padding: 0.2rem 0.35rem;
  border-radius: 0.25rem;
  color: var(--bs-body-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-sidebar__link:hover {
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

.planner-sidebar__link--active {
  background: rgba(19, 124, 251, 0.12);
  font-weight: 600;
}

.planner-sidebar__link--hint {
  background: rgba(19, 124, 251, 0.06);
}

.planner-toolbar__preset {
  min-width: 10.5rem;
}

.planner-disponibles__list {
  columns: 1;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .planner-disponibles__list {
    columns: 2;
    column-gap: 1.5rem;
  }
}

.planner-disponibles__list li {
  break-inside: avoid;
  margin-bottom: 0.25rem;
}

.planner-disponibles__link {
  text-decoration: none;
}

.planner-disponibles__link:hover {
  text-decoration: underline;
}

.planner-page .planner-toolbar__title {
  font-family: Outfit, system-ui, sans-serif;
  min-width: 0;
}

.planner-table-wrap {
  max-height: min(78vh, 900px);
  overflow: auto;
}

.planner-table {
  font-size: 0.8125rem;
  table-layout: fixed;
  min-width: 720px;
}

.planner-th-name,
.planner-name-col {
  width: 11rem;
  min-width: 9rem;
  max-width: 14rem;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bs-body-bg, #fff);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
}

.planner-table thead .planner-th-name {
  z-index: 3;
  vertical-align: bottom;
}

.planner-th-day {
  text-align: center;
  font-weight: 600;
  min-width: 5.5rem;
}

.planner-th-day--today {
  background: rgba(19, 124, 251, 0.08);
}

.planner-th-day__wd {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bs-secondary-color);
}

.planner-th-day__num {
  font-size: 1rem;
}

.planner-group-row__label {
  background: var(--bs-tertiary-bg, #f1f3f5);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  border-bottom-width: 1px;
}

.planner-name-col {
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-cell {
  vertical-align: top;
  padding: 0.35rem 0.4rem !important;
  min-height: 2.5rem;
}

.planner-cell--today {
  background: rgba(19, 124, 251, 0.04);
}

.planner-cell .planner-chip {
  font-size: 0.7rem;
  line-height: 1.25;
  padding: 0.2rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-cell__empty {
  font-size: 0.75rem;
  opacity: 0.45;
}

/* Escasez de alquiler (tabla + panel detalle) */
.shortages-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 992px) {
  .shortages-shell {
    flex-direction: row;
    align-items: flex-start;
  }

  .shortages-main {
    flex: 1;
    min-width: 0;
  }

  .shortages-detail {
    flex: 0 0 20rem;
    max-width: 24rem;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
  }
}

.shortages-table__group td {
  background: var(--bs-tertiary-bg, #f1f3f5);
  border-bottom-width: 0;
}

.shortages-table__row--alert td {
  background: rgba(220, 53, 69, 0.06);
}

.subhire-table__row--pending td {
  background: rgba(255, 193, 7, 0.1);
}

.invoices-table__row--overdue td {
  background: rgba(220, 53, 69, 0.07);
}

.por-facturar-row--pendiente td {
  background: rgba(255, 193, 7, 0.08);
}

.shortages-page .shortages-table tbody tr.shortages-table__row:hover td {
  background: rgba(19, 124, 251, 0.05);
}

.shortages-page .shortages-table tbody tr.shortages-table__row.table-active td {
  background: rgba(19, 124, 251, 0.1);
}
