/* =====================================================================
   JP2000 - estilos
   Fondo rojo oscuro con brillo, tarjetas de vidrio, pensado para celular.
   ===================================================================== */

:root {
    /* Verde JP2000 (como el logo y la referencia) */
    --bg:        #040605;
    --bg-2:      #0a100c;
    --acc:       #26e097;          /* verde brillante */
    --acc-2:     #159a6b;          /* verde profundo */
    --acc-ink:   #03140d;          /* texto sobre verde */
    --card:      rgba(22, 30, 27, .62);
    --card-2:    rgba(11, 15, 14, .7);
    --glass:     rgba(255, 255, 255, .045);
    --glass-2:   rgba(255, 255, 255, .07);
    --border:    rgba(255, 255, 255, .1);
    --text:      #f1f6f3;
    --muted:     #9fb1a8;
    --dim:       #6c7d75;
    --green:     #26e097;
    --amber:     #ffbe3b;
    --danger:    #ff5d6c;
    --radius:    18px;
    --display:   "Montserrat", system-ui, sans-serif;
    --body:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono:      "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.5;
    background:
        radial-gradient(720px 300px at 50% -10%, rgba(24, 110, 74, .26), transparent 70%),
        radial-gradient(1200px 520px at 50% -20%, rgba(10, 40, 28, .55), transparent 72%),
        linear-gradient(180deg, #060908 0%, var(--bg) 45%, #030404 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Rejilla de puntos */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.25) 100%);
            mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.25) 100%);
    z-index: 0;
}

/* Lucecitas flotantes: las dibuja assets/particles.js en este canvas */
.sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.wrap { position: relative; z-index: 1; }

a { color: var(--acc); }
.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Barra superior ---------- */

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px;
}
.brand {
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
    color: var(--text); text-decoration: none;
    font-family: var(--display); font-weight: 900; letter-spacing: .06em;
}
.brand img {
    width: 40px; height: 40px; object-fit: contain;   /* el logo ya trae sus bordes redondeados */
    filter: drop-shadow(0 4px 12px rgba(38, 224, 151, .35));
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 999px;
    background: var(--glass); border: 1px solid var(--border);
    font-weight: 600; font-size: .88rem; max-width: 46vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 8px var(--green); flex: none;
}
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--glass); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--glass-2); }
.icon-btn svg { width: 18px; height: 18px; }
.top-actions form { margin: 0; }

/* ---------- Encabezado de sección ---------- */

.hero { text-align: center; padding: 18px 16px 6px; }
.hero h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(1.9rem, 7vw, 3.1rem);
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1.05;
    text-shadow: 0 4px 30px rgba(38, 224, 151, .35);
}
.hero p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- Selector de pestañas (CÓDIGOS / CUENTAS) ---------- */

.seg {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    margin: 20px auto 0;
    border-radius: 999px;
    background: rgba(8, 14, 12, .72);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}
.seg button {
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; cursor: pointer;
    padding: 11px 24px;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--display); font-weight: 800; font-size: .86rem;
    letter-spacing: .1em; text-transform: uppercase;
}
.seg button[aria-selected="true"] {
    color: var(--acc-ink);
    background: linear-gradient(180deg, var(--acc), var(--acc-2));
    box-shadow: 0 8px 22px rgba(38, 224, 151, .45), inset 0 1px 0 rgba(255,255,255,.25);
}
.badge {
    display: inline-block; min-width: 24px; padding: 1px 7px;
    border-radius: 999px; font-size: .72rem; line-height: 1.6;
    background: rgba(255,255,255,.12); color: inherit; text-align: center;
    font-family: var(--body); font-weight: 700; letter-spacing: 0;
}
.seg button[aria-selected="true"] .badge { background: rgba(3,20,13,.18); }

.center { text-align: center; }

/* ---------- Contenido ---------- */

.content { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }

/* Barra fina que indica la próxima actualización */
.pulse-bar {
    width: 170px; height: 4px; margin: 16px auto 0;
    border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden;
}
.pulse-bar span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--acc-2), var(--acc), #4cc3ff);
    border-radius: 4px;
}

/* Estado vacío */
.empty {
    margin-top: 22px;
    padding: 46px 20px;
    text-align: center;
    border: 1px dashed rgba(255,255,255,.14);
    border-radius: 22px;
    background: rgba(255,255,255,.02);
    color: var(--muted);
}
.empty .emoji { font-size: 2.4rem; line-height: 1; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); opacity: .3; animation: blink 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Tarjetas de código (fila compacta) ---------- */

.codes { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 22px auto 0; }

.code-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 16px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-left: 4px solid var(--pc, var(--acc));
    box-shadow: 0 12px 34px rgba(0,0,0,.4);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.code-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--pc, var(--acc)) 55%, transparent);
    box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 22px color-mix(in srgb, var(--pc, var(--acc)) 25%, transparent);
}
.cc-meta { min-width: 0; }
.cc-platform { font-family: var(--display); font-weight: 800; font-size: .92rem; letter-spacing: .03em; }
.cc-email { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-ago { text-align: right; line-height: 1.1; white-space: nowrap; }
.cc-ago small { display: block; font-size: .6rem; letter-spacing: .14em; color: var(--dim); font-weight: 800; text-transform: uppercase; }
.cc-ago strong { font-family: var(--display); font-weight: 900; font-size: .95rem; color: var(--amber); }

/* El código va dentro del botón de copiar */
.code-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--acc) 55%, transparent);
    background: color-mix(in srgb, var(--acc) 12%, transparent);
    color: var(--text);
    font-family: var(--mono); font-weight: 800; font-size: 1.25rem; letter-spacing: .14em;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.code-btn svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.code-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, var(--acc), var(--acc-2));
    color: var(--acc-ink);
    box-shadow: 0 8px 22px rgba(38, 224, 151, .4);
}
.code-btn.is-link { font-family: var(--display); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.cc-actions { display: flex; gap: 6px; }

/* "COPIADO": toda la fila se pone verde un momento */
.cc-copied {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, #1f7a52, #145c3d);
    color: #d9ffee;
    font-family: var(--display); font-weight: 900; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.code-card.copied .cc-copied { opacity: 1; }

/* Barra de tiempo hasta que se borra */
.cc-timer { position: absolute; left: 14px; right: 12px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.06); }
.cc-timer span { display: block; height: 100%; border-radius: 3px; background: var(--acc); transition: width 1s linear; }
.cc-timer.warn span { background: var(--amber); }
.cc-timer.end span  { background: var(--danger); }

@media (max-width: 560px) {
    .code-card { grid-template-columns: auto 1fr auto auto; }
    .code-card > .trash-btn { grid-row: 1; grid-column: 4; }
    .code-card > .code-btn, .code-card > .cc-actions { grid-column: 1 / -1; justify-content: center; }
    .cc-actions .code-btn { flex: 1; justify-content: center; }
}

/* Icono de plataforma */
.p-icon {
    flex: none;
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pc, var(--acc-2)); color: #fff;
    font-family: var(--display); font-weight: 900; font-size: 1.1rem;
    box-shadow: 0 6px 16px rgba(0,0,0,.4);
    overflow: hidden;
}
.p-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Botones ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--glass-2);
    color: var(--text);
    font-family: var(--display); font-weight: 800; font-size: .8rem;
    letter-spacing: .08em; text-transform: uppercase;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: rgba(255,255,255,.11); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-main {
    border-color: transparent; color: var(--acc-ink);
    background: linear-gradient(180deg, var(--acc), var(--acc-2));
    box-shadow: 0 8px 22px rgba(38, 224, 151, .38), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-main:hover { background: linear-gradient(180deg, #45f0ae, #18a874); }
.btn-ok { background: rgba(38, 224, 151, .16); border-color: rgba(38, 224, 151, .5); color: var(--green); }
.btn-danger { background: transparent; border-color: rgba(255, 93, 108, .55); color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: .72rem; border-radius: 10px; }
.btn-block { width: 100%; padding: 14px; font-size: .9rem; }

/* Logo abajo, como marca */
.foot-logo { display: flex; justify-content: center; padding: 50px 16px 40px; position: relative; z-index: 1; }
.foot-logo img { width: 120px; height: auto; opacity: .92; filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
.list-note { text-align: center; color: var(--dim); font-size: .78rem; margin-top: 14px; }

/* ---------- Pestaña Cuentas ---------- */

.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.chip {
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
    border: 1px solid var(--border);
    background: rgba(8, 14, 12, .6);
    color: var(--muted);
    padding: 9px 16px; border-radius: 999px; cursor: pointer;
    font-family: var(--display); font-weight: 800; font-size: .74rem;
    letter-spacing: .08em; text-transform: uppercase;
}
.chip:hover { border-color: rgba(255,255,255,.22); color: var(--text); transform: translateY(-1px); }
.chip b { margin-left: 4px; }
.chip[data-f="active"] b  { color: var(--green); }
.chip[data-f="soon"] b    { color: var(--amber); }
.chip[data-f="expired"] b { color: var(--danger); }
.chip[aria-pressed="true"] {
    color: var(--acc-ink); border-color: transparent;
    background: linear-gradient(180deg, var(--acc), var(--acc-2));
    box-shadow: 0 8px 20px rgba(38, 224, 151, .35);
}
.chip[aria-pressed="true"] b { color: var(--acc-ink); }

.search {
    position: relative; margin: 16px auto 0; max-width: 640px;
}
.search input[type="search"] { padding-left: 42px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--dim); }

.acc-list { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 18px auto 0; }
.acc {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-left: 4px solid var(--sc, var(--dim));
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.acc:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--sc, #777) 60%, transparent);
    box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 20px color-mix(in srgb, var(--sc, #777) 22%, transparent);
}
.acc:hover .acc-date {
    background: var(--sc, #777);
    color: var(--acc-ink);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--sc, #777) 45%, transparent);
}
.acc .p-icon { width: 38px; height: 38px; font-size: 1rem; }
.acc-email { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-platform { color: var(--dim); font-size: .78rem; }
.acc-right { display: flex; align-items: center; gap: 10px; }
.acc-days { text-align: right; line-height: 1.1; }
.acc-days small { display: block; font-size: .62rem; letter-spacing: .14em; color: var(--dim); font-weight: 800; text-transform: uppercase; }
.acc-days strong { font-family: var(--display); font-weight: 900; font-size: 1.05rem; color: var(--sc, var(--muted)); }
.acc-date {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--sc, #777) 45%, transparent);
    background: color-mix(in srgb, var(--sc, #777) 10%, transparent);
    color: var(--sc, var(--muted));
    font-family: var(--display); font-weight: 800; font-size: .74rem; letter-spacing: .06em;
    text-transform: uppercase; white-space: nowrap;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.acc-bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.06); }
.acc-bar span { display: block; height: 100%; border-radius: 3px; background: var(--sc, var(--dim)); }

.acc[data-s="active"]  { --sc: var(--green); }
.acc[data-s="soon"]    { --sc: var(--amber); }
.acc[data-s="expired"] { --sc: var(--danger); }
.acc[data-s="nodate"]  { --sc: #8a7b80; }

@media (max-width: 520px) {
    .acc { grid-template-columns: auto 1fr; }
    .acc-right { grid-column: 1 / -1; justify-content: space-between; }
    .acc-days { text-align: left; }
}

/* ---------- Formularios ---------- */

label { display: block; margin: 0 0 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(3, 7, 6, .6);
    color: var(--text);
    font: inherit;
    font-size: 16px; /* evita el zoom en iPhone */
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(38, 224, 151, .75);
    box-shadow: 0 0 0 3px rgba(38, 224, 151, .18);
}
input[type="date"] { color-scheme: dark; }
textarea { min-height: 110px; resize: vertical; font-size: .92rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.check { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--acc-2); margin: 0; }

.field { margin-bottom: 14px; }

/* ---------- Login ---------- */

.login {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px 16px;
}
.login-logo {
    width: 128px; height: 128px; object-fit: contain;
    filter: drop-shadow(0 18px 40px rgba(0,0,0,.6)) drop-shadow(0 0 36px rgba(38, 224, 151, .35));
}
.login h1 {
    margin: 16px 0 4px;
    font-family: var(--display); font-weight: 900; font-size: clamp(1.7rem, 7vw, 2.1rem); letter-spacing: .08em;
}
.login .sub { color: var(--muted); margin: 0 0 24px; }
.login-card {
    width: 100%; max-width: 420px;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20, 28, 25, .82), rgba(9, 12, 11, .88));
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

/* ---------- Avisos ---------- */

.alert {
    max-width: 640px; margin: 0 auto 16px;
    padding: 12px 16px; border-radius: 12px; border: 1px solid;
    font-size: .9rem;
}
.alert-ok    { border-color: rgba(38,224,151,.5); color: #8ff0b4; background: rgba(38,224,151,.08); }
.alert-error { border-color: rgba(255,93,108,.55); color: #ff9aa4; background: rgba(255,93,108,.09); }

.toast {
    position: fixed; left: 50%; bottom: 22px; z-index: 50;
    transform: translateX(-50%);
    padding: 11px 18px; border-radius: 12px;
    background: #0f1a16; border: 1px solid rgba(38,224,151,.5); color: #8ff0b4;
    font-weight: 600; box-shadow: 0 14px 40px rgba(0,0,0,.5);
}

/* =====================================================================
   Admin
   ===================================================================== */

.admin-nav {
    display: flex; gap: 6px; overflow-x: auto;
    max-width: 1100px; margin: 0 auto; padding: 4px 16px 6px;
    scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
    flex: none;
    padding: 9px 15px; border-radius: 999px;
    color: var(--muted); text-decoration: none;
    border: 1px solid var(--border); background: rgba(8,14,12,.6);
    font-family: var(--display); font-weight: 800; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
}
.admin-nav a.on {
    color: var(--acc-ink); border-color: transparent;
    background: linear-gradient(180deg, var(--acc), var(--acc-2));
    box-shadow: 0 8px 20px rgba(38,224,151,.35);
}

.admin { max-width: 1100px; margin: 0 auto; padding: 18px 16px 70px; }
.admin h2 {
    margin: 6px 0 14px;
    font-family: var(--display); font-weight: 900; font-size: 1.25rem; letter-spacing: .06em; text-transform: uppercase;
}
.admin h3 { margin: 0 0 12px; font-size: 1rem; }

.panel {
    padding: 18px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar > * { flex: 1 1 180px; }
.toolbar .btn { flex: 0 0 auto; }

/* Filas de listas del admin */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
    border-radius: 14px;
    background: rgba(18, 24, 22, .6);
    border: 1px solid var(--border);
}
.row > summary, .row-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}
.row > summary::-webkit-details-marker { display: none; }
.row[open] > summary { border-bottom: 1px solid var(--border); }
.row-body { padding: 14px; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--dim); font-size: .8rem; }
.row-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .72rem; font-weight: 700;
    background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid var(--border);
    white-space: nowrap;
}
.tag-green { color: var(--green); border-color: rgba(38,224,151,.4); background: rgba(38,224,151,.08); }
.tag-amber { color: var(--amber); border-color: rgba(255,190,59,.4); background: rgba(255,190,59,.08); }
.tag-red   { color: var(--danger); border-color: rgba(255,93,108,.45); background: rgba(255,93,108,.08); }
.tag-off   { color: var(--dim); text-decoration: line-through; }

.row .pick { width: 18px; height: 18px; accent-color: var(--acc-2); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--pc, #777); box-shadow: 0 0 8px var(--pc, #777); }

/* Barra de acciones masivas (cuentas) */
.bulk {
    position: sticky; bottom: 12px; z-index: 5;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 12px; margin-top: 14px;
    border-radius: 16px;
    background: rgba(10, 18, 15, .95);
    border: 1px solid rgba(38,224,151,.4);
    box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.bulk > * { flex: 1 1 150px; }
.bulk .btn { flex: 0 0 auto; }
.bulk strong { flex: 0 0 auto; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; color: var(--text); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 12px; background: rgba(255,255,255,.14); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { left: 21px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--acc); outline-offset: 2px; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat {
    flex: 1 1 150px; padding: 14px; border-radius: 14px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
}
.stat b { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 900; }
.stat span { color: var(--dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

.help { color: var(--dim); font-size: .8rem; margin: 6px 0 0; }
code.k { font-family: var(--mono); font-size: .82rem; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 6px; }

.log-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.log-table th, .log-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-table th { color: var(--dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.table-scroll { overflow-x: auto; }


/* =====================================================================
   Dentro del sistema (body.app): un poco más de verde y vida
   ===================================================================== */

body.app {
    --card:   rgba(20, 38, 31, .62);
    --card-2: rgba(9, 19, 15, .72);
    --border: rgba(140, 255, 210, .1);
    background:
        radial-gradient(900px 420px at 50% -8%, rgba(34, 168, 110, .42), transparent 68%),
        radial-gradient(1400px 700px at 50% -22%, rgba(12, 74, 48, .8), transparent 72%),
        radial-gradient(700px 500px at 0% 100%, rgba(20, 110, 72, .14), transparent 70%),
        radial-gradient(700px 500px at 100% 100%, rgba(20, 110, 72, .12), transparent 70%),
        linear-gradient(180deg, #07110d 0%, #050907 55%, #040705 100%);
    background-attachment: fixed;
}

/* =====================================================================
   Animaciones suaves de entrada
   ===================================================================== */

@keyframes rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes newGlow {
    0%   { box-shadow: 0 0 0 0 rgba(38, 224, 151, .0); }
    30%  { box-shadow: 0 0 0 2px rgba(38, 224, 151, .55), 0 0 32px rgba(38, 224, 151, .35); }
    100% { box-shadow: 0 12px 34px rgba(0,0,0,.4); }
}

/* "backwards" para no pisar el efecto hover cuando termina */
.rise { animation: rise .5s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.code-card.is-new { animation: rise .5s cubic-bezier(.2, .7, .2, 1) backwards, newGlow 1.8s ease-out .3s; }

/* Encabezado al cargar */
body.app .hero h1  { animation: rise .6s cubic-bezier(.2, .7, .2, 1) backwards; }
body.app .hero p   { animation: rise .6s cubic-bezier(.2, .7, .2, 1) .08s backwards; }
body.app .hero .seg { animation: rise .6s cubic-bezier(.2, .7, .2, 1) .16s backwards; }
body.app .topbar   { animation: rise .5s ease backwards; }
.filters, .search { animation: rise .5s cubic-bezier(.2, .7, .2, 1) .1s backwards; }
.foot-logo img { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .3s backwards; }

/* Las barritas se llenan al aparecer */
.acc-bar span { width: 0; transition: width 1s cubic-bezier(.2, .7, .2, 1); }

/* Pestañas: el contenido entra suave al cambiar */
[role="tabpanel"]:not(.hidden) { animation: rise .35s ease backwards; }


/* Papelera para borrar un código */
.trash-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid rgba(255, 93, 108, .45);
    background: rgba(255, 93, 108, .1);
    color: var(--danger);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.trash-btn svg { width: 18px; height: 18px; }
.trash-btn:hover {
    background: var(--danger); color: #fff; transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 93, 108, .4);
}
.code-card.removing { opacity: 0; transform: translateX(20px) scale(.98); transition: opacity .25s ease, transform .25s ease; }

/* Ajustes del revendedor */
.settings-card { max-width: 460px; margin: 10px auto 0; }


/* =====================================================================
   Estadísticas (admin)
   ===================================================================== */

/* Barras verticales: códigos por día */
.vbars {
    display: flex; align-items: flex-end; gap: 6px;
    height: 190px; padding: 26px 0 0;
    border-bottom: 1px solid var(--border);
}
.vbar {
    position: relative; flex: 1; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
    cursor: default; outline: none;
}
.vbar-fill {
    display: block; width: 100%; max-width: 34px; margin: 0 auto;
    border-radius: 4px 4px 0 0;
    background: var(--acc-2);
    transition: background .15s ease;
}
.vbar.is-today .vbar-fill { background: var(--acc); }
.vbar:hover .vbar-fill, .vbar:focus .vbar-fill { background: var(--acc); box-shadow: 0 0 14px rgba(38, 224, 151, .45); }
.vbar-day {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
    text-align: center; font-size: .66rem; line-height: 1.2; color: var(--dim);
}
.vbar.is-today .vbar-day { color: var(--text); font-weight: 700; }
.vbar::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% - 22px); left: 50%; transform: translateX(-50%);
    white-space: nowrap; padding: 5px 9px; border-radius: 8px;
    background: #0f1a16; border: 1px solid var(--border); color: var(--text);
    font-size: .74rem; font-weight: 600;
    opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 3;
}
.vbar:hover::after, .vbar:focus::after { opacity: 1; }
.vbars + .dim { margin-top: 34px !important; }

/* Barras horizontales: por revendedor / plataforma */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--acc-2); }
.hbar:hover .hbar-fill { background: var(--acc); }
.hbar-value { font-family: var(--mono); font-size: .8rem; color: var(--muted); min-width: 28px; text-align: right; }


/* =====================================================================
   Filtro por plataforma (botón con embudo + panel con íconos)
   ===================================================================== */

.search-row { display: flex; gap: 10px; align-items: stretch; max-width: 640px; margin: 16px auto 0; }
.search-row .search { flex: 1; margin: 0; max-width: none; }
.codes + .list-note, .search-row + .codes { margin-top: 16px; }

.pf { position: relative; flex: none; }
.pf-btn {
    height: 100%; min-height: 48px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(3, 7, 6, .6);
    color: var(--muted);
    font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
.pf-btn:hover { border-color: rgba(38, 224, 151, .45); color: var(--text); }
.pf.open .pf-btn, .pf-btn.is-set {
    border-color: rgba(38, 224, 151, .7); color: var(--text);
    background: rgba(38, 224, 151, .08);
    box-shadow: 0 0 0 3px rgba(38, 224, 151, .12);
}
.pf-funnel svg, .pf-chev svg { width: 16px; height: 16px; display: block; }
.pf-chev { opacity: .7; transition: transform .18s ease; }
.pf.open .pf-chev { transform: rotate(180deg); }
.pf-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

.pf-pop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
    width: min(340px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 16px;
    background: rgba(12, 20, 17, .97);
    border: 1px solid rgba(140, 255, 210, .14);
    box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.3);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    animation: pfIn .16s ease;
}
@keyframes pfIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.pf-title { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 2px 4px 10px; }
.pf-grid { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.pf-opt {
    display: grid; grid-template-columns: auto 1fr auto 18px; align-items: center; gap: 10px;
    width: 100%; padding: 8px 10px; border-radius: 10px;
    border: 1px solid transparent; background: transparent; color: var(--text);
    font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.pf-opt:hover, .pf-opt:focus-visible { background: rgba(255,255,255,.05); outline: none; }
.pf-opt[aria-selected="true"] { background: rgba(38, 224, 151, .1); border-color: rgba(38, 224, 151, .45); }
.pf-ico {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    background: var(--pc, #26e097); color: #fff; font-weight: 900; font-size: .85rem;
}
.pf-ico img { width: 100%; height: 100%; object-fit: cover; }
.pf-ico.pf-all { background: rgba(38, 224, 151, .14); color: var(--acc); }
.pf-ico.pf-all svg { width: 16px; height: 16px; }
.pf-btn .pf-ico { width: 22px; height: 22px; border-radius: 6px; font-size: .7rem; }
.pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-count { font-family: var(--mono); font-size: .78rem; color: var(--muted); background: rgba(255,255,255,.06); padding: 1px 8px; border-radius: 999px; }
.pf-tick { color: var(--acc); opacity: 0; }
.pf-tick svg { width: 16px; height: 16px; display: block; }
.pf-opt[aria-selected="true"] .pf-tick { opacity: 1; }

@media (max-width: 560px) {
    .pf-btn .pf-label { display: none; }
    .pf-btn.is-set .pf-label { display: inline; max-width: 90px; }
}

/* =====================================================================
   Colores por día: hoy, 1, 2 y 3 días
   ===================================================================== */
.acc[data-d="0"] { --sc: #ff3d57; }   /* hoy: rojo */
.acc[data-d="1"] { --sc: #ff7a2e; }   /* mañana: naranja */
.acc[data-d="2"] { --sc: #ffab1f; }   /* 2 días: ámbar */
.acc[data-d="3"] { --sc: #ffd93b; }   /* 3 días: amarillo */
.acc[data-s="expired"] { --sc: #b8424f; }  /* vencida: rojo apagado, distinto de "hoy" */
.acc[data-d="0"] .acc-date { animation: todayPulse 2.2s ease-in-out infinite; }
@keyframes todayPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 87, 0); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 61, 87, .18); }
}
.tag-d0 { color: #ff6b80; border-color: rgba(255, 61, 87, .5);  background: rgba(255, 61, 87, .1); }
.tag-d1 { color: #ff9a5c; border-color: rgba(255, 122, 46, .5); background: rgba(255, 122, 46, .1); }
.tag-d2 { color: #ffbe4d; border-color: rgba(255, 171, 31, .5); background: rgba(255, 171, 31, .1); }
.tag-d3 { color: #ffe066; border-color: rgba(255, 217, 59, .45); background: rgba(255, 217, 59, .08); }

.toolbar > .pf { flex: 0 0 auto; }

/* SÍ / NO en Actividad ("¿Lo agarró?") */
.yesno {
    display: inline-block; min-width: 38px; padding: 3px 9px; margin-right: 4px;
    border-radius: 7px; text-align: center;
    font-family: var(--display); font-weight: 900; font-size: .72rem; letter-spacing: .08em;
}
.yesno.yes { background: rgba(38, 224, 151, .16); color: var(--acc); border: 1px solid rgba(38, 224, 151, .55); }
.yesno.no  { background: rgba(255, 93, 108, .12); color: #ff7d8a; border: 1px solid rgba(255, 93, 108, .45); }


/* =====================================================================
   Cartel "Instalá la app" y hoja de pasos
   ===================================================================== */
.install-banner {
    position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 24px));
    display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 40, 33, .97), rgba(10, 18, 15, .98));
    border: 1px solid rgba(38, 224, 151, .4);
    box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 30px rgba(38, 224, 151, .15);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    animation: ibIn .35s cubic-bezier(.2, .8, .2, 1);
}
.install-banner.out { animation: ibOut .25s ease forwards; }
@keyframes ibIn  { from { opacity: 0; transform: translate(-50%, 30px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ibOut { to { opacity: 0; transform: translate(-50%, 30px); } }
.ib-logo { width: 52px; height: 52px; border-radius: 13px; grid-row: span 2; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.ib-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ib-text b { font-family: var(--display); font-weight: 900; font-size: .95rem; letter-spacing: .02em; }
.ib-text span { color: var(--muted); font-size: .82rem; }
.ib-actions { display: flex; gap: 8px; }
.ib-never {
    grid-column: 1 / -1; justify-self: center;
    background: none; border: 0; color: var(--dim); font: inherit; font-size: .78rem;
    text-decoration: underline; cursor: pointer; padding: 2px;
}
.ib-never:hover { color: var(--muted); }

.jp-sheet-back {
    position: fixed; inset: 0; z-index: 70;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, .55);
    animation: pfIn .2s ease;
}
.jp-sheet {
    width: min(480px, 100%);
    margin: 0 12px max(12px, env(safe-area-inset-bottom));
    padding: 22px 20px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #13211c, #0a120f);
    border: 1px solid rgba(140, 255, 210, .16);
    box-shadow: 0 30px 80px rgba(0,0,0,.7);
    text-align: center;
    animation: ibIn2 .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes ibIn2 { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.jp-sheet-logo { width: 64px; height: 64px; border-radius: 16px; }
.jp-sheet h3 { margin: 10px 0 12px; font-family: var(--display); font-weight: 900; }
.jp-sheet ol { text-align: left; margin: 0 0 16px; padding-left: 22px; line-height: 1.9; font-size: .92rem; }
.jp-ico { display: inline-flex; vertical-align: middle; color: var(--acc); }
.jp-ico svg { width: 18px; height: 18px; }

/* =====================================================================
   Celular: todo entra en el ancho de la pantalla (sin moverse a los costados)
   ===================================================================== */
html, body { max-width: 100%; overflow-x: hidden; }
.topbar { min-width: 0; }
.top-actions { min-width: 0; flex-wrap: nowrap; }
.brand { min-width: 0; flex-shrink: 0; }

@media (max-width: 520px) {
    .topbar { padding: 10px 12px; gap: 8px; }
    .brand span { display: none; }                 /* en el celular, solo el logo */
    .brand img { width: 38px; height: 38px; }
    .top-actions { gap: 6px; }
    .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
    .icon-btn svg { width: 17px; height: 17px; }
    .user-chip { max-width: 34vw; padding: 6px 10px; font-size: .84rem; }
    .install-btn { display: none !important; }    /* ya está el cartel y la opción en Ajustes */
}

/* =====================================================================
   Campanita de notificaciones
   ===================================================================== */
.bell { position: relative; }
#bell-btn { position: relative; }
.bell-count {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--bg); line-height: 1;
}
.bell-count.hidden { display: none; }
.bell-panel {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
    width: 340px; max-height: min(70vh, 480px);
    display: flex; flex-direction: column;
    background: rgba(10, 16, 13, .97); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    overflow: hidden; animation: bellIn .18s ease-out;
}
@keyframes bellIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bell-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .95rem;
}
.bell-x {
    background: none; border: 0; color: var(--muted); font-size: 1rem;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
}
.bell-x:hover { background: var(--glass-2); color: var(--text); }
.bell-list { overflow-y: auto; padding: 6px; }
.bell-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px 10px 14px; border-radius: 12px;
    color: var(--text); text-decoration: none; position: relative;
}
a.bell-item:hover { background: var(--glass-2); }
.bell-item + .bell-item { margin-top: 2px; }
.bell-item b { font-size: .9rem; font-weight: 700; }
.bell-item span { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.bell-item small { font-size: .74rem; color: var(--dim); }
.bell-item.unread { background: rgba(38, 224, 151, .08); }
.bell-item.unread::before {
    content: ""; position: absolute; left: 5px; top: 16px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.bell-item.t-offers b { color: var(--amber); }
.bell-empty { text-align: center; color: var(--muted); padding: 22px 12px; margin: 0; font-size: .9rem; }
.bell-empty span { color: var(--dim); font-size: .82rem; }

@media (max-width: 520px) {
    .bell { position: static; }
    .bell-panel { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }
}

/* =====================================================================
   Admin > Cobros
   ===================================================================== */
.billing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.billing-card { margin: 0; }
.billing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.billing-msg {
    margin: 0; padding: 12px 14px; border-radius: 12px;
    background: var(--card-2); border: 1px solid var(--border);
    font-family: var(--body); font-size: .86rem; line-height: 1.45; color: var(--text);
    white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto;
}
.billing-card.copied { border-color: rgba(38, 224, 151, .45); }

/* Cuentas sin vencimiento (pago único) */
.acc[data-s="lifetime"] { --sc: #4cc9f0; }
.acc[data-s="lifetime"] .acc-days strong { font-size: .82rem; }
.billing-all { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.billing-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.billing-nophone { margin: -4px 0 10px; color: var(--amber); }
.billing-nophone.has { color: var(--dim); }
.billing-card.sent { border-color: rgba(38, 224, 151, .45); }

/* =====================================================================
   Admin > Inicio (dashboard)
   ===================================================================== */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dash-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px;
    background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.kpi:hover { border-color: rgba(38, 224, 151, .45); transform: translateY(-2px); }
.kpi span { color: var(--dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kpi b { font-family: var(--display); font-size: 1.9rem; font-weight: 900; line-height: 1.15; }
.kpi small { color: var(--muted); font-size: .76rem; }
.kpi small.up { color: var(--green); }
.kpi small.down { color: var(--amber); }
.kpi.kpi-red b { color: #ff5d6c; }
.kpi.kpi-amber b { color: var(--amber); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-card { margin: 0; min-width: 0; }
.dash-card h3 { margin: 0 0 12px; }
.dash-wide { grid-column: span 2; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-card-head h3 { margin: 0; }

.dash-status { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dash-status li { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; align-items: baseline; }
.dash-status li .small { grid-column: 2; }
.sdot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.sdot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sdot.bad { background: #ff5d6c; box-shadow: 0 0 8px #ff5d6c; }

.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; min-width: 0; }
.dash-list li:last-child { border-bottom: 0; }
.dash-list li > b:last-child { margin-left: auto; white-space: nowrap; }
.dash-list li > .dim { margin-left: auto; }
.dash-list li > .dim + b { margin-left: 8px; }
.dash-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.dash-list a:hover { color: var(--acc); }
.dash-time { color: var(--dim); font-size: .76rem; white-space: nowrap; min-width: 46px; }
.dash-code-main { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-codes .yesno { margin-left: auto; }
.dash-audit li { align-items: baseline; }
.dash-audit .dash-time { min-width: 62px; }

.dash-vbars { height: 150px; }
.dash-exp { display: flex; flex-direction: column; gap: 9px; }
.dash-exp-row { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 10px; font-size: .86rem; }
.dash-exp-day { color: var(--muted); }
.dash-exp-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.dash-exp-bar span { display: block; height: 100%; border-radius: 6px; }
.dash-exp-row b { text-align: right; }

@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-wide { grid-column: auto; }
    .kpi b { font-size: 1.6rem; }
}

/* Cobros: avisados */
.billing-progress { margin: -6px 0 12px; color: var(--muted); }
.billing-progress b { color: var(--amber); }
.avisado-tag { display: inline-block; margin-top: 4px; font-size: .74rem; font-weight: 800; color: #1a1300; background: var(--amber); border-radius: 999px; padding: 0 8px; }
.avisado-tag:empty { display: none; }
.billing-card.avisado { border-color: rgba(255, 190, 59, .55); background: rgba(255, 190, 59, .05); }
.billing-card.avisado .billing-msg { opacity: .55; }
.billing-card.avisado [data-billing-send] { background: transparent; color: var(--text); box-shadow: none; border-color: var(--border); }
.billing-head { flex-wrap: wrap; }
.billing-head > div:first-child { flex: 1 1 150px; min-width: 0; }
.avisado-tag { white-space: nowrap; display: table; }
