/* SICOTRAC · diseño con los colores del logo (azul #0072bc + rojo #e81c24) */
/* Letra redondeada de los paneles de referencia (local, sin internet) */
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../vendor/fonts/plus-jakarta-sans.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --azul: #1761ac;
    --azul-2: #114a85;
    --azul-oscuro: #0b2540;
    --azul-menu-activo: #144a78;
    --azul-claro: #e8f0fa;
    --rojo: #ed3237;
    --rojo-claro: #fde9ea;
    --verde: #15803d;
    --verde-claro: #e6f6ec;
    --ambar: #b45309;
    --ambar-claro: #fef3c7;
    --fondo: #f4f6f9;
    --borde: #e5e9f0;
    --texto: #111827;
    --muted: #6b7280;
    --radio: 12px;
    --radio-sm: 9px;
    --sidebar: 240px;
}

* { box-sizing: border-box; }
body {
    background: var(--fondo);
    color: var(--texto);
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: .92rem;
}
a { color: var(--azul); }
/* Bootstrap pone .text-muted en #6c757d y casi no se ve sobre blanco: aquí más oscuro */
.text-muted, .form-text.text-muted { color: #4b5563 !important; }
a:hover { color: var(--azul-2); text-decoration: none; }

/* ---------- Menú lateral ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    background: var(--azul-oscuro); z-index: 1040;
    display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar-brand { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.5rem 1rem 1.2rem; }
.brand-name { color: #fff; font-size: 1.65rem; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.brand-sub { color: var(--rojo); font-size: .85rem; font-weight: 800; letter-spacing: .35em; margin-top: .3rem; padding-left: .35em; }
.sidebar-brand:hover .brand-name { color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 .85rem 1rem; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.nav-group {
    font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
    color: #c9d6e6; padding: 1rem .6rem .4rem;
}
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .7rem; margin-bottom: 2px; border-radius: var(--radio-sm);
    color: #fff !important; font-weight: 500; font-size: .9rem; transition: background .15s;
}
.nav-item i { font-size: 1rem; width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: var(--azul-menu-activo); font-weight: 600; }
.sidebar-user {
    display: flex; align-items: center; gap: .7rem;
    margin: .85rem; padding: .75rem; border-radius: var(--radio);
    background: rgba(255,255,255,.07);
}
.sidebar-user .avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: #fff; color: var(--azul-oscuro); font-weight: 800; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-user .user-info { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-user strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #fff; font-size: .82rem; line-height: 1.2; word-break: break-word; }
.sidebar-user small { color: #c9d6e6; font-size: .75rem; }
.btn-salir {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff !important; background: rgba(255,255,255,.08);
}
.btn-salir:hover { background: var(--rojo); }

/* ---------- Barra superior ---------- */
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border-bottom: 1px solid var(--borde);
    padding: .8rem 1.75rem; min-height: 68px;
}
.topbar-heading { flex: 1; min-width: 0; line-height: 1.2; }
.topbar-heading small { color: var(--muted); font-size: .75rem; }
.topbar-heading h1 { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--texto); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.pill {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: #f1f4f8; color: #374151;
}
.pill-info { background: var(--azul-claro); color: var(--azul-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.btn-menu {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--borde);
    background: #fff; color: var(--texto); display: inline-flex; align-items: center; justify-content: center;
}
.content { padding: 1.5rem 1.75rem 2rem; flex: 1; }
.footer { padding: .75rem 1.75rem 1.25rem; color: var(--muted); font-size: .78rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar, .content { padding-left: 1rem; padding-right: 1rem; }
}

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--borde); border-radius: var(--radio); background: #fff; box-shadow: none; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.15rem; border-bottom: 1px solid var(--borde);
}
.card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card-head a { font-size: .8rem; font-weight: 600; }
.card-toolbar {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
    padding: 1rem 1.15rem; border-bottom: 1px solid var(--borde);
}

/* Indicadores (KPI) */
.kpi { padding: 1.1rem 1.2rem; height: 100%; position: relative; }
.kpi-label { color: var(--muted); font-size: .82rem; }
.kpi-valor { font-size: 1.75rem; font-weight: 800; margin: .35rem 0 .2rem; letter-spacing: -.01em; }
.kpi-sub { font-size: .78rem; font-weight: 700; }
.kpi-icon {
    position: absolute; top: 1rem; right: 1rem; width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.kpi-oscuro { background: var(--azul-oscuro); border-color: var(--azul-oscuro); }
.kpi-oscuro .kpi-label { color: #c9d6e6; }
.kpi-oscuro .kpi-valor { color: #fff; font-size: 2rem; }
.kpi-oscuro .kpi-sub { color: #6cc4ff; }
.ic-azul { background: var(--azul-claro); color: var(--azul); }
.ic-verde { background: var(--verde-claro); color: var(--verde); }
.ic-ambar { background: var(--ambar-claro); color: var(--ambar); }
.ic-rojo { background: var(--rojo-claro); color: var(--rojo); }
.t-azul { color: var(--azul); } .t-verde { color: var(--verde); } .t-ambar { color: var(--ambar); } .t-rojo { color: var(--rojo); }

/* Listas de las tarjetas laterales */
.lista-item { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.15rem; border-bottom: 1px solid #eff2f6; }
.lista-item:last-child { border-bottom: 0; }
.lista-item .li-texto { flex: 1; min-width: 0; line-height: 1.25; }
.lista-item strong { display: block; font-size: .87rem; font-weight: 700; }
.lista-item small { color: var(--muted); font-size: .76rem; }
.lista-item .li-valor { font-weight: 700; white-space: nowrap; }
.barra { width: 110px; height: 7px; border-radius: 4px; background: #eef1f5; overflow: hidden; flex-shrink: 0; }
.barra span { display: block; height: 100%; background: var(--azul); border-radius: 4px; }

.card-hero { padding: 1.25rem 1.4rem; }
.card-hero h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .2rem; }
.card-hero p { margin: 0; color: var(--muted); }
.section-title { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 700; color: var(--muted); margin: 1.25rem 0 .6rem; }
.accesos { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.15rem; }
.acceso {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem;
    border: 1px solid var(--borde); border-radius: 999px; color: var(--texto) !important; font-weight: 600; font-size: .83rem;
}
.acceso i { color: var(--azul); }
.acceso:hover { border-color: var(--azul); background: var(--azul-claro); }

/* ---------- Afiliados ---------- */
.card-body { padding: 1.15rem; }
.filtros { justify-content: flex-start; background: #fafbfc; }
.filtro { width: 190px; }
.filtro-ancho { width: 240px; }
.persona { display: flex; align-items: center; gap: .7rem; }
.persona-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    background: var(--azul-claro); color: var(--azul-2); font-weight: 800; font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
}
.persona-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.persona-avatar:has(img) { background: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--borde); }
.persona-texto { min-width: 0; line-height: 1.25; }
.persona-texto strong { display: block; font-size: .86rem; font-weight: 700; }
.persona-texto small { color: var(--muted); font-size: .74rem; }
.select2-selection.is-invalid { border-color: var(--rojo) !important; }
.foto-item { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.15rem; border-bottom: 1px solid #eff2f6; }
.foto-item.subiendo { opacity: .5; pointer-events: none; }
.foto-prev {
    width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
    background: #f1f4f8; color: #9ca3af; font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
}
.foto-prev img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.foto-info { flex: 1; min-width: 0; line-height: 1.25; }
.foto-info strong { display: block; font-size: .86rem; }
.foto-info small { color: var(--muted); font-size: .75rem; }
.ficha-perfil { padding: 1.5rem 1.25rem; text-align: center; }
.ficha-foto {
    width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 1rem; overflow: hidden;
    background: var(--azul-claro); color: var(--azul-2); font-size: 2.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(15,35,60,.12);
}
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.ficha-perfil h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .15rem; }
.ficha-perfil p { color: var(--muted); margin-bottom: .75rem; }
.ficha-resumen { margin-top: 1.25rem; text-align: left; border-top: 1px solid var(--borde); }
.ficha-resumen .dato { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid #eff2f6; }
.ficha-resumen .dato:last-child { border-bottom: 0; }
.datos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.25rem; padding: 1.15rem; }
.dato small { display: block; color: var(--muted); font-size: .74rem; margin-bottom: .1rem; }
.dato span { font-weight: 600; font-size: .88rem; word-break: break-word; }
.dato-ancho { grid-column: 1 / -1; }
.docs { display: flex; flex-wrap: wrap; gap: 1rem; padding: 0 1.15rem 1.15rem; }
.doc { text-align: center; }
.doc .foto-prev { width: 120px; height: 84px; }
.doc small { color: var(--muted); font-size: .75rem; }

/* Editor de fotos (Cropper.js) */
.foto-acciones { display: flex; align-items: center; gap: .35rem; }
.editor-area { height: 420px; background: #0f172a; border-radius: var(--radio); overflow: hidden; }
.editor-area img { display: block; max-width: 100%; }
.editor-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.editor-grupo { display: flex; gap: .3rem; padding: .25rem; background: #f1f4f8; border-radius: 12px; }
.editor-btn {
    width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: #374151; font-size: 1.05rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.editor-btn:hover { background: #fff; color: var(--azul); box-shadow: 0 2px 6px rgba(15,35,60,.08); }
.editor-chip { border: 0; border-radius: 9px; background: transparent; color: #374151; font-weight: 600; font-size: .8rem; padding: 0 .75rem; height: 38px; }
.editor-chip:hover { background: #fff; }
.editor-chip.activo { background: var(--azul); color: #fff; }
.editor-btn:focus, .editor-chip:focus { outline: none; }
.cropper-view-box { outline: 2px solid var(--azul); outline-color: rgba(0,114,188,.9); }
.cropper-point { background-color: var(--azul); width: 8px; height: 8px; opacity: 1; }
.cropper-line { background-color: var(--azul); }
@media (max-width: 575.98px) { .editor-area { height: 300px; } }

/* Encabezado de ficha/formulario y pestañas */
.ficha-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--borde); }
.ficha-head-foto { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(15,35,60,.15); }
.ficha-head-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; cursor: pointer; }
.ficha-head-foto span {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--azul-claro); color: var(--azul-2); font-weight: 800; font-size: 1.35rem; letter-spacing: .02em;
}
.ficha-head-cuerpo { flex: 1; min-width: 0; }
.ficha-head-linea { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.ficha-head-linea .etq { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ficha-head-linea .numero { font-size: 1.6rem; font-weight: 800; color: var(--azul); line-height: 1.1; }
.ficha-head-linea .nombre { font-size: 1.05rem; font-weight: 700; color: var(--texto); }
.ficha-head-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.ficha-head-acciones { margin-left: auto; display: flex; gap: .5rem; }
.etiquetas { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }

/* Encabezado de perfil: foto | nombre + (N.º y etiquetas) | botón */
.perfil-head { flex-wrap: nowrap; gap: 1.1rem; padding: 1.25rem 1.4rem; }
.perfil-foto { width: 72px; height: 72px; }
.perfil-texto { flex: 1; min-width: 0; }
.perfil-nombre { font-size: 1.3rem; font-weight: 800; margin: 0 0 .4rem; line-height: 1.2; color: var(--texto); }
.perfil-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.perfil-num { color: var(--muted); font-size: .85rem; font-weight: 600; margin-right: .35rem; padding-right: .85rem; border-right: 2px solid #9ca3af; }
.perfil-num strong { color: var(--azul); font-weight: 800; font-size: .95rem; }
.perfil-acciones { flex-shrink: 0; align-self: center; }
.foto-vehiculo { border-radius: 50%; background: var(--azul-claro); color: var(--azul-2); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.foto-vehiculo img { object-position: 50% 50%; }
.texto-corto { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* En el select de ruta las opciones largas se ven completas en la lista */
.select2-results__option { white-space: normal; line-height: 1.35; }
@media (max-width: 767.98px) {
    .perfil-head { flex-wrap: wrap; }
    .perfil-acciones { width: 100%; }
    .perfil-acciones .btn { width: 100%; }
}
.tabs-app { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .25rem; padding: 0 1rem; border-bottom: 1px solid var(--borde); list-style: none; margin: 0; }
.tabs-app a {
    display: block; padding: .85rem .9rem; white-space: nowrap; font-weight: 600; font-size: .87rem;
    color: var(--muted) !important; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs-app a:hover { color: var(--texto) !important; }
.tabs-app a.active { color: var(--azul) !important; border-bottom-color: var(--azul); }
/* Tarjetas de foto: imagen grande arriba, título y botones abajo */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.fotos-grid .foto-item {
    flex-direction: column; align-items: stretch; gap: 0; padding: 0;
    border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; background: #fff;
}
.fotos-grid .foto-prev {
    width: 100%; height: 190px; border-radius: 0; font-size: 2.2rem; color: #b8c0cc;
    background: #f4f6f9; position: relative;
}
.fotos-grid .foto-prev img { object-fit: contain; background: #f4f6f9; }
.fotos-grid .foto-prev:has(img)::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
    background: rgba(11,37,64,.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35M11 8v6M8 11h6'/%3E%3C/svg%3E") no-repeat center;
}
.fotos-grid .foto-prev:hover::after { opacity: 1; }
.foto-pie { display: flex; align-items: center; gap: .6rem; padding: .75rem .85rem; border-top: 1px solid var(--borde); }
.foto-pie .foto-info { flex: 1; min-width: 0; }
.foto-pie .foto-info strong { font-size: .86rem; line-height: 1.25; }
.foto-pie .foto-info small { display: block; white-space: nowrap; }
.foto-pie .foto-acciones { flex-shrink: 0; }
.foto-pie .btn-accion { margin-left: 0; width: 34px; height: 34px; cursor: pointer; }
.btn-subir-foto { color: var(--azul); }

/* ---------- Botones ---------- */
.btn { border-radius: var(--radio-sm); font-weight: 700; padding: .5rem 1rem; font-size: .88rem; }
.btn i { margin-right: .3rem; }
.btn-primary { background: var(--azul); border-color: var(--azul); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):active { background: var(--azul-2); border-color: var(--azul-2); }
.btn-danger { background: var(--rojo); border-color: var(--rojo); }
.btn-light { background: #f1f4f8; border-color: #f1f4f8; color: #374151; }
.btn-lg { padding: .75rem 1.2rem; font-size: 1rem; }
.btn-accion {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--borde); margin-left: .25rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: #374151; transition: all .15s;
}
.btn-accion:hover { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn-accion.peligro { color: var(--rojo); }
.btn-accion.peligro:hover { background: var(--rojo); border-color: var(--rojo); color: #fff; }

/* ---------- Formularios ---------- */
label { font-weight: 600; font-size: .82rem; color: #374151; margin-bottom: .35rem; }
.req { color: var(--rojo); }
.form-control {
    border-radius: var(--radio-sm); border: 1px solid var(--borde);
    min-height: 40px; padding: .45rem .8rem; font-size: .9rem; background: #fff;
}
.form-control:focus { border-color: var(--azul); box-shadow: 0 0 0 .2rem rgba(0,114,188,.12); }
.form-control.is-invalid { border-color: var(--rojo); }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .form-control { padding-left: 2.4rem; }
.search { position: relative; flex: 1; max-width: 360px; min-width: 200px; }
.search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .form-control { padding-left: 2.3rem; background: #f8fafc; }

/* ---------- Select2 moderno ---------- */
.select2-container--default .select2-selection--single {
    height: 40px; border-radius: var(--radio-sm); border: 1px solid var(--borde); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.select2-container--default .select2-selection--single:hover { border-color: #c8d1dd; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px; padding-left: .8rem; padding-right: 2.2rem; font-size: .9rem; color: var(--texto);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #9ca3af; }
/* Flecha tipo chevron en lugar del triángulo viejo */
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; width: 34px; right: 2px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: 0; width: 8px; height: 8px; margin: -6px 0 0 -4px;
    border-right: 2px solid #6b7280; border-bottom: 2px solid #6b7280;
    transform: rotate(45deg); transition: transform .2s, margin .2s;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border: 0; border-right: 2px solid var(--azul); border-bottom: 2px solid var(--azul);
    transform: rotate(-135deg); margin-top: -2px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--azul); box-shadow: 0 0 0 .2rem rgba(0,114,188,.12);
}
.select2-container--open .select2-dropdown--below { margin-top: 6px; }
.select2-container--open .select2-dropdown--above { margin-top: -6px; }
.select2-dropdown {
    border: 1px solid var(--borde) !important; border-radius: var(--radio) !important;
    overflow: hidden; box-shadow: 0 14px 34px rgba(15,35,60,.14); padding: .35rem;
}
.select2-search--dropdown { padding: .25rem .25rem .45rem; }
.select2-search--dropdown .select2-search__field {
    border-radius: 8px; border: 1px solid var(--borde) !important; padding: .45rem .7rem; font-size: .88rem; outline: 0;
}
.select2-search--dropdown .select2-search__field:focus { border-color: var(--azul) !important; }
.select2-results__options { max-height: 240px !important; }
.select2-results__option { border-radius: 8px; padding: .5rem .7rem; font-size: .88rem; margin-bottom: 1px; position: relative; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--azul-claro); color: var(--azul-2); }
.select2-container--default .select2-results__option[aria-selected=true] { background: transparent; color: var(--azul); font-weight: 700; padding-right: 2rem; }
.select2-container--default .select2-results__option[aria-selected=true]::after {
    content: ""; position: absolute; right: .85rem; top: 50%; width: 6px; height: 11px; margin-top: -7px;
    border-right: 2px solid var(--azul); border-bottom: 2px solid var(--azul); transform: rotate(45deg);
}
.select2-container--default .select2-results__option--highlighted[aria-selected=true] { background: var(--azul-claro); }
.select2-results__message { color: var(--muted); }

/* ---------- Calendario (Flatpickr) ---------- */
input.fecha-alt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.4rem; cursor: pointer;
}
input.fecha-alt[readonly] { background-color: #fff; }
.flatpickr-calendar {
    font-family: inherit; border: 1px solid var(--borde); border-radius: var(--radio);
    box-shadow: 0 16px 40px rgba(15,35,60,.16); padding: .4rem;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months { padding: .2rem 0 .4rem; }
.flatpickr-months .flatpickr-month { height: 40px; }
.flatpickr-current-month { font-size: 1rem; font-weight: 700; padding-top: 8px; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; border-radius: 6px; }
.flatpickr-current-month .flatpickr-monthDropdown-months:hover, .flatpickr-current-month input.cur-year:hover { background: var(--azul-claro); }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month {
    top: .55rem; height: 32px; width: 32px; padding: 9px; border-radius: 8px; margin: 0 .3rem;
}
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { background: var(--azul-claro); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--azul); }
span.flatpickr-weekday { color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; }
.flatpickr-day { border-radius: 10px; font-weight: 500; color: var(--texto); }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--azul-claro); border-color: var(--azul-claro); }
.flatpickr-day.today { border-color: var(--azul); color: var(--azul); font-weight: 700; }
.flatpickr-day.today:hover { background: var(--azul-claro); color: var(--azul); border-color: var(--azul); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
    background: var(--azul); border-color: var(--azul); color: #fff; font-weight: 700;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #c4cad4; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: #d6dae1; background: transparent; }

/* ---------- Tablas ---------- */
.table-app { margin: 0; }
.table-app thead th {
    border: 0; border-bottom: 1px solid var(--borde); background: #fafbfc; color: var(--muted);
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    padding: .75rem 1.15rem; white-space: nowrap;
}
.table-app td { border-top: 1px solid #eff2f6; padding: .85rem 1.15rem; vertical-align: middle; }
.table-app tbody tr:first-child td { border-top: 0; }
.table-app tbody tr:hover { background: #fafbfd; }
.table-app td small { display: block; color: var(--muted); font-size: .75rem; }
/* Tabla compacta (panel inicial) */
.table-compacta td { padding: .6rem 1.15rem; font-size: .84rem; }
.table-compacta .nombre { display: block; font-weight: 600; font-size: .82rem; line-height: 1.25; }
.table-compacta td small { font-size: .72rem; }
.table-compacta .hora { color: var(--muted); font-size: .76rem; margin-left: .25rem; }
.table-compacta .badge-soft { font-size: .68rem; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.badge-soft { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-weight: 700; font-size: .72rem; white-space: nowrap; }
.badge-activo { background: var(--verde-claro); color: var(--verde); }
.badge-inactivo { background: var(--rojo-claro); color: var(--rojo); }
.badge-gris { background: #f1f4f8; color: #4b5563; }
.badge-azul { background: var(--azul-claro); color: var(--azul-2); }
.badge-ambar { background: var(--ambar-claro); color: var(--ambar); }
.table-permisos td:not(:first-child), .table-permisos th:not(:first-child) { text-align: center; width: 80px; }
.table-permisos .grupo td { background: #fafbfc; font-weight: 700; font-size: .72rem; text-transform: uppercase; color: var(--azul-2); letter-spacing: .06em; }
.table-permisos input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--azul); cursor: pointer; }

/* ---------- Paginación propia ---------- */
.card-footer-pager {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
    padding: .85rem 1.15rem; border-top: 1px solid var(--borde); color: var(--muted); font-size: .82rem;
}
.pager { display: flex; gap: .3rem; flex-wrap: wrap; }
.pager button {
    min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--borde);
    background: #fff; color: #374151; font-weight: 600;
}
.pager button:hover:not(:disabled):not(.active) { background: var(--azul-claro); border-color: var(--azul); color: var(--azul-2); }
.pager button.active, .pager button.active:hover { background: var(--azul); border-color: var(--azul); color: #fff; cursor: default; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager button.flecha { font-size: 1.45rem; line-height: 1; padding-bottom: 3px; font-weight: 400; }
.pager-size { display: flex; align-items: center; gap: .5rem; }
.pager-size select { border-radius: 8px; border: 1px solid var(--borde); padding: .2rem .4rem; background: #fff; }

/* ---------- Modales ---------- */
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.modal-header { border-bottom: 1px solid var(--borde); padding: 1rem 1.4rem; }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--borde); padding: .9rem 1.4rem; }
.alert-soft { background: var(--azul-claro); color: var(--azul-2); border: 0; border-radius: var(--radio-sm); font-size: .85rem; }

/* ---------- SweetAlert2 ---------- */
.swal2-popup { border-radius: 14px !important; font-family: inherit !important; }
.swal2-styled { border-radius: var(--radio-sm) !important; font-weight: 700 !important; }
/* Sin el recuadro de foco en botones ni en la X de alertas y modales */
.swal2-styled:focus, .swal2-close:focus, .swal2-popup:focus,
.modal .close:focus, .modal-content:focus, .modal:focus { outline: none !important; box-shadow: none !important; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--fondo); }
.login-card {
    display: flex; width: 100%; max-width: 880px; background: #fff;
    border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,60,110,.18);
}
.login-side {
    flex: 1; padding: 2.5rem 2rem; color: #fff; text-align: center;
    background: linear-gradient(160deg, var(--azul), var(--azul-2));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.login-logo-ancho { width: 400px !important; max-width: 92% !important; height: auto !important; border-radius: 18px !important; padding: 18px 22px !important; }
.login-logo { width: 280px; height: 280px; border-radius: 50%; background: #fff; padding: 0; object-fit: contain; box-shadow: 0 12px 34px rgba(0,0,0,.28); }
.login-side h2 { font-weight: 800; letter-spacing: .03em; margin: 1.5rem 0 .4rem; color: #fff; }
.login-form { flex: 1; padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.login-form h3 { font-weight: 700; color: var(--azul); }
.login-form .login-sub { margin-bottom: 1.25rem; color: #4b5563; }
@media (max-width: 767.98px) { .login-side { display: none; } .login-form { padding: 2rem 1.5rem; } }

/* ---------- Errores ---------- */
.error-page { max-width: 520px; margin: 3rem auto; padding: 3rem 2rem; text-align: center; align-items: center; }
.error-page i { font-size: 3.2rem; color: var(--rojo); margin-bottom: 1rem; }
.error-page h2 { font-weight: 700; font-size: 1.4rem; }
.error-page p { color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- Cobro de servicios ---------- */
.cobro-barra { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.cobro-buscar { flex: 1; min-width: 280px; }
.cobro-campo { width: 190px; }
.cobro-barra label { margin-bottom: .35rem; }
.deuda-tabla { max-height: 420px; overflow-y: auto; }
.deuda-tabla thead th { position: sticky; top: 0; z-index: 1; }
.deuda-tabla input[type=checkbox], .chk-todos { width: 17px; height: 17px; accent-color: var(--azul); cursor: pointer; }
.deuda-tabla .monto-pago { max-width: 130px; margin-left: auto; }
.deuda-tabla .monto-pago[readonly] { background: #f4f6f9; }
.tab-total { display: inline-block; margin-left: .3rem; padding: .05rem .45rem; border-radius: 999px; background: var(--rojo-claro); color: var(--rojo); font-size: .72rem; font-weight: 700; }
.tab-total:empty { display: none; }
.recibo { position: sticky; top: 84px; }
.recibo-linea { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.15rem; border-bottom: 1px solid #eff2f6; }
.recibo-linea .li-texto { flex: 1; min-width: 0; line-height: 1.25; }
.recibo-linea strong { display: block; font-size: .85rem; }
.recibo-linea small { color: var(--muted); font-size: .75rem; }
.recibo-linea .li-valor { font-weight: 700; white-space: nowrap; }
.recibo-linea .btn-accion { width: 28px; height: 28px; }
#reciboLineas { max-height: 360px; overflow-y: auto; }
.recibo-total { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; border-top: 1px solid var(--borde); background: #fafbfc; }
.recibo-total span { color: var(--muted); font-weight: 600; }
.recibo-total strong { font-size: 1.6rem; font-weight: 800; color: var(--azul); }
#btnFechaPago { height: 40px; font-weight: 600; }
#btnFechaPago i { color: var(--azul); }

/* Cobro: datos del encabezado y resumen de deuda */
.meta-datos { color: var(--muted); font-size: .88rem; margin-right: .35rem; }
.meta-datos strong { color: var(--texto); font-weight: 700; }
.meta-sep { margin: 0 .5rem; color: #9ca3af; font-weight: 700; }
.deuda-resumen { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--borde); background: #fafbfc; }
.deuda-item { text-align: left; border: 1px solid var(--borde); border-radius: 10px; background: #fff; padding: .6rem .8rem; line-height: 1.25; }
button.deuda-item { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.deuda-item:hover { border-color: var(--azul); box-shadow: 0 2px 8px rgba(0,114,188,.12); }
.deuda-item:focus { outline: none; }
.deuda-item small { display: block; color: var(--muted); font-size: .74rem; font-weight: 600; }
.deuda-item strong { font-size: 1.02rem; font-weight: 800; }
.deuda-item.debe strong { color: var(--rojo); }
.deuda-item.al-dia strong { color: var(--verde); }
.deuda-total { background: var(--azul-oscuro); border-color: var(--azul-oscuro); }
.deuda-total small { color: #c9d6e6; }
.deuda-total strong { color: #fff; font-size: 1.15rem; }
@media (max-width: 991.98px) { .deuda-resumen { grid-template-columns: repeat(2, 1fr); } .deuda-total { grid-column: 1 / -1; } }

/* Cobro: encabezado con separador pipe y ruta en su propia línea */
.perfil-num { font-weight: 700; }
.perfil-num.sin-sep { border-right: 0; padding-right: 0; }
.perfil-ruta { margin-top: .45rem; color: var(--muted); font-size: .86rem; line-height: 1.35; }
.perfil-ruta i { color: var(--azul); }
.perfil-ruta strong { color: var(--texto); }
.btn-agregar { white-space: nowrap; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.btn-agregar i { margin: 0; }
/* El selector de vehículo solo ocupa espacio cuando el afiliado tiene varios */
#cVehiculos { min-width: 220px; }
#cVehiculos:empty { display: none; }
.perfil-num { white-space: nowrap; }

/* Registro de daños */
.dano-dias { max-height: 300px; border: 1px solid var(--borde); border-radius: var(--radio-sm); }
.dano-doc { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.dano-doc .foto-prev { width: 100%; height: 180px; border-radius: 0; font-size: 2rem; }
.dano-doc .foto-prev img { object-fit: contain; }
.dano-dias-lista { max-width: 260px; }

/* Pago de gastos */
.segmento { display: inline-flex; padding: .25rem; background: #f1f4f8; border-radius: 12px; gap: .25rem; }
.segmento button { border: 0; background: transparent; border-radius: 9px; padding: .5rem .9rem; font-weight: 700; font-size: .85rem; color: #4b5563; white-space: nowrap; }
.segmento button:focus { outline: none; }
.segmento button.activo { background: #fff; color: var(--azul); box-shadow: 0 2px 8px rgba(15,35,60,.1); }
.total-input[readonly] { background: var(--azul-claro); color: var(--azul-2); font-weight: 800; }
.factura-doc { max-width: 420px; }
/* Daños */
.btn-accion.aprobar { color: var(--verde); }
.btn-accion.aprobar:hover { background: var(--verde); border-color: var(--verde); color: #fff; }
.nav-contador { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rojo); color: #fff; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

.btn-dano { height: 40px; font-weight: 600; white-space: nowrap; }
.btn-dano i { color: var(--ambar); }
.btn-dano:disabled { opacity: .55; }

/* Cobro: nombre y botón de daños en la misma línea, sin avatar */
.cobro-titulo { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cobro-titulo .perfil-nombre { flex: 1; min-width: 0; }
.cobro-titulo .btn-dano { flex-shrink: 0; }

/* Tooltip del sistema (negro, letra blanca) */
.tip-app {
    position: fixed; z-index: 2000; max-width: 280px; padding: .45rem .7rem; border-radius: 8px;
    background: #111827; color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.35;
    box-shadow: 0 8px 22px rgba(0,0,0,.22); pointer-events: none;
    opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip-app.visible { opacity: 1; transform: translateY(0); }
.tip-app::after {
    content: ""; position: absolute; left: var(--flecha, 50%); top: 100%; margin-left: -5px;
    border: 5px solid transparent; border-top-color: #111827;
}
.tip-app.abajo::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111827; }

/* Popover de días (Registro de daños) */
.dias-btn {
    border: 1px solid var(--borde); background: #fff; border-radius: 999px; padding: .15rem .65rem;
    font-weight: 700; font-size: .82rem; color: var(--azul); display: inline-flex; align-items: center; gap: .3rem;
}
.dias-btn:hover { border-color: var(--azul); }
.dias-btn:focus { outline: none; }
.dias-btn i { transition: transform .15s; }
.dias-btn.abierto { background: var(--azul); border-color: var(--azul); color: #fff; }
.dias-btn.abierto i { transform: rotate(180deg); }
.pop-app {
    position: absolute; z-index: 1900; width: 340px; max-width: calc(100vw - 16px);
    background: #111827; color: #fff; border-radius: 12px; padding: .75rem; box-shadow: 0 14px 34px rgba(0,0,0,.28);
    animation: popEntra .12s ease-out;
}
.pop-app::before {
    content: ""; position: absolute; bottom: 100%; left: var(--flecha, 24px); margin-left: -6px;
    border: 6px solid transparent; border-bottom-color: #111827;
}
.pop-titulo { font-size: .78rem; font-weight: 700; color: #c9d6e6; margin-bottom: .55rem; text-transform: uppercase; letter-spacing: .06em; }
.pop-titulo span { display: inline-block; margin-left: .3rem; padding: 0 .45rem; border-radius: 999px; background: var(--rojo); color: #fff; }
.pop-dias { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; max-height: 260px; overflow-y: auto; }
.pop-dias span { background: #1f2937; border-radius: 8px; padding: .35rem .55rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pop-dias::-webkit-scrollbar { width: 6px; }
.pop-dias::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
@keyframes popEntra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Reportes ---------- */
.hoja { padding: 1.5rem 1.75rem 2rem; }
.solo-impresion { display: none; }
.hoja-membrete img { max-width: 100%; height: auto; margin-bottom: 1rem; }
.hoja-titulo { text-align: center; margin-bottom: 1.25rem; }
.hoja-titulo h2 { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--texto); }
.hoja-titulo p { margin: .2rem 0 0; color: var(--muted); font-weight: 600; }
.hoja-resumen { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.hoja-resumen > div { flex: 1; min-width: 150px; border: 1px solid var(--borde); border-radius: 10px; padding: .7rem .9rem; }
.hoja-resumen small { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; }
.hoja-resumen strong { font-size: 1.15rem; font-weight: 800; }
.hoja-resumen .destacado { background: var(--azul-oscuro); border-color: var(--azul-oscuro); }
.hoja-resumen .destacado small { color: #c9d6e6; }
.hoja-resumen .destacado strong { color: #fff; }
.hoja-persona { margin-bottom: 1rem; }
.hoja-persona h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 .35rem; }
.hoja-seccion { font-size: .95rem; font-weight: 800; margin: 1.25rem 0 .5rem; color: var(--azul-2); }
.tabla-reporte { border: 1px solid var(--borde); }
.tabla-reporte tfoot td { background: #fafbfc; font-weight: 800; border-top: 2px solid var(--borde); padding: .8rem 1.15rem; }
.tabla-reporte .fila-alerta td { color: var(--rojo); font-weight: 700; }
.tabla-reporte .col-monto { white-space: nowrap; min-width: 120px; }
.fechas-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.fechas-chips span { background: #f1f4f8; border-radius: 6px; padding: .1rem .4rem; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.marca-vehiculo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; margin-left: .3rem; }
.hoja-nota { color: var(--muted); font-size: .78rem; margin-top: .5rem; }
.bloque-total { border: 1px solid var(--borde); border-radius: 12px; padding: 1rem 1.15rem; height: 100%; }
.bloque-total h4 { font-size: .9rem; font-weight: 800; margin-bottom: .6rem; color: var(--azul-2); }
.bloque-total > div { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid #eff2f6; }
.bloque-total > div.total { border-bottom: 0; font-size: 1.05rem; }
.bloque-total > div.total strong { color: var(--azul); font-size: 1.2rem; }
.hoja-firmas { display: flex; justify-content: space-around; gap: 2rem; margin-top: 4rem; text-align: center; font-weight: 700; font-size: .85rem; }
.hoja-firmas div { width: 260px; }
.hoja-firmas span { display: block; border-top: 1.5px solid #374151; margin-bottom: .4rem; }
.hoja-pie { margin-top: 2rem; text-align: center; color: var(--muted); font-size: .72rem; }

@media print {
    @page { margin: 1.2cm; }
    body { background: #fff !important; font-size: 11px; }
    .sidebar, .sidebar-backdrop, .topbar, .footer, .no-print, .tip-app, .pop-app { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    .hoja { padding: 0; }
    .solo-impresion { display: block !important; }
    .hoja-resumen .destacado { background: #fff !important; border: 2px solid #111827 !important; }
    .hoja-resumen .destacado small, .hoja-resumen .destacado strong { color: #111827 !important; }
    .tabla-reporte { font-size: 12px; }
    .tabla-reporte td, .tabla-reporte th { padding: .45rem .55rem !important; }
    .table-app thead th { background: #eef1f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    tr { page-break-inside: avoid; }
}

.detalle-recibo { font-size: .8rem; line-height: 1.35; }
.detalle-recibo strong { font-weight: 700; }
.detalle-recibo span { color: var(--muted); }
.fila-anulada td { color: #9ca3af; text-decoration: line-through; }
.fila-anulada td .badge-soft { text-decoration: none; }
.gran-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem; margin-top: 1rem; padding: .9rem 1.15rem; border-radius: 10px; background: #fafbfc; border: 1px solid var(--borde); font-weight: 700; color: var(--muted); }
.gran-total strong { font-size: 1.4rem; color: var(--azul); font-weight: 800; }

/* Menú plegable */
.nav-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; background: transparent; border: 0; text-align: left; cursor: pointer; border-radius: 8px; }
.nav-toggle:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-toggle:focus { outline: none; }
.nav-toggle i { font-size: .85rem; transition: transform .2s; }
.nav-seccion.abierta .nav-toggle i { transform: rotate(180deg); }
.nav-seccion .nav-items { overflow: hidden; }
.nav-seccion .nav-items { max-height: 0; transition: max-height .25s ease; display: block; }
.nav-seccion.abierta .nav-items { max-height: 800px; }
.nav-seccion.con-activo .nav-toggle span::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--rojo); margin-left: .45rem; vertical-align: middle; }

/* Campanita de notificaciones */
.notif { position: relative; }
.notif-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--borde); background: #fff; color: #374151; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; }
.notif-btn:hover { border-color: var(--azul); color: var(--azul); }
.notif-btn:focus { outline: none; }
.notif-num { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--rojo); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--borde); border-radius: 14px; box-shadow: 0 18px 40px rgba(15,35,60,.16); display: none; z-index: 1050; overflow: hidden; }
.notif-panel.visible { display: block; animation: popEntra .12s ease-out; }
.notif-head { padding: .85rem 1rem; font-weight: 800; border-bottom: 1px solid var(--borde); display: flex; align-items: center; gap: .5rem; }
.notif-head span { background: var(--rojo); color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .72rem; }
.notif-item { display: flex; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid #eff2f6; color: var(--texto) !important; }
.notif-item:hover { background: #fafbfc; }
.notif-icono { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: var(--ambar-claro); color: var(--ambar); display: flex; align-items: center; justify-content: center; }
.notif-texto { min-width: 0; line-height: 1.3; }
.notif-texto strong { display: block; font-size: .84rem; }
.notif-texto small { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.notif-texto .notif-meta { color: #9ca3af; font-size: .72rem; }
.notif-todos { display: block; text-align: center; padding: .7rem; font-weight: 700; font-size: .82rem; }
.notif-vacio { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
.notif-vacio i { display: block; font-size: 1.6rem; color: var(--verde); margin-bottom: .4rem; }

/* Roles: casillas para marcar columnas completas */
.th-chk { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; margin: 0; cursor: pointer; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.th-chk input { width: 17px; height: 17px; accent-color: var(--azul); cursor: pointer; }
.table-permisos .grupo td:last-child { text-align: center; }
.table-permisos .grupo input { width: 17px; height: 17px; accent-color: var(--azul); cursor: pointer; }
/* La etiqueta del encabezado de tarjeta no se parte en dos líneas */
.card-head .pill { white-space: nowrap; flex-shrink: 0; padding: .3rem .7rem; font-size: .74rem; }
.card-head h3 { min-width: 0; }

/* Panel: ingresos por categoría */
.segmento-sm button { padding: .3rem .6rem; font-size: .74rem; }
.cat-mes { padding: .6rem 1.15rem 0; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cat-icono { position: static; width: 34px; height: 34px; border-radius: 9px; font-size: .95rem; flex-shrink: 0; }
.cat-barra { width: 100%; margin-top: .35rem; height: 6px; }
.cat-total { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 1.15rem; border-top: 1px solid var(--borde); background: #fafbfc; font-weight: 700; color: var(--muted); }
.cat-total strong { font-size: 1.15rem; color: var(--azul); }

/* ===== Temas (APP_TEMA en Config.php): solo cambian el menú lateral; la barra superior es clara en los dos =====
   Cada sistema define --acento (opción marcada del menú), --nombre y --sub (nombre del sistema y letras de abajo en el tema claro). */

/* Contenido: mismos colores en todos los temas y en los dos sistemas */
.content a:not(.btn):not(.btn-accion) { color: #1e6fb8; }
.btn-primary { background: #1e6fb8; border-color: #1e6fb8; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #185c99; border-color: #185c99; }
.btn-success { background: #15803d; border-color: #15803d; color: #fff; }
.btn-success:hover, .btn-success:focus { background: #116b33; border-color: #116b33; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #b91c1c; border-color: #b91c1c; }
.kpi-oscuro { background: #1f2937; border-color: #1f2937; }
.kpi-oscuro .kpi-label, .kpi-oscuro .kpi-sub { color: #cbd5e1; }
.kpi-oscuro .kpi-valor { color: #fff; }
.kpi-oscuro .kpi-sub .t-rojo { color: #fca5a5 !important; }
.deuda-total, .hoja-resumen .destacado { background: #1f2937; border-color: #1f2937; }
.deuda-total small, .hoja-resumen .destacado small { color: #cbd5e1; }
.pill-info { background: #e7f0fa; color: #1e5f9e; }
.pill-info .dot { background: #1e6fb8; }
.cat-barra span { background: #1e6fb8; }
.cat-total strong { color: #1e6fb8; }

/* Barra superior clara (igual en los dos temas) */
.topbar { background: #fff; border-bottom: 1px solid #e6eaf0; }

/* Tema "oscuro": menú oscuro, barra superior clara */
body.tema-oscuro .sidebar { background: #1f2937; }
body.tema-oscuro .brand-name, body.tema-oscuro .sidebar-brand:hover .brand-name { color: #fff; }
body.tema-oscuro .nav-group { color: #8d99a8; }
body.tema-oscuro .nav-item i { color: #9aa5b4; }
body.tema-oscuro .nav-item:hover { background: rgba(255,255,255,.06); }
body.tema-oscuro .nav-item.active { background: var(--acento); }
body.tema-oscuro .nav-item.active i { color: #fff; }
body.tema-oscuro .nav-seccion.con-activo .nav-toggle span::after { background: var(--acento); }
body.tema-oscuro .sidebar-user { background: rgba(255,255,255,.06); }
body.tema-oscuro .sidebar-user .avatar { background: var(--acento); color: #fff; }
body.tema-oscuro .sidebar-user small { color: #dbe3ec; }

/* Tema "claro": menú claro, barra superior clara */
body.tema-claro .sidebar { background: #fff; border-right: 1px solid #e6eaf0; }
body.tema-claro .brand-name, body.tema-claro .sidebar-brand:hover .brand-name { color: var(--nombre); }
body.tema-claro .brand-sub { color: var(--sub); }
body.tema-claro .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); }
body.tema-claro .nav-group { color: #94a0b3; }
body.tema-claro .nav-toggle:hover { color: #475569; background: #f1f4f8; }
body.tema-claro .nav-item { color: #3d4a5c !important; }
body.tema-claro .nav-item i { color: #7b8ba3; }
body.tema-claro .nav-item:hover { background: #f1f4f8; }
body.tema-claro .nav-item.active { background: var(--acento); color: #fff !important; }
body.tema-claro .nav-item.active i { color: #fff; }
body.tema-claro .nav-seccion.con-activo .nav-toggle span::after { background: var(--acento); }
body.tema-claro .sidebar-user { background: #f1f4f8; }
body.tema-claro .sidebar-user .avatar { background: var(--acento); color: #fff; }
body.tema-claro .sidebar-user strong { color: #1f2937; }
body.tema-claro .sidebar-user small { color: #374151; }
body.tema-claro .btn-salir { color: #64748b !important; background: #fff; }
body.tema-claro .btn-salir:hover { color: #fff !important; background: var(--acento); }
:root { --acento: #1761ac; --nombre: #1761ac; --sub: #ed3237; }

/* Login: lado izquierdo azul plano */
.login-side { background: #1761ac; }

/* Sucursal con la que entró el usuario */
.sidebar-user .user-sucursal { display: block; font-size: .7rem; opacity: .85; line-height: 1.25; margin-top: 1px; }
.login-form select.form-control { padding-left: 2.4rem; }

/* Factura / recibo imprimible */
.factura-doc { padding: 1.75rem 2rem; }
.fd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--borde); }
.fd-logo { max-width: 240px; height: auto; }
.fd-empresa { text-align: right; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.fd-empresa strong { display: block; color: var(--texto); font-size: .95rem; }
.fd-empresa span { display: block; }
.fd-datos { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.3rem 0 1rem; }
.fd-titulo { font-size: 1.8rem; font-weight: 800; margin: 0 0 .3rem; }
.fd-num { font-size: 1.05rem; margin-bottom: .3rem; }
.fd-num strong { font-size: 1.3rem; }
.fd-label { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; font-weight: 800; color: var(--muted); margin: .7rem 0 .2rem; }
.fd-totales { margin-left: auto; max-width: 320px; padding-top: .5rem; }
.fd-totales div { display: flex; justify-content: space-between; padding: .3rem 0; }
.fd-totales .fd-total { border-top: 2px solid var(--texto); margin-top: .3rem; padding-top: .55rem; font-size: 1.15rem; }
.fd-total strong { font-size: 1.4rem; font-weight: 800; }
.fd-comprobante { margin-top: 1.5rem; }
.fd-comprobante img { max-width: 260px; border: 1px solid var(--borde); border-radius: 8px; }
@media print { .factura-doc { padding: 0; } .fd-comprobante { display: none; } }

/* ===== Nueva factura ===== */
.fac-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--borde); }
.fac-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0 0 .25rem; }
.fac-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.fac-num { text-align: right; }
.fac-num small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fac-num strong { font-size: 1.25rem; font-weight: 800; color: #1e6fb8; }
.fac-seccion { padding: 1.1rem 1.5rem; border-bottom: 1px solid #eef1f5; }
.fac-paso { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: .92rem; margin-bottom: .65rem; }
.fac-paso span { width: 24px; height: 24px; border-radius: 50%; background: #e7f0fa; color: #1e6fb8; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; }
.cliente-ficha { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1px solid #dbe7f5; background: #f5f9fe; border-radius: 12px; }
.cf-avatar { width: 46px; height: 46px; border-radius: 50%; background: #1e6fb8; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.cf-datos { flex: 1; min-width: 0; line-height: 1.45; }
.cf-datos strong { display: block; font-size: 1.02rem; }
.cf-datos span { display: block; color: var(--muted); font-size: .84rem; }
.cf-datos i { font-size: .8rem; }
.fac-items td { vertical-align: middle; }
.fac-cod { display: inline-block; font-weight: 800; font-size: .75rem; background: #f1f4f8; border-radius: 6px; padding: .12rem .45rem; margin-right: .3rem; }
.fac-vacio { text-align: center; color: var(--muted); padding: 2rem 1rem 2.2rem; }
.fac-vacio i { display: block; font-size: 1.8rem; margin-bottom: .4rem; opacity: .6; }
.cobro-panel { position: sticky; top: 84px; }
.cp-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); margin-bottom: .4rem; }
.seg-forma { display: flex; }
.seg-forma button { flex: 1; }
.metodo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.metodo-btn { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--borde); background: #fff; border-radius: 10px; padding: .6rem .7rem; font-weight: 600; font-size: .88rem; color: #374151; cursor: pointer; }
.metodo-btn i { font-size: 1rem; color: #6b7280; }
.metodo-btn.activo { border-color: #1e6fb8; background: #e7f0fa; color: #1e5f9e; box-shadow: 0 0 0 2px rgba(30,111,184,.12); }
.metodo-btn.activo i { color: #1e6fb8; }
.metodo-btn:focus { outline: none; }
.comprobante-drop { display: flex; align-items: center; gap: .6rem; border: 1.5px dashed #c5d3e3; border-radius: 10px; padding: .75rem .9rem; cursor: pointer; color: #475569; font-size: .86rem; margin: 0; }
.comprobante-drop i { font-size: 1.2rem; color: #1e6fb8; }
.comprobante-drop.con-archivo { border-style: solid; border-color: #15803d; background: #f0fdf4; color: #15803d; }
.cp-totales { border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); padding: .7rem 1.15rem; background: #fafbfc; }
.cp-totales div { display: flex; justify-content: space-between; padding: .2rem 0; font-size: .92rem; }
.cp-totales .cp-total { padding-top: .5rem; margin-top: .3rem; border-top: 1px dashed var(--borde); }
.cp-total span { font-weight: 700; }
.cp-total strong { font-size: 1.6rem; font-weight: 800; color: #111827; }
.cp-monto { font-size: 1.4rem; font-weight: 700; text-align: right; }
.montos-rapidos { display: flex; gap: .4rem; margin-top: .5rem; }
.montos-rapidos button { flex: 1; border: 1px solid var(--borde); background: #fff; border-radius: 8px; padding: .35rem 0; font-weight: 600; font-size: .82rem; cursor: pointer; }
.montos-rapidos button:hover { background: #f1f4f8; }
.cp-resultado { display: flex; justify-content: space-between; align-items: baseline; margin-top: .75rem; padding: .6rem .8rem; border-radius: 10px; font-weight: 600; }
.cp-resultado strong { font-size: 1.25rem; }
.cp-resultado.ok { background: #f0fdf4; color: #15803d; }
.cp-resultado.pend { background: #fef3c7; color: #a16207; }
.cp-resultado.falta { background: #fee2e2; color: #b91c1c; }

/* ===== Modal de cobros ===== */
.cobros-head { align-items: center; }
.cobros-cliente { display: flex; align-items: center; gap: .85rem; }
.cobros-cliente .modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: .15rem; }
.cobros-cliente #cbFactura { color: var(--muted); font-size: .85rem; margin-right: .35rem; }
.cobros-montos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.2rem; }
.cobros-montos div { border: 1px solid var(--borde); border-radius: 12px; padding: .8rem 1rem; }
.cobros-montos small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: .15rem; }
.cobros-montos strong { font-size: 1.35rem; font-weight: 800; }
.cobros-montos .cm-saldo { background: #fafbfc; }
.cobros-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); margin: 0 0 .5rem; }
.cobros-abono { margin-top: 1.2rem; padding: 1rem; border-radius: 12px; background: #f5f9fe; border: 1px solid #dbe7f5; }
.fila-anulada td { opacity: .55; }

/* ===== Factura en hoja carta (8.5 × 11 in) ===== */
.papel-barra { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; max-width: 8.5in; margin: 0 auto 1rem;
               background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: .65rem .75rem; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.pb-izq { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pb-titulo { line-height: 1.2; }
.pb-titulo strong { display: block; font-size: .95rem; }
.pb-titulo small { color: var(--muted); font-size: .78rem; }
.pb-acciones { display: flex; gap: .4rem; flex-wrap: wrap; }
.pb-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-width: 84px; padding: .45rem .6rem; border: 1px solid var(--borde);
          background: #fff; border-radius: 10px; color: #374151 !important; font-size: .74rem; font-weight: 600; text-decoration: none !important; cursor: pointer; line-height: 1.1; }
.pb-btn i { font-size: 1.15rem; color: #1e6fb8; }
.pb-btn:hover { background: #f1f4f8; }
.pb-btn:focus { outline: none; }
.pb-principal { background: #1e6fb8; border-color: #1e6fb8; color: #fff !important; }
.pb-principal i { color: #fff; }
.pb-principal:hover { background: #185c99; }
.pb-peligro i { color: #dc2626; }
.pb-peligro:hover { background: #fee2e2; border-color: #fecaca; }
.pb-anulada { font-size: .82rem; padding: .5rem .8rem; }
.correo-destino { margin: .6rem 0 .5rem; padding: .55rem .8rem; background: #f1f4f8; border-radius: 8px; font-weight: 700; color: #1e5f9e; word-break: break-all; }
.papel-carta { width: 8.5in; min-height: 11in; margin: 0 auto; background: #fff; padding: .65in .7in; box-shadow: 0 6px 28px rgba(15,23,42,.12); border-radius: 4px; font-size: 14.5px; color: #111827; }
.papel-anulada .pc-titulo { color: #dc2626; }
.pc-fecha { font-size: 18px; }
.pc-fecha strong { font-size: 19px; }
.pc-tabla { width: 100%; border-collapse: collapse; }
.pc-tabla td { vertical-align: top; }
.pc-head td { padding-bottom: 14px; border-bottom: 2px solid #111827; }
.pc-logo { width: 290px; height: auto; display: block; }
.pc-empresa { display: inline-block; text-align: left; color: #4b5563; font-size: 13px; line-height: 1.55; }
.pc-empresa strong { display: block; color: #111827; font-size: 14px; }
.pc-datos td { padding: 22px 0 16px; }
.pc-datos p { margin: 0 0 3px; }
.pc-titulo { font-size: 34px; font-weight: 800; margin: 0 0 8px; }
.pc-etq { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 800; color: #6b7280; margin: 12px 0 3px !important; }
.pc-cliente { font-size: 17px; font-weight: 800; }
.pc-num { font-size: 18px; }
.pc-num strong { font-size: 19px; }
.pc-detalle th { background: #f1f3f6; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 10px; color: #374151; }
.pc-detalle td { padding: 14px 10px; border-bottom: 1px solid #e5e7eb; }
.pc-detalle .pc-relleno td { border-bottom: 0; }
.pc-totales { margin-top: 12px; }
.pc-totales td { padding: 5px 0; }
.pc-total td { border-top: 2px solid #111827; padding-top: 10px; font-size: 21px; font-weight: 800; }
.pc-comprobante { margin-top: 28px; }
.pc-comprobante img { max-width: 260px; border: 1px solid #e5e7eb; border-radius: 8px; }
.pc-pie { margin-top: 48px; text-align: center; color: #6b7280; font-size: 13px; }
@media (max-width: 991.98px) { .papel-carta { width: 100%; min-height: 0; padding: 1.25rem; } }
@media print {
    @page { size: letter; margin: .5in; }
    .papel-barra { display: none !important; }
    .papel-carta { width: auto; min-height: 0; padding: 0; box-shadow: none; border-radius: 0; }
}

.cobro-panel .p-3 { padding: 1rem 1.15rem !important; }
.cf-datos span span { display: inline; }
.cobro-panel .mb-3 { margin-bottom: 1rem !important; }

/* Factura impresa con Ctrl+P desde la pantalla: tamaños en puntos, como el PDF */
@media print {
    .papel-carta { font-size: 12.5pt !important; }
    .pc-logo { width: 240pt !important; }
    .pc-empresa { font-size: 10pt !important; }
    .pc-titulo { font-size: 30pt !important; }
    .pc-fecha, .pc-fecha strong, .pc-cliente { font-size: 15pt !important; }
    .pc-num, .pc-num strong { font-size: 14pt !important; }
    .pc-detalle th { font-size: 9.5pt !important; }
    .pc-detalle td { padding: 15pt 8pt !important; }
    .pc-total td { font-size: 18pt !important; }
}

/* Foco solo visible al usar el teclado; con el mouse no se queda el botón marcado */
.btn:focus:not(:focus-visible), .btn-accion:focus:not(:focus-visible), .pb-btn:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* Barra de la factura (opción 2): Imprimir + menú "Más acciones" */
.pb-acciones { align-items: center; }
.pb-mas { position: relative; }
.pb-mas-btn { border: 1px solid var(--borde); background: #fff; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.pb-mas-btn .icon-chevron-down { transition: transform .15s; }
.pb-mas-btn.abierto .icon-chevron-down { transform: rotate(180deg); }
.pb-imprimir { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; padding-left: 1.1rem; padding-right: 1.1rem; }
.pb-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1050; min-width: 220px; background: #fff; border: 1px solid #e6eaf0; border-radius: 10px;
           box-shadow: 0 12px 30px rgba(15,23,42,.14); padding: .35rem; }
.pb-menu a, .pb-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; border: 0; background: none; border-radius: 7px;
           color: #1f2937 !important; font-size: .9rem; text-align: left; text-decoration: none !important; cursor: pointer; }
.pb-menu a:hover, .pb-menu button:hover { background: #f1f4f8; }
.pb-menu i { color: #6b7280; font-size: 1rem; }
.pb-menu .pb-menu-peligro, .pb-menu .pb-menu-peligro i { color: #dc2626 !important; }

/* Reportes: fila de grupo (instructor en horarios) */
.tabla-reporte .fila-grupo td { background: #f1f3f6; font-size: .85rem; padding-top: .5rem; padding-bottom: .5rem; }

/* Nueva factura: el servicio ocupa el ancho disponible */
.fac-items td:first-child { font-size: .95rem; line-height: 1.35; white-space: normal; min-width: 280px; }
.fac-items .item-precio { width: 100px; margin-left: auto; }

/* Encabezado de los reportes al imprimir: logo, datos de la sede, línea roja y azul, título */
.rpt-encabezado { margin-bottom: 1.2rem; }
.rpt-tabla { width: 100%; border-collapse: collapse; }
.rpt-tabla td { vertical-align: middle; }
.rpt-logo { width: 230px; height: auto; display: block; }
.rpt-der { text-align: right; }
.rpt-empresa { display: inline-block; text-align: left; font-size: 11px; line-height: 1.5; color: #374151; }
.rpt-empresa strong { font-size: 13px; color: #111827; }
.rpt-linea { height: 3px; margin-top: 4px; }
.rpt-roja { background: #ed3237; margin-top: 12px; }
.rpt-azul { background: #1761ac; }
.rpt-titulo { text-align: center; font-size: 18px; font-weight: 800; margin: 16px 0 4px; }
.rpt-sub { text-align: center; font-size: 12px; color: #374151; margin: 0; }
.rpt-firma { margin-top: 70px; display: flex; justify-content: flex-end; }
.rpt-firma div { width: 260px; text-align: center; font-size: 12px; font-weight: 700; }
.rpt-firma span { display: block; border-top: 1.5px solid #111827; margin-bottom: 6px; }
@media print {
    .rpt-roja, .rpt-azul { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rpt-firma.solo-impresion { display: flex !important; }
}

/* Caja diaria: concepto y observación cuando el recibo no tiene servicios */
.desc-co { display: flex; gap: 18px; }
.desc-co span { flex: 1; }
.tabla-reporte .desc-co small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; font-weight: 700; }

/* Campana del administrador (barra superior) */
.campana { position: relative; margin-right: .6rem; }
.campana-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; color: #374151; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; cursor: pointer; }
.campana-btn:hover { background: #f3f4f6; }
.campana-num { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ed3237; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.campana-menu { width: 290px; padding: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(17, 24, 39, .14); border: 1px solid #e5e7eb; }
.campana-head { padding: .7rem 1rem; font-weight: 700; font-size: 13px; border-bottom: 1px solid #f1f3f6; }
.campana-item { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; color: #111827; text-decoration: none !important; }
.campana-item:hover { background: #f8fafc; color: #111827; }
.campana-item small { display: block; color: #6b7280; font-size: 12px; }
.campana-ico { width: 36px; height: 36px; border-radius: 10px; background: #eff6ff; color: #1761ac; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }

/* Clientes: botón Diplomas con cantidad */
.btn-diplomas { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; background: #eff6ff; color: #1761ac; font-weight: 700; font-size: 13px; text-decoration: none !important; }
.btn-diplomas:hover { background: #dbeafe; color: #1761ac; }
.btn-diplomas.vacio { background: #f3f4f6; color: #9ca3af; }
.btn-diplomas span { font-size: 12px; }

/* Diplomas del cliente */
.cd-cliente { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; flex-wrap: wrap; }
.cd-foto { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; }
.cd-ini { background: #eff6ff; color: #1761ac; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; }
.cd-datos { flex: 1; min-width: 220px; }
.cd-datos h2 { font-size: 18px; font-weight: 800; margin: 0 0 2px; }
.cd-datos p { margin: 0; color: #6b7280; font-size: 13px; }
.cd-cifras { display: flex; gap: 1.4rem; margin-right: .5rem; }
.cd-cifras div { text-align: center; }
.cd-cifras strong { display: block; font-size: 20px; line-height: 1.1; }
.cd-cifras small { color: #6b7280; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.btn-examen { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 7px; border: 1px solid #e5e7eb; color: #374151; font-size: 12px; font-weight: 600; text-decoration: none !important; margin-right: 3px; }
.btn-examen:hover { background: #f3f4f6; color: #111827; }

/* Aviso de documentos pendientes al iniciar sesión */
.swal-docs .swal2-title { font-size: 20px; }
.dp-intro { font-size: 13.5px; color: #6b7280; margin-bottom: .8rem; }
.dp-tabla { max-height: 55vh; overflow: auto; text-align: left; }
.dp-tabla .table td { vertical-align: middle; font-size: 13px; }
.dp-tabla small { display: block; color: #6b7280; }
.dp-nombre { font-weight: 700; color: #111827; }
.dp-falta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 6px; background: #fef2f2; color: #dc2626; font-size: 12px; font-weight: 700; }
.dp-ok { color: #16a34a; font-size: 16px; }
.dp-na { color: #d1d5db; }

/* Clientes: dirección en una línea con "…" (el title muestra la completa) y birrete de diplomas */
.dir-corta { display: block; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ico-birrete { width: 17px; height: 17px; }

/* Menú de acciones (flota sobre la página) */
.menu-acciones { position: fixed; z-index: 1060; min-width: 190px; background: #fff; border: 1px solid #e6eaf0; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.14); padding: .35rem; }
.menu-acciones a, .menu-acciones button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .75rem; border: 0; background: none; border-radius: 7px; color: #1f2937 !important; font-size: .88rem; text-align: left; text-decoration: none; cursor: pointer; }
.menu-acciones a:hover, .menu-acciones button:hover { background: #f1f4f8; }
.menu-acciones i { color: #6b7280; font-size: 1rem; }
.menu-acciones .menu-peligro, .menu-acciones .menu-peligro i { color: #dc2626 !important; }

/* Clientes: teléfono y correo debajo del nombre, uno por línea */
#tabla .persona-texto small { display: block; margin-top: 1px; }
#tabla .persona-texto small i { font-size: .72rem; margin-right: 2px; }

/* Icono birrete para Diplomas (Feather no lo trae): <i class="feather icon-birrete"></i> */
.feather.icon-birrete::before { content: ""; display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 10 12 5 2 10l10 5 10-5z'/%3E%3Cpath d='M6 12v5c0 1.1 2.7 3 6 3s6-1.9 6-3v-5'/%3E%3Cpath d='M22 10v6'/%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 10 12 5 2 10l10 5 10-5z'/%3E%3Cpath d='M6 12v5c0 1.1 2.7 3 6 3s6-1.9 6-3v-5'/%3E%3Cpath d='M22 10v6'/%3E%3C/svg%3E") no-repeat center / contain; }

/* Tarjeta del usuario en el menú: nombre en hasta 2 líneas y sucursal completa (sin "…") */
.sidebar-user { align-items: flex-start !important; }
.sidebar-user small { display: block; margin-top: 2px; }
.sidebar-user .avatar, .sidebar-user .btn-salir { flex: none; }

/* Tarjeta del usuario sin avatar de iniciales: el texto usa todo el ancho; rol y sucursal más oscuros para distinguirse del fondo */
.sidebar-user .user-info { padding-left: .2rem; }
.sidebar-user .user-sucursal { opacity: 1; }
body.tema-claro .sidebar-user .user-sucursal i { color: var(--acento); }

.campana-menu { position: absolute; top: calc(100% + 8px); right: 0; left: auto; z-index: 1050; display: none; }
.campana-menu.show { display: block; }

/* Logo con el carrito (más alto que ancho) en la hoja de la factura */
.papel-carta .pc-logo.pc-logo-ruta { width: 200px; max-width: 200px; height: auto; }
@media print { .papel-carta .pc-logo.pc-logo-ruta { width: 150pt !important; } }
