/* Service Camiones — tema CMMS (Bootstrap 5) */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

:root {
  --app-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --app-body-bg: #eef1f6;
  --app-navbar-bg: #1e293b;
  --app-navbar-hover: rgba(255, 255, 255, 0.08);
  --app-card-radius: 0.65rem;
  --app-border-subtle: rgba(15, 23, 42, 0.08);
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
}

[data-bs-theme="light"] {
  --bs-body-bg: var(--app-body-bg);
}

html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.app-body {
  font-family: var(--app-font);
  background-color: var(--app-body-bg);
  color: #1e293b;
}

/* Barra superior */
.app-navbar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.app-navbar .navbar-brand {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f8fafc !important;
}

.app-navbar .nav-link {
  font-weight: 500;
  border-radius: 0.375rem;
  padding: 0.45rem 0.85rem !important;
  margin: 0 0.1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  background-color: var(--app-navbar-hover);
  color: #fff !important;
}

.app-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.15rem;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.app-user-badge .badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Contenedor principal */
.app-main-wrap {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

/* Cabecera de página */
.page-hero {
  margin-bottom: 1.75rem;
}

.page-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

@media (min-width: 768px) {
  .page-hero-title {
    font-size: 1.65rem;
  }
}

.page-hero-lead {
  font-size: 0.95rem;
  color: #64748b;
  max-width: 42rem;
  margin-bottom: 0;
}

/* Tarjetas */
.app-card {
  border-radius: var(--app-card-radius);
  border: 1px solid var(--app-border-subtle);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.app-card .card-header {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
  border-bottom: 1px solid var(--app-border-subtle);
  padding: 1rem 1.25rem;
}

.app-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.app-card .card-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0;
}

/* Tablas */
.table-app thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom-width: 1px;
  white-space: nowrap;
  background-color: #f8fafc;
}

.table-app tbody td {
  vertical-align: middle;
}

.table-app.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(248, 250, 252, 0.85);
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #64748b;
}

.empty-state .bi {
  font-size: 2.25rem;
  opacity: 0.35;
  margin-bottom: 0.75rem;
  display: block;
}

/* Hero métrica (detalle vehículo) */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
}

/* Login */
.app-login-bg {
  background: linear-gradient(160deg, #e8eef9 0%, #eef1f6 45%, #f1f5f9 100%);
  min-height: 100vh;
}

.app-auth-card {
  border-radius: var(--app-card-radius);
  border: 1px solid var(--app-border-subtle);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.app-auth-card .card-body {
  padding: 2rem;
}

/* Enlaces */
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item) {
  color: #1d4ed8;
  text-decoration-color: rgba(29, 78, 216, 0.35);
}

a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):hover {
  color: #1e40af;
}

/* Focus accesible */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.35);
}

/* Alertas */
.alert-dismissible {
  border: none;
  border-radius: var(--app-card-radius);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.validation-summary-valid {
  display: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 1080;
  padding: 0.5rem 1rem;
  background: #1e293b;
  color: #fff !important;
  border-radius: 0.25rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Tarjetas enlazadas (inicio) */
a.text-decoration-none .app-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  color: inherit;
}

a.text-decoration-none:hover .app-card {
  box-shadow: 0 0.5rem 1.75rem rgba(15, 23, 42, 0.12) !important;
  transform: translateY(-3px);
}

/* Pie (opcional) */
.app-footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid var(--app-border-subtle);
  font-size: 0.8125rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.6);
}
