/* Ticopa Finanzas · r17 «moderno» (pedido de Piero 31/10). Solo presentación: no cambia datos, cálculos ni llamadas al servidor.
   Se carga DESPUÉS de ticopa-marcador-finanzas.css. Tokens --m-* ACORDADOS con el Hub y el portal admin (mismos valores). */
:root {
  --m-cristal: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  --m-tarjeta: linear-gradient(160deg, #1a1748 0%, #14123a 60%, #120f33 100%);
  --m-cabecera: radial-gradient(120% 140% at 0% 0%, rgba(139,92,246,.34), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(255,45,85,.16), transparent 60%), linear-gradient(135deg, #231d63, #15123d);
  --m-borde: rgba(180,157,255,.14);
  --m-borde-fuerte: rgba(180,157,255,.28);
  --m-acento: linear-gradient(90deg, #8b5cf6, #ff2d55);
  --m-r-chip: 999px; --m-r-ctl: 10px; --m-r-card: 16px; --m-r-hero: 20px;
  --m-sombra-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px -10px rgba(8,4,30,.8);
  --m-sombra-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 40px -22px rgba(76,40,190,.65);
}
body::before { opacity: .06 !important; }

/* Cabecera: bloque con degradado, título grande, línea de acento, rótulo sin mayúsculas */
html body .finance-header { position: relative; overflow: hidden; background: var(--m-cabecera) !important; border: 1px solid var(--m-borde) !important; border-radius: var(--m-r-hero) !important; box-shadow: var(--m-sombra-2) !important; }
html body .finance-header::after { content: ""; position: absolute; left: clamp(18px, 3vw, 32px); bottom: 0; width: 60px; height: 3px; border-radius: 3px 3px 0 0; background: var(--m-acento); }
html body .finance-header .eyebrow { color: var(--violeta-texto) !important; font: 600 .9rem/1.3 var(--f-texto) !important; letter-spacing: 0 !important; text-transform: none !important; }
html body .finance-title { font-size: clamp(2.4rem, 1.4rem + 3vw, 4rem) !important; line-height: .92 !important; letter-spacing: -.01em !important; text-shadow: 0 2px 30px rgba(139, 92, 246, .35); }
html body .finance-subtitle { font-weight: 400 !important; }
html body .mc-placa-fin { transform: none !important; border-radius: var(--m-r-chip) !important; height: 26px; padding: 0 12px; background: linear-gradient(90deg, rgba(139, 92, 246, .3), rgba(255, 45, 85, .22)) !important; border: 1px solid rgba(255, 120, 160, .38); color: #fff !important; font: 600 .82rem/1 var(--f-texto) !important; letter-spacing: 0 !important; text-transform: none !important; vertical-align: middle; }
html body :is(.mc-ir-hub-fin, .finance-account-btn) { border-radius: var(--m-r-chip) !important; background: rgba(139, 92, 246, .1) !important; border: 1px solid var(--m-borde-fuerte) !important; text-transform: none !important; letter-spacing: 0 !important; font-family: var(--f-texto) !important; font-weight: 600 !important; }
html body .fa-rol { border-radius: var(--m-r-chip) !important; text-transform: none !important; }
html body .readonly-banner { border-radius: var(--m-r-card) !important; border: 1px solid rgba(69, 212, 255, .3) !important; border-left: 3px solid #45d4ff !important; background: rgba(69, 212, 255, .08) !important; color: var(--texto) !important; }

/* Menú lateral: ítems suaves, activo con barra de acento */
html body .finance-sidebar .nav-tabs, html body .nav-tabs { background: linear-gradient(180deg, rgba(20, 18, 58, .9), rgba(11, 10, 36, .9)) !important; border: 1px solid var(--m-borde) !important; border-radius: var(--m-r-card) !important; padding: 10px !important; box-shadow: var(--m-sombra-1) !important; }
html body .nav-tabs .nav-link { position: relative; min-height: 42px; font: 500 .95rem/1.3 var(--f-texto) !important; transition: background .15s, color .15s; }
html body .nav-tabs .nav-link i { color: var(--tenue); width: 18px; text-align: center; }
html body .nav-tabs .nav-link:hover { background: rgba(139, 92, 246, .08) !important; }
html body .nav-tabs .nav-link.active { background: rgba(139, 92, 246, .16) !important; color: #fff !important; font-weight: 600 !important; box-shadow: none !important; }
html body .nav-tabs .nav-link.active i { color: var(--violeta-texto); }
html body .nav-tabs .nav-link.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--m-acento); }
html body .finance-menu-toggle { border-radius: var(--m-r-card) !important; border-color: var(--m-borde-fuerte) !important; }

/* Tarjetas */
html body .card { background: var(--m-cristal), var(--m-tarjeta) !important; border: 1px solid var(--m-borde) !important; border-radius: var(--m-r-card) !important; box-shadow: var(--m-sombra-1) !important; }
html body .card .card { background: rgba(11, 10, 36, .35) !important; box-shadow: none !important; }
html body .section-title, html body .card > strong, html body .card h2, html body .card h3:not(.metric-card h3) { text-transform: none !important; letter-spacing: 0 !important; }
html body .card .eyebrow { color: var(--violeta-texto) !important; font: 600 .82rem/1.3 var(--f-texto) !important; letter-spacing: 0 !important; text-transform: none !important; }
html body .section-icon { border-radius: 12px !important; background: rgba(139, 92, 246, .16) !important; border-color: transparent !important; }
#gastoIaFinanzas h3, #gastoIaFinanzas h4, #gastoIaFinanzas h5, html body .card :is(h4, h5).text-info { color: var(--texto) !important; font: 800 clamp(1.5rem, 1.1rem + 1vw, 1.9rem)/1 var(--f-display) !important; letter-spacing: -.005em !important; }

/* Cifras grandes */
html body .metric-card { background: var(--m-cristal), var(--m-tarjeta) !important; border: 1px solid var(--m-borde) !important; border-radius: var(--m-r-card) !important; box-shadow: var(--m-sombra-1) !important; position: relative; overflow: hidden; padding: 16px 18px !important; }
html body .metric-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--m-acento); }
html body .metric-card :is(h3, h4, .h3, .h4) { font: 800 clamp(2.4rem, 1.6rem + 2vw, 3.4rem)/.9 var(--f-display) !important; color: #fff !important; letter-spacing: -.01em; }

/* Botones: sin mayúsculas */
html body .btn { text-transform: none !important; letter-spacing: 0 !important; font-family: var(--f-texto) !important; font-weight: 700 !important; border-radius: var(--m-r-ctl) !important; transition: background .15s, border-color .15s, box-shadow .15s; }
html body .btn-ticopa { box-shadow: 0 8px 20px -10px rgba(115, 68, 240, .9) !important; }
html body .btn-outline-info, html body .btn-outline-light, html body .btn-outline-secondary { background: rgba(139, 92, 246, .1) !important; border-color: var(--m-borde-fuerte) !important; }
html body .btn-warning { background: var(--espera) !important; border-color: var(--espera) !important; color: #1a1400 !important; }
html body .btn-group { gap: 4px; padding: 4px; border-radius: 12px; background: rgba(11, 10, 36, .5); border: 1px solid var(--m-borde); }
html body .btn-group > .btn { border-radius: 8px !important; border-color: transparent !important; }

/* Campos */
html body :is(.form-control, .form-select) { min-height: 42px; background-color: rgba(11, 10, 36, .55) !important; border: 1px solid var(--m-borde-fuerte) !important; border-radius: var(--m-r-ctl) !important; transition: border-color .15s, box-shadow .15s; }
html body :is(.form-control, .form-select):hover { border-color: rgba(180, 157, 255, .42) !important; }
html body :is(.form-control, .form-select):focus { border-color: var(--violeta) !important; box-shadow: 0 0 0 3px rgba(139, 92, 246, .28) !important; }
html body .form-control::placeholder { color: rgba(185, 182, 221, .55) !important; }
html body .form-control[type="file"]::file-selector-button { background: rgba(139, 92, 246, .16); color: var(--texto); border: 0; border-right: 1px solid var(--m-borde-fuerte); }
html body .input-group-text { background: rgba(139, 92, 246, .12) !important; border-color: var(--m-borde-fuerte) !important; color: var(--suave) !important; }

/* Tablas: también la del «Gasto de IA», que salía blanca */
html body .table-responsive { border: 1px solid var(--m-borde) !important; border-radius: var(--m-r-card) !important; background: rgba(20, 18, 58, .6); }
html body .table, html body .table-dark { --bs-table-bg: transparent; --bs-table-color: var(--texto); --bs-table-striped-bg: rgba(139, 92, 246, .035); --bs-table-hover-bg: rgba(139, 92, 246, .07); --bs-table-hover-color: var(--texto); --bs-table-border-color: rgba(180, 157, 255, .08); color: var(--texto) !important; margin-bottom: 0 !important; }
html body .table > :not(caption) > * > * { background-color: transparent !important; color: inherit; padding: 11px 14px !important; border-bottom-color: rgba(180, 157, 255, .08) !important; }
html body .table thead th { color: var(--tenue) !important; background: rgba(255, 255, 255, .03) !important; font: 700 .76rem/1.2 var(--f-datos) !important; letter-spacing: .02em !important; border-bottom: 1px solid var(--m-borde) !important; }
html body .table tbody tr { transition: background .12s; }
html body .table tbody tr:hover > * { background-color: rgba(139, 92, 246, .07) !important; }
html body .table tfoot td, html body .table tr:last-child > :is(td, th) { border-bottom: 0 !important; }
#gastoIaFinanzas .table tr:last-child > * { font-weight: 700; color: #fff; background: rgba(139, 92, 246, .08) !important; }
/* Fila «no hay…» como estado vacío */
html body .table td.text-center.text-secondary[colspan] { padding: 34px 16px !important; color: var(--suave) !important; font: 500 .95rem/1.5 var(--f-texto) !important; }
html body .table td.text-center.text-secondary[colspan]::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%;
  background: rgba(139, 92, 246, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b49dff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18M3 12h18M3 17h10'/%3E%3C/svg%3E") center / 22px no-repeat; }

/* Avisos */
html body .alert { border-radius: var(--m-r-card) !important; border: 1px solid var(--m-borde) !important; background: rgba(139, 92, 246, .08) !important; color: var(--texto) !important; }
html body .alert-warning { border-color: rgba(245, 197, 66, .3) !important; border-left: 3px solid var(--espera) !important; background: rgba(245, 197, 66, .07) !important; }
html body .alert-danger { border-color: rgba(255, 92, 122, .3) !important; border-left: 3px solid var(--rojo) !important; background: rgba(255, 45, 85, .07) !important; }
html body .alert-success { border-color: rgba(32, 232, 155, .3) !important; border-left: 3px solid var(--ok) !important; background: rgba(32, 232, 155, .07) !important; }
html body .badge { border-radius: var(--m-r-chip) !important; font-weight: 600 !important; letter-spacing: 0 !important; }

/* Pantalla ancha: el contenido usa el ancho (sin huecos a los lados) */
@media (min-width: 1600px) { html body .finance-shell { max-width: 1760px !important; margin-inline: auto !important; } }
@media (max-width: 760px) {
  html body .finance-header::after { left: 16px; }
  html body .finance-title { font-size: 2.6rem !important; }
}
@media (prefers-reduced-motion: reduce) { html body * { transition: none !important; } }
/* r17 · celular vertical (pedido de Piero 31/10): botones ES/EN cómodos para el dedo y tablas vacías sin el aviso cortado */
@media (max-width: 760px) {
  html body .ticopa-idioma button { min-height: 40px; min-width: 44px; }
  html body .table-responsive:has(tbody > tr:only-child > td[colspan]) table { min-width: 0 !important; }
  html body .table-responsive:has(tbody > tr:only-child > td[colspan]) thead { display: none; }
  html body .table-responsive:has(tbody > tr:only-child > td[colspan]) td[colspan] { white-space: normal !important; }
}

/* r17 botones (31/10): el menú «Mi cuenta» (Cambiar de cuenta, idioma) se abre debajo de la cabecera;
   con overflow:hidden quedaba cortado e inalcanzable. La cabecera deja ver lo que sale de ella. */
html body .finance-header { overflow: visible !important; z-index: 20; }
