/* =============================================================================
   Tema de marca (capa visual común)
   Se carga al final de cada página. Solo cambia apariencia: no altera cálculos,
   datos, permisos ni los identificadores que usan los scripts.
   Colores de marca: config.local.php → brand_primary, brand_accent, brand_ink.
   Tipografía IBM Plex Sans incluida (licencia OFL: assets/fonts/LICENSE-IBM-Plex-OFL.txt).
   ========================================================================== */
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:400;src:url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:400;src:url("fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:500;src:url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:500;src:url("fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:600;src:url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:600;src:url("fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:700;src:url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-display:swap;font-weight:700;src:url("fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

/* ---------- Tokens ---------- */
:root{
  --brand:#0f5f66; --brand-accent:#d9932b; --brand-ink:#0b2e33;
  --brand-strong:color-mix(in srgb,var(--brand) 78%,#000);
  --brand-soft:color-mix(in srgb,var(--brand) 8%,#fff);
  --brand-soft-2:color-mix(in srgb,var(--brand) 14%,#fff);
  --brand-line:color-mix(in srgb,var(--brand) 26%,#fff);
  --brand-light:color-mix(in srgb,var(--brand) 42%,#fff);
  --accent-soft:color-mix(in srgb,var(--brand-accent) 15%,#fff);
  --accent-ink:color-mix(in srgb,var(--brand-accent) 62%,#000);

  --t-bg:#edf1f0; --t-surface:#fff; --t-surface-2:#f5f7f7; --t-surface-3:#e9eeed;
  --t-ink:#13262a; --t-ink-2:#33474b; --t-muted:#5b6d70; --t-faint:#869597;
  --t-line:#d9e1e0; --t-line-2:#e7eceb;
  --t-pos:#1c7a4c; --t-pos-soft:#e5f3ec; --t-neg:#b2392b; --t-neg-soft:#f9e9e6;
  --t-r-lg:14px; --t-r-md:10px; --t-r-sm:7px;
  --t-shadow:0 1px 2px rgba(11,46,51,.05),0 2px 8px rgba(11,46,51,.04);
  --t-shadow-pop:0 18px 48px rgba(11,46,51,.18),0 2px 8px rgba(11,46,51,.08);
  --t-focus:0 0 0 3px color-mix(in srgb,var(--brand) 30%,transparent);
  --t-font:"IBM Plex Sans","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  --client:var(--brand);
}
body.t-claro{--client:#d52b1e}
body.t-monge{--client:#2c9a3f}
body.t-insta{--client:#0b4fc2}

/* ---------- Base común ---------- */
body.t-mod,body.t-portal,body.t-auth,body.t-fact{font-family:var(--t-font)!important;-webkit-font-smoothing:antialiased;font-feature-settings:"tnum" 0}
body.t-mod,body.t-portal,body.t-auth{background:var(--t-bg)!important;color:var(--t-ink)}
body.t-mod button,body.t-mod input,body.t-mod select,body.t-portal button,body.t-portal input,body.t-auth button,body.t-auth input,body.t-auth select{font-family:inherit}
body.t-mod button:focus-visible,body.t-mod a:focus-visible,body.t-mod input:focus-visible,body.t-mod select:focus-visible,
body.t-portal button:focus-visible,body.t-portal a:focus-visible,body.t-portal input:focus-visible,
body.t-auth button:focus-visible,body.t-auth a:focus-visible,body.t-auth input:focus-visible,body.t-auth select:focus-visible{outline:2px solid var(--brand)!important;outline-offset:2px}

/* Barra superior */
.platform-nav{background:var(--brand-ink)!important;color:#fff!important;box-shadow:none!important;border-bottom:1px solid rgba(255,255,255,.06);padding-top:0!important;padding-bottom:0!important;min-height:58px;font-family:var(--t-font)}
.platform-brand{font-weight:600!important;font-size:14.5px!important;letter-spacing:-.005em}
.platform-brand img{width:30px!important;height:30px!important;border-radius:8px!important;object-fit:contain;background:#fff}
.platform-links{align-self:stretch;align-items:stretch}
.platform-links a{display:flex;align-items:center;color:rgba(255,255,255,.7)!important;border-radius:0!important;padding:0 14px!important;font-size:13.5px!important;font-weight:500;background:none!important;box-shadow:none!important;position:relative}
.platform-links a:hover{color:#fff!important;background:rgba(255,255,255,.05)!important}
.platform-links a.active{color:#fff!important}
.platform-links a.active::after{content:"";position:absolute;left:14px;right:14px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:var(--brand-accent)}
.platform-user span{color:rgba(255,255,255,.6)!important}
.platform-user a{color:rgba(255,255,255,.82)!important;font-size:13px!important}
.platform-user a:hover{color:#fff!important;background:rgba(255,255,255,.08)!important}
@media(max-width:1000px){.platform-nav{padding-top:10px!important;min-height:0}.platform-links a{padding:12px 12px!important}.platform-links a.active::after{left:12px;right:12px}}

/* Aviso de fuente SQL */
.connection-note{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-left:3px solid var(--brand-accent)!important;color:var(--t-ink-2)!important;border-radius:var(--t-r-md)!important;font-size:12.5px!important;padding:9px 14px!important}
.connection-note strong{color:var(--t-ink);font-weight:600}
.connection-dot{background:var(--brand-accent)!important}

/* Iconos de acciones (máscara SVG; heredan el color del texto) */
.qi{display:inline-block;flex:0 0 auto;width:16px;height:16px;margin-right:7px;vertical-align:-3px;background:currentColor;-webkit-mask:var(--qi) center/contain no-repeat;mask:var(--qi) center/contain no-repeat}

/* =============================================================================
   Dashboards de proyecto (Claro, Monge, Instacredit)
   ========================================================================== */
body.t-mod .shell{padding-top:22px!important}

/* Encabezado del proyecto */
body.t-mod .hero{background:var(--t-surface)!important;color:var(--t-ink)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important;padding:22px 26px 22px 31px!important;min-height:0!important;align-items:center!important;position:relative;overflow:hidden;animation:none!important}
body.t-mod .hero::after{display:none!important;content:none!important}
body.t-mod .hero::before{content:""!important;display:block!important;position:absolute!important;inset:0 auto 0 0!important;width:5px!important;height:auto!important;border-radius:0!important;background:var(--client)!important;opacity:1!important;transform:none!important}
body.t-mod .hero .logo-card{width:64px!important;height:64px!important;flex:0 0 64px!important;padding:9px!important;background:#fff!important;border:1px solid var(--t-line)!important;border-radius:12px!important;box-shadow:none!important}
body.t-mod .hero .brand-row,body.t-insta .hero .brand{gap:18px!important;align-items:center!important}
body.t-mod .hero .eyebrow{color:var(--t-muted)!important;font-size:13px!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important;opacity:1!important;margin:0 0 2px!important}
body.t-mod .hero h1{color:var(--t-ink)!important;font-size:clamp(24px,2.3vw,31px)!important;font-weight:600!important;letter-spacing:-.02em!important;line-height:1.15!important;text-shadow:none!important}
body.t-mod .hero .hero-copy,body.t-insta .hero .subtitle{color:var(--t-muted)!important;font-size:14px!important;margin:12px 0 0!important;max-width:640px;opacity:1!important}
body.t-insta .hero .subtitle{margin-top:4px!important}
body.t-monge .scope-current{color:var(--brand)!important;font-weight:600!important;font-size:13.5px!important;letter-spacing:0!important;margin-top:2px!important}
body.t-mod .hero-actions{gap:14px!important}
body.t-mod .hero-buttons{gap:8px!important}

/* Botones */
body.t-mod .btn{font-weight:600!important;font-size:13px!important;border-radius:var(--t-r-md)!important;padding:9px 14px!important;min-height:38px!important;box-shadow:none!important;transform:none!important;letter-spacing:0!important;text-transform:none!important}
body.t-mod .btn.primary,body.t-mod .btn.white,body.t-insta .hero .btn.primary{background:var(--brand)!important;color:#fff!important;border:1px solid var(--brand)!important}
body.t-mod .btn.primary:hover,body.t-mod .btn.white:hover{background:var(--brand-strong)!important;border-color:var(--brand-strong)!important}
body.t-mod .btn.ghost,body.t-mod .btn.soft,body.t-mod .btn.upload-action{background:var(--t-surface)!important;color:var(--t-ink-2)!important;border:1px solid var(--t-line)!important}
body.t-mod .btn.ghost:hover,body.t-mod .btn.soft:hover,body.t-mod .btn.upload-action:hover{background:var(--brand-soft)!important;color:var(--brand-strong)!important;border-color:var(--brand-line)!important}
body.t-claro .operativo-toolbar{gap:6px!important}
body.t-claro .btn.upload-action{min-height:34px!important;padding:7px 11px!important;font-size:12.5px!important;background:var(--t-surface-2)!important}

/* Corte de pagos (Claro) */
body.t-claro .payment-cutoff{background:var(--t-surface-2)!important;border:1px solid var(--t-line)!important;box-shadow:none!important;border-radius:var(--t-r-md)!important;padding:10px 14px!important;margin-top:14px!important}
body.t-claro .payment-cutoff-label{color:var(--brand)!important;text-transform:none!important;letter-spacing:0!important;font-size:12.5px!important;font-weight:600!important}
body.t-claro .payment-cutoff-value{font-size:17px!important;font-weight:600!important}

/* Meta del proyecto */
body.t-mod .hero-meta{background:var(--t-surface-2)!important;border:1px solid var(--t-line)!important;border-top:3px solid var(--brand-accent)!important;border-radius:var(--t-r-md)!important;backdrop-filter:none!important;box-shadow:none!important;color:var(--t-ink)!important;padding:12px 16px!important;min-width:220px}
body.t-mod .hero-meta-label{color:var(--t-muted)!important;text-transform:none!important;letter-spacing:0!important;font-size:12.5px!important;font-weight:500!important}
body.t-mod .hero-meta-value{color:var(--t-ink)!important;font-size:25px!important;font-weight:600!important;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
body.t-mod .hero-meta small{color:var(--t-faint)!important}
body.t-claro .hero-meta-edit{background:none!important;border:0!important;color:var(--brand)!important;font-weight:600!important;text-decoration:underline;text-underline-offset:2px;padding:0!important;font-size:12px!important;text-transform:none!important;letter-spacing:0!important}

/* Selector de cartera (Monge) */
body.t-monge .scope-tabs{display:inline-flex!important;flex-wrap:wrap;gap:2px!important;padding:3px!important;background:var(--t-surface-3)!important;border-radius:var(--t-r-md)!important;margin:16px 0 0!important;width:auto!important}
body.t-monge .scope-pill{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--t-ink-2)!important;border-radius:8px!important;padding:8px 16px!important;font-weight:500!important;font-size:13.5px!important;transform:none!important;width:auto!important}
body.t-monge .scope-pill:hover{color:var(--t-ink)!important;background:rgba(255,255,255,.6)!important}
body.t-monge .scope-pill.active{background:var(--t-surface)!important;color:var(--brand-strong)!important;font-weight:600!important;box-shadow:0 1px 2px rgba(11,46,51,.12)!important}

/* Filtros */
body.t-mod .filters-card,body.t-insta .filters{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important;padding:14px 16px!important;backdrop-filter:none!important;margin:16px 0!important}
body.t-mod .filters-card label,body.t-insta .filters label{color:var(--t-muted)!important;font-size:12.5px!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important}
body.t-mod .filters-card input,body.t-mod .filters-card select,body.t-insta .filters input,body.t-insta .filters select,body.t-mod .mini-select select{border:1px solid var(--t-line)!important;border-radius:8px!important;background:#fff!important;color:var(--t-ink)!important;font-size:13.5px!important;font-weight:500!important;padding:9px 11px!important;min-height:40px!important;box-shadow:none!important}
body.t-mod .filters-card input:focus,body.t-mod .filters-card select:focus,body.t-insta .filters select:focus{border-color:var(--brand)!important;box-shadow:var(--t-focus)!important;outline:none!important}
body.t-insta .filter-note{color:var(--t-muted)!important;font-weight:400!important}

/* Indicadores */
body.t-mod .kpi-grid,body.t-insta .kpis{gap:12px!important;margin:0 0 16px!important}
body.t-claro .kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.t-mod .kpi-card,body.t-mod .kpi{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important;padding:16px 18px!important;min-height:0!important;transform:none!important;overflow:hidden}
body.t-mod .kpi-card::before,body.t-mod .kpi-card::after,body.t-mod .kpi::before,body.t-mod .kpi::after{display:none!important;content:none!important}
body.t-mod .kpi-card span,body.t-mod .kpi>small:first-child,body.t-insta .kpi>span{color:var(--t-muted)!important;font-size:12.5px!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important}
body.t-mod .kpi-card strong,body.t-mod .kpi b,body.t-insta .kpi strong{color:var(--t-ink)!important;font-weight:600!important;font-size:clamp(20px,1.75vw,27px)!important;letter-spacing:-.02em!important;line-height:1.15!important;margin:8px 0 6px!important;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.t-mod .kpi-card small,body.t-insta .kpi small{color:var(--t-faint)!important;font-size:12px!important;font-weight:400!important;text-transform:none!important;letter-spacing:0!important}
body.t-monge .kpi.green b{color:var(--t-ink)!important}
body.t-monge .kpi.red b,body.t-insta .kpi.bad strong{color:var(--t-neg)!important}
body.t-insta .kpi.good strong{color:var(--t-pos)!important}
body.t-claro .operativo-origen-grid{gap:12px!important;margin-bottom:16px!important}
body.t-claro .operativo-origen-card{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important}
body.t-claro .operativo-origen-card span{text-transform:none!important;letter-spacing:0!important;font-size:12.5px!important;font-weight:500!important;color:var(--t-muted)!important}
body.t-claro .operativo-origen-card strong{font-weight:600!important;color:var(--t-ink)!important;font-variant-numeric:tabular-nums}
body.t-claro .operativo-origen-card small{color:var(--t-faint)!important}
body.t-claro .operativo-origen-card.comparativo{background:var(--accent-soft)!important;border-color:color-mix(in srgb,var(--brand-accent) 35%,#fff)!important}
body.t-insta .shell>.hero:first-child,body.t-insta .hero{margin-top:0!important}
body.t-insta .shell{margin-top:0!important}
body.t-insta .hero .brand{align-items:center!important;text-align:left!important}
@media(max-width:850px){body.t-insta .hero .brand{align-items:flex-start!important}}

/* Barra de accesos rápidos */
body.t-mod .quick-actions,body.t-insta .actions{display:flex!important;flex-wrap:wrap!important;gap:2px!important;padding:5px!important;margin:0 0 16px!important;background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important;overflow:visible!important}
body.t-mod .quick-actions button,body.t-insta .actions button{display:inline-flex!important;align-items:center;background:transparent!important;border:0!important;box-shadow:none!important;color:var(--t-ink-2)!important;font-size:13px!important;font-weight:500!important;padding:9px 12px!important;border-radius:8px!important;min-height:0!important;width:auto!important;transform:none!important;white-space:nowrap;letter-spacing:0!important;text-transform:none!important}
body.t-mod .quick-actions button:hover,body.t-insta .actions button:hover{background:var(--brand-soft)!important;color:var(--brand-strong)!important}
body.t-mod .quick-actions button .qi,body.t-insta .actions button .qi{color:var(--brand)}
body.t-mod .quick-actions button[hidden]{display:none!important}

/* Tarjetas */
body.t-mod .card,body.t-insta .card{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;border-radius:var(--t-r-lg)!important;box-shadow:var(--t-shadow)!important;padding:18px 20px!important;transform:none!important}
body.t-mod .grid{gap:16px!important;margin-bottom:16px!important}
body.t-mod .card-title h2{font-size:15.5px!important;font-weight:600!important;color:var(--t-ink)!important;letter-spacing:-.01em!important}
body.t-mod .card-title h3,body.t-mod .inner-card h3{font-weight:600!important;color:var(--t-ink)!important}
body.t-mod .card-title span,body.t-mod .muted,body.t-mod .card-title small{color:var(--t-muted)!important}
body.t-mod .inner-card{background:var(--t-surface)!important;border:1px solid var(--t-line-2)!important;border-radius:var(--t-r-md)!important;box-shadow:none!important}
body.t-mod .platform-chart-download{background:var(--t-surface)!important;border:1px solid var(--t-line)!important;color:var(--t-muted)!important;border-radius:6px!important;font-weight:500;font-size:11px!important}
body.t-mod .platform-chart-download:hover{color:var(--brand-strong)!important;border-color:var(--brand-line)!important;background:var(--brand-soft)!important}

/* Botones pequeños y pestañas internas */
body.t-mod .mini,body.t-mod .pill,body.t-mod .card .btn.soft,body.t-mod .card-title button:not(.platform-chart-download),body.t-mod .mini-actions button{background:var(--t-surface)!important;color:var(--t-ink-2)!important;border:1px solid var(--t-line)!important;border-radius:8px!important;font-weight:500!important;font-size:12.5px!important;box-shadow:none!important;text-transform:none!important;letter-spacing:0!important}
body.t-mod .mini:hover,body.t-mod .pill:hover,body.t-mod .card-title button:not(.platform-chart-download):hover,body.t-mod .mini-actions button:hover{background:var(--brand-soft)!important;color:var(--brand-strong)!important;border-color:var(--brand-line)!important}
body.t-mod .pill.active,body.t-mod .mini.active,body.t-mod .gestor-chip.active,body.t-mod .chip.active{background:var(--brand)!important;color:#fff!important;border-color:var(--brand)!important}

/* Lecturas y mini indicadores */
body.t-mod .acum-kpi,body.t-mod .mini-kpi-row article,body.t-mod .mini-kpi,body.t-insta .mini-kpi{background:var(--t-surface-2)!important;border:1px solid var(--t-line-2)!important;border-radius:var(--t-r-md)!important;box-shadow:none!important}
body.t-mod .acum-kpi span,body.t-mod .mini-kpi-row article span,body.t-mod .mini-kpi span,body.t-insta .mini-kpi span{text-transform:none!important;letter-spacing:0!important;font-size:12px!important;font-weight:500!important;color:var(--t-muted)!important}
body.t-mod .acum-kpi strong,body.t-mod .mini-kpi strong,body.t-mod .mini-kpi-row article strong,body.t-insta .mini-kpi strong{font-weight:600!important;color:var(--t-ink)!important;font-variant-numeric:tabular-nums}
body.t-mod .azul{color:var(--brand)!important}
body.t-mod .rosa{color:var(--t-muted)!important}
body.t-mod .positive{color:var(--t-pos)!important;font-weight:600!important}

/* Tablas */
body.t-mod table th,body.t-mod .table th{text-transform:none!important;letter-spacing:0!important;font-size:12px!important;font-weight:600!important;color:var(--t-muted)!important;background:var(--t-surface-2)!important;border-bottom:1px solid var(--t-line)!important}
body.t-mod table td{font-variant-numeric:tabular-nums;border-bottom-color:var(--t-line-2)!important;color:var(--t-ink-2)}
body.t-mod table tbody tr:nth-child(even) td{background:transparent!important}
body.t-mod table tbody tr:hover td,body.t-mod table tbody tr:hover th{background:var(--brand-soft)!important}
body.t-mod table tbody th{color:var(--t-ink)!important;background:transparent!important;font-weight:600!important}
body.t-mod .responsive-table,body.t-mod .table-box{border:1px solid var(--t-line)!important;border-radius:var(--t-r-md)!important;background:#fff!important}
body.t-mod .total-cell,body.t-mod .grand-total td,body.t-mod .grand-total th{background:var(--t-surface-2)!important;color:var(--t-ink)!important;font-weight:600!important}
body.t-mod .mora-badge,body.t-mod .badge,body.t-mod .tag{text-transform:none!important;letter-spacing:0!important}

/* Mensajes */
body.t-mod .error-card,body.t-mod .operativo-aviso,body.t-mod .error-box,body.t-insta .error{background:var(--t-neg-soft)!important;border:1px solid color-mix(in srgb,var(--t-neg) 25%,#fff)!important;color:var(--t-neg)!important;border-radius:var(--t-r-md)!important}
body.t-mod .empty-state{background:var(--t-surface-2)!important;border:1px dashed var(--t-line)!important;color:var(--t-muted)!important;border-radius:var(--t-r-md)!important}

/* Ventanas emergentes */
body.t-mod .modal{background:rgba(11,46,51,.45)!important;backdrop-filter:blur(2px)}
body.t-mod .modal-content,body.t-mod .modal-card{border-radius:16px!important;border:1px solid var(--t-line)!important;box-shadow:var(--t-shadow-pop)!important}
body.t-mod .modal-head,body.t-mod .modal-header{border-bottom:1px solid var(--t-line-2)!important}
body.t-mod .modal h2,body.t-mod .modal h3{font-weight:600!important;color:var(--t-ink)!important;letter-spacing:-.01em}
body.t-mod .close{color:var(--t-muted)!important;background:var(--t-surface-2)!important;border:1px solid var(--t-line)!important;border-radius:8px!important}

/* Pestañas internas, chips y detalles de ventanas */
body.t-mod .tabs button,body.t-insta .tabs-mini button{background:var(--t-surface)!important;color:var(--t-ink-2)!important;border:1px solid var(--t-line)!important;border-radius:8px!important;font-weight:500!important;font-size:13px!important;box-shadow:none!important}
body.t-mod .tabs button:hover,body.t-insta .tabs-mini button:hover{background:var(--brand-soft)!important;color:var(--brand-strong)!important}
body.t-mod .tabs button.active,body.t-insta .tabs-mini button.active{background:var(--brand)!important;color:#fff!important;border-color:var(--brand)!important;font-weight:600!important}
body.t-mod .modal-chip{background:var(--t-surface-2)!important;color:var(--brand-strong)!important;border:1px solid var(--t-line)!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important}
body.t-monge .config-shared-badge{color:var(--brand)!important;text-transform:none!important;letter-spacing:0!important}
body.t-monge .shared-config-row td:first-child{border-left-color:var(--brand)!important}
body.t-mod .error-soft{color:var(--t-neg)!important}
body.t-mod .btn.dark{background:var(--brand-ink)!important;color:#fff!important;border:1px solid var(--brand-ink)!important}
body.t-mod .modal input,body.t-mod .modal select,body.t-mod .modal textarea{border-color:var(--t-line)!important;border-radius:8px!important;font-family:inherit}
body.t-mod .modal input:focus,body.t-mod .modal select:focus,body.t-mod .modal textarea:focus{border-color:var(--brand)!important;box-shadow:var(--t-focus)!important;outline:none!important}
body.t-mod .modal label{text-transform:none!important;letter-spacing:0!important;color:var(--t-ink-2)!important;font-weight:500!important}
body.t-mod .hero-buttons{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important}
body.t-monge .hero .logo-card.monge-card{width:64px!important;height:64px!important;flex:0 0 64px!important;margin-bottom:0!important}
.dashboard-toast{background:var(--brand-ink)!important;border-radius:var(--t-r-md)!important;font-family:var(--t-font)}
.dashboard-toast.success{background:var(--t-pos)!important}
.dashboard-toast.warning{background:var(--accent-ink)!important}
body.t-users label.app-option.mandatory{border-color:var(--brand-line)!important;background:var(--brand-soft)!important}
body.t-auth .app-option:has(input:checked),body.t-auth .visibility-setting:has(input:checked){border-color:var(--brand-line)!important;background:var(--brand-soft)!important}
body.t-auth input[type=checkbox]{accent-color:var(--brand)}

@media(max-width:1100px){body.t-claro .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:1000px){body.t-mod .hero{align-items:stretch!important}body.t-mod .hero-actions{align-items:flex-start!important}body.t-mod .hero-buttons,body.t-mod .operativo-toolbar{justify-content:flex-start!important}body.t-mod .hero-meta{text-align:left!important}}
@media(max-width:600px){
  body.t-mod .hero{padding:18px 18px 18px 22px!important}
  body.t-mod .hero .logo-card{width:52px!important;height:52px!important;flex-basis:52px!important}
  body.t-mod .kpi-card strong,body.t-mod .kpi b,body.t-insta .kpi strong{font-size:20px!important}
  body.t-mod .quick-actions,body.t-insta .actions{flex-wrap:nowrap!important;overflow-x:auto!important;scrollbar-width:none}
  body.t-mod .quick-actions::-webkit-scrollbar,body.t-insta .actions::-webkit-scrollbar{display:none}
  body.t-monge .scope-tabs{display:flex!important;width:100%!important}
  body.t-monge .scope-pill{flex:1 1 auto;width:auto!important;padding:8px 10px!important}
}

/* =============================================================================
   Facturación General: conserva su diseño ejecutivo y adopta la marca
   ========================================================================== */
body.t-fact{
  --bg:var(--t-bg); --ink:var(--t-ink); --ink-2:var(--t-ink-2); --muted:var(--t-muted); --faint:var(--t-faint);
  --line:var(--t-line); --line-2:var(--t-line-2); --surface-2:var(--t-surface-2); --surface-3:var(--t-surface-3);
  --accent:var(--brand); --accent-ink:var(--brand-strong); --accent-soft:var(--brand-soft); --accent-line:var(--brand-line);
  --s-fact:var(--brand); --s-proy:var(--brand-light); --s-meta:var(--brand-accent);
  --good:var(--t-pos); --good-ink:#13603b; --good-soft:var(--t-pos-soft); --good-bar:#2f8f5f;
  --bad:var(--t-neg); --bad-ink:#93291d; --bad-soft:var(--t-neg-soft); --bad-bar:#c75545;
  --focus:var(--t-focus); --font:var(--t-font);
  background:var(--t-bg)!important;
}
body.t-fact .btn{font-weight:600!important;font-size:13px!important;padding:0 14px!important;border-radius:8px!important}
body.t-fact .kicker,body.t-fact .kpi-label,body.t-fact .k-label{letter-spacing:.01em!important;text-transform:none!important;font-size:12.5px!important;font-weight:500!important}
body.t-fact th{text-transform:none!important;letter-spacing:0!important}
body.t-fact .kpi-label,body.t-fact .av-head,body.t-fact .cb-head,body.t-fact .data-table thead th,body.t-fact .metric span,body.t-fact .section-title,body.t-fact .brand p,body.t-fact .data-table tr.group td{text-transform:none!important;letter-spacing:0!important;font-size:12px!important}
body.t-fact .logo-box img,body.t-fact .login-brand img{inline-size:30px!important;block-size:30px!important}

/* =============================================================================
   Acceso, usuarios, instalación
   ========================================================================== */
body.t-auth{--primary:var(--brand);--navy:var(--brand-ink);--muted:var(--t-muted);--line:var(--t-line);--bg:var(--t-bg)}
body.t-auth .auth-card,body.t-auth .card,body.t-auth .panel,body.t-auth .install-card{border-radius:var(--t-r-lg)!important;border:1px solid var(--t-line)!important;box-shadow:var(--t-shadow)!important}
body.t-auth h1,body.t-auth h2{color:var(--t-ink)!important;font-weight:600!important;letter-spacing:-.015em}
body.t-auth label,body.t-auth .field span{color:var(--t-ink-2)!important;font-weight:500!important}
body.t-auth input,body.t-auth select{border-color:var(--t-line)!important;border-radius:8px!important}
body.t-auth input:focus,body.t-auth select:focus{border-color:var(--brand)!important;box-shadow:var(--t-focus)!important;outline:none!important}
body.t-auth .btn-primary,body.t-auth button.btn-primary,body.t-auth .btn.primary{background:var(--brand)!important;border-color:var(--brand)!important;color:#fff!important;border-radius:8px!important;font-weight:600!important;box-shadow:none!important}
body.t-auth .btn-primary:hover{background:var(--brand-strong)!important}

/* Pantalla de ingreso: panel de marca + formulario */
body.t-login{background:var(--t-surface)!important}
body.t-login .platform-nav{display:none!important}
body.t-login .auth-shell{min-height:100vh!important;display:grid!important;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);padding:0!important;place-items:stretch!important;background:none!important}
body.t-login .auth-aside{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:40px;padding:48px clamp(28px,5vw,72px);background:var(--brand-ink);color:#fff;overflow:hidden}
body.t-login .auth-aside>*{position:relative;z-index:1}
body.t-login .auth-aside::after{content:"";position:absolute;z-index:0;right:-170px;bottom:-210px;width:440px;height:440px;border-radius:50%;border:56px solid rgba(255,255,255,.05);border-top-color:var(--brand-accent);transform:rotate(-20deg)}
body.t-login .auth-aside-brand{display:flex;align-items:center;gap:12px;font-weight:600;font-size:16px}
body.t-login .auth-aside-brand img{width:40px;height:40px;border-radius:10px;background:#fff;object-fit:contain}
body.t-login .auth-aside h2{color:#fff!important;font-size:clamp(28px,3.2vw,42px);line-height:1.12;font-weight:600;letter-spacing:-.025em;max-width:13em;margin:0}
body.t-login .auth-aside p{color:rgba(255,255,255,.72);font-size:15px;line-height:1.6;max-width:32em;margin:14px 0 0}
body.t-login .auth-aside small{color:rgba(255,255,255,.5);font-size:12.5px;position:relative;z-index:1}
body.t-login .auth-card{align-self:center;justify-self:center;width:min(420px,calc(100% - 40px))!important;border:0!important;box-shadow:none!important;padding:24px 0!important;background:transparent!important}
body.t-login .auth-card .brand img{display:none}
body.t-login .auth-card h1{font-size:28px!important}
body.t-login .auth-card .brand p,body.t-login .intro{color:var(--t-muted)!important}
body.t-login .btn-primary{min-height:44px;font-size:14px!important}
body.t-login .security{color:var(--t-faint)!important;border-top-color:var(--t-line-2)!important}
@media(max-width:820px){
  body.t-login .auth-shell{grid-template-columns:1fr;align-content:start}
  body.t-login .auth-aside{padding:28px 24px;gap:18px}
  body.t-login .auth-aside h2{font-size:24px}
  body.t-login .auth-aside p,body.t-login .auth-aside small{display:none}
  body.t-login .auth-aside::after{width:220px;height:220px;border-width:30px;right:-80px;bottom:-110px}
}

/* Iconos */
.qi-chart{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2020h16%22%2F%3E%3Cpath%20d%3D%22M7%2016v-5%22%2F%3E%3Cpath%20d%3D%22M12%2016V6%22%2F%3E%3Cpath%20d%3D%22M17%2016v-8%22%2F%3E%3C%2Fsvg%3E")}
.qi-calendar{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%225%22%20width%3D%2216%22%20height%3D%2215%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M4%2010h16M9%203v4M15%203v4%22%2F%3E%3C%2Fsvg%3E")}
.qi-calcheck{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%225%22%20width%3D%2216%22%20height%3D%2215%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M4%2010h16M9%203v4M15%203v4%22%2F%3E%3Cpath%20d%3D%22m9%2015%202%202%204-4%22%2F%3E%3C%2Fsvg%3E")}
.qi-user{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%228%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M4%2021a8%208%200%200%201%2016%200%22%2F%3E%3C%2Fsvg%3E")}
.qi-trend{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%2017%206-6%204%204%208-8%22%2F%3E%3Cpath%20d%3D%22M15%207h6v6%22%2F%3E%3C%2Fsvg%3E")}
.qi-phone{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%204h4l2%205-2.5%201.5a11%2011%200%200%200%205%205L15%2013l5%202v4a2%202%200%200%201-2%202A16%2016%200%200%201%203%206a2%202%200%200%201%202-2%22%2F%3E%3C%2Fsvg%3E")}
.qi-network{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%225%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%225%22%20cy%3D%2219%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2219%22%20cy%3D%2219%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22M12%207v5M12%2012l-6%205M12%2012l6%205%22%2F%3E%3C%2Fsvg%3E")}
.qi-alert{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.3%203.9%202.4%2018a2%202%200%200%200%201.7%203h15.8a2%202%200%200%200%201.7-3L13.7%203.9a2%202%200%200%200-3.4%200z%22%2F%3E%3Cpath%20d%3D%22M12%209v4M12%2017h.01%22%2F%3E%3C%2Fsvg%3E")}
.qi-target{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%225%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221%22%2F%3E%3C%2Fsvg%3E")}
.qi-file{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203H7a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h10a2%202%200%200%200%202-2V8z%22%2F%3E%3Cpath%20d%3D%22M14%203v5h5M9%2013h6M9%2017h6%22%2F%3E%3C%2Fsvg%3E")}
.qi-upload{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2017v2a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-2%22%2F%3E%3Cpath%20d%3D%22m7%208%205-5%205%205%22%2F%3E%3Cpath%20d%3D%22M12%203v13%22%2F%3E%3C%2Fsvg%3E")}
.qi-download{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2017v2a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-2%22%2F%3E%3Cpath%20d%3D%22m7%2011%205%205%205-5%22%2F%3E%3Cpath%20d%3D%22M12%204v12%22%2F%3E%3C%2Fsvg%3E")}
.qi-grid{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%224%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%224%22%20y%3D%2213%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%2213%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E")}
.qi-edit{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2020h4L18.5%209.5a2.8%202.8%200%200%200-4-4L4%2016v4%22%2F%3E%3Cpath%20d%3D%22m13.5%206.5%204%204%22%2F%3E%3C%2Fsvg%3E")}
.qi-sliders{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%206h10M18%206h2M4%2012h4M12%2012h8M4%2018h12M20%2018h0%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%226%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2212%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%2218%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}
.qi-list{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%206h11M9%2012h11M9%2018h11%22%2F%3E%3Cpath%20d%3D%22M4%206h.01M4%2012h.01M4%2018h.01%22%2F%3E%3C%2Fsvg%3E")}
.qi-search{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%227%22%2F%3E%3Cpath%20d%3D%22m20%2020-4-4%22%2F%3E%3C%2Fsvg%3E")}
.qi-refresh{--qi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2011a8%208%200%201%200-2.3%205.7%22%2F%3E%3Cpath%20d%3D%22M20%204v7h-7%22%2F%3E%3C%2Fsvg%3E")}
