:root {
  --erp-sidebar: #1e1033;
  --erp-sidebar-hover: #2f1a4f;
  --erp-acento: #a78bfa;
  --erp-fondo: #f6f3fb;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Color principal de Bootstrap en morado */
  --bs-primary: #7c3aed;
  --bs-primary-rgb: 124, 58, 237;
  --bs-primary-text-emphasis: #4c1d95;
  --bs-primary-bg-subtle: #ede9fe;
  --bs-primary-border-subtle: #c4b5fd;
  --bs-link-color: #6d28d9;
  --bs-link-color-rgb: 109, 40, 217;
  --bs-link-hover-color: #4c1d95;
  --bs-link-hover-color-rgb: 76, 29, 149;
  --bs-focus-ring-color: rgba(124, 58, 237, .25);
}
.btn-primary {
  --bs-btn-bg: #7c3aed; --bs-btn-border-color: #7c3aed;
  --bs-btn-hover-bg: #6d28d9; --bs-btn-hover-border-color: #6d28d9;
  --bs-btn-active-bg: #5b21b6; --bs-btn-active-border-color: #5b21b6;
  --bs-btn-disabled-bg: #7c3aed; --bs-btn-disabled-border-color: #7c3aed;
  --bs-btn-focus-shadow-rgb: 124, 58, 237;
}
.btn-outline-primary {
  --bs-btn-color: #6d28d9; --bs-btn-border-color: #7c3aed;
  --bs-btn-hover-bg: #7c3aed; --bs-btn-hover-border-color: #7c3aed;
  --bs-btn-active-bg: #6d28d9; --bs-btn-active-border-color: #6d28d9;
  --bs-btn-focus-shadow-rgb: 124, 58, 237;
}
.nav-pills { --bs-nav-pills-link-active-bg: #7c3aed; --bs-nav-link-color: #6d28d9; --bs-nav-link-hover-color: #4c1d95; }
.pagination { --bs-pagination-color: #6d28d9; --bs-pagination-active-bg: #7c3aed; --bs-pagination-active-border-color: #7c3aed; --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(124,58,237,.25); }
.dropdown-menu { --bs-dropdown-link-active-bg: #7c3aed; }
.progress { --bs-progress-bar-bg: #7c3aed; }
.form-control:focus, .form-select:focus { border-color: #a78bfa; box-shadow: 0 0 0 .25rem rgba(124, 58, 237, .2); }
.form-check-input:checked { background-color: #7c3aed; border-color: #7c3aed; }
.form-check-input:focus { border-color: #a78bfa; box-shadow: 0 0 0 .25rem rgba(124, 58, 237, .2); }
body { background: var(--erp-fondo); font-size: .925rem; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--erp-sidebar); color: #d8cdea;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .marca { color: #fff; font-weight: 700; font-size: 1.15rem; padding: 1.1rem 1.25rem; display: flex; gap: .5rem; align-items: center; }
.sidebar .marca i { color: var(--erp-acento); }
.sidebar .seccion { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #9580b8; padding: 1rem 1.25rem .35rem; }
.sidebar a { display: flex; align-items: center; gap: .65rem; color: #d8cdea; text-decoration: none; padding: .45rem 1.25rem; border-left: 3px solid transparent; }
.sidebar a:hover { background: var(--erp-sidebar-hover); color: #fff; }
.sidebar a.activo { background: var(--erp-sidebar-hover); color: #fff; border-left-color: var(--erp-acento); }
.contenido { flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid #e9e1f5; padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 10; }
main { padding: 1.5rem 1.25rem; max-width: 1500px; }
.card { border: 1px solid #e9e1f5; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f5; font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }
.kpi { display: flex; align-items: center; gap: 1rem; }
.kpi .icono { width: 48px; height: 48px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.35rem; }
.kpi .numero { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi .etiqueta { color: #6b7a90; font-size: .8rem; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #7a6b90; background: #faf8fd; font-weight: 600; white-space: nowrap; }
.table-hover tbody tr { cursor: pointer; }
.page-title { font-weight: 700; margin: 0; font-size: 1.4rem; }
.dl-campos dt { color: #6b7a90; font-weight: 500; font-size: .8rem; }
.dl-campos dd { margin-bottom: .8rem; }
/* Tablero Kanban */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban-col { background: #ece6f5; border-radius: .75rem; min-width: 290px; width: 290px; flex-shrink: 0; }
.kanban-col h6 { padding: .75rem 1rem .25rem; display: flex; justify-content: space-between; }
.kanban-lista { padding: .5rem; display: flex; flex-direction: column; gap: .5rem; min-height: 60px; }
.tarjeta-ticket { background: #fff; border-radius: .6rem; padding: .75rem; border-left: 4px solid #cbd5e1; box-shadow: 0 1px 2px rgba(0,0,0,.06); text-decoration: none; color: inherit; display: block; }
.tarjeta-ticket:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.tarjeta-ticket.p-URGENTE { border-left-color: #dc3545; }
.tarjeta-ticket.p-ALTA { border-left-color: #fd7e14; }
.tarjeta-ticket.p-MEDIA { border-left-color: #a78bfa; }
/* Línea de tiempo */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ''; position: absolute; left: .55rem; top: .25rem; bottom: .25rem; width: 2px; background: #e3e8ef; }
.timeline .item { position: relative; margin-bottom: 1.1rem; }
.timeline .item::before { content: ''; position: absolute; left: -1.5rem; top: .3rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; border: 3px solid var(--erp-acento); }
/* Firma */
.firma-canvas { border: 2px dashed #b8c2d0; border-radius: .5rem; background: #fff; width: 100%; height: 200px; touch-action: none; }
.firma-img { max-height: 110px; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s; }
  .sidebar.abierto { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  main { padding: 1rem .75rem; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card { border: none; box-shadow: none; }
}
