﻿:root {
    --bg0: #070913;
    --bg1: #0b1022;
    --card: #0f1633cc;
    --card2: #0e1530f0;
    --stroke: #232a52;
    --stroke2: #2e2a63;
    --txt: #E9E7FF;
    --muted: #B9B3E9;
    --purple: #7C3AED;
    --purple2: #A855F7;
    --pink: #EC4899;
    --green: #22C55E;
    --shadow: 0 18px 50px rgba(0,0,0,.45);
    --r: 18px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
    color: var(--txt);
    background: radial-gradient(1200px 900px at 20% 10%, #27104a 0%, transparent 60%), radial-gradient(1000px 800px at 85% 20%, #2b124f 0%, transparent 55%), linear-gradient(180deg, var(--bg0), var(--bg1));
    overflow-x: hidden;
}

.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .85
}

.glow {
    position: absolute;
    width: 700px;
    height: 700px;
    filter: blur(70px);
    border-radius: 50%;
}

.g1 {
    left: -220px;
    top: -220px;
    background: rgba(124,58,237,.35)
}

.g2 {
    right: -250px;
    top: -140px;
    background: rgba(236,72,153,.22)
}

.g3 {
    right: 10%;
    bottom: -320px;
    background: rgba(168,85,247,.20)
}

.topbar {
    position: sticky;
    top: 0;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 22px;
    backdrop-filter: blur(14px);
    background: rgba(8,10,20,.55);
    border-bottom: 1px solid rgba(255,255,255,.06);
    z-index: 10;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center
}

.logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(168,85,247,.10));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 30px rgba(124,58,237,.15);
}

.title {
    font-weight: 800;
    letter-spacing: .2px
}

.subtitle {
    font-size: 12.5px;
    color: var(--muted);
    opacity: .9
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.muted {
    color: var(--muted)
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: .2px;
}

h2 {
    margin: 0
}

.grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.card-head {
    padding: 18px 18px 0;
}

.form {
    padding: 0 18px 18px
}

.output {
    padding: 0 18px 18px
}

.field {
    margin-top: 14px
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(10,14,28,.75);
    color: var(--txt);
    outline: none;
    transition: .15s ease;
}

    input:focus, select:focus {
        border-color: rgba(168,85,247,.65);
        box-shadow: 0 0 0 4px rgba(124,58,237,.18);
    }

.input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .input-wrap input {
        flex: 1
    }

button {
    border: 0;
    cursor: pointer;
    font-weight: 700;
    border-radius: 14px;
    padding: 12px 14px;
    transition: transform .06s ease, background .15s ease, opacity .15s ease;
}

    button:active {
        transform: translateY(1px)
    }

.mini {
    padding: 10px 12px;
    font-size: 12.5px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: var(--txt);
    white-space: nowrap;
}

    .mini:hover {
        background: rgba(255,255,255,.09)
    }

.hint {
    font-size: 12.5px;
    margin-top: 8px;
    color: rgba(185,179,233,.85)
}

.error {
    font-size: 12.5px;
    margin-top: 8px;
    color: #ff86a6;
    min-height: 18px
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;

 flex-wrap: wrap;
}

.primary {
    flex: 1;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    color: #fff;
    box-shadow: 0 14px 30px rgba(124,58,237,.28);
}

    .primary:hover {
        filter: brightness(1.05)
    }

    .primary:disabled {
        opacity: .5;
        cursor: not-allowed
    }

.ghost {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: var(--txt);
}

    .ghost:hover {
        background: rgba(255,255,255,.09)
    }

    .ghost:disabled {
        opacity: .45;
        cursor: not-allowed
    }

.fineprint {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12.5px;
    color: rgba(185,179,233,.9);
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px dashed rgba(168,85,247,.35);
    background: rgba(124,58,237,.08);
}

.tag {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
}

.tabs {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.tab {
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: var(--txt);
    font-size: 12.5px;
}

    .tab.active {
        background: rgba(124,58,237,.18);
        border-color: rgba(168,85,247,.45);
        box-shadow: 0 10px 24px rgba(124,58,237,.18);
    }

.panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(10,14,28,.55);
    min-height: 260px;
}

.empty {
    height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(124,58,237,.16);
    border: 1px solid rgba(168,85,247,.38);
    box-shadow: 0 18px 40px rgba(124,58,237,.18);
    font-size: 22px;
}

.empty-title {
    margin-top: 10px;
    font-weight: 800
}

.empty-text {
    margin-top: 6px;
    color: rgba(185,179,233,.9);
    max-width: 300px
}

.divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 14px 0;
}

.output-actions {
    display: flex;
    gap: 10px
}

.footer {
    margin: 18px 0 10px;
    text-align: center;
    opacity: .8;
    font-size: 12.5px;
}

.toast-wrap {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: grid;
    gap: 10px;
    z-index: 999;
}

.toast {
    width: 320px;
    padding: 12px 12px;
    border-radius: 16px;
    background: rgba(15,22,51,.92);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 20px 60px rgba(0,0,0,.40);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
    /* Compatibilidad: tu CSS original usaba .t-ic, pero el HTML/JS usa .t-icon */
    .toast .t-ic,
    .toast .t-icon {
        width: 30px;
        height: 30px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        background: rgba(124,58,237,.18);
        border: 1px solid rgba(168,85,247,.35);
    }

    .toast .t-title {
        font-weight: 800
    }

    .toast .t-msg {
        margin-top: 2px;
        font-size: 12.5px;
        color: rgba(185,179,233,.95)
    }

    .toast .t-close {
        margin-left: auto;
        background: transparent;
        border: 0;
        color: rgba(233,231,255,.8);
        padding: 2px 8px;
        font-size: 18px;
    }

        .toast .t-close:hover {
            color: #fff
        }

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr
    }
}

@media (max-width: 560px) {
    .row {
        grid-template-columns: 1fr
    }

    .input-wrap {
        flex-direction: column;
        align-items: stretch
    }

    .mini {
        width: 100%
    }
}

/* ==========================================================
   PLAN UI + PRINT
========================================================== */
.plan-card {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    background: rgba(15,22,51,.55);
    box-shadow: 0 16px 45px rgba(0,0,0,.30);
    padding: 14px;
}

.plan-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.plan-head-left {
    display: grid;
    gap: 8px
}

.plan-title {
    font-weight: 900;
    letter-spacing: .2px
}

.plan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.plan-head-right {
    margin-left: auto;
    display: grid;
    gap: 8px;
    justify-items: end
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end
}

.pill-strong {
    background: rgba(124,58,237,.18);
    border-color: rgba(168,85,247,.45)
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px
}

@media (max-width: 560px) {
    .plan-head {
        flex-direction: column;
        align-items: stretch
    }

    .plan-head-right {
        margin-left: 0;
        justify-items: start
    }

    .pill-row {
        justify-content: flex-start
    }
}

.plan-sub {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.plan-total {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(124,58,237,.10);
}

.plan-bets {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.bet-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(10,14,28,.50);
}

    .bet-row b {
        font-weight: 800
    }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(168,85,247,.45);
    background: rgba(124,58,237,.12);
    font-size: 11.5px;
    margin-left: 8px;
}

/* Print wrapper */
.print-wrap {
    padding: 0;
}

/* Impresión a PDF: fondo blanco y legible, sin perder estructura */
@media print {
    :root {
        --txt: #111;
        --muted: #444;
    }

    body {
        background: #fff !important;
        color: #111 !important;
    }

    .bg, .glow, .topbar, .toast-wrap {
        display: none !important;
    }

    .card, .panel, .plan-card {
        background: #fff !important;
        box-shadow: none !important;
        border-color: #ddd !important;
    }

    .plan-total {
        background: #f5f2ff !important;
        border-color: #ddd !important;
    }

    .bet-row {
        background: #fff !important;
        border-color: #ddd !important;
    }

    .tag {
        background: #f5f2ff !important;
        border-color: #bbb !important;
    }
}

/* ==========================================================
   LANDING (HUB) UI
========================================================== */
.hero {
  padding: 26px 22px;
  border-radius: calc(var(--r) + 6px);
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(236,72,153,.10));
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(600px 220px at 20% 20%, rgba(168,85,247,.35), transparent 60%),
              radial-gradient(540px 240px at 80% 30%, rgba(236,72,153,.22), transparent 55%);
  filter: blur(10px);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hero-title {
  font-size: clamp(28px, 3.1vw, 44px);
  font-weight: 900;
  letter-spacing: .2px;
  margin: 0;
}
.hero-sub {
  margin-top: 8px;
  max-width: 62ch;
  color: rgba(185,179,233,.95);
  line-height: 1.45;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--txt);
}
.btn:hover { background: rgba(255,255,255,.09); }
.btn.primary-link {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  border-color: rgba(168,85,247,.35);
  box-shadow: 0 14px 30px rgba(124,58,237,.28);
  color: #fff;
}
.btn.primary-link:hover { filter: brightness(1.05); }
.kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.kpi {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10,14,28,.45);
  border: 1px solid rgba(255,255,255,.08);
}
.kpi .num {
  font-weight: 900;
  font-size: 18px;
}
.kpi .lbl {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(185,179,233,.9);
}

.hub-controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 12px;
}

.project-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

.project {
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,22,51,.55);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 45px rgba(0,0,0,.25);
  display: grid;
  gap: 10px;
}
.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.project-ic {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(124,58,237,.16);
  border: 1px solid rgba(168,85,247,.35);
  box-shadow: 0 18px 40px rgba(124,58,237,.14);
  font-size: 18px;
}
.project-title {
  font-weight: 900;
  margin: 0;
}
.project-desc {
  margin: 0;
  color: rgba(185,179,233,.92);
  font-size: 12.8px;
  line-height: 1.35;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.project-actions a { text-decoration: none; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  font-size: 11.5px;
  color: rgba(233,231,255,.92);
}
.badge.green { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.badge.pink { border-color: rgba(236,72,153,.35); background: rgba(236,72,153,.10); }
.badge.purple { border-color: rgba(168,85,247,.45); background: rgba(124,58,237,.12); }

.small { font-size: 12.5px; color: rgba(185,179,233,.9); }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpis { grid-template-columns: 1fr; }
  .hub-controls { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .project-grid { grid-template-columns: 1fr; }
  .hero-actions { width: 100%; }
  .btn { width: 100%; justify-content: center; }
}
