

<?php $__env->startSection('title', 'Configurações - SGE'); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-md-8">
        <div class="d-flex justify-content-between align-items-center mb-2" style="border-bottom: 1px solid #dee2e6; padding-bottom: 8px;">
            <h5 class="mb-0" style="font-weight: 600;">Configurações do Sistema</h5>
        </div>
        
        <div style="background: #f8f9fa; padding: 15px; border-radius: 4px;">
            <form method="POST" action="<?php echo e(route('superadmin.configuracoes.update')); ?>">
                <?php echo csrf_field(); ?>

                <div class="mb-2">
                    <label for="ano_letivo_id" class="form-label" style="font-size: 0.85rem; margin-bottom: 3px;">Ano Letivo Activo</label>
                    <select class="form-select form-select-sm <?php $__errorArgs = ['ano_letivo_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                            id="ano_letivo_id" name="ano_letivo_id">
                        <option value="">Selecione</option>
                        <?php $__currentLoopData = \App\Models\AnoLetivo::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ano): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($ano->id); ?>" <?php echo e(($anoLetivoAtivo && $anoLetivoAtivo->id == $ano->id) ? 'selected' : ''); ?>>
                                <?php echo e($ano->ano); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    <?php $__errorArgs = ['ano_letivo_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid-feedback"><?php echo e($message); ?></div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <hr style="margin: 0.75rem 0;">

                <h6 style="font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem;">Controle de Lançamento de Notas por Trimestre</h6>

                <?php if($trimestres && $trimestres->isNotEmpty()): ?>
                    <?php $__currentLoopData = $trimestres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trimestre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="mb-2 p-2 border rounded" style="background: white;">
                            <div class="form-check form-switch">
                                <input type="hidden" name="trimestres[<?php echo e($trimestre->id); ?>]" value="0">
                                <input class="form-check-input" type="checkbox" 
                                       id="trimestre_<?php echo e($trimestre->id); ?>" 
                                       name="trimestres[<?php echo e($trimestre->id); ?>]" 
                                       value="1"
                                       <?php echo e(($lancamentoPorTrimestre[$trimestre->id] ?? true) ? 'checked' : ''); ?>>
                                <label class="form-check-label" for="trimestre_<?php echo e($trimestre->id); ?>" style="font-size: 0.85rem;">
                                    <strong><?php echo e($trimestre->numero); ?>º Trimestre - <?php echo e($trimestre->nome); ?></strong>
                                </label>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <small class="form-text text-muted d-block" style="font-size: 0.75rem; margin-top: 5px;">
                        Quando desmarcado, os professores poderão apenas visualizar as notas daquele trimestre, mas não poderão alterá-las.
                    </small>
                <?php else: ?>
                    <div class="alert alert-warning" style="font-size: 0.85rem; padding: 8px;">
                        <i class="bi bi-exclamation-triangle"></i> Nenhum trimestre encontrado para o ano letivo ativo.
                    </div>
                <?php endif; ?>

                <hr style="margin: 0.75rem 0;">

                <h6 style="font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem;">Tema Visual</h6>

                <div class="mb-2">
                    <label for="cor_principal" class="form-label" style="font-size: 0.85rem; margin-bottom: 3px;">Cor Principal <span class="text-danger">*</span></label>
                    <input type="color" class="form-control form-control-color form-control-sm <?php $__errorArgs = ['cor_principal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                           id="cor_principal" name="cor_principal" value="<?php echo e($temaAtivo->cor_principal ?? '#6c757d'); ?>" required style="width: 60px; height: 35px;">
                    <?php $__errorArgs = ['cor_principal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid-feedback"><?php echo e($message); ?></div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <div class="mb-2">
                    <label for="cor_secundaria" class="form-label" style="font-size: 0.85rem; margin-bottom: 3px;">Cor Secundária</label>
                    <input type="color" class="form-control form-control-color form-control-sm <?php $__errorArgs = ['cor_secundaria'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                           id="cor_secundaria" name="cor_secundaria" value="<?php echo e($temaAtivo->cor_secundaria ?? '#0d6efd'); ?>" style="width: 60px; height: 35px;">
                    <?php $__errorArgs = ['cor_secundaria'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid-feedback"><?php echo e($message); ?></div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <div class="mt-2">
                    <button type="submit" class="btn btn-sm btn-primary">Salvar</button>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>




<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Alcidio\Desktop\escola\resources\views/superadmin/configuracoes.blade.php ENDPATH**/ ?>