@import url('../fonts/outfit.css');

:root {
    --label-bg: #ffffff;
    --text-color: #1a1a1a;
    --primary: #4f46e5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: #f1f5f9;
    padding: 30px;
    min-height: 100vh;
}

.kiosk-top-controls {
    margin-bottom: 20px;
}

.btn-action,
.btn-next {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.btn-action:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-next {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-next:hover {
    background: #b91c1c;
}

.kiosk-layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.centered-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.kiosk-table-section {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 50px;
}

.table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.table-header h3 {
    font-size: 1.2rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search {
    position: relative;
    width: 300px;
}

.table-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.table-search input {
    width: 100%;
    padding: 10px 15px 10px 35px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    outline: none;
    font-size: 0.95rem;
}

.table-search input:focus {
    border-color: var(--primary);
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    z-index: 10;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-table tbody:empty::after,
.data-table tbody tr td[colspan] {
    border-bottom: none !important;
}

.data-table tr.active-row {
    background: #eef2ff;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.badge-printed {
    background: #dcfce7;
    color: #166534;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.badge-paid {
    background: #dcfce7;
    color: #166534;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.badge-unpaid {
    background: #fee2e2;
    color: #991b1b;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.btn-print-row {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-print-row:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.actions-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary {
    background: #1e293b;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    padding: 80px;
    color: #94a3b8;
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    text-align: center;
    width: 650px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.toggle-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.kiosk-container {
    width: 100%;
    margin-bottom: 10px;
}

.kiosk-header {
    margin-bottom: 40px;
}

.kiosk-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -1px;
}

.kiosk-status {
    color: #64748b;
    font-weight: 600;
    margin-top: 10px;
}

.etiqueta-wrapper {
    background: white;
    width: 600px;
    height: 300px;
    margin: 0 auto;
    border-radius: 12px;
    display: flex;
    padding: 20px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.label-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Forzar separación máxima */
    text-align: left;
    height: 100%;
}

.label-logo {
    max-width: 45px;
    /* Reducido de 60px */
    height: auto;
    margin-bottom: 8px;
}

.label-name {
    font-size: 2.3rem;
    /* Reducido de 2.8rem */
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 8px;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.label-name.long-name {
    font-size: 1.85rem;
}

.label-event-details {
    color: #4b5563;
    margin-top: 5px;
}

.label-event-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.label-date-time {
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
}


@media print {
    .etiqueta-wrapper {
        width: 100mm !important;
        height: 50mm !important;
        padding: 1.5mm !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .label-info {
        justify-content: space-between !important;
        height: 100% !important;
    }

    .label-logo {
        max-width: 12mm !important;
        margin-bottom: 0 !important;
    }

    .label-name {
        font-size: 6.2mm !important;
        line-height: 1.05 !important;
        margin: 0 !important;
        flex-grow: 1 !important;
        display: flex !important;
        align-items: center !important;
    }

    .label-name.long-name {
        font-size: 4.5mm !important;
        line-height: 1.0 !important;
    }

    .label-event-details {
        margin-top: 0 !important;
    }

    .label-event-name {
        font-size: 2.8mm !important;
        line-height: 1 !important;
    }

    .label-date-time {
        font-size: 2.2mm !important;
        line-height: 1 !important;
    }

    .label-qr {
        width: 32mm !important;
        padding-left: 2mm !important;
        border-left: 1px dashed #e5e7eb !important;
    }

    .qr-box {
        width: 28mm !important;
        height: 28mm !important;
    }
}

.label-footer-info {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.label-qr {
    width: 32mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2mm;
    border-left: 1px dashed #e5e7eb;
    margin-left: 2mm;
    padding-left: 2mm;
}

.qr-box {
    width: 28mm;
    height: 28mm;
    background: white;
    padding: 0;
    border: none;
}

.qr-box canvas,
.qr-box img {
    width: 100% !important;
    height: auto !important;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.label-folio {
    margin-top: 0;
    font-family: monospace;
    font-weight: 800;
    font-size: 1rem;
    color: #1e293b;
    letter-spacing: 1px;
    text-align: center;
}

@media print {
    @page {
        size: 100mm 40mm;
        margin: 0;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
        width: 100mm;
        height: 40mm;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .kiosk-header,
    .btn-print-force,
    .no-print,
    .kiosk-top-controls,
    .kiosk-table-section {
        display: none !important;
    }

    .kiosk-layout-vertical {
        display: block;
        margin: 0;
        padding: 0;
        gap: 0;
    }

    .centered-label {
        display: block;
    }

    .etiqueta-wrapper {
        box-shadow: none;
        border: none;
        width: 100mm;
        height: 40mm;
        margin: 0;
        padding: 2mm;
        border-radius: 0;
        animation: none;
        page-break-after: always;
        display: flex;
        align-items: center;
    }

    .label-info {
        height: 100%;
        justify-content: center;
    }

    .label-logo {
        max-width: 18mm;
        margin-bottom: 0;
    }

    .label-name {
        font-size: 18pt;
        line-height: 1.1;
        margin: 1.5mm 0;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .label-event-name {
        font-size: 11pt;
        margin-bottom: 2mm;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .label-qr {
        width: 33mm;
        margin-left: 2mm;
        padding-left: 2mm;
        border-left: 1px dashed black;
        gap: 2mm;
        justify-content: center;
    }

    .qr-box {
        width: 26mm;
        height: 26mm;
        padding: 0;
        border: none;
    }

    .qr-box canvas,
    .qr-box img {
        width: 100% !important;
        height: auto !important;
        display: block;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: pixelated;
    }

    .label-folio {
        font-size: 8pt;
        margin-top: 0;
        text-align: center;
    }
}

.pulse-waiting {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}