/* SEDUC - Estilos globais */
@import url('CSS/toast.css');
:root {
    --cor-primaria: #1a5276;
    --cor-primaria-escura: #154360;
    --cor-secundaria: #27ae60;
    --cor-alerta: #e74c3c;
    --cor-aviso: #f39c12;
    --cor-fundo: #f4f6f9;
    --cor-superficie: #ffffff;
    --cor-texto: #2c3e50;
    --cor-texto-suave: #7f8c8d;
    --cor-borda: #dce1e6;
    --sombra: 0 2px 8px rgba(0, 0, 0, 0.08);
    --raio: 8px;
    --fonte: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --sidebar-largura: 260px;
    --header-altura: 56px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--fonte);
    background: var(--cor-fundo);
    color: var(--cor-texto);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout portal autenticado */
.portal-app {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: var(--sidebar-largura);
    background: var(--cor-primaria);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.portal-sidebar__brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.portal-sidebar__brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.portal-sidebar__brand span {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.portal-nav {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
}

.portal-nav__item button,
.portal-nav__item a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.portal-nav__item button:hover,
.portal-nav__item a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.portal-nav__item button.active,
.portal-nav__item a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}

.portal-sidebar__footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
}

.portal-main {
    flex: 1;
    margin-left: var(--sidebar-largura);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.portal-header {
    height: var(--header-altura);
    background: var(--cor-superficie);
    border-bottom: 1px solid var(--cor-borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--sombra);
}

.portal-header__title {
    font-size: 1.15rem;
    font-weight: 600;
}

.portal-content {
    padding: 1.5rem;
    flex: 1;
}

/* SPA views */
.tela-view {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tela-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards e grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
    background: var(--cor-superficie);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 1.25rem;
    border: 1px solid var(--cor-borda);
}

.card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--cor-primaria);
}

.stat-card {
    text-align: center;
}

.stat-card__valor {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cor-primaria);
}

.stat-card__label {
    font-size: 0.85rem;
    color: var(--cor-texto-suave);
}

/* Formulários */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--raio);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--cor-primaria);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cor-primaria-escura);
}

.btn-secondary {
    background: var(--cor-texto-suave);
    color: #fff;
}

.btn-success {
    background: var(--cor-secundaria);
    color: #fff;
}

.btn-danger {
    background: var(--cor-alerta);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--cor-borda);
    color: var(--cor-texto);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Tabelas */
.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--cor-borda);
}

.data-table th {
    background: var(--cor-fundo);
    font-weight: 600;
    color: var(--cor-primaria);
}

.data-table tbody tr:hover {
    background: rgba(26, 82, 118, 0.04);
}

/* Alertas */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--raio);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #d5f5e3; color: #1e8449; }
.alert-error { background: #fadbd8; color: #922b21; }
.alert-info { background: #d6eaf8; color: #1a5276; }

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--cor-superficie);
    border-radius: var(--raio);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cor-borda);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal__body {
    padding: 1.25rem;
}

.modal__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--cor-borda);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--cor-texto-suave);
    font-size: 0.85rem;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cor-borda);
    background: var(--cor-fundo);
}
