/* =============================================
   MOBILE FIRST - Base (< 768px)
   ============================================= */

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

body {
  background-color: #f5f7fa;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Top navbar */
.top-nav {
  height: 48px;
  padding: 0 12px;
  z-index: 1030;
}
.top-nav .navbar-brand {
  font-size: 1rem;
}

/* Main content: espacio para topnav + bottom nav */
main {
  padding: 56px 10px 70px;
}

/* Bottom tab navigation (movil) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1030;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #6c757d;
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s;
}
.bottom-nav-item i {
  font-size: 1.25rem;
}
.bottom-nav-item.active {
  color: #0d6efd;
  font-weight: 600;
}

/* KPI Cards */
.kpi-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.kpi-card .card-body {
  padding: 0.75rem;
}
.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.kpi-label {
  font-size: 0.7rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

/* Card list (mobile) */
.cards-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 0.75rem;
}
.card-item-title {
  font-size: 0.9rem;
  line-height: 1.3;
  flex: 1;
  margin-right: 8px;
}
.card-item.total-row {
  background: #f8f9fa;
  font-size: 0.85rem;
}

/* Contenedores */
.table-container, .chart-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 0.75rem;
  overflow-x: auto;
}

/* Tables */
.table {
  font-size: 0.8rem;
  margin-bottom: 0;
}
.table th {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #6c757d;
  border-bottom-width: 2px;
  white-space: nowrap;
}
.table td {
  vertical-align: middle;
}
.table .total-row {
  font-weight: 700;
  background-color: #f8f9fa;
}

/* Estado badges */
.badge-pendiente { background-color: #6c757d; }
.badge-en_curso { background-color: #0d6efd; }
.badge-finalizado { background-color: #198754; }
.badge-cancelado { background-color: #dc3545; }

/* Filters bar */
.filters-bar {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.filters-bar select,
.filters-bar input {
  font-size: 0.8rem;
}

/* Botones accion en tablas */
.btn-action {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
}

/* Section headers */
main h4 {
  font-size: 1.1rem;
}
.chart-container h6 {
  font-size: 0.85rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
}
.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Progress bar */
.progress {
  background-color: #e9ecef;
}

/* Modal (centrado y mas ancho en movil) */
.modal-dialog-centered {
  margin: 0.5rem;
}

/* Calendar - Festivos */
.cal-month {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 0.5rem;
}
.cal-month-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}
.cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  table-layout: fixed;
}
.cal-table th {
  text-align: center;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.6rem;
  padding: 2px;
  text-transform: none;
  border-bottom: none;
}
.cal-table td {
  text-align: center;
  padding: 3px 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-table td:hover:not(:empty) {
  background: #e9ecef;
}
.cal-table td.cal-festivo {
  background: #f8d7da;
  color: #dc3545;
  font-weight: 700;
}
.cal-table td.cal-festivo:hover {
  background: #f1aeb5;
}
.cal-table td.cal-weekend {
  color: #adb5bd;
}
.cal-legend {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 3px;
  vertical-align: middle;
}
.cal-legend-festivo {
  background: #f8d7da;
  border: 1px solid #dc3545;
}
.cal-legend-weekend {
  background: #f8f9fa;
  border: 1px solid #adb5bd;
}
.cal-legend-today {
  background: transparent;
  border: 2px solid #0d6efd;
}
.cal-today {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}
.cal-dots {
  display: flex;
  justify-content: center;
  gap: 1px;
  margin-top: 1px;
  min-height: 5px;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-curso-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 8px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cal-curso-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tarifa neta navegacion */
#tarifaMesLabel {
  min-width: 120px;
  text-align: center;
  font-size: 0.85rem;
}

/* Toast */
.alert.position-fixed {
  font-size: 0.85rem;
  max-width: 90vw;
}

.summary-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.75rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
}

/* =============================================
   TABLET (>= 768px)
   ============================================= */
@media (min-width: 768px) {
  body { font-size: 15px; }

  main {
    padding: 60px 16px 2rem;
  }

  /* Sin bottom nav en tablet+ */
  .bottom-nav { display: none !important; }

  .kpi-card .card-body { padding: 1rem; }
  .kpi-value { font-size: 1.3rem; }
  .kpi-label { font-size: 0.75rem; }

  .table { font-size: 0.85rem; }
  .table-container, .chart-container { padding: 1rem; border-radius: 8px; }
  .filters-bar { padding: 0.75rem 1rem; }

  .cal-table { font-size: 0.75rem; }
  .cal-table td { padding: 4px 2px; }
  .cal-month { padding: 0.75rem; }
  .cal-month-title { font-size: 0.85rem; }
  .cal-dot { width: 5px; height: 5px; }

  .btn-action { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
  main h4 { font-size: 1.25rem; }
  .modal-dialog-centered { margin: 1.75rem auto; }
}

/* =============================================
   DESKTOP (>= 992px)
   ============================================= */
@media (min-width: 992px) {
  main {
    padding: 64px 24px 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .kpi-card .card-body { padding: 1.25rem; }
  .kpi-value { font-size: 1.5rem; }
  .kpi-label { font-size: 0.8rem; }
  .kpi-card {
    transition: transform 0.2s;
  }
  .kpi-card:hover { transform: translateY(-2px); }

  .table-container, .chart-container {
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .table { font-size: 0.9rem; }
  .cal-table { font-size: 0.8rem; }
  .cal-dot { width: 5px; height: 5px; }
  .cal-dots { gap: 2px; }
}
