/**
 * Estilos específicos - Panel Principal (index)
 */

.container { max-width: 1400px; }

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
}
.upload-area:hover,
.upload-area.dragover {
    border-color: #1a73e8;
    background: #e8f0fe;
}
.upload-area svg { width: 48px; height: 48px; fill: #999; margin-bottom: 10px; }
.upload-area.dragover svg { fill: #1a73e8; }
.upload-area p { color: #666; margin-top: 8px; }
.upload-area input[type="file"] { display: none; }

.upload-progress { display: none; margin-top: 15px; }
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #1a73e8;
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}
.upload-status { margin-top: 10px; padding: 12px; border-radius: 8px; display: none; }
.upload-status.success { background: #e6f4ea; color: #137333; display: block; }
.upload-status.error { background: #fce8e6; color: #c5221f; display: block; }

/* Filters */
.filters {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 0.8em; color: #666; font-weight: 500; }
.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.2s;
}
.filter-group input:focus,
.filter-group select:focus { border-color: #1a73e8; }

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.summary-card .label { font-size: 0.8em; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.summary-card .value { font-size: 1.6em; font-weight: 700; color: #1a73e8; margin-top: 5px; }
.summary-card .value.negative { color: #d93025; }
.summary-card .value.positive { color: #137333; }

/* Table */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}
.table-header {
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}
.table-header h3 { font-size: 1.1em; color: #333; }
.table-wrapper { overflow-x: auto; }
table { font-size: 0.85em; }
thead th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
thead th:hover { background: #e8eaed; }
thead th.sorted-asc::after { content: ' ▲'; font-size: 0.7em; }
thead th.sorted-desc::after { content: ' ▼'; font-size: 0.7em; }
tbody tr { border-bottom: 1px solid #f0f0f0; transition: background 0.15s; }
td { padding: 10px 15px; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.negative { color: #d93025; }
td.positive { color: #137333; }
td input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; }

/* Pagination */
.pagination {
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    font-size: 0.9em;
}
.pagination-buttons { display: flex; gap: 5px; }
.pagination-buttons button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
.pagination-buttons button:hover { background: #f0f0f0; }
.pagination-buttons button.active { background: #1a73e8; color: white; border-color: #1a73e8; }
.pagination-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Responsive */
@media (max-width: 768px) {
    .filters { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-group input,
    .filter-group select { width: 100%; }
    td, th { padding: 8px 10px; font-size: 0.8em; }
}

/* Modal styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.1em;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

/* Button warning style */
.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

/* Lista de cierres */
.cierre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.cierre-item:hover {
    background: #f8f9fa;
}
.cierre-info h4 {
    margin: 0 0 4px 0;
    font-size: 1em;
}
.cierre-info span {
    font-size: 0.85em;
    color: #666;
}
.cierre-actions {
    display: flex;
    gap: 8px;
}
.loading-small {
    text-align: center;
    padding: 30px;
    color: #666;
}
.empty-cierres {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Tabla de detalle cierre */
.detalle-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.detalle-tabla th,
.detalle-tabla td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.detalle-tabla th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}
.detalle-tabla tr:hover {
    background: #f9f9f9;
}
