/* EVBro — Maintenance.
   Standalone sheet: the load ORDER (templates/index.html) follows the original cascade; do not change it. */

/* ========================================================
   MANTENIMIENTO (MAINTENANCE) MODULE
   ======================================================== */
.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.maintenance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: var(--transition);
}

.maintenance-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.maint-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.maint-title-group h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.maint-category-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.maint-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.maint-status-pill.ok {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.maint-status-pill.warning {
  background: rgba(255, 179, 0, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 179, 0, 0.3);
}

.maint-status-pill.due {
  background: rgba(255, 61, 0, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 61, 0, 0.3);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 0, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 61, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 0, 0); }
}

/* Wear / Health Progress Bar */
.maint-progress-wrap {
  width: 100%;
}

.maint-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.maint-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.maint-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.maint-progress-fill.ok {
  background: linear-gradient(90deg, var(--success), var(--accent));
}

.maint-progress-fill.warning {
  background: linear-gradient(90deg, #ffb300, #ff9100);
}

.maint-progress-fill.due {
  background: linear-gradient(90deg, #ff3d00, #d50000);
}

.maint-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.maint-dates {
  color: var(--text-muted);
}

.maint-actions {
  display: flex;
  gap: 0.5rem;
}

/* Edit Modal Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.form-control {
  background: var(--bg-input, rgba(10, 14, 23, 0.8));
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Route Map Modal */
.modal-card.large {
  max-width: 900px;
  width: 95%;
}

#routeModalMap {
  width: 100%;
  height: 480px;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

/* Trip replay under the route map */
.route-replay { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.route-replay[hidden] { display: none; }
.route-replay input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--accent-bright); }
.route-replay-info { flex: none; font-size: 0.8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.hist-actions a.btn-sm { text-decoration: none; display: inline-flex; align-items: center; }
