/**
 * CSS: Editor de Control de Acceso
 * Archivo: assets/css/control-acceso-editor-shortcode.css
 */

/* ── Wrapper ────────────────────────────────────────────────────────── */
.cae-wrapper {
    font-family: sans-serif;
    max-width: 100%;
    position: relative;
}

/* ── Selector de grupo ──────────────────────────────────────────────── */
.cae-selector-zona {
    background: #fff;
    border: 1px solid #dde3f0;
    border-left: 4px solid #6c5ce7;
    border-radius: 8px;
    padding: 18px 24px;
    margin-bottom: 20px;
}

.cae-selector-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cae-label {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.cae-label-icon {
    margin-right: 6px;
}

.cae-select {
    flex: 1;
    min-width: 220px;
    max-width: 400px;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.cae-select:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}

/* ── Info del grupo ─────────────────────────────────────────────────── */
.cae-grupo-info {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 32px;
    font-size: 15px;
    margin-bottom: 0;
}

.cae-grupo-label strong,
.cae-grupo-total strong {
    font-size: 17px;
}

/* ── Aviso sin ID ───────────────────────────────────────────────────── */
.cae-aviso-sin-id {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 16px;
    color: #856404;
    font-size: 14px;
    margin: 12px 0;
}

/* ── Pestañas ───────────────────────────────────────────────────────── */
.cae-tabs {
    display: flex;
    gap: 4px;
    margin: 16px 0 0;
    border-bottom: 2px solid #e0e0e0;
}

.cae-tab {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cae-tab:hover {
    background: #ede9ff;
    color: #6c5ce7;
}

.cae-tab-activa {
    background: #6c5ce7;
    color: #fff;
    border-color: #6c5ce7;
}

/* ── Tabla ──────────────────────────────────────────────────────────── */
.cae-tabla-dia {
    margin-top: 0;
}

.cae-tabla-scroll {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

.cae-tabla {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    font-size: 14px;
}

.cae-tabla thead {
    background: #3d3580;
    color: #fff;
}

.cae-th-nombre {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 200px;
    position: sticky;
    left: 0;
    background: #3d3580;
    z-index: 2;
}

.cae-th-hora {
    text-align: center;
    padding: 8px 6px;
    min-width: 90px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.cae-th-hora-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* ── Checkboxes custom ──────────────────────────────────────────────── */
.cae-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    width: 28px;
    height: 28px;
}

.cae-check-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cae-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #aaa;
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.cae-check-wrap input:checked ~ .cae-checkmark {
    background: #6c5ce7;
    border-color: #6c5ce7;
}

.cae-check-wrap input:checked ~ .cae-checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.cae-check-wrap input:disabled ~ .cae-checkmark {
    background: #eee;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Check maestro en encabezado */
.cae-check-maestro-wrap .cae-checkmark {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.15);
}

.cae-check-maestro-wrap input:checked ~ .cae-checkmark {
    background: #fff;
    border-color: #fff;
}

.cae-check-maestro-wrap input:checked ~ .cae-checkmark::after {
    border-color: #6c5ce7;
}

/* ── Filas de la tabla ──────────────────────────────────────────────── */
.cae-tabla tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.1s;
}

.cae-tabla tbody tr:hover {
    background: #f8f6ff;
}

.cae-td-nombre {
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    border-right: 2px solid #e0e0e0;
}

.cae-tabla tbody tr:hover .cae-td-nombre {
    background: #f8f6ff;
}

.cae-td-check {
    text-align: center;
    padding: 4px;
    border-left: 1px solid #f0f0f0;
}

/* ── Filas sin ID CBTA ──────────────────────────────────────────────── */
.cae-fila-sin-id {
    background: #fff8e1 !important;
}

.cae-fila-sin-id:hover {
    background: #fff3cd !important;
}

.cae-fila-sin-id .cae-td-nombre {
    background: #fff8e1;
    color: #856404;
}

.cae-fila-sin-id:hover .cae-td-nombre {
    background: #fff3cd;
}

.cae-icono-advertencia {
    color: #e6a817;
    font-size: 13px;
    margin-right: 4px;
}

/* ── Botones ────────────────────────────────────────────────────────── */
.cae-botones {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding: 16px 0;
}

.cae-btn {
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.cae-btn:active {
    transform: scale(0.97);
}

.cae-btn-guardar {
    background: #6c5ce7;
    color: #fff;
}

.cae-btn-guardar:hover {
    opacity: 0.88;
}

.cae-btn-guardar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cae-btn-cancelar {
    background: #636e72;
    color: #fff;
}

.cae-btn-cancelar:hover {
    opacity: 0.88;
}

/* ── Mensajes ───────────────────────────────────────────────────────── */
.cae-mensaje {
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 15px;
    margin-top: 8px;
}

.cae-mensaje-exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cae-mensaje-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cae-mensaje-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ── Loading ────────────────────────────────────────────────────────── */
.cae-loading {
    text-align: center;
    padding: 32px;
    color: #666;
}

.cae-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e0e0e0;
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: cae-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes cae-spin {
    to { transform: rotate(360deg); }
}

/* ── Error general ──────────────────────────────────────────────────── */
.cae-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cae-selector-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .cae-select {
        width: 100%;
        max-width: 100%;
    }
    .cae-botones {
        flex-direction: column;
    }
    .cae-btn {
        width: 100%;
        text-align: center;
    }
}
