/* tablero.css — v2.1.5: panel con menú de iconos + barra superior + tablero en vivo. Colores del tema actual (naranja #FF6016). */
:root { --t-radio: 24px; --t-gris: #ece9da; --t-prev: #d6d2bd; }
html.tema-oscuro { --t-gris: #2a2a1f; --t-prev: #55533f; }

.panel-wrapper { display: flex; min-height: 100vh; background: var(--fondo-pagina); }
.panel-principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-contenido { padding: 8px 28px 40px; }

/* ---- Menú lateral de iconos (cápsula blanca flotante) ---- */
.panel-menu { width: 92px; margin: 14px 0 14px 14px; padding: 10px 6px; border-radius: 32px; background: var(--fondo-tarjeta); box-shadow: 0 4px 18px rgba(28,27,11,.08);
    display: flex; flex-direction: column; justify-content: space-between; align-self: flex-start; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
.rail-grupo { display: flex; flex-direction: column; gap: 4px; }
.panel-menu a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border: 0; border-radius: 22px; font-size: 11px; line-height: 1.15; text-align: center; color: var(--texto-principal); }
.panel-menu a .rail-txt { font-weight: 600; max-width: 76px; overflow-wrap: anywhere; }
.panel-menu a:hover { background: #fff1e8; color: var(--color-naranja-texto, #B03A08); }
.panel-menu a.activo { background: var(--color-naranja); color: #fff; }
.panel-menu a.activo:hover { background: var(--color-naranja); color: #fff; }
.panel-menu .menu-alerta { position: absolute; top: 4px; right: 12px; margin: 0; }
html.tema-oscuro .panel-menu a:hover { background: #3a2a20; }

/* ---- Barra superior ---- */
.panel-barra { display: flex; align-items: center; gap: 14px; margin: 14px 28px 6px; padding: 8px 12px 8px 18px; border-radius: 999px; background: var(--fondo-tarjeta); box-shadow: 0 4px 18px rgba(28,27,11,.08); }
.barra-logo { display: flex; flex-shrink: 0; }
.barra-tienda { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barra-tienda label { font-size: 12px; opacity: .7; white-space: nowrap; }
.barra-tienda .selector-tienda { max-width: 220px; min-height: 40px; border-radius: 999px; padding: 0 14px; }
.barra-buscador { flex: 1; min-width: 120px; display: flex; align-items: center; background: var(--t-gris); border-radius: 999px; padding: 0 6px 0 16px; }
.barra-buscador input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; font: inherit; color: inherit; outline-offset: 4px; }
.barra-buscador button { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: inherit; display: grid; place-items: center; }
.barra-acciones { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.barra-icono { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--t-gris); color: inherit; border: 0; cursor: pointer; text-decoration: none; }
.barra-icono .badge-notif { position: absolute; top: -2px; right: -2px; }
.barra-perfil { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--t-gris); color: inherit; text-decoration: none; }
.barra-perfil .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-naranja); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.barra-perfil-txt { display: flex; flex-direction: column; line-height: 1.15; font-size: 13px; }
.barra-perfil-txt small { opacity: .7; font-size: 11px; }

/* ---- Saludo y controles ---- */
.t-saludo { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-end; margin: 20px 0 18px; }
.t-saludo h1 { font-size: clamp(24px, 3.2vw, 36px); line-height: 1.1; }
.t-saludo h1 span { opacity: .45; }
.t-saludo p { margin-top: 4px; opacity: .75; }
.t-controles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.t-pildora { display: inline-flex; background: var(--fondo-tarjeta); border-radius: 999px; padding: 4px; box-shadow: 0 2px 10px rgba(28,27,11,.06); }
.t-pildora button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; min-height: 40px; border-radius: 999px; cursor: pointer; }
.t-pildora button.activo { background: var(--color-oscuro); color: #fff; }
html.tema-oscuro .t-pildora button.activo { background: var(--color-naranja); }
.t-vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px; background: var(--fondo-tarjeta); }
.t-vivo i { width: 9px; height: 9px; border-radius: 50%; background: #3a9d23; box-shadow: 0 0 0 0 rgba(58,157,35,.6); animation: t-pulso 2s infinite; }
.t-vivo.caido i { background: #b3261e; animation: none; }
.t-vivo.caido span::after { content: " (reconectando)"; font-weight: 400; }
@keyframes t-pulso { 70% { box-shadow: 0 0 0 8px rgba(58,157,35,0); } 100% { box-shadow: 0 0 0 0 rgba(58,157,35,0); } }
@media (prefers-reduced-motion: reduce) { .t-vivo i { animation: none; } }

/* ---- Tarjetas ---- */
.t-tarjeta, .t-hero { background: var(--fondo-tarjeta); border-radius: var(--t-radio); padding: 20px 22px; box-shadow: 0 4px 18px rgba(28,27,11,.06); min-width: 0; }
.t-tarjeta > header, .t-kpi > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.t-tarjeta h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.t-tarjeta h3 { font-size: 14px; margin: 18px 0 8px; }
.t-rejilla { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; margin-bottom: 16px; }
.t-hero { background: var(--color-naranja); color: #fff; display: flex; flex-direction: column; gap: 8px; }
.t-hero header { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.t-hero-cifra { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; overflow-wrap: anywhere; }
.t-hero p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.t-hero small { opacity: .9; }
.t-hero dl { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t-hero dt { font-size: 12px; opacity: .9; } .t-hero dd { font-weight: 700; font-size: 18px; }
.t-hero-enlace { display: inline-flex; align-items: center; gap: 8px; justify-content: center; min-height: 44px; margin-top: 6px; border-radius: 999px; background: #fff; color: #7a2a05; font-weight: 700; text-decoration: none; }
.t-grafica .t-leyenda { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.t-leyenda b { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .l-act { background: var(--color-naranja); } .l-prev { background: var(--t-prev); margin-left: 8px; }
.t-svg { width: 100%; height: auto; display: block; }
.t-svg text { font-size: 11px; fill: currentColor; opacity: .7; }
.t-eje { stroke: var(--borde-sutil); }
.b-act { fill: var(--color-naranja); } .b-prev { fill: var(--t-prev); }
.a-rel { fill: rgba(255,96,22,.16); } .a-lin { fill: none; stroke: var(--color-naranja); stroke-width: 2.5; stroke-linejoin: round; } .a-pto { fill: var(--color-naranja); }
.t-area .t-num { font-size: 32px; display: block; margin-bottom: 6px; }
.t-delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--t-gris); }
.t-bueno { background: #dff1c9; color: #2d5f0a; } .t-malo { background: #fbe0d3; color: #9a3408; } .t-nuevo { background: #fff0b8; color: #6b4d00; }
.t-hero .t-delta { background: rgba(255,255,255,.95); }
html.tema-oscuro .t-bueno { background: #23391a; color: #b4d772; } html.tema-oscuro .t-malo { background: #4a2414; color: #ffb08a; } html.tema-oscuro .t-nuevo { background: #4a3c0a; color: #ffd870; }

.t-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.t-kpi { background: var(--fondo-tarjeta); border-radius: var(--t-radio); padding: 18px 20px; box-shadow: 0 4px 18px rgba(28,27,11,.06); }
.t-kpi header { justify-content: flex-start; font-size: 14px; font-weight: 600; opacity: .85; margin-bottom: 6px; }
.t-kpi-valor { display: block; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.t-kpi footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; } .t-kpi small { opacity: .7; }
.t-doble { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.t-partido-barra { height: 16px; border-radius: 999px; background: var(--t-prev); overflow: hidden; } .t-partido-barra i { display: block; height: 100%; background: var(--color-naranja); border-radius: 999px; }
.t-partido-leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 14px; }
.t-partido-leyenda b { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; } .p1 { background: var(--color-naranja); } .p2 { background: var(--t-prev); }
.t-nota { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; font-size: 14px; }
.t-horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 96px; align-items: end; }
.t-hora { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; align-items: center; } .t-hora i { width: 100%; border-radius: 4px; background: var(--t-prev); } .t-hora.pico i { background: var(--color-naranja); } .t-hora small { font-size: 9px; height: 12px; opacity: .7; }
.t-rank { list-style: none; display: grid; gap: 10px; } .t-rank li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.t-rank li div { min-width: 0; } .t-rank small { display: block; opacity: .7; } .t-rank strong { overflow-wrap: anywhere; }
.t-puesto { width: 30px; height: 30px; border-radius: 50%; background: var(--t-gris); display: grid; place-items: center; font-weight: 700; font-size: 13px; } .t-rank li:first-child .t-puesto { background: var(--color-amarillo); color: #1C1B0B; }
.t-rank-num { font-size: 13px; font-weight: 600; text-align: right; }
.t-vacio { opacity: .7; padding: 6px 0; }
.t-lista { list-style: none; display: grid; gap: 8px; margin-top: 8px; } .t-lista li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--t-gris); } .t-lista li strong { flex: 1 1 140px; } .t-lista small { opacity: .75; }
.t-nueva { outline: 2px solid var(--color-naranja); animation: t-parpadeo 1.2s 3; }
@keyframes t-parpadeo { 50% { background: #ffe1cf; } }
.t-resalta { box-shadow: 0 0 0 2px var(--color-naranja), 0 4px 18px rgba(28,27,11,.06); }
.t-tarjeta .estante { margin-top: 10px; }
.t-estado { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; } .t-estado i { width: 9px; height: 9px; border-radius: 50%; background: #999; }
.t-e-entregado i { background: #3a9d23; } .t-e-cancelado i { background: #b3261e; } .t-e-pendiente i, .t-e-confirmado i { background: var(--color-amarillo); } .t-e-en_preparacion i, .t-e-en_camino i { background: var(--color-naranja); }
.t-feed-flotante { position: fixed; right: 18px; bottom: 18px; z-index: 40; list-style: none; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.t-noticia { background: var(--color-oscuro); color: #fff; padding: 12px 16px; border-radius: 16px; font-size: 14px; border-left: 6px solid var(--color-naranja); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.t-noticia.fiao { border-left-color: var(--color-amarillo); }

@media (max-width: 1100px) { .t-rejilla { grid-template-columns: 1fr 1fr; } .t-grafica { grid-column: 1 / -1; order: 3; } }
@media (max-width: 768px) {
    .panel-wrapper { flex-direction: column; }
    .panel-principal { order: 1; } .panel-menu { order: 2; }
    /* 🧒 En celular el menú de iconos baja y queda como barra fija abajo. */
    .panel-menu { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; margin: 0; z-index: 60; flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; border-radius: 28px; padding: 6px; }
    .rail-grupo { flex-direction: row; } .rail-abajo { margin-left: 4px; }
    .panel-menu a { min-width: 64px; min-height: 52px; padding: 6px 4px; } .panel-menu a .rail-txt { font-size: 10px; }
    .panel-menu .menu-alerta { right: 8px; }
    .panel-barra { margin: 8px 12px 4px; flex-wrap: wrap; border-radius: 28px; padding: 8px 12px; gap: 8px; }
    .barra-buscador { order: 5; flex-basis: 100%; }
    .barra-perfil-txt { display: none; } .barra-perfil { padding: 4px; }
    .barra-tienda label { display: none; } .barra-tienda .selector-tienda { max-width: 150px; }
    .panel-contenido { padding: 8px 14px 110px; }
    .t-rejilla { grid-template-columns: 1fr; } .t-grafica { order: 0; grid-column: auto; }
    .t-doble { grid-template-columns: 1fr; }
    .t-feed-flotante { bottom: 92px; }
}

/* ---- Ajustes tras la revisión visual ---- */
.t-hero-cifra { font-size: clamp(26px, 2.6vw, 38px); white-space: nowrap; }
.t-tarjeta header .btn, .t-lista .btn, .t-tarjeta .reponer .btn { width: auto; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.t-lista li .btn { margin-left: auto; }
.t-tarjeta .reponer { display: flex; gap: 6px; align-items: center; } .t-tarjeta .reponer input { width: 64px; }
