/* ═══════════════════════════════════════════════════════════════════════════
   FAKTORA — Overrides sobre SmartAdmin (Color Admin v5.5.2)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Contenido: margen del template + aire abajo para que el botón flotante no tape lo último */
#content.app-content { padding-bottom: 96px; background: #f4f6f9; }
[data-bs-theme="dark"] #content.app-content { background: var(--bs-body-bg); }

/* ─── Ajustes de paleta ─────────────────────────────────────────────────────
   SmartAdmin en dark mode usa #161a1d para el body (casi negro) lo que crea
   un contraste agresivo con los paneles (#2d353c). Suavizamos a un gris
   medio para que el dark mode se vea como en el template oficial. */
[data-bs-theme="dark"] {
    --bs-body-bg: #1f262d;
    --bs-body-bg-rgb: 31, 38, 45;
}

/* Theme black: el negro puro (#000000) en hovers/activos y accents queda muy
   duro; lo cambiamos a un gris oscuro suave que combina con #2d353c. */
.theme-black {
    --bs-app-theme: #353c44;
    --bs-app-theme-rgb: 53, 60, 68;
    --bs-app-theme-hover: #2a3138;
    --bs-app-theme-hover-border-color: #2a3138;
    --bs-app-theme-active: #2a3138;
    --bs-app-theme-active-border-color: #2a3138;
}

/* ─── Avatar circular (header) ──────────────────────────────────────────── */
.faktora-avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    background: #0f766e;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

/* ─── Selector de sucursal en navbar (desktop) ─────────────────────────── */
.navbar-local-sel {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .65rem;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 6px;
    max-width: 240px;
}
.navbar-local-sel i { color: #0f766e; font-size: .82rem; flex-shrink: 0; }
.navbar-local-sel select {
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
    font-size: .82rem;
    font-weight: 600;
    padding: 0;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
    max-width: 190px;
    cursor: pointer;
}
.navbar-local-sel select option { color: #1a2e4f; background: #fff; }
.navbar-local-sel select:focus { outline: 0; box-shadow: none !important; }
[data-bs-theme="dark"] .navbar-local-sel {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
}
[data-bs-theme="dark"] .navbar-local-sel select { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .navbar-local-sel select option { color: #1a2e4f; background: #fff; }

/* ─── Selector de local en sidebar ─────────────────────────────────────── */
.faktora-local-sel {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 15px 5px;
    padding: .45rem .75rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
}
.faktora-local-sel i { color: #0f766e; font-size: .85rem; flex-shrink: 0; }
.faktora-local-sel select {
    background: transparent !important;
    border: 0 !important;
    color: #e2e8f0 !important;
    font-size: .82rem;
    font-weight: 600;
    padding: 0;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}
.faktora-local-sel select option { color: #1a2e4f; background: #fff; }
.faktora-local-sel select:focus { outline: 0; box-shadow: none !important; }

/* ─── Botón paleta en mobile controls ──────────────────────────────────── */
.navbar-mobile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    color: inherit;
    font-size: 1rem;
    opacity: .8;
    text-decoration: none;
}
.navbar-mobile-icon:hover { opacity: 1; color: inherit; }

/* ─── Buscador global ───────────────────────────────────────────────────── */
#globalSearchWrap { padding: 0 .5rem; display: flex; align-items: center; }
#globalSearchWrap .position-relative { width: 100%; min-width: 260px; max-width: 380px; }
#globalSearch {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 999px;
    padding: 0 44px 0 18px;
    height: 38px;
    font-size: .85rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
    width: 100%;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
#globalSearch::placeholder { color: #94a3b8; }
#globalSearch:focus {
    background: #fff;
    border-color: #2a5298;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(42,82,152,0.15);
    color: #1e293b;
}
[data-bs-theme="dark"] #globalSearch {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] #globalSearch::placeholder { color: #64748b; }
[data-bs-theme="dark"] #globalSearch:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

#globalSearchWrap .btn-search {
    position: absolute;
    right: 4px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border: 0;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform .12s, box-shadow .15s;
    font-size: .8rem;
}
#globalSearchWrap .btn-search:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 2px 8px rgba(30,60,114,0.4);
}
[data-bs-theme="dark"] #globalSearchWrap .btn-search {
    background: linear-gradient(135deg, #2a5298, #3b82f6);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px); left: 0; right: 0;
    background: #fff;
    border: 1px solid #d1dae6;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-height: 70vh; overflow-y: auto;
    z-index: 1050;
    min-width: 380px;
}
[data-bs-theme="dark"] .search-results {
    background: #1e293b; border-color: #475569; color: #e2e8f0;
}
.search-group-title {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
    font-weight: 700;
    color: #64748b;
    padding: .55rem 1rem .25rem;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}
[data-bs-theme="dark"] .search-group-title {
    background: #0f172a; color: #94a3b8; border-bottom-color: #334155;
}
.search-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}
[data-bs-theme="dark"] .search-item { color: #e2e8f0; border-bottom-color: #334155; }
.search-item:hover, .search-item.active {
    background: #eef4ff; color: #1e3c72;
}
[data-bs-theme="dark"] .search-item:hover,
[data-bs-theme="dark"] .search-item.active {
    background: #2a3a5c; color: #fff;
}
.search-item .si-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.search-item .si-body { flex: 1; min-width: 0; }
.search-item .si-title { font-weight: 600; font-size: .88rem; }
.search-item .si-subtitle { font-size: .75rem; color: #64748b; }
[data-bs-theme="dark"] .search-item .si-subtitle { color: #94a3b8; }
.search-item .si-meta { font-size: .7rem; color: #94a3b8; flex-shrink: 0; }
.search-empty {
    padding: 1.5rem; text-align: center; color: #94a3b8; font-size: .85rem;
}
.search-loading { padding: 1rem; text-align: center; color: #64748b; font-size: .85rem; }
mark.search-hl { background: #fef3c7; color: #92400e; padding: 0 2px; border-radius: 2px; }
[data-bs-theme="dark"] mark.search-hl { background: #78350f; color: #fef3c7; }

/* ─── Select2 overrides ─────────────────────────────────────────────────── */
.select2-container--default .select2-selection--single {
    height: 38px;
    border-color: #ced4da;
    border-radius: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 10px;
    color: var(--bs-body-color);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0f766e;
}
.select2-dropdown { border-color: #ced4da; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.select2-search--dropdown .select2-search__field { border-radius: 4px; border-color: #ced4da; }
/* Dark mode Select2 */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background: #2d353c; border-color: #475569; color: #e2e8f0;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: #e2e8f0; }
[data-bs-theme="dark"] .select2-dropdown { background: #2d353c; border-color: #475569; color: #e2e8f0; }
[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field { background: #20252a; border-color: #475569; color: #e2e8f0; }
[data-bs-theme="dark"] .select2-container--default .select2-results__option { color: #e2e8f0; }
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted { background: #0f766e; }

/* ─── KPI cards (Home) ─────────────────────────────────────────────────── */
.kpi-card {
    position: relative;
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: transform .15s, box-shadow .15s;
    min-height: 130px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.kpi-primary { background: linear-gradient(135deg, #1e3c72, #2a5298); }
.kpi-success { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.kpi-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.kpi-info    { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-purple  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.kpi-card .kpi-icon {
    position: absolute;
    right: -10px; top: -10px;
    font-size: 5rem;
    opacity: 0.18;
    transform: rotate(-12deg);
    line-height: 1;
}
.kpi-card .kpi-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    opacity: 0.92;
}
.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: .25rem;
}
.kpi-card .kpi-foot {
    font-size: .78rem;
    opacity: 0.85;
    margin-top: .35rem;
    display: flex; align-items: center; gap: .35rem;
}
.kpi-card .kpi-foot a { color: #fff; text-decoration: none; opacity: 0.9; }
.kpi-card .kpi-foot a:hover { opacity: 1; text-decoration: underline; }

/* ─── Selector de local en sidebar móvil ───────────────────────────────── */
#sidebarLocalWrap select {
    background: transparent;
    border: 0;
    color: #e2e8f0;
    box-shadow: none;
}
#sidebarLocalWrap select option { color: #1a2e4f; background: #fff; }
#sidebarLocalWrap select:focus { outline: 0; box-shadow: none; }

/* ─── Controles móviles en navbar-header ──────────────────────────────── */
.navbar-mobile-controls {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* Menú con bordes: SmartAdmin lo maneja con .menu>.menu-item (selector nativo)
   porque los ítems ya son hijos directos de .menu (sin wrapper #sidebarNav). */

/* ─── Búsqueda en sidebar (solo móvil) ─────────────────────────────────── */
.faktora-sidebar-search {
    display: none;           /* oculta en desktop; se activa en ≤767px */
    padding: .6rem .75rem .5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.faktora-sidebar-search .form-control {
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 0 38px 0 14px;
    height: 36px;
    font-size: .83rem;
}
.faktora-sidebar-search .form-control::placeholder { color: rgba(255,255,255,0.4); }
.faktora-sidebar-search .form-control:focus {
    background: rgba(255,255,255,0.14);
    border-color: rgba(96,165,250,0.55);
    box-shadow: 0 0 0 3px rgba(96,165,250,0.1);
    color: #f1f5f9; outline: 0;
}
.btn-mobile-search {
    position: absolute;
    right: 4px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px;
    background: linear-gradient(135deg,#1e3c72,#2a5298);
    border: 0; color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; cursor: pointer;
}
/* Resultados flotantes (no empujan el menú) */
#mobileSearchResults {
    position: absolute !important;
    top: calc(100% + 4px); left: 0; right: 0;
    z-index: 1100;
    border-radius: 10px;
    max-height: 55vh;
    overflow-y: auto;
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
#mobileSearchResults .search-group-title { background:#0f172a; color:#94a3b8; border-bottom-color:#334155; }
#mobileSearchResults .search-item { color:#e2e8f0; border-bottom-color:#334155; }
#mobileSearchResults .search-item:hover,
#mobileSearchResults .search-item.active { background:#2a3a5c; color:#fff; }
#mobileSearchResults .search-item .si-subtitle { color:#94a3b8; }
#mobileSearchResults .search-empty { color:#94a3b8; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    #globalSearchWrap { padding: 0 .25rem; }
    #globalSearchWrap .position-relative { min-width: 200px; }
    #globalSearch { font-size: .8rem; padding: 0 38px 0 14px; }
}
@media (max-width: 767.98px) {
    /* Ocultar elementos del header que no caben en móvil */
    #globalSearchWrap,
    #btnTheme,
    #btnFullscreen,
    .navbar-user { display: none !important; }

    /* Mostrar controles móviles (avatar + tema + hamburger) */
    .navbar-mobile-controls { display: flex !important; }

    /* Mostrar búsqueda en sidebar */
    .faktora-sidebar-search { display: block !important; }

    /* Mostrar el selector de local en el sidebar */
    #sidebarLocalWrap { display: block !important; }

    /* KPI: ajuste en mobile */
    .kpi-card { min-height: 110px; padding: 1rem; }
    .kpi-card .kpi-value { font-size: 1.5rem; }
    .kpi-card .kpi-icon { font-size: 4rem; }

    /* Resultados de búsqueda full width */
    .search-results { left: 0; right: 0; min-width: 0; }
}

/* DataTables */
table.dataTable { width: 100% !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select { border-radius: 6px; }
div.dt-buttons { margin-bottom: .5rem; }

/* Padding por módulo */
.module-placeholder { padding: 1.5rem; }
.faktora-module { padding: 1.25rem; }
@media (max-width: 575.98px) { .faktora-module { padding: .75rem; } }

/* ─── Atajos de teclado: estilos kbd + hints en botones ────────────────── */
kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: .78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #1e293b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    border-radius: 4px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08);
}
[data-bs-theme="dark"] kbd {
    color: #e2e8f0; background: #1e293b; border-color: #475569;
}

/* Hint visible junto al label cuando atajos activos */
.faktora-kbd-on .btn[id^="btn"][id*="Crear"]::after {
    content: ' Alt+N';
    font-size: .68rem;
    opacity: .7;
    margin-left: .35rem;
    font-weight: 400;
    letter-spacing: .02em;
}
.faktora-kbd-on .modal .btn-primary[type="submit"]::after,
.faktora-kbd-on form .btn-primary[type="submit"]::after {
    content: ' Ctrl+G';
    font-size: .68rem;
    opacity: .7;
    margin-left: .35rem;
    font-weight: 400;
}

/* ─── UbigeoPicker ─────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .ubigeo-picker .form-select {
    background-color: #2d353c;
    border-color: #475569;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .ubigeo-picker .form-select:disabled {
    background-color: #1e252b;
    border-color: #334155;
    color: #64748b;
    opacity: 1;
}
.ubigeo-picker .ub-results {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    background: #fff;
    border: 1px solid #d1dae6;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    max-height: 280px; overflow-y: auto;
    z-index: 1060;
}
[data-bs-theme="dark"] .ubigeo-picker .ub-results { background: #1e293b; border-color: #475569; }
.ub-result-item {
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
[data-bs-theme="dark"] .ub-result-item { border-bottom-color: #334155; color: #e2e8f0; }
.ub-result-item:hover { background: #eef4ff; }
[data-bs-theme="dark"] .ub-result-item:hover { background: #2a3a5c; }
.ub-result-empty { padding: .75rem; color: #94a3b8; text-align: center; font-size: .85rem; }

/* Avatar circular con inicial */
.avatar-letter {
    width: 36px; height: 36px; flex-shrink: 0;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
}

/* Matriz de permisos: hover sutil */
#permMatriz tbody tr:hover { background: rgba(30,60,114,0.04); }
[data-bs-theme="dark"] #permMatriz tbody tr:hover { background: rgba(96,165,250,0.08); }

/* ─── Accesos de Rol: cajas rojo/verde + chips de acción ───────────────── */
.acc-box {
    border: 2px solid;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    min-height: 200px;
    display: flex; flex-direction: column;
}
.acc-box-red    { border-color: #ef4444; background: #fef2f2; }
.acc-box-green  { border-color: #10b981; background: #f0fdf4; }
[data-bs-theme="dark"] .acc-box-red   { background: rgba(239,68,68,0.10); }
[data-bs-theme="dark"] .acc-box-green { background: rgba(16,185,129,0.10); }

.acc-box-title {
    background: rgba(0,0,0,0.04);
    padding: .5rem .75rem;
    font-weight: 600; font-size: .85rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.acc-box-red   .acc-box-title { color: #b91c1c; }
.acc-box-green .acc-box-title { color: #047857; }
[data-bs-theme="dark"] .acc-box-red   .acc-box-title { color: #fca5a5; }
[data-bs-theme="dark"] .acc-box-green .acc-box-title { color: #6ee7b7; }

.acc-box-body {
    padding: .5rem;
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}
.acc-chip {
    border-radius: 999px !important;
    font-weight: 500;
}
.acc-chip:hover { transform: translateY(-1px); }

/* jstree theming */
.jstree-default { font-size: .88rem; }
.jstree-default .jstree-anchor { height: 26px; line-height: 26px; }
[data-bs-theme="dark"] .jstree-default .jstree-anchor { color: #e2e8f0; }
[data-bs-theme="dark"] .jstree-default .jstree-hovered,
[data-bs-theme="dark"] .jstree-default .jstree-clicked,
[data-bs-theme="dark"] .jstree-default .jstree-wholerow-hovered {
    background: rgba(96,165,250,0.15);
}
[data-bs-theme="dark"] .jstree-default .jstree-wholerow-clicked {
    background: rgba(96,165,250,0.25);
}

#loader.app-loader { display: none; }

/* ─── Sidebar: flex para que el botón de minify quede al fondo ──────────── */
.app-sidebar {
    display: flex !important;
    flex-direction: column;
}
.app-sidebar > .app-sidebar-content {
    flex: 1 1 0;
    min-height: 0;
}
/* Botón minify: pegado al borde derecho del sidebar (donde sidebar toca el contenido) */
.app-sidebar .app-sidebar-minify-btn {
    align-self: flex-end;
}

/* Cuando está minificado, dar espacio superior para no pegar al header */
.app-sidebar-minified:not(.app-without-sidebar) .app-sidebar:not(.app-sidebar-end) .app-sidebar-content > .menu {
    padding-top: 10px;
}

/* Ocultar widgets propios al minimizar (no cubiertos por SmartAdmin CSS nativo) */
.app-sidebar-minified:not(.app-without-sidebar) .app-sidebar:not(.app-sidebar-end) .faktora-sidebar-search,
.app-sidebar-minified:not(.app-without-sidebar) .app-sidebar:not(.app-sidebar-end) #sidebarLocalWrap {
    display: none !important;
}

/* ─── Panel de Ajustes de Apariencia ────────────────────────────────────── */
.app-settings-panel {
    position: fixed;
    top: 0; right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bs-body-bg, #fff);
    border-left: 1px solid var(--bs-border-color, #e2e8f0);
    box-shadow: -6px 0 30px rgba(0,0,0,0.12);
    z-index: 1200;
    display: flex; flex-direction: column;
    transition: right .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.app-settings-panel.open { right: 0; }

.app-settings-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1199;
}
.app-settings-backdrop.open { display: block; }

.asp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1rem;
    font-weight: 700; font-size: .95rem;
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
    flex-shrink: 0;
}
.asp-close {
    background: none; border: none; cursor: pointer;
    width: 30px; height: 30px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; font-size: .9rem;
    transition: background .15s;
}
.asp-close:hover { background: #f1f5f9; color: #1e293b; }
[data-bs-theme="dark"] .asp-close:hover { background: #334155; color: #f1f5f9; }

.asp-body {
    flex: 1; overflow-y: auto;
    padding: 1rem;
}

.asp-section-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #94a3b8;
    margin-bottom: .65rem;
}

/* Colores */
.asp-colors {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: .5rem;
}
.asp-color {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
    padding: 0;
}
.asp-color:hover { transform: scale(1.15); }
.asp-color.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px currentColor, 0 2px 8px rgba(0,0,0,0.25);
    transform: scale(1.1);
}

/* Divisor */
.asp-divider {
    border-top: 1px solid var(--bs-border-color, #e2e8f0);
    margin: .85rem 0;
}

/* Filas de toggles */
.asp-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem 0;
    gap: .75rem;
}
.asp-toggle-label { font-size: .88rem; font-weight: 500; }
.asp-toggle-desc  { font-size: .75rem; color: #94a3b8; margin-top: 1px; }
.asp-toggle-row .form-check-input { width: 2.2em; height: 1.15em; cursor: pointer; }

@media (max-width: 767.98px) {
    .app-settings-panel { width: 280px; right: -290px; }
}

/* ─── DataTables estándar Faktora ──────────────────────────────────────── */

/* Fila de búsqueda por columna en el encabezado */
thead tr.dt-search-row th {
    padding: 6px 8px;
    background: var(--app-component-bg, #fff);
    border-bottom: 2px solid rgba(0,0,0,0.08);
}
thead tr.dt-search-row th input.form-control {
    min-width: 60px;
    font-size: .8rem;
}
[data-bs-theme="dark"] thead tr.dt-search-row th {
    background: var(--app-component-bg, #1a2233);
}

/* Barra inferior: largo + info + paginación */
.faktora-dt-foot {
    font-size: .82rem;
}
.faktora-dt-foot .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: #64748b;
    font-weight: 400;
}
.faktora-dt-foot .dataTables_length select {
    border-radius: 6px;
    font-size: .8rem;
    height: 30px;
    padding: 0 24px 0 8px;
    min-width: 60px;
}
.faktora-dt-foot .dataTables_info { color: #64748b; }
.faktora-dt-foot .dataTables_paginate { display: flex; align-items: center; gap: 2px; }
.faktora-dt-foot .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: .8rem;
}
[data-bs-theme="dark"] .faktora-dt-foot .dataTables_length label,
[data-bs-theme="dark"] .faktora-dt-foot .dataTables_info { color: #94a3b8; }

/* ─── Fix Bootstrap modals en SmartAdmin ───────────────────────────────────
   .faktora-content tiene overflow-y:auto + position:relative, lo que forma
   un scroll-container que puede atrapar position:fixed en ciertos browsers.
   La solución real está en JS (hoistarModales): los .modal se mueven al
   <body> al cargar cada módulo, así position:fixed es relativo al viewport.
   Esta regla cubre además dropdowns custom (Select2) que deben aparecer
   por encima del modal (Bootstrap modal z-index = 1055).
   ────────────────────────────────────────────────────────────────────────── */
.select2-dropdown,
.select2-container--open .select2-dropdown {
    z-index: 1060 !important;
}
body.modal-open #app {
    transform: none !important;
    -webkit-transform: none !important;
}

/* ── jstree (módulos) ────────────────────────────────────────── */
#modTree                          { margin: 8px 0; }
#modTree .jstree-container-ul     { margin: 0; padding: 0; }
#modTree .jstree-node             { margin: 2px 0; }
#modTree .jstree-anchor           { padding: 5px 8px 5px 4px; font-size: 13px; line-height: 1.4; border-radius: 4px; }
#modTree .jstree-wholerow         { height: 30px; border-radius: 4px; }
#modTree .jstree-wholerow-hovered { background: rgba(0,0,0,.04); }
#modTree .jstree-wholerow-clicked { background: rgba(32,168,149,.12); }
#modTree .jstree-icon.fa          { font-size: 13px; width: 18px; text-align: center; }

/* ═══ Dashboard (pd-*) ═════════════════════════════════════════════════════
   Estilo sobrio tipo panel financiero: tarjetas blancas, borde fino, números
   grandes y color solo donde informa (verde = bien, rojo = mal).            */
.app-content { --pd-border: #e5e7eb; --pd-muted: #6b7280; --pd-text: #111827;
               --pd-pos: #0f9f6e; --pd-neg: #dc2626; --pd-warn: #d97706; --pd-accent: #14b8a6; }
[data-bs-theme="dark"] .app-content { --pd-border: #334155; --pd-muted: #94a3b8; --pd-text: #f1f5f9; }
[data-bs-theme="dark"] .pd-card, [data-bs-theme="dark"] .pd-monthnav { background: #2d353c; }

.pd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.pd-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin: 0; color: var(--pd-text); }
.pd-sub { margin: 2px 0 0; color: var(--pd-muted); font-size: .9rem; }
.pd-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.pd-monthnav { display: inline-flex; align-items: center; background: #fff;
               border: 1px solid var(--pd-border); border-radius: 8px; overflow: hidden; }
.pd-monthlabel { padding: 0 14px; font-weight: 600; font-size: .9rem; min-width: 128px; text-align: center; color: var(--pd-text); }
.pd-navbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
             color: var(--pd-muted); text-decoration: none; transition: background .15s, color .15s; }
a.pd-navbtn:hover { background: rgba(14,165,164,.1); color: var(--pd-accent); }
.pd-navbtn.disabled { opacity: .35; cursor: default; }

.pd-card { background: #fff; border: 1px solid var(--pd-border); border-radius: 12px;
           box-shadow: 0 1px 2px rgba(16,24,40,.04); }

/* Alertas */
.pd-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pd-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px;
            font-size: .875rem; border: 1px solid transparent; }
.pd-alert i { margin-top: 3px; }
.pd-alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.pd-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.pd-alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
[data-bs-theme="dark"] .pd-alert-danger  { background: rgba(220,38,38,.12);  border-color: rgba(220,38,38,.35);  color: #fca5a5; }
[data-bs-theme="dark"] .pd-alert-warning { background: rgba(217,119,6,.12);  border-color: rgba(217,119,6,.35);  color: #fcd34d; }
[data-bs-theme="dark"] .pd-alert-info    { background: rgba(37,99,235,.12);  border-color: rgba(37,99,235,.35);  color: #93c5fd; }

/* Indicadores */
.pd-kpi { display: block; padding: 18px 20px; height: 100%; text-decoration: none; color: inherit;
          transition: border-color .15s, box-shadow .15s, transform .15s; }
a.pd-kpi:hover { border-color: rgba(14,165,164,.55); box-shadow: 0 4px 14px rgba(16,24,40,.08); transform: translateY(-1px); color: inherit; }
.pd-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pd-kpi-label { font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--pd-muted); text-transform: uppercase; }
.pd-kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--pd-text);
                font-variant-numeric: tabular-nums; }
.pd-kpi-value.pd-neg { color: var(--pd-neg); }
.pd-kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: .8rem; min-height: 20px; }
.pd-chip { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; font-size: .85rem; }
.pd-chip-green  { background: rgba(15,159,110,.12); color: #0f9f6e; }
.pd-chip-red    { background: rgba(220,38,38,.1);   color: #dc2626; }
.pd-chip-blue   { background: rgba(37,99,235,.1);   color: #2563eb; }
.pd-chip-violet { background: rgba(99,102,241,.12); color: #6366f1; }
.pd-delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; padding: 1px 7px; border-radius: 20px; font-size: .75rem; }
.pd-delta.pd-up   { background: rgba(15,159,110,.12); color: var(--pd-pos); }
.pd-delta.pd-down { background: rgba(220,38,38,.1);   color: var(--pd-neg); }
.pd-delta i { font-size: .65rem; }
.pd-delta-vs { color: var(--pd-muted); }
.pd-pos { color: var(--pd-pos); } .pd-neg { color: var(--pd-neg); } .pd-warn { color: var(--pd-warn); }
.pd-muted { color: var(--pd-muted); }

/* Paneles */
.pd-panel { padding: 18px 20px; }
.pd-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pd-panel-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--pd-text); }
.pd-panel-sub { font-size: .8rem; color: var(--pd-muted); }
.pd-link { font-size: .8rem; font-weight: 600; color: var(--pd-accent); text-decoration: none; white-space: nowrap; }
.pd-link:hover { text-decoration: underline; }
.pd-link i { font-size: .65rem; margin-left: 2px; }

.pd-chart { position: relative; }
.pd-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
                  color: var(--pd-muted); font-size: .85rem; pointer-events: none; }

.pd-donut { position: relative; height: 190px; margin: 4px 0 14px; }
.pd-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pd-donut-center small { color: var(--pd-muted); font-size: .75rem; }
.pd-donut-center strong { font-size: 1.1rem; color: var(--pd-text); font-variant-numeric: tabular-nums; }
.pd-legend { list-style: none; margin: 0; padding: 0; }
.pd-legend li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--pd-border); font-size: .85rem; }
.pd-legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-legend-pct { color: var(--pd-muted); width: 38px; text-align: right; }
.pd-legend-amt { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.pd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; flex-shrink: 0; }
.pd-legend .pd-dot { margin-right: 0; }

.pd-empty { text-align: center; color: var(--pd-muted); padding: 28px 8px; }
.pd-empty i { font-size: 2rem; opacity: .35; margin-bottom: 10px; display: block; }
.pd-empty p { margin: 0; font-size: .875rem; }
.pd-empty-sm { padding: 10px 0 4px; }
.pd-empty a { color: var(--pd-accent); font-weight: 600; }

/* Tabla */
.pd-table { --bs-table-bg: transparent; font-size: .875rem; }
.pd-table thead th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--pd-muted);
                     border-bottom: 1px solid var(--pd-border); background: transparent; padding: 8px 10px; }
.pd-table tbody td { padding: 11px 10px; border-bottom: 1px solid var(--pd-border); }
.pd-table tbody tr:last-child td { border-bottom: 0; }
.pd-table tbody tr:hover td { background: rgba(100,116,139,.06); }
.pd-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-table td.pd-pos, .pd-table td.pd-neg { font-variant-numeric: tabular-nums; }

/* Barras de avance */
.pd-bar-row + .pd-bar-row { margin-top: 14px; }
.pd-bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; margin-bottom: 6px; }
.pd-bar-foot { font-size: .75rem; color: var(--pd-muted); margin-top: 4px; }
.pd-meter { flex: 1; min-width: 60px; height: 6px; border-radius: 6px; background: rgba(100,116,139,.18); overflow: hidden; }
.pd-meter > span { display: block; height: 100%; border-radius: 6px; background: var(--pd-accent); }
.pd-meter-ok > span { background: var(--pd-pos); }
.pd-meter-warning > span { background: #f59e0b; }
.pd-meter-danger > span { background: var(--pd-neg); }
.pd-kpi-foot .pd-meter { flex: 0 0 90px; }

/* Regla 50/30/20 y proyección */
.pd-stack { display: flex; height: 12px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.pd-stack span { display: block; height: 100%; }
.pd-rule { list-style: none; margin: 0 0 14px; padding: 0; }
.pd-rule li { display: flex; align-items: center; padding: 6px 0; font-size: .875rem; }
.pd-rule li span:nth-child(2) { flex: 1; }
.pd-compare, .pd-proj { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px;
                        padding-top: 14px; border-top: 1px solid var(--pd-border); }
.pd-proj { border-top: 0; padding-top: 0; margin-bottom: 14px; }
.pd-compare > div, .pd-proj > div { display: flex; flex-direction: column; gap: 2px; }
.pd-compare strong, .pd-proj strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--pd-text); }
.pd-compare strong.pd-pos { color: var(--pd-pos); }
.pd-compare strong.pd-neg { color: var(--pd-neg); }
.pd-compare strong.pd-warn { color: var(--pd-warn); }
.pd-compare span, .pd-proj span, .pd-compare small, .pd-proj small { font-size: .78rem; }
.pd-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: .85rem; }
.pd-note i { margin-top: 3px; }
.pd-note-ok   { background: rgba(15,159,110,.1); color: #0b7a55; }
.pd-note-warn { background: rgba(217,119,6,.1);  color: #92400e; }
[data-bs-theme="dark"] .pd-note-ok   { color: #6ee7b7; }
[data-bs-theme="dark"] .pd-note-warn { color: #fcd34d; }

@media (max-width: 575.98px) {
    .pd-title { font-size: 1.3rem; }
    .pd-head-actions { width: 100%; }
    .pd-monthnav { flex: 1; }
    .pd-monthlabel { flex: 1; min-width: 0; }
    .pd-kpi-value { font-size: 1.5rem; }
    .pd-panel { padding: 16px; }
}

/* Móvil: el encabezado es de una sola fila (51px); el template reserva 101px para una segunda fila que aquí no existe */
@media (max-width: 767.98px) {
    .app-header-fixed { padding-top: 51px; }
}
@media (max-width: 575.98px) {
    .pd-table thead th, .pd-table tbody td { padding-left: 6px; padding-right: 6px; }
    .pd-table { font-size: .82rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PACHAY — marca, contraste (WCAG AA 4.5:1), accesibilidad y diseño móvil
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Tipografía propia (se quitó el @import de Google Fonts: la pantalla no depende de un tercero) ─── */
:root, [data-bs-theme=light], [data-bs-theme=dark] {
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ─── Paleta con contraste suficiente ───────────────────────────────────────
   #00acac (turquesa de la plantilla) como texto sobre blanco da 2.8:1. Marca Platanota (9-nov-2026): verde petróleo #0f766e
   en botones (5.5:1 con texto blanco) y #115e59 en textos (7.6:1). #14b8a6 queda sólo para rellenos decorativos. */
:root, [data-bs-theme=light] {
    --bs-app-theme: #0f766e;
    --bs-app-theme-rgb: 15, 118, 110;
    --bs-app-theme-hover: #115e59;
    --bs-app-theme-hover-border-color: #115e59;
    --bs-app-theme-active: #115e59;
    --bs-app-theme-active-border-color: #115e59;
    --bs-success: #115e59;           --bs-success-rgb: 17, 94, 89;
    --bs-success-text-emphasis: #0b3b38;
    --bs-danger: #c62828;            --bs-danger-rgb: 198, 40, 40;
    --bs-danger-text-emphasis: #7f1d1d;
    --bs-primary: #1b64a8;           --bs-primary-rgb: 27, 100, 168;
    --bs-info: #1c7490;              --bs-info-rgb: 28, 116, 144;
    --bs-secondary-color: rgba(45, 53, 60, .78);
}
.app-content { --pd-muted: #5b6472; --pd-pos: #0b7a55; --pd-neg: #c62828; --pd-warn: #b45309; --pd-accent: #115e59; --pd-accent-fill: #14b8a6; }
.pd-meter:not(.pd-meter-ok):not(.pd-meter-warning):not(.pd-meter-danger) > span { background: var(--pd-accent-fill); }
.text-muted { color: #5b6472 !important; }
.text-warning { color: #8a5a00 !important; }
.btn-success { --bs-btn-bg: #115e59; --bs-btn-border-color: #115e59; --bs-btn-hover-bg: #134e4a; --bs-btn-hover-border-color: #134e4a;
               --bs-btn-active-bg: #134e4a; --bs-btn-active-border-color: #134e4a; --bs-btn-disabled-bg: #4d918b; --bs-btn-disabled-border-color: #4d918b; }
.btn-danger  { --bs-btn-bg: #c62828; --bs-btn-border-color: #c62828; --bs-btn-hover-bg: #a61e1e; --bs-btn-hover-border-color: #a61e1e;
               --bs-btn-active-bg: #a61e1e; --bs-btn-active-border-color: #a61e1e; }
.btn-primary { --bs-btn-bg: #1b64a8; --bs-btn-border-color: #1b64a8; --bs-btn-hover-bg: #15507f; --bs-btn-hover-border-color: #15507f;
               --bs-btn-active-bg: #15507f; --bs-btn-active-border-color: #15507f; }
.btn-warning { --bs-btn-color: #212529; --bs-btn-hover-color: #212529; --bs-btn-active-color: #212529; --bs-btn-disabled-color: #212529; }
.btn-outline-success { --bs-btn-color: #115e59; --bs-btn-border-color: #115e59; --bs-btn-hover-bg: #115e59; --bs-btn-hover-border-color: #115e59; }
.btn-outline-danger  { --bs-btn-color: #c62828; --bs-btn-border-color: #c62828; --bs-btn-hover-bg: #c62828; --bs-btn-hover-border-color: #c62828; }
.btn-outline-primary { --bs-btn-color: #1b64a8; --bs-btn-border-color: #1b64a8; --bs-btn-hover-bg: #1b64a8; --bs-btn-hover-border-color: #1b64a8; }
.badge.bg-success-subtle, .badge.bg-success-subtle.text-success { color: #115e59 !important; }
.badge.bg-danger-subtle,  .badge.bg-danger-subtle.text-danger  { color: #a61e1e !important; }
.text-success { color: #115e59 !important; }
.text-danger  { color: #c62828 !important; }
.faktora-avatar { background: #0f766e; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #0f766e; }

/* ─── Foco visible para teclado ─── */
:focus-visible { outline: 3px solid rgba(27, 100, 168, .65); outline-offset: 2px; }
.form-control:focus-visible, .form-select:focus-visible { outline: 0; }

/* Portada del login: la foto «respira», se acerca y se aleja muy despacio (solo la imagen; el texto y el formulario no se mueven).
   Se apaga si el sistema pide reducir movimiento. */
.login .news-feed { overflow: hidden; }
.login.login-with-news-feed .news-feed .news-image { background-position: center bottom; }   /* base; las tablets lo ajustan más abajo */
.login .news-feed .news-image {
    transform-origin: 55% 78%;               /* cerca de la isla y la flota */
    will-change: transform;
    animation: pachay-respira 26s ease-in-out infinite alternate;
}
@keyframes pachay-respira {
    from { transform: scale(1); }
    to   { transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
    .login .news-feed .news-image { animation: none; }
}

/* Tablet VERTICAL: la plantilla deja el panel como una columna de ~420px × alto completo y la foto se recorta sin mostrar la isla.
   Aquí el panel pasa a ser una franja superior de ancho completo (se ve la isla y la flota) y el formulario va debajo, centrado. */
@media (min-width: 768px) and (max-width: 1199.98px) and (orientation: portrait) {
    .login.login-with-news-feed .news-feed {
        position: relative; inset: auto; width: 100%; height: min(62vw, 620px);
    }
    .login.login-with-news-feed { background: var(--bs-component-bg); }
    .login.login-with-news-feed .news-feed .news-image { background-position: center 80%; }
    .login.login-with-news-feed .news-feed .news-caption { padding: 40px 40px 30px; }
    .login.login-with-news-feed .news-feed .news-caption p { display: none; }   /* en la franja solo el título; el texto largo taparía la isla */
    .login.login-with-news-feed .login-container {
        width: 100%; max-width: 580px; min-height: 0; margin-inline: auto; background: transparent; padding: 36px 45px 56px;
    }
}
/* Tablet horizontal / pantallas medianas: columna lateral, centrada hacia la cumbre de la isla (~58 % del ancho de la foto) */
@media (min-width: 768px) and (max-width: 1199.98px) and (orientation: landscape) {
    .login.login-with-news-feed .news-feed .news-image { background-position: 58% bottom; }
}

/* Crédito de la foto de portada (la licencia CC BY-SA exige mostrarlo) */
.pachay-foto-credito { position: absolute; right: 14px; bottom: 8px; z-index: 50; max-width: calc(100% - 28px); text-align: right;
                       font-size: .68rem; line-height: 1.3; color: rgba(255,255,255,.88); text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.pachay-foto-credito a { color: inherit; text-decoration: underline; }

/* ─── Marca ─── */
.pachay-brand { display: flex; align-items: center; gap: 8px; }
.pachay-brand b { font-weight: 700; letter-spacing: .01em; }
.pachay-brand-logo { border-radius: 7px; flex-shrink: 0; }
.pachay-brand-texto { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.pachay-brand-texto small { font-size: .68rem; font-weight: 500; opacity: .75; white-space: nowrap; }

/* Perfil del menú lateral: en escritorio el encabezado fijo (64px) tapa el arranque del bloque, así que el contenido
   se baja esa altura y queda centrado en la parte visible. En móvil el menú se abre por encima del encabezado (sin reserva). */
.app-sidebar .menu .menu-profile { --pachay-hdr: 0px; padding: 0; }
@media (min-width: 768px) { .app-sidebar .menu .menu-profile { --pachay-hdr: 64px; } }
.app-sidebar .menu .menu-profile .menu-profile-link { margin: 0; padding: calc(var(--pachay-hdr) + 16px) 20px 16px; display: flex; align-items: center; gap: 12px; }
.app-sidebar .menu .menu-profile .menu-profile-image { width: 40px; height: 40px; margin: 0; flex-shrink: 0; justify-content: center; background-color: rgba(255,255,255,.16); }
.app-sidebar .menu .menu-profile .menu-profile-image.menu-profile-image-icon i { margin: 0; font-size: 18px; }
.app-sidebar .menu .menu-profile .menu-profile-info { flex: 1; min-width: 0; line-height: 1.3; }
.app-sidebar .menu .menu-profile .menu-profile-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.app-sidebar .menu .menu-profile .menu-profile-info small { margin-bottom: 0; }
.app-sidebar .menu .menu-profile .menu-caret { flex-shrink: 0; position: relative; }

/* ─── Menú lateral con la marca: claro y oscuro ───────────────────────────────────────────────
   Tokens --pa-* por tema; el color de marca es el verde petróleo de Platanota (#0F766E → #134E4A). */
#sidebar.app-sidebar {
    --pa-bg: #ffffff; --pa-border: #e6ebf1; --pa-text: #475467; --pa-icon: #98a2b3;
    --pa-hover-bg: #f2f5f8; --pa-hover-text: #101828; --pa-act-bg: rgba(20,184,166,.12);
    --pa-act-text: #115e59; --pa-act-icon: #0d9488; --pa-head: #98a2b3; --pa-sub-line: #e4e9ef;
    --pa-perfil: linear-gradient(135deg, #115e59 0%, #0f766e 55%, #14b8a6 100%);
    --pa-velo: linear-gradient(100deg, rgba(19,78,74,.92) 0%, rgba(15,118,110,.6) 48%, rgba(13,148,136,.1) 100%);
    background: var(--pa-bg); border-right: 1px solid var(--pa-border);
}
[data-bs-theme="dark"] #sidebar.app-sidebar {
    --pa-bg: #161d22; --pa-border: rgba(255,255,255,.07); --pa-text: #aeb9c4; --pa-icon: #71808e;
    --pa-hover-bg: rgba(255,255,255,.05); --pa-hover-text: #ffffff; --pa-act-bg: rgba(45,212,191,.14);
    --pa-act-text: #5eead4; --pa-act-icon: #2dd4bf; --pa-head: #6b7a88; --pa-sub-line: rgba(255,255,255,.09);
    --pa-perfil: linear-gradient(135deg, #0b3b38 0%, #115e59 55%, #0f766e 100%);
    --pa-velo: linear-gradient(100deg, rgba(6,40,38,.94) 0%, rgba(11,59,56,.66) 48%, rgba(17,94,89,.18) 100%);
}
#sidebar.app-sidebar .menu .menu-profile { background: var(--pa-perfil); color: #fff; }
/* La foto de portada se conserva, con un velo de la marca para que el nombre se lea y combine en claro y oscuro */
/* Foto: el nevado Huascarán (Áncash), de dominio público (Wikimedia Commons), recortada a banner.
   Día (6:00–17:59): vista aérea de Patricio Mena Vásconez. Noche: cumbres al atardecer de Maurice Chédel.
   El script de main.php pone html[data-momento] según la hora del dispositivo. La portada empieza debajo del encabezado fijo. */
#sidebar.app-sidebar { --pa-foto: url("/huascaran-dia.jpg"); }
html[data-momento="noche"] #sidebar.app-sidebar { --pa-foto: url("/huascaran-noche.jpg"); }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-cover {
    top: var(--pachay-hdr);
    background-image: var(--pa-velo), var(--pa-foto);
    background-size: cover; background-position: center;
}
#sidebar.app-sidebar .menu .menu-profile .menu-profile-info { text-shadow: 0 1px 3px rgba(0,0,0,.45); }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-cover.with-shadow::before { display: none; }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-link { gap: 10px; padding-left: 16px; padding-right: 12px; }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-image { width: 38px; height: 38px; }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-info span {
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2;
}
#sidebar.app-sidebar .menu .menu-profile .menu-profile-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-link { color: #fff; }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-info small { color: rgba(255,255,255,.78); }
#sidebar.app-sidebar .menu .menu-profile .menu-profile-image { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
#sidebar.app-sidebar .menu .menu-profile .menu-caret { color: rgba(255,255,255,.9); filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }

#sidebar.app-sidebar .menu .menu-header {
    padding: 20px 24px 8px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pa-head);
}
#sidebar.app-sidebar .menu > .menu-item { padding: 0 12px; margin-bottom: 2px; }
#sidebar.app-sidebar .menu > .menu-profile + .collapse + .menu-item { margin-top: 12px; }   /* aire entre el perfil y el primer ítem (ya no hay título «Navegación») */
#sidebar.app-sidebar .menu .menu-item > .menu-link {
    position: relative; border-radius: 10px; color: var(--pa-text); font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
#sidebar.app-sidebar .menu .menu-item > .menu-link .menu-icon { color: var(--pa-icon); transition: color .15s ease; }
#sidebar.app-sidebar .menu .menu-item > .menu-link .menu-text { color: inherit; }
#sidebar.app-sidebar .menu .menu-item > .menu-link:hover { background: var(--pa-hover-bg); color: var(--pa-hover-text); }
#sidebar.app-sidebar .menu .menu-item > .menu-link:hover .menu-icon { color: var(--pa-act-icon); }
#sidebar.app-sidebar .menu .menu-item.active > .menu-link,
#sidebar.app-sidebar .menu .menu-item.active.expand > .menu-link { background: var(--pa-act-bg); color: var(--pa-act-text); font-weight: 600; }
#sidebar.app-sidebar .menu .menu-item.active > .menu-link .menu-icon { color: var(--pa-act-icon); }
#sidebar.app-sidebar .menu .menu-item.active > .menu-link::before {
    content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pa-act-icon);
}
#sidebar.app-sidebar .menu .menu-item > .menu-link:focus-visible { outline: 2px solid var(--pa-act-icon); outline-offset: -2px; }
#sidebar.app-sidebar .menu .menu-item.has-sub > .menu-link .menu-caret { color: var(--pa-icon); }
/* Submenús: una línea guía a la izquierda y sin fondo propio */
#sidebar.app-sidebar .menu .menu-submenu { background: transparent; margin: 2px 0 6px 22px; padding: 0 0 0 8px; border-left: 1px solid var(--pa-sub-line); }
#sidebar.app-sidebar .menu .menu-submenu .menu-item { padding: 0; margin-bottom: 1px; }
#sidebar.app-sidebar .menu .menu-submenu .menu-item::before,
#sidebar.app-sidebar .menu .menu-submenu .menu-item::after,
#sidebar.app-sidebar .menu .menu-submenu .menu-item > .menu-link::after { display: none; }   /* conectores de árbol del template */
#sidebar.app-sidebar .menu .menu-submenu .menu-item > .menu-link { font-size: .82rem; padding: 7px 12px; line-height: 1.3; }
#sidebar.app-sidebar .menu .menu-submenu .menu-item.active > .menu-link::before { display: none; }
#sidebar.app-sidebar .menu .menu-divider { background: var(--pa-border); height: 1px; margin: 8px 16px; }
#sidebar.app-sidebar .menu .pachay-menu-btn { border-radius: 10px; }
.login-header .brand b { font-size: 1.6rem; }
.pachay-skip { position: absolute; left: 8px; top: 8px; z-index: 20000; background: #fff; color: #115e59;
               padding: 8px 14px; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25); font-weight: 600; }
.pachay-menu-btn { background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }

/* ─── Botón flotante «+» (no tapa contenido: el contenido deja 96 px abajo) ─── */
.pachay-fab { position: fixed; z-index: 1050; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
              width: 52px; height: 52px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center;
              font-size: 1.4rem; text-decoration: none; background: linear-gradient(135deg, #0f766e, #115e59);
              box-shadow: 0 4px 16px rgba(17, 94, 89, .45); transition: transform .15s, box-shadow .15s; }
.pachay-fab:hover { color: #fff; transform: scale(1.06); }
@media (min-width: 768px) { .pachay-fab { right: 28px; bottom: 28px; } }

/* ─── Colores de categorías/etiquetas por variable (--c llega como #rrggbb desde la BD) ─── */
.etiqueta   { color: color-mix(in srgb, var(--c, #6c757d) 55%, #000); background: color-mix(in srgb, var(--c, #6c757d) 14%, #fff);
              border: 1px solid color-mix(in srgb, var(--c, #6c757d) 35%, #fff); font-weight: 600; }
.chip-cat   { color: color-mix(in srgb, var(--c, #6c757d) 55%, #000); background: color-mix(in srgb, var(--c, #6c757d) 14%, #fff); font-weight: 600; }
.cat-dot    { width: 28px; height: 28px; background: color-mix(in srgb, var(--c, #6c757d) 14%, #fff); color: var(--c, #6c757d); flex-shrink: 0; }
.cat-dot-lg { width: 36px; height: 36px; }
.etiqueta-check { cursor: pointer; border-color: var(--c, #6c757d) !important; background: color-mix(in srgb, var(--c, #6c757d) 10%, #fff); color: color-mix(in srgb, var(--c, #6c757d) 55%, #000); }
.meta-actual { color: color-mix(in srgb, var(--c, #348fe2) 60%, #000); }
.meta-proy   { background: #f4f6f8; border-left: 3px solid var(--c, #348fe2); }
.meta-abonar { background: color-mix(in srgb, var(--c, #348fe2) 10%, #fff); color: color-mix(in srgb, var(--c, #348fe2) 60%, #000);
               border: 1px solid color-mix(in srgb, var(--c, #348fe2) 35%, #fff); }
.recurrente-pausada { opacity: .72; }
.min-w-0 { min-width: 0; }

/* ─── Radios Egreso/Ingreso: ocultos a la vista pero alcanzables con Tab ─── */
.tipo-btn { position: relative; cursor: pointer; }
.pachay-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.tipo-btn:focus-within { outline: 3px solid rgba(27, 100, 168, .65); outline-offset: 2px; }

/* ─── Gráficos con alto propio (antes el de Reportes quedaba de 232×62 px en móvil) ─── */
.chart-box { position: relative; height: 320px; }
@media (max-width: 575.98px) { .chart-box { height: 300px; } }
.pd-chart-empty { position: static; min-height: 290px; }

/* ─── Textos largos nunca desbordan ─── */
.card, .card-body { min-width: 0; }
.text-break { overflow-wrap: anywhere; word-break: break-word; }

/* ─── Tablas: en móvil pasan a tarjetas apiladas (Monto y acciones siempre visibles) ─── */
.tabla-cards .c-acc { white-space: nowrap; }
@media (max-width: 767.98px) {
    .app-content { padding: 14px 14px 96px; }   /* margen a ambos lados: sin él las tarjetas se pegan a los bordes */
    body { font-size: .875rem; }

    .tabla-wrap.table-responsive { overflow: visible; }               /* el menú ⋯ no queda recortado */
    .tabla-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* sólo para lectores de pantalla */
    .tabla-cards, .tabla-cards tbody { display: block; width: 100%; }
    .tabla-cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px;
                      border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
    .tabla-cards tr:last-child { border-bottom: 0; }
    .tabla-cards td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; background: transparent !important; }
    .tabla-cards td.c-main  { order: 1; flex: 1 1 55%; min-width: 0; font-size: .95rem; }
    .tabla-cards td.c-monto { order: 2; margin-left: auto; font-size: 1rem; }
    .tabla-cards td.c-sub   { order: 3; }
    .tabla-cards td.c-acc   { order: 4; margin-left: auto; }
    .tabla-cards td.c-ocultar-movil { display: none !important; }
    .tabla-cards td.c-sub[data-etq]::before { content: attr(data-etq) ": "; color: #5b6472; }
    .tabla-cards td:not([class*="c-"]) { order: 5; flex: 1 1 100%; }
    .tabla-cards .c-email { overflow-wrap: anywhere; }
    .tabla-cards .c-desc  { display: block; }
    .tabla-cards td.c-acc:empty { display: none; }
    .tabla-cards form.d-inline { display: inline-flex; }
}
@media (min-width: 768px) { .tabla-cards .c-desc, .tabla-cards .c-email { display: none; } }

/* ─── Objetivos táctiles de al menos 44 px en móvil ─── */
.pachay-touch-icon, .pachay-touch-icon-sm { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 767.98px) {
    .btn:not(.btn-close):not(.navbar-mobile-toggler):not(.app-sidebar-minify-btn),
    .form-control, .form-select, .page-link, .dropdown-item { min-height: 44px; }
    .btn:not(.btn-close):not(.navbar-mobile-toggler) { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
    .btn-sm, .btn-xs { padding-top: .5rem; padding-bottom: .5rem; }
    .pachay-touch-icon, .pachay-touch-icon-sm { min-width: 44px; }
    .dropdown-item { display: flex; align-items: center; }
    .form-check-input { width: 1.25rem; height: 1.25rem; }
    .pagination .page-link { min-width: 44px; display: flex; align-items: center; justify-content: center; }

    /* Modales a casi pantalla completa */
    .modal-dialog { max-width: none; margin: .5rem; min-height: calc(100% - 1rem); }
    .modal-dialog.modal-dialog-centered { align-items: flex-start; }
    .modal-dialog-scrollable .modal-content { max-height: calc(100vh - 1rem); }
    .modal-content { border-radius: 12px; }
    .modal-footer { flex-wrap: wrap; gap: 8px; }
    .modal-footer > .btn { flex: 1 1 auto; }

    .page-header { font-size: 1.4rem; }
    .pd-head-actions { width: 100%; }
}

@media (max-width: 575.98px) {
    .pd-title { font-size: 1.3rem; }
    .alert { font-size: .85rem; }
}

/* Encabezado móvil: la marca no desborda */
@media (max-width: 767.98px) {
    .pachay-brand b { font-size: 1.1rem; }
    .app-header .navbar-brand { overflow: hidden; }
}

/* Dashboard: nombres largos de presupuestos/metas no desbordan la tarjeta */
.pd-bar-top > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pd-bar-top > .pd-muted { flex-shrink: 0; }
.pd-card { min-width: 0; }

/* El fondo claro llega hasta el pie aunque la página sea corta (403, listas vacías) */
#content.app-content { min-height: calc(100vh - 51px); }
@media (max-width: 767.98px) { .page-header::before, .page-header::after { display: none; } }

/* ─── Anotar rápido (ventana del botón +; public/anotar.js) ─── */
.ar-dialogo { max-width: 440px; }
.ar { --ar-c: #d6455d; --ar-suave: #fdecef; position: relative; border: 0; border-radius: 22px; overflow: hidden; background: var(--ar-suave); transition: background-color .3s; }
.ar[data-tipo="ingreso"] { --ar-c: #0f9d6b; --ar-suave: #e6f6ef; }
.ar-barra { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px; }
.ar-cerrar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #374151; font-size: 1.1rem; }
.ar-cerrar:hover { background: rgba(0, 0, 0, .06); }
.ar-titulo { font-weight: 600; font-size: 1.05rem; color: #1f2937; }
.ar-error { background: #fde2e4; color: #8a1c2b; border-radius: 99px; padding: 5px 12px; font-size: .85rem; font-weight: 600; max-width: 100%; }
.ar-cuerpo { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.ar-tipo { display: flex; background: #fff; border-radius: 99px; padding: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ar-tipo-btn { flex: 1; height: 40px; border: 0; border-radius: 99px; background: transparent; color: #6b7280; font-weight: 700; transition: background-color .2s, color .2s; }
.ar-tipo-btn.on { background: var(--ar-c); color: #fff; }
.ar-monto { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0; color: var(--ar-c); cursor: text; }
.ar-sol { font-size: 2rem; font-weight: 800; }
.ar-monto input { field-sizing: content; min-width: 1ch; max-width: 230px; border: 0; background: transparent; outline: 0; color: inherit; font-size: 3.4rem; font-weight: 800; line-height: 1.1; text-align: left; padding: 0; min-width: 0; }
.ar-monto input::placeholder { color: var(--ar-c); opacity: .35; }
.ar-seccion { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-ficha { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 12px; border: 1px solid #d5dbe3; border-radius: 14px; background: #fff; color: #1f2937; font-size: .85rem; }
.ar-ficha i { color: var(--c, #6c757d); }
.ar-ficha span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-ficha.on { border: 2px solid #115e59; padding: 7px 11px; background: #ccfbf1; font-weight: 700; }
.ar-otra { color: #115e59; font-weight: 600; }
.ar-vacio { margin: 0; font-size: .85rem; color: #6b7280; }
/* «Otra…»: buscador de categorías (public/anotar.js). Con él abierto, las fichas van en varias filas con su propio scroll */
.ar-seccion.ar-todas { display: block; }
.ar-buscar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 2px solid #115e59; border-radius: 14px; background: #fff; }
.ar-buscar > i { color: #64748b; }
.ar-buscar input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: #1f2937; font-size: 1rem; padding: 4px 0; }
.ar-buscar-cerrar { flex-shrink: 0; border: 0; background: transparent; color: #115e59; font-weight: 600; font-size: .85rem; padding: 6px 8px; border-radius: 10px; }
.ar-buscar-cerrar:focus-visible { outline: 2px solid #115e59; }
.ar-lista { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-height: 210px; overflow-y: auto; padding: 2px; }
.ar-origen { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-pill { height: 36px; padding: 0 16px; border: 1px solid #d5dbe3; border-radius: 99px; background: #fff; color: #1f2937; font-size: .85rem; font-weight: 500; }
.ar-pill.on { border: 2px solid #115e59; padding: 0 15px; background: #ccfbf1; font-weight: 700; }
.ar-desc { height: 44px; border: 0; border-radius: 14px; padding: 0 14px; background: #fff; font-size: .9rem; outline: 0; }
.ar-desc:focus, .ar-ficha:focus-visible, .ar-pill:focus-visible, .ar-tipo-btn:focus-visible { outline: 2px solid #115e59; outline-offset: 1px; }
.ar-teclado { display: none; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ar-teclado button { height: 54px; border: 0; border-radius: 14px; background: #fff; font-size: 1.5rem; font-weight: 600; color: #1f2937; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.ar-teclado button:active { background: #e5e7eb; }
@media (pointer: coarse) { .ar-teclado { display: grid; } }
.ar-pie { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.ar-guardar { width: 100%; height: 52px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; font-size: 1.05rem; font-weight: 700; }
.ar-guardar:disabled { opacity: .6; }
.ar-ok { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, .92); animation: ar-ok .22s ease-out; }
.ar-ok[hidden] { display: none; }
.ar-ok-check { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; font-size: 2.6rem; font-weight: 800; }
.ar-ok b { font-size: 1.25rem; } .ar-ok small { color: #6b7280; }
@keyframes ar-ok { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 575.98px) { .ar-monto input { font-size: 3rem; } }
@media (prefers-reduced-motion: reduce) { .ar, .ar-tipo-btn { transition: none; } .ar-ok { animation: none; } }

.ar-mas { align-self: flex-start; border: 0; background: transparent; padding: 4px 2px; color: #115e59; font-size: .85rem; font-weight: 600; }
.ar-flecha { font-size: .7rem; margin-left: 4px; transition: transform .2s; }
.ar-mas.abierto .ar-flecha { transform: rotate(180deg); }
.ar-extra { display: flex; flex-direction: column; gap: 10px; }
.ar-extra[hidden] { display: none; }
.ar-campo { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; font-weight: 600; color: #374151; }
.ar-campo small { font-weight: 400; color: #6b7280; }
.ar-campo input[type="date"] { height: 44px; border: 0; border-radius: 14px; padding: 0 14px; background: #fff; font-size: .9rem; font-weight: 400; outline: 0; }
.ar-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-etiquetas:empty { display: none; }
.ar-tag { padding: 4px 12px; border: 1px solid var(--c, #6c757d); border-radius: 99px; background: #fff; color: color-mix(in srgb, var(--c, #6c757d) 55%, #000); font-size: .8rem; }
.ar-tag.on { background: var(--c, #6c757d); color: #fff; font-weight: 700; }
.ar-cuerpo { max-height: calc(100vh - 200px); overflow-y: auto; }
.ar-cuerpo > * { flex-shrink: 0; }
/* Pantallas angostas o táctiles: categorías y origen en una sola fila que se desliza, para que el teclado numérico quepa sin scroll */
@media (pointer: coarse), (max-width: 575.98px) {
    .ar-seccion, .ar-origen { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
    .ar-seccion::-webkit-scrollbar, .ar-origen::-webkit-scrollbar { display: none; }
    .ar-ficha, .ar-pill { flex-shrink: 0; white-space: nowrap; }
    .ar-seccion.ar-todas { margin: 0; padding: 0; overflow: visible; }
    .ar-lista .ar-ficha { flex-shrink: 1; }
    .ar-teclado button { height: 46px; }
    .ar-cuerpo { gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Buscador de opciones (lupa del encabezado + Ctrl+K) — public/buscador.js
   Las ayudas de teclado (Ctrl K, ↑ ↓, Enter, Esc) sólo se ven en PC con mouse y teclado; el móvil queda limpio.
   ═══════════════════════════════════════════════════════════════════════════ */
.bq-boton { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 38px; height: 38px; padding: 0;
            background: transparent; border: 0; border-radius: 50%; color: inherit; font-size: 1rem; cursor: pointer; }
.bq-boton:hover { background: rgba(127,127,127,.14); }
.bq-boton:focus-visible { outline: 2px solid var(--bs-app-theme, #0f766e); outline-offset: 2px; }
.bq-atajos { display: none; }

.bq { position: fixed; inset: 0; z-index: 12000; display: flex; align-items: flex-start; justify-content: center;
      padding: 12vh 16px 16px; background: rgba(15,23,42,.5); }
.bq[hidden] { display: none; }
html.bq-abierto { overflow: hidden; }
.bq-caja { width: 100%; max-width: 600px; max-height: 76vh; display: flex; flex-direction: column; overflow: hidden;
           background: #fff; color: #1f2937;
           border: 1px solid #d9dee5; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.bq-cabeza { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem .35rem 1rem; border-bottom: 1px solid #e5e7eb; }
.bq-lupa { color: #5b6472; font-size: 1rem; }
.bq-campo { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: inherit; font-size: 1rem; outline: 0; box-shadow: none; -webkit-appearance: none; appearance: none; }
.bq-campo::-webkit-search-cancel-button { display: none; }
.bq-campo::placeholder { color: #6b7280; }
.bq-cerrar { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #5b6472; font-size: 1rem; cursor: pointer; }
.bq-cerrar:hover { background: rgba(127,127,127,.15); }
.bq-lista { list-style: none; margin: 0; padding: .35rem; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.bq-lista li { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 10px; cursor: pointer; min-height: 52px; }
.bq-lista li[aria-selected="true"] { background: rgba(15, 118, 110,.12); }
.bq-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(15, 118, 110,.12); color: var(--bs-app-theme, #0f766e); font-size: .9rem; }
.bq-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bq-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-txt small { color: #5b6472; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-ir { flex: none; color: #8a93a0; font-size: .7rem; }
.bq-vacio { padding: 2rem 1rem; text-align: center; color: #5b6472; }
.bq-vacio i { display: block; font-size: 1.6rem; margin-bottom: .5rem; opacity: .5; }
.bq-pie { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid #e5e7eb; font-size: .78rem; color: #5b6472; }
[data-bs-theme="dark"] .bq { background: rgba(0,0,0,.6); }
[data-bs-theme="dark"] .bq-caja { background: #1e293b; color: #e2e8f0; border-color: #334155; }
[data-bs-theme="dark"] .bq-cabeza, [data-bs-theme="dark"] .bq-pie { border-color: #334155; }
[data-bs-theme="dark"] .bq-lupa, [data-bs-theme="dark"] .bq-cerrar, [data-bs-theme="dark"] .bq-txt small,
[data-bs-theme="dark"] .bq-vacio, [data-bs-theme="dark"] .bq-pie { color: #a7b0bd; }
[data-bs-theme="dark"] .bq-ico, [data-bs-theme="dark"] .bq-lista li[aria-selected="true"] { background: rgba(14,165,164,.2); }
[data-bs-theme="dark"] .bq-ico { color: #5eead4; }

/* PC con mouse y teclado: la guía de flechas / Esc dentro de la ventana; el ✕ sobra porque Esc cierra. El botón del encabezado es sólo la lupa */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .bq-atajos { display: inline-flex; align-items: center; gap: .25rem; }
    .bq-atajos kbd { padding: .05rem .4rem; border: 1px solid rgba(127,127,127,.4); border-bottom-width: 2px; border-radius: 5px;
                              background: rgba(127,127,127,.1); color: inherit; font: inherit; font-size: .72rem; }
    .bq-cerrar { display: none; }
    .bq-cabeza { padding-right: 1rem; }
}
/* Móvil: hoja a pantalla casi completa, objetivos táctiles grandes, sin pie de teclado */
@media (max-width: 767.98px), (hover: none), (pointer: coarse) {
    .bq { padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px; }
    .bq-caja { max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 16px); border-radius: 14px; }
    .bq-campo { font-size: 16px; }              /* 16px evita el zoom automático de iOS al enfocar */
    .bq-lista li { min-height: 56px; }
    .bq-pie { padding: .4rem 1rem calc(.4rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
    .bq:not([hidden]) .bq-caja { animation: bq-entra .12s ease-out; }
    @keyframes bq-entra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* Buscador en el encabezado: PC/tablet en .navbar-nav (derecha); móvil junto a la hamburguesa (el .navbar-nav no se ve en móvil) */
.bq-boton-movil { display: none; }
@media (max-width: 767.98px) {
    .navbar-buscar { display: none !important; }
    .bq-boton-movil { display: inline-flex; width: 44px; height: 44px; margin-left: auto; font-size: 1.1rem; }
}

/* Móvil: el contenedor interno ya no suma su propio margen al de la pantalla (quedaba ~29px a cada lado) */
@media (max-width: 767.98px) { .app-content > .container-fluid { padding-left: 0 !important; padding-right: 0 !important; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Diseño móvil (≤ 767px): indicadores compactos, hojas inferiores, menú lateral y encabezados más cómodos
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Encabezado: una línea sutil de sombra para separarlo del contenido */
    .app-header { box-shadow: 0 1px 6px rgba(16,24,40,.08); }

    /* Títulos de pantalla: más sobrios y con aire */
    .page-header, .pd-title { font-weight: 700; letter-spacing: -.01em; }
    .app-content .container-fluid > .d-flex.pt-3 { padding-top: .25rem !important; }
    .pachay-acciones-hdr { width: 100%; }
    .pachay-acciones-hdr > .btn { flex: 1 1 0; }

    /* Tarjetas: esquinas y sombra suaves, sin bordes pesados */
    .app-content .card { border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }

    /* Menú lateral: filas más altas para el dedo y sombra al abrirse */
    .app-sidebar .menu .menu-item > .menu-link { padding-top: .8rem; padding-bottom: .8rem; font-size: .95rem; }
    .app-sidebar .menu-submenu .menu-item > .menu-link { padding-top: .7rem; padding-bottom: .7rem; }
    .app-sidebar-mobile-toggled .app-sidebar { box-shadow: 8px 0 30px rgba(0,0,0,.35); }

    /* Botón «Filtros» plegable: claro, no un bloque gris pesado */
    [data-bs-target="#filtrosTx"] { background: #f3f5f8; border-color: #dfe3e8; color: #374151; font-weight: 600; }
    [data-bs-target="#filtrosTx"][aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
    [data-bs-target="#filtrosTx"] .fa-chevron-down { transition: transform .2s; }

    /* Campos a 16px: iOS no hace zoom al enfocarlos */
    .form-control, .form-select { font-size: 16px; }

    /* Ventanas (modales) como hoja que sube desde abajo; «Anotar rápido» conserva su diseño propio */
    .modal:not(#modalAnotar) .modal-dialog { margin: 0; max-width: none; width: 100%; min-height: 100%; display: flex; align-items: flex-end; }
    .modal:not(#modalAnotar).fade .modal-dialog { transform: translateY(40px); }
    .modal:not(#modalAnotar).show .modal-dialog { transform: none; }
    .modal:not(#modalAnotar) .modal-content { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; border: 0;
                                              padding-bottom: env(safe-area-inset-bottom, 0px); }
    .modal:not(#modalAnotar) .modal-body { overflow-y: auto; }
    .modal:not(#modalAnotar) .modal-header { position: relative; padding-top: 1.1rem; }
    .modal:not(#modalAnotar) .modal-header::before { content: ""; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px;
                                                     border-radius: 4px; background: rgba(127,127,127,.35); }
}

/* Teléfonos: indicadores del escritorio, de Transacciones y de Reportes en dos columnas, compactos */
@media (max-width: 575.98px) {
    .pd-kpi { padding: 12px 12px 10px; }
    .pd-kpi-top { margin-bottom: 6px; }
    .pd-kpi-label { font-size: .68rem; letter-spacing: .01em; }
    .pd-kpi-top > span:last-child, .pd-kpi-top > .pd-kpi-ico { transform: scale(.8); transform-origin: right center; }
    .pd-kpi-value { font-size: 1.2rem; }
    .pd-kpi-foot { margin-top: 6px; font-size: .7rem; min-height: 0; gap: 4px; }
    .pd-kpi-foot .pd-meter { flex-basis: 48px; }
    .pd-delta-vs { font-size: .7rem; }
    .app-content .row.g-3 { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
    .app-content .fs-24px { font-size: 1.2rem !important; }
    .app-content .fs-20px { font-size: 1.1rem !important; }
}
@media (max-width: 767.98px) { .form-select-sm { padding-left: .6rem; padding-right: 1.9rem; background-position: right .55rem center; } }

/* Botón de tema claro/oscuro: sólo en web; muestra la luna en claro y el sol en oscuro */
.tema-sol { display: none; }
[data-bs-theme="dark"] .tema-luna { display: none; }
[data-bs-theme="dark"] .tema-sol { display: inline; }
@media (max-width: 767.98px) { .navbar-tema { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Tema oscuro (botón del encabezado, sólo web): contraste de textos, insignias, tablas y paneles
   ═══════════════════════════════════════════════════════════════════════════ */
[data-bs-theme="dark"] .app-content { --pd-muted: #9aa7b8; --pd-pos: #34d399; --pd-neg: #f87171; --pd-warn: #fbbf24; --pd-accent: #2dd4bf; }
[data-bs-theme="dark"] .text-muted { color: #9aa7b8 !important; }
[data-bs-theme="dark"] .text-success, [data-bs-theme="dark"] .text-theme { color: #2dd4bf !important; }
[data-bs-theme="dark"] .text-danger { color: #f87171 !important; }
[data-bs-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-bs-theme="dark"] .badge.bg-success-subtle, [data-bs-theme="dark"] .badge.bg-success-subtle.text-success { background-color: rgba(45,212,191,.16) !important; color: #5eead4 !important; }
[data-bs-theme="dark"] .badge.bg-danger-subtle,  [data-bs-theme="dark"] .badge.bg-danger-subtle.text-danger  { background-color: rgba(248,113,113,.16) !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .table-light, [data-bs-theme="dark"] .table-light > :is(tr, th, td),
[data-bs-theme="dark"] thead.table-light th, [data-bs-theme="dark"] tfoot.table-light td, [data-bs-theme="dark"] tfoot.table-light th {
    --bs-table-bg: #273241; --bs-table-color: #e2e8f0; --bs-table-border-color: #334155;
    background-color: #273241 !important; color: #e2e8f0 !important; border-color: #334155 !important; }
[data-bs-theme="dark"] .card, [data-bs-theme="dark"] .pd-card, [data-bs-theme="dark"] .pd-panel { box-shadow: none; }
[data-bs-theme="dark"] .app-header { box-shadow: 0 1px 0 rgba(255,255,255,.06); }
@media (max-width: 767.98px) {
    [data-bs-theme="dark"] [data-bs-target="#filtrosTx"] { background: #273241; border-color: #334155; color: #e2e8f0; }
}

/* «Anotar rápido» en tema oscuro: fondo teñido según el tipo y fichas en azul pizarra */
[data-bs-theme="dark"] .ar { --ar-c: #f87171; --ar-suave: #34202a; }
[data-bs-theme="dark"] .ar[data-tipo="ingreso"] { --ar-c: #34d399; --ar-suave: #15302a; }
[data-bs-theme="dark"] .ar-cerrar { color: #e2e8f0; }
[data-bs-theme="dark"] .ar-cerrar:hover { background: rgba(255,255,255,.1); }
[data-bs-theme="dark"] .ar-titulo { color: #f1f5f9; }
[data-bs-theme="dark"] .ar-error { background: #5a1f2a; color: #fecdd3; }
[data-bs-theme="dark"] .ar-tipo, [data-bs-theme="dark"] .ar-desc, [data-bs-theme="dark"] .ar-campo input[type="date"],
[data-bs-theme="dark"] .ar-teclado button { background: #273241; color: #e2e8f0; box-shadow: none; }
[data-bs-theme="dark"] .ar-teclado button:active { background: #334155; }
[data-bs-theme="dark"] .ar-tipo-btn { color: #9aa7b8; }
[data-bs-theme="dark"] .ar-tipo-btn.on { color: #fff; background: var(--ar-c); }
[data-bs-theme="dark"] .ar[data-tipo="egreso"] .ar-tipo-btn.on { background: #d6455d; }
[data-bs-theme="dark"] .ar[data-tipo="ingreso"] .ar-tipo-btn.on { background: #0f9d6b; }
[data-bs-theme="dark"] .ar-ficha, [data-bs-theme="dark"] .ar-pill, [data-bs-theme="dark"] .ar-tag { background: #273241; border-color: #3b475a; color: #e2e8f0; }
[data-bs-theme="dark"] .ar-ficha.on, [data-bs-theme="dark"] .ar-pill.on { background: rgba(45,212,191,.2); border-color: #2dd4bf; color: #fff; }
[data-bs-theme="dark"] .ar-tag { color: #e2e8f0; }
[data-bs-theme="dark"] .ar-tag.on { color: #fff; }
[data-bs-theme="dark"] .ar-otra, [data-bs-theme="dark"] .ar-mas { color: #5eead4; }
[data-bs-theme="dark"] .ar-buscar { background: #1b2430; border-color: #2dd4bf; }
[data-bs-theme="dark"] .ar-buscar input { color: #f1f5f9; }
[data-bs-theme="dark"] .ar-buscar input::placeholder, [data-bs-theme="dark"] .ar-buscar > i { color: #8391a5; }
[data-bs-theme="dark"] .ar-buscar-cerrar { color: #5eead4; }
[data-bs-theme="dark"] .ar-vacio, [data-bs-theme="dark"] .ar-campo small, [data-bs-theme="dark"] .ar-ok small { color: #9aa7b8; }
[data-bs-theme="dark"] .ar-campo { color: #cbd5e1; }
[data-bs-theme="dark"] .ar-desc::placeholder { color: #8391a5; }
[data-bs-theme="dark"] .ar-desc:focus, [data-bs-theme="dark"] .ar-ficha:focus-visible, [data-bs-theme="dark"] .ar-pill:focus-visible, [data-bs-theme="dark"] .ar-tipo-btn:focus-visible { outline-color: #2dd4bf; }
[data-bs-theme="dark"] .ar-ok { background: rgba(21,32,44,.94); color: #f1f5f9; }
[data-bs-theme="dark"] .ar-campo input[type="date"] { color-scheme: dark; }
[data-bs-theme="dark"] .ar-ficha i { filter: brightness(1.8); }   /* íconos de categoría oscuros (p. ej. Compras) se pierden sobre el fondo */

/* ─── Ventanas (modales) con <form> envolviendo cabecera, cuerpo y pie ──────
   Con modal-dialog-scrollable, Bootstrap solo hace scroll del cuerpo si es hijo directo de
   .modal-content; con el <form> en medio el pie quedaba cortado y no se podía guardar.
   El form pasa a ser la columna flexible: el cuerpo se desplaza y el pie siempre se ve. */
.modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; }
.modal-content > form > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-content > form > .modal-header,
.modal-content > form > .modal-footer { flex: 0 0 auto; }
.modal-dialog-scrollable .modal-content { max-height: 100%; }
/* Recordatorio del atajo en el botón de guardar de la ventana */
.modal-footer [type="submit"]:not(.btn-danger)::after {
    content: "Ctrl+S"; font-size: .68rem; opacity: .75; margin-left: .45rem; font-weight: 400; letter-spacing: .02em;
}
@media (hover: none), (max-width: 767.98px) { .modal-footer [type="submit"]::after { content: none; } }

/* ─── Contraste (pruebas P1, 08-nov-2026): textos ≥ 4,5:1 en tema claro y oscuro ─── */
.btn-info { --bs-btn-color: #0b1f33; --bs-btn-hover-color: #0b1f33; --bs-btn-active-color: #0b1f33; --bs-btn-disabled-color: #0b1f33; }
.pagination { --bs-pagination-active-bg: #1b64a8; --bs-pagination-active-border-color: #1b64a8; --bs-pagination-active-color: #fff; }
code { color: #b0194f; }
[data-bs-theme="dark"] code { color: #f9a8d4; }
[data-bs-theme="dark"] .badge.bg-secondary-subtle { background-color: #334155 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #cbd5e1; --bs-btn-border-color: #64748b; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #475569; --bs-btn-hover-border-color: #64748b;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #475569; --bs-btn-active-border-color: #64748b; --bs-btn-disabled-color: #94a3b8; --bs-btn-disabled-border-color: #475569;
}
[data-bs-theme="dark"] .btn-outline-success {
    --bs-btn-color: #5eead4; --bs-btn-border-color: #2dd4bf; --bs-btn-hover-color: #042f2e; --bs-btn-hover-bg: #2dd4bf; --bs-btn-hover-border-color: #2dd4bf;
    --bs-btn-active-color: #042f2e; --bs-btn-active-bg: #2dd4bf; --bs-btn-active-border-color: #2dd4bf;
}
[data-bs-theme="dark"] .meta-proy { background: rgba(255, 255, 255, .07); color: #e2e8f0; }
[data-bs-theme="dark"] .meta-actual { color: color-mix(in srgb, var(--c, #348fe2) 55%, #fff); }
[data-bs-theme="dark"] .meta-abonar { background: color-mix(in srgb, var(--c, #348fe2) 18%, transparent); color: color-mix(in srgb, var(--c, #348fe2) 40%, #fff);
                                       border-color: color-mix(in srgb, var(--c, #348fe2) 50%, transparent); }
[data-bs-theme="dark"] .app-content { --pd-neg: #f87171; --pd-pos: #34d399; }
[data-bs-theme="dark"] .pd-delta.pd-down { background: rgba(248, 113, 113, .14); color: #fecaca; }
[data-bs-theme="dark"] .pd-delta.pd-up   { background: rgba(52, 211, 153, .14);  color: #a7f3d0; }

/* ─── Botón «contraer menú»: quedaba tapado por el contenido del menú (absolute) y no se podía pulsar (pruebas P1) ─── */
.app-sidebar .app-sidebar-minify-btn { position: relative; z-index: 5; margin-top: auto; margin-bottom: 14px; }

/* ─── Foco visible en enlaces del encabezado y del menú (antes sin indicador al navegar con Tab) ─── */
.navbar-brand:focus-visible, .navbar-link:focus-visible, .menu-profile-link:focus-visible, .menu-link:focus-visible,
.app-sidebar-minify-btn:focus-visible, .navbar-mobile-toggler:focus-visible {
    outline: 3px solid #5eead4; outline-offset: -3px; border-radius: 8px;
}

/* ─── Nombres largos de categoría/etiqueta: se parten en vez de ensanchar la página en el móvil (pruebas P1) ─── */
.badge.chip-cat, .chip-cat, .badge.etiqueta, .etiqueta { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.badge.bg-secondary-subtle.text-secondary { color: #495057 !important; }
[data-bs-theme="dark"] .badge.bg-secondary-subtle.text-secondary { color: #e2e8f0 !important; }

/* ═══ Cuentas con saldo (views/cuentas/index.php, public/cuentas.js) ═══════════════════════════════════════════════
   Una tarjeta por cuenta: ícono del tipo, nombre, chips y el saldo grande (verde = tiene, rojo = debe). */
.pcta { --cta-pos: #0b7a55; --cta-neg: #c62828; }
.cta-pos { color: var(--cta-pos); } .cta-neg { color: var(--cta-neg); }
.cta-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 16px 20px; }
.cta-total-tit { font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--pd-muted); }
.cta-total-montos { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cta-total-monto { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cta-sep { font-size: 1.4rem; color: var(--pd-muted); }
.cta-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 16px 18px; }
.cta-cab { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cta-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #e6f4f3; font-size: 1.5rem; line-height: 1; }
.cta-nom { min-width: 0; }
.cta-nombre { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--pd-text); overflow-wrap: anywhere; }
.cta-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cta-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; background: #eef2f6; color: #374151; font-size: .72rem; font-weight: 600; }
.cta-chip-bill { background: #ede9fe; color: #5b21b6; }
.cta-chip-mon  { background: #e0f2fe; color: #075985; }
.cta-chip-arch { background: #fef3c7; color: #92400e; }
.cta-saldo { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cta-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.cta-acciones .btn { white-space: nowrap; }
.cta-archivada { opacity: .78; border-style: dashed; }
.cta-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-op { position: relative; margin: 0; cursor: pointer; }
.cta-op input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cta-op > span { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px; border: 1px solid #d5dbe3; border-radius: 99px;
                 background: #fff; color: #1f2937; font-size: .9rem; font-weight: 500; }
.cta-op input:checked + span { border: 2px solid #115e59; padding: 0 13px; background: #ccfbf1; font-weight: 700; }
.cta-op input:focus-visible + span { outline: 2px solid #115e59; outline-offset: 2px; }
.cta-op input:disabled + span { opacity: .55; cursor: not-allowed; }
.cta-aviso-bill { padding: 8px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
@media (max-width: 575.98px) {
    .cta-total-monto { font-size: 1.45rem; }
    .cta-saldo { font-size: 1.65rem; }
    .cta-acciones .btn { flex: 1 1 auto; }
}
[data-bs-theme="dark"] .pcta { --cta-pos: #34d399; --cta-neg: #f87171; }
[data-bs-theme="dark"] .cta-ico { background: rgba(45, 212, 191, .14); }
[data-bs-theme="dark"] .cta-chip { background: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .cta-chip-bill { background: rgba(167, 139, 250, .2); color: #ddd6fe; }
[data-bs-theme="dark"] .cta-chip-mon  { background: rgba(56, 189, 248, .18); color: #bae6fd; }
[data-bs-theme="dark"] .cta-chip-arch { background: rgba(251, 191, 36, .16); color: #fde68a; }
[data-bs-theme="dark"] .cta-op > span { background: #273241; border-color: #3b475a; color: #e2e8f0; }
[data-bs-theme="dark"] .cta-op input:checked + span { background: rgba(45, 212, 191, .2); border-color: #2dd4bf; color: #fff; }
[data-bs-theme="dark"] .cta-op input:focus-visible + span { outline-color: #2dd4bf; }
[data-bs-theme="dark"] .cta-aviso-bill { background: rgba(217, 119, 6, .12); border-color: rgba(217, 119, 6, .35); color: #fcd34d; }

/* «Anotar rápido»: fichas de cuenta («¿De dónde salió?» / «¿A dónde entró?») */
.ar-cuentas { display: flex; flex-direction: column; gap: 6px; }
.ar-cuentas-tit { font-size: .8rem; font-weight: 700; color: #374151; }
.ar-cuenta small { font-weight: 600; opacity: .75; }
[data-bs-theme="dark"] .ar-cuentas-tit { color: #cbd5e1; }

/* Totales en la otra moneda (dólares) debajo de los totales en la moneda local */
.otra-moneda { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: -4px 0 14px; padding: 8px 14px; border-radius: 10px;
               background: #f1f5f9; color: #334155; font-size: .875rem; }
.otra-moneda b { font-variant-numeric: tabular-nums; }
[data-bs-theme="dark"] .otra-moneda { background: #273241; color: #e2e8f0; }
@media (max-width: 767.98px) { .pcta { padding-bottom: 72px; } }   /* que el botón flotante (+) no tape la última tarjeta */

/* ── Contraste (WCAG AA, prueba 2026-11-09) ─────────────────────────────────────────────────────────────────────
   · Ayudas bajo los campos (.form-text): el gris del tema (#adb5bd) daba 2,1:1 sobre blanco y 3,9:1 en la ventana oscura.
   · Botón con borde del tema: #0f766e daba 4,46:1 sobre el fondo gris claro y 3,2:1 en oscuro.
   · Botón «Eliminar» con borde rojo en oscuro: #c62828 daba 2,2:1 sobre la tarjeta.
   · «Gasto» / «Ingreso» elegidos en «Anotar rápido»: texto blanco sobre #d6455d (4,3:1) y #0f9d6b (3,4:1). */
.form-text { color: #5f6b76; }
[data-bs-theme="dark"] .form-text { color: #ced4da; }
.btn-outline-theme { --bs-btn-color: #115e59; color: #115e59; }
[data-bs-theme="dark"] .btn-outline-theme { --bs-btn-color: #2dd4bf; color: #2dd4bf; border-color: #2dd4bf; }
.btn-outline-theme:hover, .btn-outline-theme:focus-visible, .btn-outline-theme.active { color: #fff; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #fb8a8a; color: #fb8a8a; border-color: #fb8a8a; }
[data-bs-theme="dark"] .btn-outline-danger:hover, [data-bs-theme="dark"] .btn-outline-danger:focus-visible { color: #fff; }
.ar .ar-tipo-btn.on, [data-bs-theme="dark"] .ar .ar-tipo-btn.on, [data-bs-theme="dark"] .ar[data-tipo="egreso"] .ar-tipo-btn.on { background: #c0354d; }
.ar[data-tipo="ingreso"] .ar-tipo-btn.on, [data-bs-theme="dark"] .ar[data-tipo="ingreso"] .ar-tipo-btn.on { background: #0b7a53; }

/* ═══════════════════════════════════════════════════════════════════════════
   Ayuda del sistema: (?) en la barra (PC y móvil) + panel lateral (views/partials/ayuda.php)
   ═══════════════════════════════════════════════════════════════════════════ */
.ay-boton { font-size: 1.15rem; color: var(--bs-app-theme, #0f766e); }
.ay-boton-movil { display: none; }
@media (max-width: 767.98px) {
    .navbar-ayuda { display: none !important; }
    .ay-boton-movil { display: inline-flex; width: 44px; height: 44px; font-size: 1.25rem; }
}
.ay-panel { --bs-offcanvas-width: min(440px, 100vw); --bs-offcanvas-zindex: 1060; }
.offcanvas-backdrop.show:has(+ .ay-panel), body:has(.ay-panel.show) .offcanvas-backdrop { z-index: 1055; }
.ay-panel .offcanvas-body { padding-top: 4px; }
.ay-seccion { margin-bottom: 22px; }
.ay-h { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.ay-actual { background: #e6f4f1; border-radius: 14px; padding: 14px 16px; }
.ay-intro { margin: 0 0 10px; color: #475569; }
.ay-lista { margin: 0; padding-left: 1.1rem; }
.ay-lista li { margin-bottom: 6px; line-height: 1.45; }
.ay-glosario { margin: 0; }
.ay-glosario > div { padding: 8px 0; border-top: 1px solid #e2e8f0; }
.ay-glosario dt { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ay-glosario dt i { width: 18px; text-align: center; color: #0f766e; }
.ay-glosario dd { margin: 2px 0 0 26px; color: #475569; }
.ay-det { border-top: 1px solid #e2e8f0; padding: 8px 0; }
.ay-det summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.ay-det summary::-webkit-details-marker { margin-right: 6px; }
.ay-det p, .ay-det ul { margin: 6px 0 4px; color: #475569; }
[data-bs-theme="dark"] .ay-boton, [data-bs-theme="dark"] .ay-glosario dt i { color: #5eead4; }
[data-bs-theme="dark"] .ay-actual { background: rgba(45,212,191,.12); }
[data-bs-theme="dark"] .ay-intro, [data-bs-theme="dark"] .ay-glosario dd, [data-bs-theme="dark"] .ay-det p, [data-bs-theme="dark"] .ay-det ul { color: #cbd5e1; }
[data-bs-theme="dark"] .ay-glosario > div, [data-bs-theme="dark"] .ay-det { border-color: #334155; }

/* ═══ Platanota — nombre, logo y mascota (9-nov-2026) ═══════════════════════════════════════
   El nombre se escribe en HTML: «Plata» en el verde de la marca y «nota» en dorado. La letra es Baloo 2 ExtraBold
   (SIL Open Font License), servida desde aquí y recortada a las letras del nombre (2 KB): no depende de Google Fonts.
   Contraste: el dorado #d97706 sobre blanco da 3,2:1, por eso el nombre va siempre en negrita y a 19 px o más
   (texto grande de WCAG: pide 3:1). En oscuro: turquesa claro #5eead4 y dorado claro #fcd34d. */
@font-face {
    font-family: "Baloo 2 Platanota";
    src: url("/baloo2-marca.woff") format("woff");
    font-weight: 800; font-style: normal; font-display: swap;
}
.marca-nombre { font-family: "Baloo 2 Platanota", "Baloo 2", Nunito, "Arial Rounded MT Bold", system-ui, sans-serif;
                font-weight: 800 !important; letter-spacing: 0 !important; line-height: 1; white-space: nowrap; }
.marca-nombre .m-plata { color: #134e4a; }
.marca-nombre .m-nota  { color: #d97706; }
[data-bs-theme="dark"] .marca-nombre .m-plata { color: #5eead4; }
[data-bs-theme="dark"] .marca-nombre .m-nota  { color: #fcd34d; }
/* Sobre la foto del login: «Plata» en blanco y «nota» en dorado claro */
.marca-nombre.marca-sobre-foto .m-plata { color: #fff; }
.marca-nombre.marca-sobre-foto .m-nota  { color: #fcd34d; }

/* Barra superior */
.pachay-brand .marca-nombre { font-size: 1.3rem; display: block; margin-bottom: 1px; }
.pachay-brand-logo { border-radius: 8px; }
/* Login / registro */
.login-header .brand .marca-nombre { font-size: 2rem; }

/* Plati (la mascota): solo en momentos clave y discreta */
.plati { display: block; height: auto; user-select: none; pointer-events: none; }
.login .login-header .icon .plati-login { width: 84px; height: 84px; opacity: 1; }
@media (max-width: 767.98px) { .login .login-header .icon .plati-login { width: 64px; height: 64px; } }
.plati-vacio { width: 96px; height: 96px; margin: 0 auto 12px; }
.pd-empty .plati-vacio { width: 72px; height: 72px; margin-bottom: 8px; }
.cta-vacio { padding: 14px 16px; }
.cta-vacio .cta-vacio-plati { width: 64px; height: 64px; flex: 0 0 64px; }
