/* ===== Frutcom Vehicular — paleta y estilos base ===== */
:root {
  --fv-primary: #1d4f7c;        /* azul institucional */
  --fv-primary-dark: #143a5c;
  --fv-primary-soft: #e8f0f8;
  --fv-accent: #237a4b;         /* verde (acciones positivas) */
  --fv-bg: #f4f6f9;
  --fv-surface: #ffffff;
  --fv-border: #dde3ea;
  --fv-text: #1f2933;
  --fv-muted: #5c6b7a;
  --fv-sidebar-w: 248px;
  --bs-primary: var(--fv-primary);
  --bs-primary-rgb: 29, 79, 124;
  --bs-success: var(--fv-accent);
  --bs-success-rgb: 35, 122, 75;
  --bs-link-color: var(--fv-primary);
  --bs-link-color-rgb: 29, 79, 124;
  --bs-link-hover-color: var(--fv-primary-dark);
  --bs-body-color: var(--fv-text);
  --bs-border-color: var(--fv-border);
  --bs-secondary-color: var(--fv-muted);
  --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--fv-bg); font-size: .95rem; }

.btn-primary { --bs-btn-bg: var(--fv-primary); --bs-btn-border-color: var(--fv-primary); --bs-btn-hover-bg: var(--fv-primary-dark); --bs-btn-hover-border-color: var(--fv-primary-dark); --bs-btn-active-bg: var(--fv-primary-dark); --bs-btn-disabled-bg: var(--fv-primary); }
.btn-outline-primary { --bs-btn-color: var(--fv-primary); --bs-btn-border-color: var(--fv-primary); --bs-btn-hover-bg: var(--fv-primary); --bs-btn-hover-border-color: var(--fv-primary); --bs-btn-active-bg: var(--fv-primary-dark); }
.btn-success { --bs-btn-bg: var(--fv-accent); --bs-btn-border-color: var(--fv-accent); --bs-btn-hover-bg: #1b6139; --bs-btn-hover-border-color: #1b6139; }
.text-bg-primary { background-color: var(--fv-primary) !important; }
.bg-primary-soft { background: var(--fv-primary-soft); }

/* Accesibilidad: foco siempre visible */
:focus-visible { outline: 3px solid #f5b301 !important; outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: .5rem; }

/* ===== Sidebar ===== */
.fv-sidebar, .fv-sidebar.offcanvas-lg, .fv-sidebar.offcanvas-start { width: var(--fv-sidebar-w); background-color: var(--fv-primary-dark) !important; color: #dbe6f1; }
.fv-sidebar .brand { color: #fff; font-weight: 700; letter-spacing: .3px; text-decoration: none; }
.fv-sidebar .nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9fb7cf; margin: 1.1rem 0 .35rem; padding: 0 .9rem; }
.fv-sidebar .nav-link { color: #dbe6f1; border-radius: .4rem; padding: .42rem .9rem; display: flex; gap: .6rem; align-items: center; }
.fv-sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.fv-sidebar .nav-link.active { background: #fff; color: var(--fv-primary-dark); font-weight: 600; }
.fv-sidebar .nav-link .bi { font-size: 1rem; width: 1.1rem; text-align: center; }
@media (min-width: 992px) {
  .fv-sidebar.offcanvas-lg { position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; visibility: visible !important; transform: none !important; }
  .fv-main { margin-left: var(--fv-sidebar-w); }
}
.fv-topbar { background: var(--fv-surface); border-bottom: 1px solid var(--fv-border); min-height: 56px; }

/* ===== Contenido ===== */
.fv-card { background: var(--fv-surface); border: 1px solid var(--fv-border); border-radius: .6rem; }
.page-title { font-size: 1.35rem; font-weight: 650; margin: 0; }
.table { --bs-table-bg: transparent; }
.table thead th { background: #eef2f6; color: #33475b; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 650; white-space: nowrap; vertical-align: middle; }
.table thead th a { color: inherit; text-decoration: none; }
.table td { vertical-align: middle; }
.table-sm td, .table-sm th { padding: .4rem .5rem; }
.table tfoot td, .table tfoot th { background: #f1f5f9; font-weight: 700; }
.table-hover tbody tr:hover { background: var(--fv-primary-soft); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sticky-col { position: sticky; left: 0; background: var(--fv-surface); z-index: 1; }
.table-dashboard { font-size: .82rem; }
.table-dashboard td, .table-dashboard th { white-space: nowrap; }
.kpi { border-left: 4px solid var(--fv-primary); }
.kpi .valor { font-size: 1.5rem; font-weight: 700; }
.kpi.verde { border-left-color: var(--fv-accent); }
.kpi.ambar { border-left-color: #d08a00; }
.kpi.rojo { border-left-color: #c0392b; }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .25rem; }
.req-label::after { content: " *"; color: #c0392b; }
.thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .4rem; border: 1px solid var(--fv-border); }
dl.detalle dt { color: var(--fv-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
dl.detalle dd { margin-bottom: .9rem; white-space: pre-line; }
.login-wrap { min-height: 100vh; background: linear-gradient(135deg, var(--fv-primary-dark), var(--fv-primary)); }
.nav-tabs .nav-link { color: var(--fv-muted); }
.nav-tabs .nav-link.active { color: var(--fv-primary); font-weight: 600; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.ts-wrapper.form-select { padding: 0; }
.ts-control { border: 0 !important; }

/* ===== Impresión de reportes ===== */
@media print {
  .fv-sidebar, .fv-topbar, .no-print, .pagination { display: none !important; }
  .fv-main { margin: 0 !important; }
  body { background: #fff; font-size: 10pt; }
  .fv-card { border: 0; }
  .table-responsive { overflow: visible !important; }
  a { color: inherit; text-decoration: none; }
}

/* Contraste AA */
.text-secondary { color: var(--fv-muted) !important; }
.text-bg-success { background-color: var(--fv-accent) !important; }
.btn-outline-danger { --bs-btn-color: #b02a37; --bs-btn-border-color: #b02a37; --bs-btn-hover-bg: #b02a37; --bs-btn-hover-border-color: #b02a37; }
.text-danger { color: #b02a37 !important; }
.text-bg-warning { background-color: #f2b318 !important; color: #1f2933 !important; }
