/*
Theme Name: El Quipu Theme
Theme URI: https://elquipu.pe
Description: Tema personalizado para El Quipu - Convocatorias CAS y noticias del Estado Peruano.
Author: El Quipu
Author URI: https://elquipu.pe
Template: twentytwentyone
Version: 1.0.0
Text Domain: el-quipu-theme
*/

/* ============================================================
   VARIABLES GLOBALES
============================================================ */
:root {
    --red: #b8332f;
    --darkred: #7c2120;
    --ink: #111827;
    --text: #1F2937;
    --muted: #6B7280;
    --line: #E5E7EB;
    --bg: #F5F5F5;
    --green: #059669;
    --amber: #D97706;
    --blue: #1E40AF;
    --font-main: 'Cinzel', Georgia, serif;
    --font-info: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-info);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: none;
}
input, select, button, textarea { font-family: inherit; }
input, select, textarea { font-size: 16px !important; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }

.page-wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ============================================================
   UTIL BAR — Con clima en marquee
============================================================ */
.util-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    font-family: var(--font-info);
    font-size: 12px;
}
.util-bar .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}
.util-bar .left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.util-bar .lbl { color: var(--muted); font-weight: 600; }
.util-bar .val { color: var(--ink); font-weight: 800; }
.util-bar .sep { color: #D1D5DB; }
.util-bar .indicador { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dolar-fijo { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex-shrink: 0; }
.ticker-cambio {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}
.ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: marquee-clima 45s linear infinite;
    will-change: transform;
}
.ticker-cambio:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee-clima {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.clima-item { color: var(--ink); font-weight: 600; }

/* ============================================================
   CABECERA
============================================================ */
.main-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.main-header__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.logo-central img {
    height: 110px;
    width: auto;
    object-fit: contain;
    display: block;
}
#logo-fallback {
    font-family: var(--font-main);
    font-weight: 900;
    font-size: 36px;
    color: var(--ink);
    letter-spacing: 0.06em;
}

/* ============================================================
   NAV DESKTOP
============================================================ */
.nav-gestion {
    background: #fff;
    border-top: 3px solid var(--red);
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 40;
}
.nav-gestion__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 52px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-gestion__inner::-webkit-scrollbar { display: none; }
.nav-menu { display: flex; align-items: stretch; }
.nav-link {
    color: var(--ink);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 14px 14px;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    position: relative;
}
.nav-link:hover { color: var(--red); }
.nav-link.active { color: var(--red); border-bottom-color: var(--red); }
.nav-extras {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.nav-search {
    background: transparent;
    border: none;
    color: var(--ink);
    font-size: 16px;
    padding: 8px;
    cursor: pointer;
    transition: color 0.15s;
}
.nav-search:hover { color: var(--red); }

/* ============================================================
   BREADCRUMB
============================================================ */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
    letter-spacing: 0.12em;
}
.breadcrumb a:hover { color: var(--red); }
.breadcrumb .sep-bc { color: #D1D5DB; font-weight: 400; font-size: 13px; line-height: 1; user-select: none; }
.breadcrumb .current { color: var(--ink); font-weight: 800; letter-spacing: 0.14em; }

/* ============================================================
   ADS
============================================================ */
.ads-container { display: flex; justify-content: center; margin: 22px 0; }
.ad-slot {
    background: #fff;
    border: 1px dashed #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-info);
    font-size: 10px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}
.ad-slot::before { content: 'Publicidad'; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-infeed { width: 100%; max-width: 728px; height: 90px; }
.ad-mpu { width: 100%; max-width: 336px; height: 280px; }
.ad-billboard { width: 100%; max-width: 970px; height: 250px; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: var(--ink);
    color: #9CA3AF;
    border-top: 4px solid var(--red);
    font-family: var(--font-info);
    font-size: 12px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}
.site-footer h4 {
    font-family: var(--font-info);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #D1D5DB;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #374151;
}
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.site-footer a { color: #9CA3AF; text-decoration: none; font-size: 12px; }
.site-footer a:hover { color: #fff; }
.footer-logo {
    display: inline-block;
    background: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    max-width: 220px;
}
.footer-logo img { height: 46px; width: auto; max-width: 100%; display: block; object-fit: contain; }

/* ============================================================
   MOBILE TOPBAR & DRAWER
============================================================ */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #fff;
    border-top: 3px solid var(--red);
    border-bottom: 3px solid var(--red);
    z-index: 60;
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
}
.mobile-topbar__logo {
    font-family: var(--font-main);
    font-weight: 900;
    font-size: 20px;
    color: var(--ink);
    letter-spacing: 0.08em;
    text-decoration: none;
}
.mobile-topbar__actions { display: flex; align-items: center; gap: 8px; }
.mobile-topbar button { background: transparent; border: none; color: var(--ink); font-size: 18px; padding: 6px; cursor: pointer; }

.mobile-drawer {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.mobile-drawer.open { opacity: 1; pointer-events: auto; }
.mobile-drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: 85%; max-width: 340px;
    background: #fff; transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-drawer.open .mobile-drawer__panel { transform: translateX(0); }
.mobile-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.mobile-drawer__header .title { font-family: var(--font-main); font-weight: 900; font-size: 18px; color: var(--ink); }
.mobile-drawer__close { background: transparent; border: none; font-size: 22px; color: var(--ink); cursor: pointer; }
.mobile-drawer__menu { list-style: none; padding: 8px 0; margin: 0; }
.mobile-drawer__menu a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; color: var(--ink); text-decoration: none;
    font-family: var(--font-main); font-size: 14px; font-weight: 700;
    text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.mobile-drawer__menu a.active { color: var(--red); background: var(--bg); }

.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--line); z-index: 50;
    padding: 6px 0; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -1px 6px rgba(0,0,0,0.06);
}
.mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: var(--font-main); font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; color: var(--muted); text-decoration: none; gap: 3px; padding: 4px 2px;
}
.mobile-nav a.active { color: var(--red); }
.mobile-nav a i { font-size: 17px; }

/* ============================================================
   RESPONSIVE GLOBAL
============================================================ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
    .content-grid { grid-template-columns: 1fr; }
    .sidebar-col { position: static; }
    .logo-central img { height: 90px; }
    #logo-fallback { font-size: 30px; }
}
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }
    .mobile-drawer { display: block; }
    .mobile-nav { display: flex; }
    .main-header { display: none; }
    .nav-gestion { display: none; }
    .breadcrumb-bar { margin-top: 56px; }
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    .util-bar .inner { padding: 6px 0; gap: 6px; }
    .util-bar .dolar-fijo .lbl { display: none; }
    #fecha-actual { font-size: 10px !important; }
    .clima-item { font-size: 10px !important; }
    .util-bar .clima-item.mobile-hide { display: none; }
    .breadcrumb { font-size: 10px; gap: 6px; }
    .breadcrumb-bar { padding: 11px 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .site-footer { padding-top: 30px; }
}
@media (max-width: 480px) {
    .page-wrap { padding: 0 12px; }
    .mobile-topbar__logo { font-size: 18px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
    .util-bar > .page-wrap {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .ticker-track, .ticker-news { animation: none; }
}
/* ============================================================
   RESET CONTRA ESTILOS DEL TEMA PADRE
============================================================ */
body {
    background: var(--bg) !important;
    font-family: var(--font-info) !important;
    color: var(--text) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    color: var(--ink);
}
a { color: inherit; }
.page-wrap > *:first-child { margin-top: 0; }

/* ============================================================
   PÁGINA APÓYANOS
============================================================ */
.apoyar-container {
    max-width: 960px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 4px solid var(--red);
    border-radius: 8px;
    padding: 48px 40px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.apoyar-titulo-seccion {
    font-family: var(--font-main);
    font-size: 26px;
    font-weight: 800;
    color: var(--red);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
}
.apoyar-subtitulo {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 32px;
    text-align: center;
}
.manifiesto-box {
    background: #FAFAFA;
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink);
    border-radius: 0 8px 8px 0;
    padding: 24px;
    margin-bottom: 36px;
}
.manifiesto-box h3 {
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.manifiesto-box p {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.7;
    margin: 0;
}
.infra-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.infra-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 20px;
}
.infra-item h4 {
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
    text-transform: uppercase;
}
.infra-item p {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}
.donacion-metodos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 30px;
    padding-top: 36px;
    border-top: 1px solid var(--line);
    align-items: stretch;
}
.metodo-card {
    background: #FAFAFA;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    gap: 16px;
}
.metodo-card h3 {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    letter-spacing: 0.02em;
}
.yape-box-wrapper {
    background: #fff;
    border: 2px solid #E9D5FF;
    padding: 14px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    width: 100%;
}
.yape-qr-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
}
.yape-titular {
    font-size: 11.5px;
    font-weight: 700;
    color: #742284;
    background: #F3E8FF;
    padding: 4px 10px;
    border-radius: 10px;
}
.montos-sugeridos {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}
.monto-chip {
    background: #fff;
    border: 1px solid var(--line);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
}
.paypal-montos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}
.btn-paypal-monto {
    background: #fff;
    color: #003087;
    border: 1px solid #BFDBFE;
    text-decoration: none;
    padding: 12px 6px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,48,135,0.04);
}
.btn-paypal-monto span {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 3px;
}
.btn-paypal-monto:hover {
    background: #003087;
    color: #fff;
    border-color: #003087;
}
.btn-paypal-monto:hover span { color: #E0E7FF; }
.btn-paypal-libre {
    background: #003087;
    color: #fff;
    text-decoration: none;
    padding: 13px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    transition: background 0.15s;
    box-shadow: 0 2px 6px rgba(0,48,135,0.15);
    margin-top: auto;
}
.btn-paypal-libre:hover { background: #002266; }
.compromiso-footer-box {
    margin-top: 40px;
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    border-radius: 8px;
    padding: 22px;
    text-align: center;
}
.compromiso-footer-box p {
    margin: 0;
    font-size: 13.5px;
    color: #9B2C2C;
    line-height: 1.6;
    font-weight: 500;
}

@media (max-width: 768px) {
    .infra-grid { grid-template-columns: 1fr; }
    .donacion-metodos { grid-template-columns: 1fr; }
    .apoyar-container { margin: 16px 12px; padding: 24px 16px; }
}
/* Ocultar breadcrumb duplicado del tema padre */
.wp-block-template-part > .breadcrumb,
.wp-site-blocks > .breadcrumb,
body > .breadcrumb-bar:not(:last-of-type) {
    display: none !important;
}
/* ============================================================
   TICKER URGENTE
============================================================ */
#ticker-urgente {
    background: #fff;
    padding: 10px 0;
    overflow: hidden;
}
#ticker-urgente .inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ticker-urgente-label {
    background: var(--red);
    color: #fff;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ticker-urgente-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: pulse-subtle 1s infinite;
}
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.ticker-news-wrap {
    overflow: hidden;
    flex: 1;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}
.ticker-news {
    display: inline-flex;
    gap: 70px;
    animation: scroll-news 120s linear infinite;
    white-space: nowrap;
    font-family: var(--font-info);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    will-change: transform;
}
.ticker-news:hover { animation-play-state: paused; }
@keyframes scroll-news {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-news a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.15s;
}
.ticker-news a:hover { color: var(--red); }
.ticker-news .news-source {
    color: var(--red);
    font-weight: 800;
    margin-right: 6px;
}

/* Responsive ticker */
@media (max-width: 480px) {
    .ticker-news { font-size: 11px; gap: 40px; }
    .ticker-urgente-label { font-size: 9px; padding: 3px 8px; }
}
/* FORZAR FUENTES EN TODOS LOS ELEMENTOS */
html, body, p, span, div, a, li, button, input, select, textarea,
.ticker-news, .clima-item, .breadcrumb, .news-card__title,
.apoyar-subtitulo, .manifiesto-box p, .infra-item p,
.metodo-card, .monto-chip, .compromiso-footer-box p {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

h1, h2, h3, h4, h5, h6,
.nav-link, .apoyar-titulo-seccion, .manifiesto-box h3,
.infra-item h4, .metodo-card h3, .editorial-section__header h2,
.lead-slide__title, .lead-slide__kicker, .footer-grid h4,
.ticker-urgente-label, .mobile-topbar__logo {
    font-family: 'Cinzel', Georgia, serif !important;
}

/* Restaurar Fuentes específicas */
.ticker-news, .clima-item, .breadcrumb, .plaza-card__entidad,
.plaza-card__desc, .news-card__meta, .info-card p {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}
/* ============================================================
   HISTORIAL DE CÁLCULOS (flotante)
   ============================================================ */

/* Botón flotante para abrir/cerrar el historial */
.historial-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(184, 51, 47, 0.35);
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.historial-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(184, 51, 47, 0.45);
}

.historial-toggle__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #111827;
    color: #fff;
    font-family: var(--font-info);
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Panel del historial */
.historial-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 45;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: var(--font-info);
}

.historial-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.historial-panel__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.historial-panel__header i {
    color: var(--red);
    font-size: 14px;
}

.historial-panel__close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
}

.historial-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.historial-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.historial-item {
    background: #F9FAFB;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.historial-item__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.historial-item__head strong {
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.historial-item__hora {
    font-size: 10.5px;
    color: var(--muted);
}

.historial-item__entradas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 6px;
}

.historial-item__resultado {
    font-size: 12px;
    color: var(--text);
    padding-top: 6px;
    border-top: 1px dashed var(--line);
}

.historial-item__resultado strong {
    color: var(--green);
    font-weight: 800;
}

.historial-panel__footer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
}

.historial-btn {
    flex: 1;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 9px 12px;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.historial-btn:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.historial-btn--danger {
    color: var(--red);
    border-color: #fecaca;
}

.historial-btn--danger:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* Ajuste móvil */
@media (max-width: 768px) {
    .historial-toggle {
        bottom: 90px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .historial-panel {
        bottom: 150px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: 65vh;
    }
}