* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-number-selected {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff6b6b;
    margin-top: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filters-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.filter-input,
.filter-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #667eea;
}

.date-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.date-shortcut {
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-shortcut:hover,
.date-shortcut.active {
    background: #667eea;
    color: white;
}

.filename-filter-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-title {
    font-size: 1.8em;
    color: #333;
    font-weight: bold;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    text-decoration: none;
}

.export-btn:hover {
    background: #667eea;
    color: white;
}

.refresh-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #ccc;
    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: #667eea;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8em;
    position: sticky;
    top: 0;
}

th:first-child {
    border-radius: 10px 0 0 0;
    width: 50px;
}

th:last-child {
    border-radius: 0 10px 0 0;
}

.filename-col {
    width: 35%;
    min-width: 200px;
}

.event-col {
    width: 8%;
}

.dimensions-col {
    width: 12%;
}

.copies-col {
    width: 8%;
}

.ml-col {
    width: 10%;
}

.pc-col {
    width: 12%;
}

.date-col {
    width: 15%;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

tr:hover td {
    background-color: #f8f9ff;
}

tr.selected td {
    background-color: #e8f4fd !important;
    border-left: 4px solid #667eea;
}

.row-checkbox {
    cursor: pointer;
}

.status-rip {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.8em;
    display: inline-block;
}

.status-print {
    background: #e8f5e8;
    color: #388e3c;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.8em;
    display: inline-block;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.file-name-full {
    white-space: normal;
    word-break: break-all;
}

.dimensions {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
}

.ml-total {
    font-weight: bold;
    color: #2e7d32;
    background: #e8f5e8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}

.pc-badge {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.8em;
    display: inline-block;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 12px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover,
.page-btn.active {
    background: #667eea;
    color: white;
}

.last-update {
    font-size: 0.8em;
    color: #888;
    margin-top: 15px;
    text-align: center;
}

.show-size-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #666;
}

.multi-select {
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    background: white;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.multi-select-option:hover {
    background-color: #f0f0f0;
}

/* =============================================
   Efecto visual premium para filas seleccionadas
============================================= */

/* Estilo base para filas seleccionadas */
tr[selected] {
    border-left: 4px solid #1e88e5 !important;
    background-color: #f0f7ff !important;
    box-shadow: 2px 0 8px rgba(30, 136, 229, 0.15) !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

/* Añadir efecto hover incluso cuando está seleccionado */
tr[selected]:hover {
    background-color: #e6f0ff !important;
    box-shadow: 2px 0 12px rgba(30, 136, 229, 0.2) !important;
}

/* Asegurar que el texto siga legible */
tr[selected] td {
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

/* Opcional: añadir un pequeño ícono de check en la celda de checkbox si quieres */
tr[selected] td input[type="checkbox"]::after {
    content: '✓';
    position: absolute;
    font-size: 10px;
    color: #1e88e5;
    opacity: 0;
    transition: opacity 0.2s;
}

tr[selected] td input[type="checkbox"]:checked::after {
    opacity: 1;
}

/* =============================================
   MODAL DE DETALLE DE IMPRESIÓN - VERSIÓN CENTRADA
============================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro directamente aquí */
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto; /* Centra automáticamente en vertical y horizontal */
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h2 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-image-container {
    text-align: center;
    margin: 15px 0;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-details p {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.5;
    color: #555;
}

.modal-details strong {
    color: #333;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.close:hover {
    color: #333;
}

/* Ajuste para móviles */
@media (max-width: 600px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 15px;
    }
    .modal-content h2 {
        font-size: 1.3em;
    }
    .modal-image-container img {
        max-height: 200px;
    }
}