/* ==========================================================================
   app.css — Estilos generales de Bitácora (compartidos por todas las vistas)
   Se carga después de template.css. Los estilos exclusivos de una vista
   van en assets/css/views/<vista>.css
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --app-radius: 20px;
    --app-radius-sm: 14px;
    --app-shadow: 0 10px 30px -12px rgba(17, 12, 46, .18);
    --app-shadow-lg: 0 24px 48px -20px rgba(88, 28, 135, .45);
    --app-ease: cubic-bezier(.2, .8, .2, 1);
    --app-safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-safe-top: env(safe-area-inset-top, 0px);

    /* Paleta de categorías: [fondo suave, color] */
    --c-violet: #9333EA;  --c-violet-bg: #F3E8FF;
    --c-blue: #2563EB;    --c-blue-bg: #E0EBFF;
    --c-orange: #EA7A1A;  --c-orange-bg: #FFEFDF;
    --c-rose: #E11D74;    --c-rose-bg: #FFE4EF;
    --c-teal: #0D9488;    --c-teal-bg: #D9F6F2;
    --c-red: #E5484D;     --c-red-bg: #FFE5E5;
    --c-green: #16A34A;   --c-green-bg: #DDF7E6;
    --c-indigo: #5B5BD6;  --c-indigo-bg: #E6E6FF;
    --c-slate: #334155;   --c-slate-bg: #EEF2F6;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

/* Modo standalone (PWA instalada): respeta el notch */
@media (display-mode: standalone) {
    body {
        padding-top: var(--app-safe-top);
    }
}

/* ---------- Íconos SVG (sprite) ---------- */
.ico {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.ico-14 { width: 14px; height: 14px; }
.ico-18 { width: 18px; height: 18px; }
.ico-20 { width: 20px; height: 20px; }
.ico-22 { width: 22px; height: 22px; }
.ico-24 { width: 24px; height: 24px; }
.ico-26 { width: 26px; height: 26px; }

/* Barra inferior / encabezado de la plantilla usando SVG */
.inner-bar-item .ico { color: var(--color-text); }
.inner-bar-item.active .ico { color: var(--primary); }
.inner-bar-item.v2 .ico { color: var(--white); }
.header-v3 .right a { color: var(--white); }

/* ---------- Colores por categoría ---------- */
.c-violet { --tone: var(--c-violet); --tone-bg: var(--c-violet-bg); }
.c-blue   { --tone: var(--c-blue);   --tone-bg: var(--c-blue-bg); }
.c-orange { --tone: var(--c-orange); --tone-bg: var(--c-orange-bg); }
.c-rose   { --tone: var(--c-rose);   --tone-bg: var(--c-rose-bg); }
.c-teal   { --tone: var(--c-teal);   --tone-bg: var(--c-teal-bg); }
.c-red    { --tone: var(--c-red);    --tone-bg: var(--c-red-bg); }
.c-green  { --tone: var(--c-green);  --tone-bg: var(--c-green-bg); }
.c-indigo { --tone: var(--c-indigo); --tone-bg: var(--c-indigo-bg); }
.c-slate  { --tone: var(--c-slate);  --tone-bg: var(--c-slate-bg); }

/* Contenedor de ícono con tono: color + fondo suave */
.c-violet, .c-blue, .c-orange, .c-rose, .c-teal,
.c-red, .c-green, .c-indigo, .c-slate,
.box-transaction-item.style-icon .icon[class*="c-"],
.notifications-item .img-icon[class*="c-"],
.box-icon .icon[class*="c-"] {
    color: var(--tone);
    background-color: var(--tone-bg);
}

/* ---------- Utilidades ---------- */
.ui-muted { color: var(--greyscale-500); }
.ui-link { color: var(--primary); font-weight: 600; }

.ui-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--error);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    vertical-align: 2px;
}

/* Barra de progreso */
.ui-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--greyscale-100);
    overflow: hidden;
}
.ui-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-400-2), var(--primary));
    transform-origin: left;
    animation: ui-bar-in 1.1s var(--app-ease) both;
}
.ui-bar.ok i     { background: linear-gradient(90deg, #4ADE80, var(--c-green)); }
.ui-bar.warn i   { background: linear-gradient(90deg, #FCD34D, var(--orange)); }
.ui-bar.danger i { background: linear-gradient(90deg, #FB923C, var(--c-red)); }

@keyframes ui-bar-in {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Pill / estado */
.ui-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, .2);
    color: var(--white);
    backdrop-filter: blur(6px);
}

.ui-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.ui-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.ui-status.is-ok      { color: var(--c-green); background: var(--c-green-bg); }
.ui-status.is-warning { color: var(--c-orange); background: var(--c-orange-bg); }
.ui-status.is-danger  { color: var(--c-red); background: var(--c-red-bg); }

/* Control segmentado */
.ui-segment {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--greyscale-100);
}
.ui-segment button {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--greyscale-500);
    transition: all .25s var(--app-ease);
}
.ui-segment button.active {
    background: var(--white);
    color: var(--primary-base);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

/* Scroll horizontal con snap */
.ui-scroll-x {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -24px;
    padding: 4px 24px 12px;
    scrollbar-width: none;
}
.ui-scroll-x > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Chips */
.ui-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ui-chip {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--greyscale-100);
    color: var(--greyscale-700);
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
}
.ui-chip:active { background: var(--primary-100); color: var(--primary); }

/* Asa de hoja inferior */
.ui-handle {
    width: 56px;
    height: 5px;
    border-radius: 999px;
    background: var(--grey-200);
    margin: 0 auto;
}

/* Buscador */
.ui-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 52px;
    border-radius: 16px;
    background: var(--greyscale-50);
    border: 1px solid var(--greyscale-200);
    color: var(--greyscale-400);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
.ui-search-box:focus-within {
    border-color: var(--primary-300);
    box-shadow: 0 0 0 4px var(--primary-50);
}
.ui-search-box input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--greyscale);
    padding: 0;
}

/* ---------- Montos ocultos (privacidad) ---------- */
body.amounts-hidden .money {
    filter: blur(7px);
    user-select: none;
    transition: filter .3s;
}
.money { transition: filter .3s; }

/* ---------- Interacción táctil ---------- */
a, button { -webkit-touch-callout: none; }

.tap,
.box-icon,
.inner-bar-item,
.box-transaction-item {
    transition: transform .15s var(--app-ease);
}
.tap:active,
.box-icon:active,
.box-transaction-item:active {
    transform: scale(.97);
}

/* Aparición al hacer scroll */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--app-ease), transform .6s var(--app-ease);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* Modales tipo hoja inferior: altura automática */
.modal.modalDown .modal-dialog .modal-content {
    height: auto;
    max-height: 88vh;
    padding-bottom: calc(24px + var(--app-safe-bottom));
}

/* ---------- Banner de instalación PWA ---------- */
.app-install {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(100px + var(--app-safe-bottom));
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    border-radius: 18px;
    background: rgba(18, 26, 38, .92);
    backdrop-filter: blur(12px);
    color: var(--white);
    box-shadow: var(--app-shadow-lg);
    animation: app-slide-up .5s var(--app-ease) both;
    max-width: 480px;
    margin: 0 auto;
}
.app-install[hidden] { display: none; }
.app-install img { border-radius: 10px; }
.app-install-text { flex: 1; line-height: 1.25; }
.app-install-text p { color: var(--white); }
.app-install-text span { color: var(--greyscale-300); }
.app-install-btn {
    border: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 13px;
}
.app-install-close {
    border: 0;
    background: transparent;
    color: var(--greyscale-400);
    padding: 4px;
}

/* ---------- Toast ---------- */
.app-toast {
    position: fixed;
    left: 50%;
    top: calc(16px + var(--app-safe-top));
    z-index: 2000;
    transform: translate(-50%, -200%);
    visibility: hidden;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primary-base);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--app-shadow);
    transition: transform .4s var(--app-ease), visibility .4s;
    white-space: nowrap;
}
.app-toast.show { transform: translate(-50%, 0); visibility: visible; }

@keyframes app-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Estructura compartida: barra inferior, menú lateral y hoja "Agregar"
   (generados por app.js)
   ========================================================================== */
/* ---------- Barra inferior ---------- */
.app-nav { padding-bottom: calc(22px + var(--app-safe-bottom)); }
.app-fab {
    background: linear-gradient(135deg, #A855F7, #7C3AED) !important;
    box-shadow: 0 12px 24px -8px rgba(124, 58, 237, .7);
    transition: transform .2s var(--app-ease);
}
.app-fab:active { transform: scale(.92) rotate(90deg); }

/* ---------- Hoja: Agregar ---------- */
.app-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 8px;
    padding-bottom: 8px;
}
.app-quick-grid .box-icon .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 8px;
    box-shadow: none;
}
.app-quick-grid .text { font-size: 12px; color: var(--greyscale-700); }

/* ---------- Menú lateral ---------- */
.app-sidebar { display: flex; flex-direction: column; }
.app-sidebar-header {
    background: linear-gradient(135deg, #7E22CE, #4C1D95) !important;
    color: var(--white);
    padding: 36px 16px 22px !important;
}
.app-sidebar-header h6 { color: var(--white); }
.app-sidebar-header p { color: var(--primary-300); }
.app-sidebar-header .ui-link { color: #FCD34D; }
.app-sidebar-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #FCD34D, #F472B6);
    flex-shrink: 0;
}
.app-sidebar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.app-sidebar .icon-close-popup { color: var(--white) !important; }
.app-sidebar .sidebar-content { flex: 1; padding: 18px 14px 32px; }
.app-menu-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--greyscale-400);
    margin: 14px 6px 6px;
}
.app-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 6px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-base);
    transition: background .2s;
}
.app-menu a:active { background: var(--greyscale-50); }
.app-menu-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-menu a.active { background: var(--primary-50); color: var(--primary); }

/* ==========================================================================
   Páginas de módulo (mod-*): estructura común de las vistas del menú
   ========================================================================== */
.page-mod { background: var(--bg-4); }
.page-mod main { padding-top: 20px; padding-bottom: calc(130px + var(--app-safe-bottom)); }

/* Tonos del encabezado */
.hero-violet { --h1: #A855F7; --h2: #7E22CE; --h3: #3B0764; }
.hero-blue   { --h1: #3B82F6; --h2: #1D4ED8; --h3: #172554; }
.hero-orange { --h1: #FB923C; --h2: #EA580C; --h3: #7C2D12; }
.hero-teal   { --h1: #2DD4BF; --h2: #0F766E; --h3: #134E4A; }
.hero-slate  { --h1: #64748B; --h2: #1E293B; --h3: #0F172A; }
.hero-rose   { --h1: #FB7185; --h2: #E11D48; --h3: #881337; }
.hero-green  { --h1: #4ADE80; --h2: #15803D; --h3: #14532D; }
.hero-indigo { --h1: #818CF8; --h2: #4338CA; --h3: #1E1B4B; }

.mod-hero {
    position: relative;
    overflow: hidden;
    padding: 12px 0 24px;
    color: var(--white);
    background: radial-gradient(130% 120% at 0% 0%, var(--h1) 0%, var(--h2) 50%, var(--h3) 100%);
    border-radius: 0 0 32px 32px;
}
.mod-hero::before,
.mod-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.mod-hero::before {
    width: 220px; height: 220px;
    right: -70px; top: -90px;
    background: rgba(255, 255, 255, .14);
}
.mod-hero::after {
    width: 140px; height: 140px;
    left: -50px; bottom: -70px;
    background: rgba(255, 255, 255, .08);
}
.mod-hero .tf-container { position: relative; z-index: 1; }

.mod-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
}
.mod-topbar-actions { display: flex; gap: 8px; }
.mod-iconbtn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    transition: background .2s, transform .15s;
}
.mod-iconbtn:hover { color: var(--white); }
.mod-iconbtn:active { transform: scale(.92); background: rgba(255, 255, 255, .25); }

.mod-hero-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}
.mod-hero-ico {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    flex-shrink: 0;
}
.mod-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}
.mod-title {
    font-size: 26px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--white);
    margin: 2px 0 0;
}
.mod-hero-desc {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .85);
}

.mod-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}
.mod-kpis.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mod-kpi {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(8px);
    min-width: 0;
}
.mod-kpi span {
    display: block;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mod-kpi strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-top: 2px;
    white-space: nowrap;
}

/* Guía "¿Qué registras aquí?" */
.mod-guide {
    margin-bottom: 24px;
    border-radius: 20px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}
.mod-guide summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
}
.mod-guide summary::-webkit-details-marker { display: none; }
.mod-guide-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, #A855F7, #EC4899);
}
.mod-guide summary strong { flex: 1; font-size: 15px; color: var(--primary-base); }
.mod-guide summary strong small { display: block; font-size: 12px; font-weight: 500; color: var(--greyscale-500); }
.mod-guide summary .ico-chev { color: var(--greyscale-400); transition: transform .3s var(--app-ease); transform: rotate(90deg); }
.mod-guide[open] summary .ico-chev { transform: rotate(-90deg); }
.mod-guide-body { padding: 0 16px 16px; }
.mod-guide-list { display: grid; gap: 10px; }
.mod-guide-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--greyscale-600);
}
.mod-guide-list li .ico { color: var(--c-green); margin-top: 1px; }
.mod-guide-list li b { color: var(--primary-base); font-weight: 600; }
.mod-guide-tip {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--bg-6);
    font-size: 12.5px;
    line-height: 1.45;
}
.mod-guide-tip .ico { flex-shrink: 0; margin-top: 1px; }

/* Secciones */
.mod-section { margin-bottom: 24px; }
.mod-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.mod-head h6 { font-size: 17px; font-weight: 600; color: var(--black); margin: 0; }
.mod-head a,
.mod-head .ui-link { font-size: 13px; font-weight: 600; color: var(--primary); border: 0; background: none; padding: 0; }

.mod-card {
    padding: 16px;
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--app-shadow);
}

/* Lista de registros */
.mod-list { display: grid; gap: 10px; }
.mod-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    color: inherit;
    transition: transform .15s var(--app-ease);
}
.mod-item:active { transform: scale(.98); }
.mod-item[hidden] { display: none; }
.mod-item-ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mod-item-ico img { width: 100%; height: 100%; object-fit: cover; }
.mod-item-body { flex: 1; min-width: 0; }
.mod-item-body p {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mod-item-body span { display: block; font-size: 12px; color: var(--greyscale-500); margin-top: 2px; }
.mod-item-end { text-align: right; flex-shrink: 0; }
.mod-item-end strong { display: block; font-size: 14px; font-weight: 700; color: var(--primary-base); }
.mod-item-end small { display: block; font-size: 11.5px; color: var(--greyscale-500); margin-top: 2px; }
.mod-item-end .ui-status { margin-top: 4px; }
.is-in { color: var(--c-green) !important; }
.is-out { color: var(--primary-base); }

/* Rejillas y tarjetas pequeñas */
.mod-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mod-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mod-tile {
    padding: 14px;
    border-radius: 18px;
    background: var(--white);
    border: 1px solid var(--greyscale-100);
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    min-width: 0;
}
.mod-tile[hidden] { display: none; }
.mod-tile .mod-item-ico { margin-bottom: 8px; width: 40px; height: 40px; border-radius: 12px; }
.mod-tile p { font-size: 14px; font-weight: 600; color: var(--primary-base); line-height: 1.25; }
.mod-tile span { font-size: 12px; color: var(--greyscale-500); }
.mod-tile strong { font-size: 18px; color: var(--primary-base); }

/* Lista clave-valor (fichas) */
.mod-kv { display: grid; }
.mod-kv li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--greyscale-200);
    font-size: 13.5px;
}
.mod-kv li:last-child { border-bottom: 0; }
.mod-kv li span { color: var(--greyscale-500); }
.mod-kv li b { color: var(--primary-base); font-weight: 600; text-align: right; }

/* Línea de tiempo */
.mod-timeline { position: relative; display: grid; gap: 16px; padding-left: 26px; }
.mod-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--greyscale-200);
    border-radius: 2px;
}
.mod-timeline li { position: relative; }
.mod-timeline li::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--tone, var(--primary));
}
.mod-timeline li.done::before { background: var(--tone, var(--primary)); }
.mod-timeline p { font-size: 14px; font-weight: 600; color: var(--primary-base); }
.mod-timeline span { display: block; font-size: 12px; color: var(--greyscale-500); margin-top: 2px; }

/* Barra de herramientas: búsqueda + filtros */
.mod-toolbar { margin-bottom: 16px; }
.mod-toolbar .ui-search-box { height: 48px; background: var(--white); margin-bottom: 12px; }
.mod-toolbar .ui-scroll-x { padding-bottom: 4px; gap: 8px; }
button.ui-chip { border: 1px solid var(--greyscale-200); background: var(--white); }
.ui-chip.active,
button.ui-chip.active { background: var(--primary-base); border-color: var(--primary-base); color: var(--white); }

/* Estado vacío */
.mod-empty {
    text-align: center;
    padding: 28px 20px;
    border-radius: 20px;
    border: 1.5px dashed var(--greyscale-200);
    color: var(--greyscale-500);
}
.mod-empty .ico { color: var(--greyscale-300); margin-bottom: 8px; }
.mod-empty p { font-weight: 600; color: var(--primary-base); margin-bottom: 4px; }

/* Formulario de registro (hoja inferior) */
.mod-sheet .modal-content { overflow-y: auto !important; }
.mod-sheet-head { text-align: left; margin: 16px 0 18px; }
.mod-sheet-head h5 { margin-bottom: 4px; color: var(--primary-base); }
.mod-sheet-head p { font-size: 13px; color: var(--greyscale-500); }
.mod-form { text-align: left; }
.mod-form fieldset { margin-bottom: 14px; }
.mod-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--greyscale-700);
    margin-bottom: 6px;
}
.mod-form .mod-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--greyscale-200);
    background-color: var(--greyscale-50);
    font-size: 15px;
    color: var(--greyscale);
    outline: 0;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
    -webkit-appearance: none;
    appearance: none;
}
.mod-form select.mod-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.mod-form textarea.mod-input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.mod-form .mod-input:focus {
    border-color: var(--primary-300);
    background-color: var(--white);
    box-shadow: 0 0 0 4px var(--primary-50);
}
.mod-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mod-check {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--greyscale-50);
    border: 1px solid var(--greyscale-200);
    margin-bottom: 14px !important;
}
.mod-upload {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px dashed var(--primary-300);
    background: var(--primary-50);
    color: var(--primary) !important;
    cursor: pointer;
    margin-bottom: 18px !important;
}
.mod-upload input { display: none; }
.mod-upload small { display: block; font-weight: 500; color: var(--greyscale-500); }
.mod-form .tf-btn { gap: 8px; font-weight: 600; }
.mod-form button.tf-btn.primary { background: linear-gradient(135deg, #A855F7, #7C3AED); border: 0; color: var(--white); }
.mod-timeline li[class*="c-"] { background: none; color: inherit; }

/* ==========================================================================
   Reset de <button>: template.css da a TODOS los botones width:100%, padding,
   fondo morado y un :hover blanco. Aquí se neutraliza para los botones propios
   (todo lo que no sea .tf-btn). Especificidad igual a la de la plantilla
   (0,0,1), así cualquier clase de componente la sobreescribe.
   ========================================================================== */
button:where(:not(.tf-btn)) {
    width: auto;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* El :hover de la plantilla (0,1,1) cambia color y fondo: se anula y cada
   componente con fondo propio lo restaura abajo. */
button:where(:not(.tf-btn)):hover {
    color: inherit;
    background-color: transparent;
    border-color: transparent;
}
.mod-iconbtn:hover,
.hm-eye:hover { color: var(--white); background-color: rgba(255, 255, 255, .16); }
.app-install-btn:hover { color: var(--white); background-color: var(--primary); }
.app-install-close:hover { color: var(--greyscale-400); }
button.ui-chip:hover { color: var(--greyscale-700); background-color: var(--white); border-color: var(--greyscale-200); }
button.ui-chip.active:hover { color: var(--white); background-color: var(--primary-base); border-color: var(--primary-base); }
.ui-segment button:hover { color: var(--greyscale-500); }
.ui-segment button.active:hover { color: var(--primary-base); background-color: var(--white); }
button.ui-chip { padding: 8px 14px; font-size: 13px; font-weight: 500; border-radius: 999px; border: 1px solid var(--greyscale-200); white-space: nowrap; }
.ui-scroll-x { scroll-padding-inline: 24px; }
[data-cat][hidden] { display: none !important; }

/* Utilidades de espaciado que la plantilla no trae */
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
