:root {
    --tl-card: #ffffff;
    --tl-line: #f0d7dd;
    --tl-shadow: 0 18px 40px rgba(60, 20, 35, .08);
    --tl-text: #2a1b22;
    --tl-muted: #7a5a66;

    --tl-pink: #f2b8c7;
    --tl-pink-2: #f7c6d3;
    --tl-gold: #d6b06a;
}

.v-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 14px 24px;
}

/* HEAD (mobile-first) */
.v-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.v-head h1 {
    margin: 0;
    font-size: clamp(22px, 4.5vw, 28px);
    color: var(--tl-text);
    line-height: 1.05;
}

.sub {
    margin: 6px 0 0;
    color: var(--tl-muted);
    font-weight: 800;
    line-height: 1.25;
    max-width: 52ch;
}

/* ✅ boton nuevo: nunca se rompe, en móvil se compacta */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 950;
    color: var(--tl-text);
    text-decoration: none;
    border: 0;
    background: linear-gradient(180deg, var(--tl-pink), var(--tl-pink-2));
    box-shadow: 0 12px 24px rgba(242, 184, 199, .25);
    transition: transform .14s ease, box-shadow .14s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(242, 184, 199, .22);
}

.btn-new .plus {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .70);
    border: 1px solid rgba(240, 215, 221, .9);
    font-weight: 950;
}

/* STATS */
.v-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.stat {
    background: var(--tl-card);
    border: 1px solid var(--tl-line);
    border-radius: 22px;
    box-shadow: var(--tl-shadow);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    inset: -40px -60px auto auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(242, 184, 199, .45), rgba(214, 176, 106, .14));
    transform: rotate(12deg);
    pointer-events: none;
}

.s-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.stat .k {
    color: var(--tl-muted);
    font-weight: 950;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.s-ico {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .75);
    border: 1px solid rgba(240, 215, 221, .9);
    box-shadow: 0 10px 18px rgba(60, 20, 35, .06);
    position: relative;
    z-index: 1;
}

.stat .v {
    margin-top: 8px;
    color: var(--tl-text);
    font-weight: 950;
    font-size: clamp(18px, 4vw, 22px);
    position: relative;
    z-index: 1;
}

.stat .t {
    margin-top: 4px;
    color: var(--tl-muted);
    font-weight: 800;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

/* TABLE */
.table-card {
    background: var(--tl-card);
    border: 1px solid var(--tl-line);
    border-radius: 22px;
    box-shadow: var(--tl-shadow);
    overflow: hidden;
}

.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
}

.table-head h2 {
    margin: 0;
    font-size: 16px;
    color: var(--tl-text);
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--tl-line);
    background: #fff;
    color: var(--tl-muted);
    font-weight: 950;
    font-size: 12px;
}

/* ✅ tabla responsive: scroll horizontal suave en móvil */
.table-wrap {
    padding: 0 10px 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.tul-table {
    width: 100%;
    min-width: 860px;
    /* ✅ evita que se rompa en móvil */
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 18px;
    overflow: hidden;
}

.tul-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--tl-muted);
    border-bottom: 1px solid var(--tl-line);
    background: rgba(242, 184, 199, .14);
    position: sticky;
    /* ✅ header pegado al hacer scroll horizontal/vertical dentro */
    top: 0;
    z-index: 2;
}

.tul-table tbody td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(240, 215, 221, .75);
    color: var(--tl-text);
    font-weight: 800;
    background: #fff;
}

.tul-table tbody tr:hover {
    background: rgba(242, 184, 199, .10);
}

.empty {
    text-align: center;
    color: var(--tl-muted);
    padding: 18px !important;
}

/* pill metodo pago */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--tl-line);
    font-weight: 950;
    font-size: 12px;
    color: var(--tl-text);
    background: rgba(255, 255, 255, .75);
    white-space: nowrap;
}

.pill.efectivo {
    background: rgba(31, 111, 74, .10);
    border-color: rgba(31, 111, 74, .25);
}

.pill.yape_plin {
    background: rgba(214, 176, 106, .16);
    border-color: rgba(214, 176, 106, .35);
}

.pill.tarjeta {
    background: rgba(242, 184, 199, .20);
    border-color: rgba(242, 184, 199, .45);
}

.pager {
    padding: 0 14px 14px;
}

/* ===== BREAKPOINTS ===== */
@media (min-width:720px) {
    .v-page {
        padding: 18px 16px 26px;
    }

    .v-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width:420px) {
    .btn-new .txt {
        display: none;
    }

    /* ✅ solo + en móviles muy chicos */
    .btn-primary {
        padding: 10px 12px;
    }
}

/* ====== FIX BOTÓN NUEVA VENTA (mobile-first PRO) ====== */

/* En móvil: header en columna y botón full-width */
.v-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* Botón: se ve como CTA elegante (no bolita) */
.btn-primary.btn-new {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 18px;
    /* más pro que 999 en móvil */
    box-shadow: 0 14px 26px rgba(242, 184, 199, .26);
}

/* Ícono + */
.btn-new .plus {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(240, 215, 221, .9);
    font-weight: 950;
}

/* Texto siempre visible en móvil (ya no ocultamos) */
.btn-new .txt {
    display: inline;
    font-weight: 950;
}

/* Quita esto si lo tienes (o sobrescribe) */
@media (max-width:420px) {
    .btn-new .txt {
        display: inline !important;
    }
}

/* En pantallas medianas/grandes: vuelve a layout normal */
@media (min-width:720px) {
    .v-head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .btn-primary.btn-new {
        width: auto;
        border-radius: 999px;
        /* pill en desktop */
        padding: 10px 14px;
    }
}

/* ALERTAS */
.v-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--tl-line);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--tl-shadow);
    margin-bottom: 12px;
}

.v-alert .ico {
    font-size: 18px;
    line-height: 1;
}

.v-alert .txt {
    font-weight: 900;
    color: var(--tl-text);
}

.v-alert.danger {
    border-color: rgba(166, 55, 74, .25);
    background: rgba(166, 55, 74, .08);
}

.v-alert.danger .txt {
    color: #a6374a;
}

.v-alert.ok {
    border-color: rgba(31, 111, 74, .25);
    background: rgba(31, 111, 74, .08);
}

.v-alert.ok .txt {
    color: #1f6f4a;
}

/* BOTÓN NUEVA VENTA PRO */
.btn-new {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
}

.btn-new .plus {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    border: 1px solid rgba(240, 215, 221, .9);
    background: rgba(255, 255, 255, .72);
}

.btn-new .txt {
    font-weight: 950;
}

/* ESTADO BLOQUEADO */
.btn-new.is-disabled {
    cursor: not-allowed;
    opacity: .82;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--tl-line);
}

.btn-new.is-disabled .plus {
    background: rgba(242, 184, 199, .14);
}
