/* caixa.css - tela Caixa (ganhos) do desktop */

#cz-caixa {
    --cx-bg: #f3f5f9;
    --cx-card: #fff;
    --cx-line: #edf0f5;
    --cx-text: #1e2a3b;
    --cx-muted: #7a8699;
    --cx-brand: #0b3a75;
    --cx-brand-2: #1557b0;
    --cx-ok: #1a9e5c;
    --cx-warn: #e08a00;
    --cx-info: #1557b0;
    height: 100%;
    overflow: auto;
    background: var(--cx-bg);
    color: var(--cx-text);
    font-family: "Segoe UI", "Inter", Roboto, Arial, sans-serif;
    font-size: 13px;
}
#cz-caixa *, #cz-caixa *::before, #cz-caixa *::after { box-sizing: border-box; }
#cz-caixa button { font-family: inherit; cursor: pointer; }

#cz-caixa .cx-app { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }

/* ---------------------------------------------- cabeçalho */
#cz-caixa .cx-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--cx-card); border-radius: 14px; padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
#cz-caixa .cx-title { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
#cz-caixa .cx-ico {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #1a9e5c, #2bc37a); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
#cz-caixa .cx-ico svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
#cz-caixa .cx-title h1 { margin: 0; font-size: 18px; line-height: 1.1; }
#cz-caixa .cx-title span { font-size: 12px; color: var(--cx-muted); }

#cz-caixa .cx-nav { display: flex; align-items: center; gap: 6px; }
#cz-caixa .cx-period { min-width: 130px; text-align: center; line-height: 1.2; }
#cz-caixa .cx-period strong { display: block; font-size: 16px; }
#cz-caixa .cx-period span { font-size: 12px; color: var(--cx-muted); }

#cz-caixa .cx-icon {
    width: 32px; height: 32px; border-radius: 9px; border: 1px solid #dde2ea; background: #fff;
    font-size: 20px; line-height: 1; color: var(--cx-text);
    display: inline-flex; align-items: center; justify-content: center;
}
#cz-caixa .cx-icon:hover { background: #e8f0fb; border-color: transparent; color: var(--cx-brand); }
#cz-caixa .cx-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#cz-caixa .cx-icon.spin svg { animation: cx-spin .8s linear infinite; }
@keyframes cx-spin { to { transform: rotate(360deg); } }

#cz-caixa .cx-segs { display: inline-flex; background: #f3f5f9; border-radius: 9px; padding: 3px; }
#cz-caixa .cx-seg { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--cx-muted); }
#cz-caixa .cx-seg.on { background: #fff; color: var(--cx-brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }

#cz-caixa .cx-datas { display: flex; align-items: center; gap: 6px; color: var(--cx-muted); }
#cz-caixa .cx-datas input, #cz-caixa .cx-sel {
    height: 32px; border: 1px solid #dde2ea; border-radius: 9px; padding: 0 8px;
    font: inherit; color: var(--cx-text); background: #fff;
}
#cz-caixa .cx-sel { min-width: 170px; max-width: 220px; font-weight: 600; }
#cz-caixa .cx-datas input { width: 128px; }
#cz-caixa .cx-acts { display: flex; gap: 6px; flex: none; }
#cz-caixa .cx-spacer { flex: 1; }
#cz-caixa .cx-eu { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
#cz-caixa .cx-close {
    width: 32px; height: 32px; border-radius: 9px; border: 0; background: #fdecec; color: #b42318;
    font-size: 20px; line-height: 1;
}
#cz-caixa .cx-close:hover { background: #fbd5d5; }

#cz-caixa .cx-alert { background: #fff4e0; color: #8a5300; border-radius: 12px; padding: 10px 14px; font-weight: 600; }

/* ---------------------------------------------- indicadores */
#cz-caixa .cx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
#cz-caixa .cx-kpi {
    background: var(--cx-card); border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    border-top: 4px solid var(--cx-brand-2);
    display: flex; flex-direction: column; gap: 2px;
}
#cz-caixa .cx-kpi span { font-size: 12px; font-weight: 600; color: var(--cx-muted); text-transform: uppercase; letter-spacing: .04em; }
#cz-caixa .cx-kpi b { font-size: 24px; }
#cz-caixa .cx-kpi small { color: var(--cx-muted); }
#cz-caixa .cx-kpi.main {
    border-top: 0; color: #fff;
    background: linear-gradient(135deg, #12804a, #1fb36b);
}
#cz-caixa .cx-kpi.main span, #cz-caixa .cx-kpi.main small { color: rgba(255, 255, 255, .85); }
#cz-caixa .cx-kpi.main b { font-size: 28px; }
#cz-caixa .cx-kpi.warn { border-top-color: var(--cx-warn); }
#cz-caixa .cx-kpi.warn b { color: var(--cx-warn); }
#cz-caixa .cx-kpi.info b { color: var(--cx-info); }

/* ---------------------------------------------- blocos */
#cz-caixa .cx-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2.2fr; gap: 12px; align-items: start; }
#cz-caixa .cx-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#cz-caixa .cx-card { background: var(--cx-card); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
#cz-caixa .cx-card h2 {
    margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--cx-muted);
    display: flex; align-items: center; gap: 8px;
}
#cz-caixa .cx-card h2 em {
    font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 999px;
    background: #e3f6ec; color: var(--cx-ok);
}
#cz-caixa .cx-card h2 em.warn { background: #fff1db; color: var(--cx-warn); }

#cz-caixa .cx-bar { margin-bottom: 12px; }
#cz-caixa .cx-bar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
#cz-caixa .cx-bar-top i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
#cz-caixa .cx-bar-nome { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cz-caixa .cx-bar-qtd { color: var(--cx-muted); font-size: 12px; }
#cz-caixa .cx-track { height: 8px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
#cz-caixa .cx-track span { display: block; height: 100%; border-radius: 999px; }
#cz-caixa .cx-pct { font-size: 11px; color: var(--cx-muted); text-align: right; margin-top: 2px; }
#cz-caixa .cx-av {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 700; text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}

#cz-caixa .cx-tab { width: 100%; border-collapse: collapse; }
#cz-caixa .cx-tab th {
    text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--cx-muted); padding: 6px 8px; border-bottom: 1px solid var(--cx-line);
}
#cz-caixa .cx-tab td { padding: 8px; border-bottom: 1px solid var(--cx-line); white-space: nowrap; }
#cz-caixa .cx-tab tr:last-child td { border-bottom: 0; }
#cz-caixa .cx-tab tbody tr:hover { background: #f8fafc; }
#cz-caixa .cx-tab td i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
#cz-caixa .cx-tab .r { text-align: right; }
#cz-caixa .cx-tab .b { font-weight: 700; }
#cz-caixa .cx-tab .ok { color: var(--cx-ok); }
#cz-caixa .cx-tab .warn { color: var(--cx-warn); }
#cz-caixa .cx-forma { padding: 2px 8px; border-radius: 6px; background: #e8f0fb; color: var(--cx-brand); font-weight: 600; font-size: 12px; }
#cz-caixa .cx-forma.off { background: #f3f5f9; color: var(--cx-muted); }
#cz-caixa .cx-vazio { color: var(--cx-muted); padding: 10px 0; }

@media (max-width: 1100px) {
    #cz-caixa .cx-kpis { grid-template-columns: repeat(2, 1fr); }
    #cz-caixa .cx-grid { grid-template-columns: 1fr; }
}

/* visão tabela */
#cz-caixa .cx-grid.one { grid-template-columns: 1fr; }
#cz-caixa .cx-lista tfoot td { border-top: 2px solid #d9e1ec; padding-top: 10px; font-weight: 700; }
#cz-caixa .cx-lista .cx-forma { margin: 1px 2px 1px 0; }

/* despesas */
#cz-caixa .cx-kpi.neg { border-top-color: #d64545; }
#cz-caixa .cx-kpi.neg b { color: #d64545; }
#cz-caixa .cx-tab .neg { color: #d64545; }
#cz-caixa .cx-card h2 em.neg { background: #fde8e8; color: #d64545; }
#cz-caixa .cx-h2sep { margin-left: 18px; }
#cz-caixa .cx-tiposel { min-width: 180px; }
#cz-caixa .cx-sub { color: var(--cx-muted); }
#cz-caixa .cx-tipo { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
#cz-caixa .cx-tipo.rec { background: #e3f5ec; color: var(--cx-ok); }
#cz-caixa .cx-tipo.desp { background: #fde8e8; color: #d64545; }
#cz-caixa .cx-lista tr.cx-desp td { background: #fffafa; }
#cz-caixa .cx-lista tfoot tr + tr td { border-top: 0; padding-top: 4px; }
#cz-caixa .cx-lista tfoot tr.cx-geral td { border-top: 2px solid #d9e1ec; padding-top: 8px; font-size: 15px; }

/* parte da empresa (aluguel do espaço) */
#cz-caixa .cx-rep h2 small { font-weight: 500; font-size: 12px; color: #8a93a3; margin-left: 6px; }
#cz-caixa .cx-rep h2 .cx-link { margin-left: auto; float: right; border: 0; background: none; color: #3b6fd8; font-weight: 600; cursor: pointer; font-size: 12.5px; }
#cz-caixa .cx-rep td i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
#cz-caixa .cx-rep tfoot td { font-weight: 700; border-top: 2px solid #e3e7ee; }
#cz-caixa .cx-rep-dica { font-size: 11.5px; color: #8a93a3; margin-top: 8px; }
