/* public/fleet/fleet-dashboard.css */

/* ---- Summary cards grid ---- */
.fd-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.fd-summary-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid #f39c12;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.fd-sc-icon {
  color: #f39c12;
  flex-shrink: 0;
}

.fd-sc-content {
  display: flex;
  flex-direction: column;
}

.fd-sc-label {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


.fd-sc-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #e2e8f0;
}

/* Smaller text for amounts ≥ 1 000 000 */
.fd-sc-value.fd-sc-value--large {
  font-size: 1.35rem;
}

/* ---- Vehicle table section ---- */
.fd-table-section {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin-bottom: 1rem;
}

.fd-table-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.fd-table-header h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.1rem;
}

.fd-table-note {
  font-size: 0.8rem;
  color: #64748b;
}

.fd-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fd-table th {
  text-align: left;
  color: #94a3b8;
  font-weight: 600;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}

.fd-table td {
  padding: 0.7rem 0.4rem;
  color: #e2e8f0;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
}

.fd-row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.fd-row-clickable:hover {
  background: #334155;
}

.fd-empty-msg {
  text-align: center;
  color: #64748b;
  padding: 2rem 0;
  font-style: italic;
}

/* ---- Refresh hint ---- */
.fd-refresh-hint {
  text-align: right;
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.5rem;
}

/* ---- Loading skeleton ---- */
.fd-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.fd-skeleton-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  animation: fd-pulse 1.5s ease-in-out infinite;
}

.fd-sk-title {
  width: 60%;
  height: 14px;
  background: #334155;
  border-radius: 4px;
  margin-bottom: 0.8rem;
}

.fd-sk-value {
  width: 40%;
  height: 24px;
  background: #334155;
  border-radius: 4px;
}

.fd-skeleton-table {
  background: #1e293b;
  border-radius: 12px;
  padding: 1rem;
}

.fd-sk-row {
  display: flex;
  gap: 1rem;
  margin: 0.8rem 0;
}

.fd-sk-cell {
  height: 16px;
  background: #334155;
  border-radius: 4px;
}

.fd-sk-cell.w40 { width: 40%; }
.fd-sk-cell.w20 { width: 20%; }

@keyframes fd-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ---- Error state ---- */
.fd-error {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #e2e8f0;
}

.fd-error p {
  margin: 0.5rem 0;
}

.fd-error-detail {
  font-size: 0.85rem;
  color: #94a3b8;
}

.fd-btn-retry {
  margin-top: 1rem;
  background: #f39c12;
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.8rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.fd-btn-retry:hover {
  background: #e67e22;
}

/* Override any global row striping – keep all rows dark */
#fleetApp .fd-table tbody tr {
  background-color: #1e293b;
  transition: background-color 0.15s;
}

#fleetApp .fd-table tbody tr:hover {
  background-color: #334155;
}


/* ---- Charts row ---- */
.fd-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .fd-charts-row {
    grid-template-columns: 1fr;
  }
}
.fd-chart-card {
  background: var(--bg-secondary, #1e293b);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.fd-chart-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-primary, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fd-chart-card h3 svg {
  stroke: var(--accent, #f39c12);
}

#fleetMonthlyChart, #fleetTypeChart {
  min-height: 320px;
}


/* Deep purple card background for chart containers */
#fleetApp .card.chart-card,
#fleetApp .card {
  background: #1e1a2f;
  color: #f1f5f9;
}

.fd-btn-export-pdf {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.fd-btn-export-pdf:hover {
  background: #475569;
}

/* Add these styles to fleet-dashboard.css (or a new fleet-dashboard.css if not existing) */

/* Search bar */
.fd-search-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  align-items: center;
}
.fd-search-bar input {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  background: var(--bg-primary, #0f172a);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.95rem;
}
.fd-search-bar input:focus {
  outline: none;
  border-color: var(--accent, #f39c12);
}
.fd-btn-clear {
  background: transparent;
  border: 1px solid var(--border, #475569);
  color: var(--text-primary, #e2e8f0);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Pagination */
.fd-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.5rem 0;
}
.fd-page-btn {
  background: var(--bg-secondary, #334155);
  color: var(--text-primary, #e2e8f0);
  border: 1px solid var(--border, #475569);
  border-radius: 6px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.fd-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.fd-page-btn:not(:disabled):hover {
  background: var(--border, #475569);
}
.fd-page-info {
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
}