/* ==========================================================================
   MotosGPS — Componentes Reutilizables de Interfaz (components.css)
   Diseño sobrio y ejecutivo alineado con el menú lateral (#111318 / #161920)
   ========================================================================== */

/* 1. Encabezados de Página y Barras de Herramientas */
.page-header,
.veh-header,
.acc-header,
.al-head,
.dash-head,
.cond-head,
.mant-head,
.usr-head,
.hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-actions,
.al-head-actions,
.cond-head-actions,
.veh-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 2. Tarjetas de Indicadores (KPIs) Sobrias */
.kpi-grid,
.dash-stats,
.al-stats,
.cond-stats,
.al-accel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card,
.dash-stat-card,
.al-stat,
.cond-stat,
.al-accel-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #161920;
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(17, 19, 24, 0.04);
}

.kpi-card.accent,
.dash-stat-card.accent,
.al-stat.accent,
.cond-stat.accent {
  border-top-color: var(--accent);
}

.kpi-label,
.dash-stat-label,
.al-stat-label,
.cond-stat-lbl,
.al-accel-lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.kpi-value,
.dash-stat-value,
.al-stat-value,
.cond-stat-val,
.al-accel-val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #111318;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.al-accel-val {
  font-size: 15px;
}

.dash-stat-value.warn,
.al-stat-value.warn,
.cond-stat-val.orange,
.al-accel-val.warn,
.al-accel-val.danger {
  color: var(--accent);
}

.dash-stat-value.ok,
.al-stat-value.ok,
.cond-stat-val.ok,
.al-accel-val.ok {
  color: #111318;
}

/* 3. Etiqueta Corporativa de Placa ([PLACA]) */
.placa-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #161920;
  color: #f8fafc;
  border: 1px solid #262b38;
  border-left: 3px solid var(--accent);
}

.veh-card-plates {
  display: none !important;
}

/* 4. Tarjetas de Vehículos (.veh-card) */
.veh-grid,
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 16px;
}

.veh-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.veh-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(17, 19, 24, 0.08);
}

.veh-card-top {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}

.veh-card-name {
  font-size: 15px;
  font-weight: 800;
  color: #111318;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.veh-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px 16px 0;
}

.veh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  line-height: 1.25;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.veh-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
}

.veh-badge.on .dot {
  background: #16a34a;
}

.veh-badge.off .dot {
  background: #6b7280;
}

.veh-badge.warn {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.veh-badge.info {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.veh-info {
  padding: 12px 16px 14px;
  flex: 1;
}

.veh-card,
.veh-card * {
  font-family: var(--font);
}

.veh-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-family: var(--font);
  font-size: 12.5px;
}

.veh-row:last-child {
  border-bottom: none;
}

.veh-label {
  font-family: var(--font);
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
}

.veh-value,
.veh-value.mono {
  font-family: var(--font) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #111318 !important;
  text-align: right;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.veh-card-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 16px 14px;
  background: #f8fafc;
  border-top: 1px solid #edf2f7;
}

.veh-card-actions .btn {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  width: 100%;
}

/* 5. Cajas Informativas y Barras de Contexto Sobrias */
.info-strip,
.ficha-veh-bar,
.hint-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #334155;
  margin-bottom: 14px;
}

/* 6. Modales Ejecutivos */
.veh-modal,
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 24, 0.6);
  backdrop-filter: blur(2px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.veh-modal.open,
.modal-backdrop.show {
  display: flex;
}

.veh-modal-box,
.modal-card {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 20px 50px rgba(17, 19, 24, 0.25);
  max-width: 480px;
  width: 100%;
  padding: 22px 24px;
}

.veh-modal-box h3,
.modal-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: #111318;
  margin-bottom: 4px;
}

.veh-modal-sub {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
  font-family: var(--font);
}

.veh-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

/* 7. Tarjetas de Autenticación (Login / Registro) en Gama del Menú */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f4f5f7;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(17, 19, 24, 0.08);
}

.auth-card-header {
  background: linear-gradient(180deg, #111318 0%, #161920 100%);
  padding: 22px 26px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-card-header .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.auth-card-header .brand-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-card-header .brand-sub {
  color: #94a3b8;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 2px;
}

.auth-card-body {
  padding: 24px 26px 26px;
}

@media (max-width: 900px) {
  .kpi-grid,
  .dash-stats,
  .al-stats,
  .cond-stats,
  .al-accel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .kpi-grid,
  .dash-stats,
  .al-stats,
  .cond-stats,
  .al-accel-grid {
    grid-template-columns: 1fr;
  }
}

.ui-aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: #1e293b;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
}
.ui-aviso.err { border-left-color: #b91c1c; }
.ui-aviso-txt { flex: 1; min-width: 0; }
.ui-aviso-x {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.ui-confirm-ov {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 19, 24, 0.55);
}
.ui-confirm {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(17, 19, 24, 0.25);
  padding: 18px;
  font-family: var(--font);
  color: #1e293b;
}
.ui-confirm h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: #111318; }
.ui-confirm p { margin: 0; font-size: 13px; line-height: 1.5; color: #64748b; white-space: pre-line; overflow-wrap: anywhere; }
.ui-confirm-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ui-confirm-pie button {
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.ui-confirm-no { background: #ffffff; border: 1px solid #e2e8f0; color: #1e293b; }
.ui-confirm-si { background: var(--accent); border: 1px solid var(--accent); color: #ffffff; }
.ui-confirm-si.peligro { background: #b91c1c; border-color: #b91c1c; }
@media (max-width: 560px) {
  .ui-confirm-pie button { flex: 1; }
}
