/**
 * Estilos específicos para el Módulo de Coordinador
 * FASE 6 - TURNO-PVU
 */

/* ===== LAYOUT PRINCIPAL ===== */
.coordinador-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.coordinador-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 1.5rem;
    margin: -1rem -1rem 1.5rem -1rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.coordinador-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.coordinador-header .centro-info {
    font-size: 0.95rem;
    opacity: 0.95;
}

/* ===== NAVEGACIÓN DE VISTAS ===== */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.nav-tab {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-tab:hover {
    border-color: var(--primary-color);
    background: #f5f5f5;
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== VISTA: ABRIR TURNO ===== */
.abrir-turno-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.abrir-turno-form h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.tipo-turno-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.tipo-turno-btn {
    padding: 1.25rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-weight: 600;
}

.tipo-turno-btn:hover {
    border-color: var(--primary-color);
    background: #f5f5f5;
}

.tipo-turno-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.inventario-inputs {
    display: grid;
    gap: 1rem;
}

.inventario-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.inventario-input-group label {
    font-weight: 600;
    min-width: 120px;
}

.inventario-input-group input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.25rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

.inventario-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.inventario-input-group .badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-srp {
    background: #ff6b6b;
    color: white;
}

.badge-sr {
    background: #a569bd;
    color: white;
}

.badge-vph {
    background: #f39c12;
    color: white;
}

/* ===== VISTA: MONITOR ===== */
.monitor-panel {
    display: grid;
    gap: 1.5rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.stat-card .label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .subtext {
    font-size: 0.9rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

/* Barras de progreso */
.progress-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.progress-item {
    margin-bottom: 1.5rem;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-header .label {
    font-weight: 600;
    font-size: 1rem;
}

.progress-header .value {
    font-weight: bold;
    font-size: 1.1rem;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #ecf0f1;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.progress-bar-fill.srp {
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
}

.progress-bar-fill.sr {
    background: linear-gradient(90deg, #a569bd, #8e44ad);
}

.progress-bar-fill.vph {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

/* Semáforo de estado */
.semaforo {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.semaforo.verde {
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
}

.semaforo.amarillo {
    background: #f39c12;
    box-shadow: 0 0 8px #f39c12;
}

.semaforo.rojo {
    background: #e74c3c;
    box-shadow: 0 0 8px #e74c3c;
}

/* ===== VISTA: DISPOSITIVOS ===== */
.dispositivos-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dispositivos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dispositivos-header h2 {
    margin: 0;
}

.btn-crear-dispositivo {
    display: flex;
    gap: 0.5rem;
}

.dispositivos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.dispositivos-table th {
    background: #f5f5f5;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.dispositivos-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
}

.dispositivos-table tr:hover {
    background: #f9f9f9;
}

.url-display {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: #f5f5f5;
    padding: 0.5rem;
    border-radius: 4px;
    word-break: break-all;
}

.btn-copiar {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-revocar {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ===== VISTA: BLOQUES DE FOLIOS ===== */
.bloques-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bloque-card {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.bloque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bloque-info {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* ===== VISTA: CORTES MANUALES ===== */
.corte-manual-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

.alert-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.alert-info p {
    margin: 0;
    color: #1565c0;
}

/* ===== VISTA: FICHAS ===== */
.fichas-list {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ficha-item {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.ficha-item:last-child {
    border-bottom: none;
}

.ficha-folio {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.ficha-estado {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ficha-estado.emitida {
    background: #3498db;
    color: white;
}

.ficha-estado.aplicada {
    background: #2ecc71;
    color: white;
}

.ficha-estado.cancelada {
    background: #e74c3c;
    color: white;
}

.ficha-estado.no_utilizada {
    background: #95a5a6;
    color: white;
}

/* ===== MODALES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== ESTADO VACÍO ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #95a5a6;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ===== VISTA: RESUMEN DEL DIA ===== */
.vista-resumen {
    display: grid;
    gap: 1.5rem;
}

.resumen-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resumen-header h2 {
    margin: 0;
    color: var(--primary-color);
}

/* Hora de actualizacion y tipo de turno */
.resumen-timestamp {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Tarjetas de conteo global */
.resumen-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.resumen-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.resumen-card--verde {
    border-top-color: #2ecc71;
}

.resumen-card--amarillo {
    border-top-color: #f39c12;
}

.resumen-card-valor {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.resumen-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

/* Secciones internas (desglose e historial) */
.resumen-seccion {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.resumen-seccion h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #2c3e50;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

/* Tabla compartida para desglose e historial */
.resumen-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.resumen-tabla th {
    background: #f8f9fa;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.resumen-tabla td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50;
}

.resumen-tabla tr:last-child td {
    border-bottom: none;
}

.resumen-tabla tr:hover td {
    background: #fafafa;
}

/* Colores de texto para estados */
.texto-verde {
    color: #27ae60;
    font-weight: 600;
}

.texto-amarillo {
    color: #e67e22;
    font-weight: 600;
}

.texto-rojo {
    color: #e74c3c;
    font-weight: 600;
}

/* Badges de estado en la tabla de historial */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-verde {
    background: #d5f5e3;
    color: #1e8449;
}

.badge-amarillo {
    background: #fef9e7;
    color: #b7770d;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .dispositivos-table {
        font-size: 0.85rem;
    }

    .dispositivos-table th,
    .dispositivos-table td {
        padding: 0.5rem;
    }
}