/* Vehicles module — tabs, KPI cards, plate badges, registry/rental forms,
   assignments split view, matrix crosstab. Reuses the shared gcc-*
   primitives (panel, table, btn, input, modal) from app.css; only
   module-specific pieces live here. */

.veh-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px; overflow: hidden; }
.veh-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 14px; flex-shrink: 0; }
.veh-tab {
  border: none; background: none; padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; display: inline-flex; align-items: center; gap: 7px;
}
.veh-tab:hover { color: var(--text); }
.veh-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.veh-tabpane { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* KPI cards */
.veh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; flex-shrink: 0; }
.veh-stat-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow); transition: all .2s ease;
}
.veh-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.veh-stat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; flex-shrink: 0;
}
.veh-icon-blue { background: #2563eb; }
.veh-icon-green { background: #059669; }
.veh-icon-red { background: #dc2626; }
.veh-icon-amber { background: #d97706; }
.veh-icon-purple { background: #7c3aed; }
.veh-icon-muted { background: #64748b; }
.veh-stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.veh-stat-value { font-size: 18px; font-weight: 800; color: var(--text); }
.veh-stat-sub { font-size: 10.5px; color: var(--text-muted); }

.veh-empty { text-align: center; color: var(--text-muted); padding: 24px; font-size: 12.5px; }
.veh-muted { color: var(--text-muted); font-size: 11.5px; }
.veh-actions-col { white-space: nowrap; width: 1%; }
.veh-foot-spacer { flex: 1; }
.veh-req { color: var(--danger-600, #dc2626); }

/* UAE plate badge — port of reference veh_plate.js/.veh-plate CSS, scaled
   down for dense table rows via .veh-plate-compact. */
.veh-plate, .veh-plate-block {
  display: inline-flex; align-items: center; width: 172px; box-sizing: border-box;
  background: #fff; border: 1.5px solid #b9bec9; border-radius: 6px; height: 40px; overflow: hidden; flex-shrink: 0;
}
.veh-plate { gap: 2px; padding: 4px 12px; }
.veh-plate-catg { font-size: 1.15rem; font-weight: 800; color: #111; line-height: 1; white-space: nowrap; overflow: hidden; max-width: 34px; }
.veh-plate-logo { display: flex; align-items: center; flex-shrink: 0; }
.veh-plate-logo img { height: 26px; width: auto; display: block; }
.veh-plate-number { color: #111; font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; margin-left: 7px; white-space: nowrap; overflow: hidden; }
.veh-plate-block-catg {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 100%; flex-shrink: 0;
  background: #178a43; color: #fff; font-size: 1.2rem; font-weight: 800; overflow: hidden;
}
.veh-plate-block-number { display: flex; align-items: center; padding: 0 12px; color: #111; font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.veh-plate-compact.veh-plate, .veh-plate-compact.veh-plate-block { width: 104px; height: 26px; }
.veh-plate-compact.veh-plate { gap: 1px; padding: 2px 7px; }
.veh-plate-compact .veh-plate-catg { font-size: .78rem; max-width: 20px; }
.veh-plate-compact .veh-plate-logo img { height: 15px; }
.veh-plate-compact .veh-plate-number { font-size: .82rem; margin-left: 4px; }
.veh-plate-compact .veh-plate-block-catg { width: 22px; font-size: .78rem; }
.veh-plate-compact .veh-plate-block-number { padding: 0 8px; font-size: .82rem; }
.veh-mulkiya-flag { color: var(--brand-600); font-size: 11px; margin-left: 3px; }

/* Registry/Rental Add-Edit form (mirrors creditfacilities.css's .cf-form-*
   pattern under its own veh- prefix, to avoid cross-module coupling). */
.veh-form-section { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.veh-form-section-head {
  padding: 8px 12px; background: var(--surface-2, #f8fafc); border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 11.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px;
}
.veh-form-section-head .bi { color: var(--brand-600); }
.veh-form-section-body { padding: 10px 12px; }
.veh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.veh-grid:last-child { margin-bottom: 0; }
.veh-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.veh-field > label { font-size: 10.5px; font-weight: 650; color: var(--text-muted, #64748b); text-transform: uppercase; letter-spacing: .03em; }

.veh-dropzone {
  border: 2px dashed var(--border-strong, #cbd5e1); border-radius: 10px; padding: 20px; text-align: center;
  cursor: pointer; color: var(--text-muted); transition: all .15s ease;
}
.veh-dropzone:hover { border-color: var(--primary); color: var(--primary); background: var(--brand-50, #eef2ff); }
.veh-dropzone .bi { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.veh-dropzone-compact { padding: 10px; margin-top: 8px; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.veh-dropzone-compact .bi { font-size: 1rem; display: inline; margin: 0; }
.veh-extract-status { font-size: 12px; margin-top: 8px; color: var(--text-muted); }
.veh-extract-status .veh-ok { color: var(--success-600, #059669); }
.veh-extract-status .veh-err { color: var(--danger-600, #dc2626); }

.veh-mulkiya-panel { display: flex; justify-content: center; padding: 6px 0; }
.veh-mulkiya-thumb { max-width: 100%; max-height: 220px; border: 1px solid var(--border); border-radius: 8px; }
.veh-mulkiya-loading, .veh-mulkiya-empty { color: var(--text-muted); font-size: 12px; padding: 10px; text-align: center; }
.veh-mulkiya-empty .bi { margin-right: 6px; }

.veh-doc-toolbar { margin-bottom: 8px; }
.veh-docs-list { display: flex; flex-direction: column; gap: 6px; }
.veh-doc-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2, #f8fafc);
}
.veh-doc-row .bi-file-earmark-text { color: var(--brand-600); font-size: 1.1rem; }
.veh-doc-info { flex: 1; min-width: 0; }
.veh-doc-title { font-size: 12.5px; font-weight: 650; color: var(--text); }
.veh-doc-sub { font-size: 11px; color: var(--text-muted); }

.veh-doc-modal { width: min(480px, 92vw); }
.veh-doc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.veh-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.veh-scan-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; margin-top: 4px; color: var(--brand-600); }

/* Assignments split view */
.veh-activelog-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; overflow: hidden; }
.veh-activelog-col { display: flex; flex-direction: column; min-height: 0; gap: 8px; }

/* Matrix crosstab */
.veh-matrix-table th, .veh-matrix-table td { white-space: nowrap; }
.veh-matrix-cell { cursor: pointer; font-weight: 650; color: var(--brand-600); }
.veh-matrix-cell:hover { text-decoration: underline; }
.veh-matrix-total { font-weight: 750; }
.veh-matrix-grand { background: var(--surface-2, #f8fafc); font-weight: 750; }
.veh-matrix-drilldown { width: min(560px, 92vw); }

@media (max-width: 900px) {
  .veh-grid { grid-template-columns: repeat(2, 1fr); }
  .veh-activelog-split { grid-template-columns: 1fr; }
}
