html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Estilos específicos para el dashboard */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  transition: transform 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px 10px 0 0 !important;
  font-weight: 600;
}

/* KPI Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
  border: none;
  color: white;
}

.card.bg-warning {
  color: #212529 !important;
}

/* Badges personalizados */
.badge {
  font-size: 0.8em;
  padding: 0.4em 0.8em;
  border-radius: 6px;
}

.badge.fs-6 {
  font-size: 1rem !important;
  padding: 0.8em 1.2em;
}

/* Tablas mejoradas */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table-dark {
  background-color: #343a40;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

/* Navegación activa */
.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-weight: 600;
}

/* Paginación personalizada */
.pagination .page-link {
  border-radius: 6px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
}

/* Breadcrumbs mejorados */
.breadcrumb {
  background-color: transparent;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  color: #6c757d;
}

/* Alertas mejoradas */
.alert {
  border: none;
  border-radius: 8px;
  border-left: 4px solid;
}

.alert-warning {
  border-left-color: #ffc107;
  background-color: #fff3cd;
}

/* Formularios mejorados */
.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Footer */
footer {
  margin-top: auto;
}

/* Iconos */
.fas, .far {
  margin-right: 0.5rem;
}

/* Loading spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Chart containers */
canvas {
  max-height: 400px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
}

/* Dark mode support 
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #ffffff;
  }
  
  .card {
    background-color: #1e1e1e;
    color: #ffffff;
  }
  
  .table {
    color: #ffffff;
  }
  
  .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
  }
}
*/

/* Animaciones suaves */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Compact / fit table utility used across views */
.table-fit {
  font-size: .9rem;
}

.table-fit th,
.table-fit td {
  padding: .35rem .5rem;
  vertical-align: middle;
}

.table-fit thead th {
  font-size: .88rem;
}

.table-fit tbody td {
  font-size: .88rem;
}

.table-fit .badge {
  font-size: .75rem;
  padding: .25rem .45rem;
}

@media (max-width: 768px) {
  .table-fit th, .table-fit td { padding: .25rem .4rem; font-size: .82rem; }
}

/* Smaller dashboard charts utility */
.chart-small {
  max-height: 180px;
  height: 180px !important;
  width: 100% !important;
  display: block;
}

@media (min-width: 992px) {
  .chart-small {
    max-height: 220px;
    height: 220px !important;
  }
}

/* Page-scoped compact styles moved from Cliente.cshtml */
.cliente-page .form-control,
.cliente-page .form-select {
  max-width: 180px;
  font-size: .9rem;
  padding: .25rem .5rem;
}

.cliente-page .table-sm td,
.cliente-page .table-sm th {
  padding: .3rem .5rem;
  vertical-align: middle;
}

#historialTable { font-size: .88rem; }
#historialTable th:nth-child(1), #historialTable td:nth-child(1) { width: 95px; white-space: nowrap; }
#historialTable th:nth-child(2), #historialTable td:nth-child(2) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#historialTable th:nth-child(4), #historialTable td:nth-child(4) { width: 120px; white-space: nowrap; }
#historialTable th:nth-child(5), #historialTable td:nth-child(5) { width: 110px; white-space: nowrap; text-align: right; }

/* Cotizaciones table: compact */
#cotizacionesTable { font-size: .88rem; }
#cotizacionesTable th:nth-child(1), #cotizacionesTable td:nth-child(1) { width: 70px; white-space: nowrap; }
#cotizacionesTable th:nth-child(3), #cotizacionesTable td:nth-child(3) { width: 110px; white-space: nowrap; text-align: right; }

/* Detalle modal table */
#detalleTable { font-size: .88rem; }
#detalleTable th, #detalleTable td { white-space: nowrap; }

.cliente-page .badge { font-size: .78rem; }

/* Compact filter styles moved from Recomendaciones.cshtml */
.reco-filters .form-control,
.reco-filters .form-select {
  max-width: 180px;
  font-size: .9rem;
  padding: .25rem .45rem;
}

.reco-filters .form-label { font-size: .85rem; margin-bottom: .25rem; }
.reco-filters .form-check-label { font-size: .85rem; }
.reco-filters .col-auto { display: flex; flex-direction: column; }
.reco-filters .date-pair { display:flex; gap:.5rem; align-items:flex-end; }
.reco-filters .date-pair .form-control { max-width: 150px; }
.reco-filters .small-btn { padding: .35rem .6rem; font-size: .9rem; }

/* Typography used in Recomendaciones page: make available globally so Dashboard and Cliente match */
.dashboard-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 1px;
}
.dashboard-lead {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}
