*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
}

.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { margin: 0; font-size: 18px; }
.sidebar-header span { font-size: 12px; opacity: 0.85; display: block; margin-top: 4px; }

.sidebar-menu { list-style: none; padding: 20px 0; margin: 0; flex: 1; }
.sidebar-menu li {
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-menu li:hover, .sidebar-menu li.active {
    background: rgba(255,255,255,0.15);
    border-left: 4px solid #34d399;
}

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.btn-sair {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.topbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.content-body { padding: 30px; max-width: 1050px; width: 100%; margin: 0 auto; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.card h3 { margin-top: 0; color: #1e3a8a; }

.grupo-junto-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grupo-junto-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #475569; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

.erro-login-msg {
    display: none;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

.btn { background: #2563eb; color: white; border: none; padding: 11px 18px; border-radius: 8px; font-weight: bold; cursor: pointer; }
.btn-success { background: #10b981; }
.btn-secondary { background: #64748b; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f8fafc; color: #334155; }

.badge-ativo { background: #dcfce7; color: #166534; padding: 4px 8px; border-radius: 6px; font-weight: bold; font-size: 11px; }
.badge-inativo { background: #fee2e2; color: #991b1b; padding: 4px 8px; border-radius: 6px; font-weight: bold; font-size: 11px; }

#loginOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #1e3a8a;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 9999;
}
.login-box {
    background: white;
    padding: 36px 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.btn-voltar-site-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #1e3a8a;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    margin-bottom: 18px;
}

@media (max-width: 768px) {
    body { flex-direction: column; height: auto; overflow: auto; }
    .sidebar { width: 100%; }
    .grupo-junto-2, .grupo-junto-3 { grid-template-columns: 1fr; }
}