/* =====================================================================
   DG FLOW — Esqueleto visual (menu lateral + painel de conteúdo)
   Fundo azul suave, menu transparente com grupos, conteúdo num painel
   branco arredondado. Carregado depois de refresh.css.
   ===================================================================== */
:root {
    --sidebar-width: 280px;
    --sb-mini: 80px;
    --shell-gap: 12px;
    --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --shell-bg: linear-gradient(165deg, #EEF2FF 0%, #E3ECFB 40%, #EDF3FD 75%, #F4F7FE 100%);
    --painel-raio: 22px;
}
html, body { font-family: var(--font-family); }
body { background: var(--shell-bg) fixed; background-color: #EEF2FB; }

/* ---------- Painel de conteúdo ---------- */
.main-content {
    background: #FBFCFE;
    border-radius: var(--painel-raio);
    margin: var(--shell-gap);
    min-height: calc(100vh - (var(--shell-gap) * 2));
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -10px rgba(30, 58, 138, .12);
    border: 1px solid rgba(255, 255, 255, .9);
    overflow: clip;
    position: relative;
}
.sb ~ .main-content { margin-left: var(--sidebar-width); }
body.sb-mini .sb ~ .main-content { margin-left: var(--sb-mini); }
.app-layout { background: transparent !important; }
.main-content .page-header {
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid #EEF1F6;
    padding: 22px 36px;
    min-height: 0;
}
.main-content .page-body { padding: 28px 36px 80px; }
.card { border-color: #E9EDF4; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }

/* ---------- Menu lateral ---------- */
.sb.sidebar {
    width: var(--sidebar-width);
    background: transparent;
    border-right: none;
    box-shadow: none;
    padding: 18px 14px 14px;
    gap: 12px;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width .2s ease;
}
.sb .sb-topo { display:flex; align-items:center; justify-content:space-between; padding: 2px 6px 4px 8px; }
.sb .sb-marca { display:flex; align-items:center; gap: 12px; min-width: 0; }
.sb .sb-logo { height: 30px; width: auto; display:block; }
.sb .sb-marca-div { width: 1px; height: 24px; background: #CBD5E1; }
.sb .sb-marca-nome { font-size: 21px; font-weight: 700; color: #1E293B; letter-spacing: -0.02em; }
.sb .sb-recolher { border:none; background: transparent; color: #64748B; width: 32px; height: 32px; border-radius: 9px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.sb .sb-recolher:hover { background: rgba(255,255,255,.7); color: #0F172A; }

.sb .sb-busca { display:flex; align-items:center; gap: 8px; background: rgba(255,255,255,.75); border: 1px solid rgba(203,213,225,.7); border-radius: 12px; padding: 0 10px; height: 40px; color: #64748B; cursor: text; transition: border-color .15s, background .15s; }
.sb .sb-busca:focus-within { background:#fff; border-color: hsl(var(--p-h), 70%, 60%); }
.sb .sb-busca input { flex:1; min-width:0; border:none; outline:none; background: transparent; font: inherit; font-size: 14px; color: #0F172A; }
.sb .sb-busca input::placeholder { color: #64748B; }
.sb .sb-busca kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #64748B; border: 1px solid #CBD5E1; border-radius: 6px; padding: 1px 6px; background: #fff; white-space: nowrap; }

.sb .sb-conta { position: relative; padding: 0; margin: 0; border: none; background: none; }
.sb .sb-conta-pill { width: 100%; display:flex; align-items:center; gap: 10px; background: #0F172A; color: #fff; border: none; border-radius: 14px; padding: 9px 12px 9px 9px; cursor:pointer; text-align:left; box-shadow: 0 6px 16px -8px rgba(15,23,42,.6); }
.sb .sb-conta-pill:hover { background: #1E293B; }
.sb .sb-conta-ico { border-radius: 8px; display:flex; align-items:center; justify-content:center; color:#fff; font-size: 12px; font-weight: 700; overflow:hidden; flex-shrink:0; }
.sb .sb-conta-ico img { width:100%; height:100%; object-fit: contain; background:#fff; }
.sb .sb-conta-txt { flex:1; min-width:0; display:flex; flex-direction:column; }
.sb .sb-conta-nome { font-size: 14px; font-weight: 600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb .sb-conta-rot { font-size: 11.5px; color: #94A3B8; }
.sb .sb-conta-pill .sb-chev { color: #94A3B8; flex-shrink: 0; }
.sb .sb-conta-lista { position:absolute; left:0; right:0; top: calc(100% + 6px); background:#fff; border: 1px solid #E2E8F0; border-radius: 14px; box-shadow: 0 16px 40px -12px rgba(15,23,42,.25); padding: 6px; max-height: 360px; overflow-y:auto; z-index: 50; }
.sb .sb-conta-lista .conta-dropdown-item { display:flex; align-items:center; gap:10px; width:100%; border:none; background:none; padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13.5px; color: #1E293B; cursor:pointer; text-align:left; }
.sb .sb-conta-lista .conta-dropdown-item:hover { background: #F1F5F9; }
.sb .sb-conta-lista .conta-dropdown-item.active { background: hsl(var(--p-h), 80%, 96%); font-weight: 600; }
.sb .sb-conta-lista .conta-dropdown-item > span:not(.sb-conta-ico) { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb .sb-conta-lista .conta-dropdown-item svg { width: 16px; height: 16px; color: var(--primary); }

.sb .sb-nav { flex:1; overflow-y:auto; overflow-x:hidden; padding: 4px 2px 8px; margin: 0 -4px; display:flex; flex-direction:column; gap: 2px; scrollbar-width: thin; }
.sb .sb-item { position: relative; display:flex; align-items:center; gap: 12px; width:100%; border:none; background: transparent; color: #334155; font: inherit; font-size: 14.5px; font-weight: 500; padding: 9px 12px; border-radius: 11px; cursor:pointer; text-align:left; transition: background .12s, color .12s; }
.sb .sb-item:hover { background: rgba(255,255,255,.7); color: #0F172A; }
.sb .sb-item.active { background: rgba(255,255,255,.95); color: hsl(var(--p-h), 75%, 40%); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.sb .sb-item.active::before { content:''; position:absolute; left: -2px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: hsl(var(--p-h), 75%, 40%); }
.sb .sb-ico { position: relative; width: 20px; height: 20px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sb .sb-ico svg { width: 19px; height: 19px; }
.sb .sb-txt { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb .sb-chev { flex-shrink:0; color: #94A3B8; transition: transform .18s ease; }
.sb .sb-grupo.fechado .sb-grupo-cab .sb-chev { transform: rotate(-90deg); }
.sb .sb-grupo-cab { color: #1E293B; font-weight: 500; }
.sb .sb-filhos { position: relative; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid rgba(148,163,184,.45); display:flex; flex-direction:column; gap: 1px; }
.sb .sb-grupo.fechado .sb-filhos { display:none; }
.sb .sb-filho { font-size: 14px; padding: 8px 10px; color: #475569; }
.sb .sb-filho .sb-ico svg { width: 17px; height: 17px; }
.sb .sb-filho.active::before { left: -14px; }
.sb .sb-badge { font-size: 11px; font-weight: 700; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 1px 8px; flex-shrink:0; }
.sb .sb-badge-alerta { color: #fff; background: #EF4444; }
.sb .sb-ponto { position:absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; border: 2px solid #EAF0FB; }
.sb .sb-nada { font-size: 13px; color: #64748B; padding: 10px 12px; }

.sb .sb-rodape { margin-top: 0; padding: 0; border: none; background: none; }
.sb .sb-usuario { display:flex; align-items:center; gap: 4px; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 18px -10px rgba(30,58,138,.25); }
.sb .sb-usuario-info { flex:1; min-width:0; display:flex; align-items:center; gap: 10px; border:none; background:none; padding: 2px; cursor:pointer; text-align:left; font: inherit; border-radius: 10px; }
.sb .sb-avatar { position: relative; flex-shrink:0; }
.sb .sb-avatar .avatar { width: 38px; height: 38px; font-size: 13px; background: #EEF2FF; color: hsl(var(--p-h), 70%, 35%); border-radius: 12px; }
.sb .sb-nuvem { position:absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: #94A3B8; }
.sb .sb-nuvem.online { background: #10B981; }
.sb .sb-usuario-txt { min-width:0; display:flex; flex-direction:column; }
.sb .sb-usuario-nome { font-size: 14px; font-weight: 700; color: #0F172A; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb .sb-usuario-papel { font-size: 12px; color: #64748B; }
.sb .sb-icone-btn { width: 32px; height: 32px; flex-shrink:0; border:none; background: transparent; color: #64748B; border-radius: 9px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.sb .sb-icone-btn:hover { background: #F1F5F9; color: #0F172A; }
.sb .sb-icone-btn svg { width: 17px; height: 17px; }

/* ---------- Menu recolhido ---------- */
body.sb-mini .sb.sidebar { width: var(--sb-mini); padding-left: 12px; padding-right: 12px; }
body.sb-mini .sb .sb-marca-div, body.sb-mini .sb .sb-marca-nome, body.sb-mini .sb .sb-busca,
body.sb-mini .sb .sb-txt, body.sb-mini .sb .sb-chev, body.sb-mini .sb .sb-badge, body.sb-mini .sb .sb-conta-txt,
body.sb-mini .sb .sb-usuario-txt, body.sb-mini .sb .sb-icone-btn, body.sb-mini .sb .sb-nada { display:none; }
body.sb-mini .sb .sb-topo { flex-direction: column; gap: 10px; padding: 0; }
body.sb-mini .sb .sb-logo { height: 24px; }
body.sb-mini .sb .sb-item { justify-content:center; padding: 10px 0; }
body.sb-mini .sb .sb-filhos { margin-left: 0; padding-left: 0; border-left: none; }
body.sb-mini .sb .sb-grupo.fechado .sb-filhos { display:flex; }
body.sb-mini .sb .sb-grupo-cab { display:none; }
body.sb-mini .sb .sb-grupo + .sb-grupo { border-top: 1px solid rgba(148,163,184,.35); padding-top: 4px; }
body.sb-mini .sb .sb-conta-pill { justify-content:center; padding: 8px; }
body.sb-mini .sb .sb-usuario { justify-content:center; padding: 6px; }
body.sb-mini .sb .sb-item.active::before { display:none; }

/* ---------- Telas menores ---------- */
@media (max-width: 1024px) {
    .sb.sidebar { transform: translateX(-100%); transition: transform .2s ease; background: #EEF2FB; box-shadow: 0 0 40px rgba(15,23,42,.2); }
    .sb.sidebar.open { transform: translateX(0); }
    .sb ~ .main-content, body.sb-mini .sb ~ .main-content { margin-left: var(--shell-gap); }
    .main-content .page-header { padding: 16px 20px; }
    .main-content .page-body { padding: 20px; }
}

/* ---------- Impressão ---------- */
@media print {
    body { background: #fff !important; }
    .main-content { margin: 0 !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; }
}

/* ajustes finos sobre regras antigas */
.sb .sb-nav.sidebar-nav { background: transparent; padding: 4px 2px 8px; }
.sb .sb-item:hover { transform: none; }
.sb .sb-conta.conta-selector { padding: 0; }
.agd-select { width: auto; }

/* rodapé do menu ocupa a largura toda */
.sb .sb-rodape { width: 100%; }

/* ---------- Login ---------- */
.login-page, .login-container { background: var(--shell-bg) fixed !important; }
.login-bg-pattern { display: none !important; }
.login-card { border-radius: 24px !important; border: 1px solid rgba(255,255,255,.9) !important; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 24px 60px -20px rgba(30,58,138,.25) !important; }
.dg-marca-login { display:flex; align-items:center; justify-content:center; gap: 14px; margin: 8px 0 10px; }
.dg-marca-login img { height: 44px; width: auto; }
.dg-marca-div { width: 1px; height: 34px; background: #CBD5E1; }
.dg-marca-nome { font-size: 32px; font-weight: 700; color: #1E293B; letter-spacing: -0.02em; }
.dg-login-sub { font-size: 14px; color: var(--gray-500); margin: 0 0 6px; text-align: center; }
.sb .sb-rodape.sidebar-footer { display:block; padding: 0; border-top: none; }
.sb .sb-usuario { width: 100%; box-sizing: border-box; }

/* sem faixas coloridas na lateral dos cartões */
.toast { border-left: none !important; }
.lideranca-conta-card.has-alert { border-left: 1px solid #FECACA; border-color: #FECACA; }
