:root {
    --cor-principal: #0d6efd;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 68px;
    --topbar-height: 60px;
}

body {
    background-color: #f4f6f9;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.auth-body {
    background: linear-gradient(160deg, #eef3fb 0%, #e3ecf7 100%);
}

/* ---------- Shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: #101a2b;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: width .2s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem;
    color: #fff;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand i { font-size: 1.4rem; color: var(--cor-principal); }

.sidebar-brand-logo { width: 65%; height: auto; max-width: 100%; object-fit: contain; }

.auth-logo { width: 50%; height: auto; max-width: 100%; object-fit: contain; }

.sidebar-nav { padding: .5rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: .5rem;
    color: #cbd5e1;
    text-decoration: none;
    margin-bottom: .15rem;
    white-space: nowrap;
    overflow: hidden;
    font-size: .92rem;
}

.sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }

.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }

.sidebar-link.active {
    background: var(--cor-principal);
    color: #fff;
}

.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-link-text {
    display: none;
}

.app-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-search { max-width: 480px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.app-content {
    padding: 1.25rem;
    flex-grow: 1;
}

/* ---------- Cards do dashboard ---------- */
.stat-card {
    background: #fff;
    border-radius: .75rem;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #eef1f5;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #6c757d; font-size: .82rem; }

.card { border: 1px solid #eef1f5; border-radius: .75rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -100%;
        height: 100vh;
        width: 260px;
        transition: left .2s ease;
    }
    .app-shell.sidebar-mobile-open .app-sidebar { left: 0; }
    .app-shell.sidebar-collapsed .app-sidebar { width: 260px; }
    .app-shell.sidebar-collapsed .sidebar-brand-text,
    .app-shell.sidebar-collapsed .sidebar-link-text { display: inline; }
}

/* ---------- Impressão: rodapé institucional sempre no final da página ---------- */
@media print {
    .rodape-institucional {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
    }
}
