.auth-body {
    background: linear-gradient(135deg, #0b1a4a, #142f7a);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.auth-main {
    width: min(1200px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: clamp(1.35rem, 2vw + 1rem, 2.1rem);
    color: #0f172a;
    width: min(100%, 460px);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.auth-logo img {
    width: 56px;
    height: 56px;
}

.auth-logo h1 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
}

.auth-logo p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form label {
    font-weight: 600;
    color: #0f172a;
}

.auth-form input {
    padding: 0.85rem 0.95rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.auth-form button {
    margin-top: 0.5rem;
    padding: 0.9rem;
    border: none;
    border-radius: 12px;
    background: #1a237e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(26, 35, 126, 0.25);
    width: 100%;
    touch-action: manipulation;
}

.auth-form button:hover {
    transform: translateY(-2px);
}

.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin: 0.5rem 0 0.75rem;
    font-weight: 600;
}

.auth-alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.auth-footer {
    text-align: center;
    color: #475569;
    margin: 1rem 0 0;
    font-size: 0.9rem;
}

/* Rodapé do login alinhado ao painel */
.painel-footer.login-footer {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.5rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    align-items: center;
    margin-top: 1.5rem;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.35);
}

.painel-footer.login-footer .footer-main-logo,
.painel-footer.login-footer .footer-logos img {
    transition: transform 0.2s ease;
}

.painel-footer.login-footer .footer-main-logo:hover,
.painel-footer.login-footer .footer-logos img:hover {
    transform: translateY(-2px);
}

.painel-footer .footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.painel-footer .footer-main-logo { width: 64px; height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35)); }
.painel-footer .footer-brand-text { display: flex; flex-direction: column; gap: 0.1rem; }
.painel-footer .footer-brand-title { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: 0.3px; }
.painel-footer .footer-brand-subtitle { margin: 0; color: #cbd5e1; }
.painel-footer .footer-meta { margin: 0; font-size: 0.95rem; line-height: 1.35; }
.painel-footer .footer-meta strong { color: #fff; }
.painel-footer .footer-meta a { color: #93c5fd; text-decoration: underline; }
.painel-footer .footer-support { display: flex; flex-direction: column; gap: 0.35rem; }
.painel-footer .footer-support-label { font-weight: 800; letter-spacing: 0.3px; }
.painel-footer .footer-logos { display: inline-flex; gap: 0.6rem; }
.painel-footer .footer-logos img { height: 42px; width: auto; filter: grayscale(0.1); background: rgba(255,255,255,0.08); padding: 0.4rem; border-radius: 10px; }

@media (max-width: 640px) {
    .auth-body { align-items: stretch; padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom)); }
    .auth-container { justify-content: flex-start; align-items: flex-start; }
    .auth-card { padding: 1.35rem; border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18); }
    .auth-logo h1 { font-size: 1.2rem; }
    .auth-logo p { font-size: 0.9rem; }
    .auth-form label { font-size: 0.95rem; }
    .auth-form input { padding: 0.8rem 0.9rem; }
    .auth-form button { padding: 0.85rem; }
    .painel-footer.login-footer { grid-template-columns: 1fr; text-align: center; padding: 1.25rem 1rem; gap: 1rem; }
    .painel-footer .footer-brand { justify-content: center; }
    .painel-footer .footer-support { align-items: center; }
    .painel-footer .footer-meta { font-size: 0.9rem; }
    .painel-footer .footer-logos { justify-content: center; flex-wrap: wrap; }
    .painel-footer .footer-logos img { height: 36px; }
}

@media (max-width: 480px) {
    .auth-body { padding: 0.75rem 0.85rem calc(1rem + env(safe-area-inset-bottom)); }
    .auth-container { padding: 0.25rem; }
    .auth-card { padding: 1.1rem; border-radius: 12px; }
    .auth-logo img { width: 48px; height: 48px; }
    .auth-form { gap: 0.65rem; }
    .auth-form label { font-size: 0.9rem; }
    .auth-form input { font-size: 1rem; padding: 0.78rem 0.9rem; }
    .auth-form button { font-size: 1rem; box-shadow: 0 6px 16px rgba(26, 35, 126, 0.22); }
    .painel-footer.login-footer { padding: 1rem 0.85rem; }
    .painel-footer .footer-logos img { height: 32px; padding: 0.35rem; }
}

@media (orientation: landscape) and (min-width: 768px) {
    .auth-body { justify-content: center; }
    .auth-main { align-items: center; }
}

@media (min-width: 840px) {
    .auth-body { justify-content: center; }
    .auth-main {
        display: grid;
        grid-template-columns: minmax(360px, 520px) minmax(360px, 1fr);
        align-items: center;
        gap: 1.5rem;
    }
    .auth-container {
        max-width: none;
        padding: 1.25rem;
    }
    .auth-card { display: flex; flex-direction: column; }
    .auth-form { margin-top: auto; }
    .painel-footer.login-footer {
        margin-top: 0;
        align-self: center;
        border-radius: 16px;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }
    .painel-footer.login-footer .footer-support { align-items: flex-start; }
    .painel-footer.login-footer .footer-logos { flex-wrap: wrap; }
}

/* Intranet */
.intranet-wrapper {
    max-width: 1100px;
    margin: calc(var(--header-height) + 1rem) auto 2rem;
    padding: 0 1.25rem 2.5rem;
}

/* Força as páginas da intranet a usarem scroll padrão, ignorando o overflow do layout geral */
html,
body.intranet-body {
    min-height: 100vh;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.intranet-header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.intranet-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.intranet-brand .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0b1a4a, #1a237e);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 24px rgba(26, 35, 126, 0.25);
}

.intranet-brand h1 {
    margin: 0;
    font-size: 1.35rem;
}

.intranet-brand p {
    margin: 0.15rem 0 0;
    color: #475569;
}

.intranet-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.intranet-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.intranet-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.intranet-tabs a {
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
}

.intranet-tabs a.active {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}

.table-responsive {
    overflow-x: auto;
}

.intranet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.intranet-table th,
.intranet-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.intranet-table th {
    background: #f8fafc;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.form-grid label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-grid input,
.form-grid select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.button.primary {
    background: #1a237e;
    color: #fff;
}

.button.secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.button.danger {
    background: #dc2626;
    color: #fff;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
}

.status-pill.admin {
    background: #1d4ed8;
}

.status-pill.user {
    background: #0ea5e9;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
}

.metric-card h4 {
    margin: 0 0 0.25rem;
}

.metric-card p {
    margin: 0;
    color: #0f172a;
    font-weight: 700;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: #e8eaf6;
    color: #1a237e;
    font-weight: 700;
}

.logout-link {
    color: #1a237e;
    font-weight: 700;
    text-decoration: none;
}
