:root {
    --primary: #cba35c;
    --primary-dark: #b8924a;
    --bg-white: #ffffff;
    --bg-soft: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-soft);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    padding: 2rem;
    text-align: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.date-text {
    display: block;
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Filters */
.filters-container {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: var(--shadow-soft);
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(203, 163, 92, 0.1);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(203, 163, 92, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.filter-group.action-group {
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-group .btn-primary {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    width: 100%;
}

/* Grid */
.lotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Card */
.lote-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.75rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.lote-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.lote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.lote-number {
    font-size: 0.75rem;
    background: var(--bg-soft);
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.lote-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lote-price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.lote-categoria {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.lote-origen {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lote-precio {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.lote-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-item {
    background: var(--bg-soft);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.lote-consignatario {
    font-size: 0.9rem;
    color: var(--text-main);
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    margin-top: auto;
}

.lote-consignatario strong {
    color: var(--text-muted);
    font-weight: 600;
}

.lote-observaciones {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: #fffbeb;
    padding: 0.5rem;
    border-radius: 0.4rem;
    border-left: 3px solid var(--primary);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    background: var(--bg-white);
    border-radius: 1rem;
    border: 1px dashed var(--border-color);
}

/* Totals Footer */
.totals-footer {
    background: var(--primary);
    color: var(--bg-white);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 4rem;
    box-shadow: 0 10px 30px rgba(203, 163, 92, 0.3);
    animation: fadeIn 0.6s ease forwards;
}

.total-item {
    text-align: center;
}

.total-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1rem;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.total-value {
    font-size: 1.75rem;
    font-weight: 800;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    width: 100%;
    max-width: 700px;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-soft);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Report Table */
.reporte-tabla {
    width: 100%;
    border-collapse: collapse;
}

.reporte-tabla th,
.reporte-tabla td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.reporte-tabla th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.reporte-tabla tr.total-row {
    background: var(--bg-soft);
    font-weight: 800;
    color: var(--primary-dark);
}

.reporte-tabla tr.total-row td {
    border-top: 2px solid var(--primary);
}

.reporte-tabla .col-cantidad {
    text-align: right;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lote-card {
    animation: fadeIn 0.4s ease forwards;
}

@media (max-width: 640px) {
    header {
        padding: 1.5rem 1rem;
    }

    .logo {
        max-width: 180px;
    }

    .filters-container {
        padding: 1rem;
        gap: 1rem;
    }

    .lotes-grid {
        grid-template-columns: 1fr;
    }

    .totals-footer {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .modal-content {
        border-radius: 0;
        height: 100%;
        max-height: 100%;
    }
}

/* Countdown Styles */
.countdown-wrapper {
    max-width: 1200px;
    margin: -1rem auto 2rem;
    padding: 0 2rem;
    display: none;
    /* Se activa por JS */
}

.countdown-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(203, 163, 92, 0.2);
    position: relative;
    overflow: hidden;
}

.countdown-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.countdown-title {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    margin: 0;
}

.countdown-timer {
    display: flex;
    gap: 1.5rem;
}

.timer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.timer-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.timer-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1rem;
    margin-top: 0.4rem;
}

@media (max-width: 640px) {
    .countdown-timer {
        gap: 0.75rem;
    }

    .timer-item {
        min-width: 50px;
    }

    .timer-value {
        font-size: 1.5rem;
    }
}

/* Switcher Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
}
.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: 24px;
}
.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);
}

/* View Controls */
.btn-view {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.btn-view:hover {
    background: #e2e8f0;
}
.btn-view.active {
    background: var(--primary);
    border-color: var(--primary-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.lote-list-item {
    grid-column: 1 / -1;
    flex-direction: column;
}

/* Consignatario Divider */
.consignatario-divider {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    animation: fadeIn 0.4s ease forwards;
}
.consignatario-divider h3 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
}