/* =====================================================================
   Tema "Verde Institucional"
   Cores da marca: altere só as variáveis abaixo para outro cliente.
   ===================================================================== */
:root {
    --brand-900: #0B4F35;   /* menu lateral */
    --brand-700: #0E6E48;   /* botões, destaques */
    --brand-600: #13855A;
    --brand-100: #E3F0E8;
    --accent:    #9BD267;   /* verde-limão */
    --bg:        #EEF2EC;
    --surface:   #FFFFFF;
    --surface-2: #F5F8F4;
    --border:    #DCE5DF;
    --text:      #17211C;
    --muted:     #4F6158;
    --danger:    #A8401D;
    --warning:   #7A4F00;
    --radius:    14px;
    --font-body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
    --sidebar-w: 264px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
}

body * { font-family: inherit; }
.fa { font-family: FontAwesome !important; }
.material-icons { font-family: "Material Icons" !important; }

a { color: var(--brand-700); }
a:hover { color: var(--brand-900); }

/* ---------- Estrutura geral ---------- */
.app-root,
.app-root > .row,
.app-root > .row > [class*="col"] {
    padding: 0 !important;
    margin: 0 !important;
}

/* Páginas com menu lateral: o container ocupa a largura toda */
.container:has(.app-sidebar),
.container-fluid:has(.app-sidebar) {
    max-width: none !important;
    padding: 0 !important;
}
.row:has(> div > .app-sidebar) {
    margin: 0 !important;
    min-height: 100vh;
    flex-wrap: nowrap;
    align-items: stretch;
}
div:has(> .app-sidebar) {
    flex: 0 0 var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    width: var(--sidebar-w) !important;
    padding: 0 !important;
}
div:has(> .app-sidebar) + div {
    flex: 1 1 0 !important;
    max-width: none !important;
    min-width: 0;
    padding: 28px 32px !important;
}

/* ---------- Menu lateral ---------- */
.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--brand-900);
    color: #D7E8DE;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}

.brand-card {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.brand-card img {
    width: 100%;
    max-width: 180px;
    height: auto;
    mix-blend-mode: multiply;
}

.nav-label {
    padding: 0 12px 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8FB5A0;
    font-weight: 700;
}

.app-sidebar .nav-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #D7E8DE;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
    text-decoration: none;
    transition: background .15s;
}
.app-sidebar .nav-section::-webkit-details-marker { display: none; }
.app-sidebar .nav-section:hover { background: rgba(255,255,255,.08); color: #FFFFFF; }
.app-sidebar a.nav-section.active { background: var(--accent); color: var(--brand-900); }

.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.nav-chevron { margin-left: auto; transition: transform .2s; }
.nav-group[open] > .nav-section .nav-chevron { transform: rotate(180deg); }
.nav-group[open] > .nav-section { color: #FFFFFF; }

.nav-sublist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 8px 30px;
}
.app-sidebar .nav-sub {
    padding: 8px 12px !important;
    border-radius: 8px;
    color: #A9C7B6 !important;
    font-size: 13.5px;
    font-weight: 500;
}
.app-sidebar .nav-sub:hover { color: #FFFFFF !important; background: rgba(255,255,255,.06); }
.app-sidebar .nav-sub.active {
    color: var(--brand-900) !important;
    background: var(--accent) !important;
    font-weight: 700;
}

.user-card {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--brand-700);
}
.user-avatar {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--brand-900);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}
.user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-name { color: #FFFFFF; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #BFD9C9; font-size: 12px; }
.user-logout.btn {
    width: 38px; height: 38px;
    padding: 0;
    border: none;
    background: transparent !important;
    color: #D7E8DE !important;
    font-size: 17px;
    border-radius: 8px;
}
.user-logout.btn:hover { background: rgba(255,255,255,.12) !important; color: #FFFFFF !important; }
.user-links { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 0; }
.user-link { color: #A9C7B6; font-size: 12.5px; text-decoration: none; }
.user-link:hover { color: #FFFFFF; }

/* ---------- Cabeçalho de página e início ---------- */
.page-header { margin-bottom: 24px; }
.page-title {
    font-family: var(--font-display) !important;
    font-size: 30px;
    font-weight: 700;
    color: var(--brand-900);
    margin: 0;
}
.page-subtitle { color: var(--muted); margin: 4px 0 0; }

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 16px;
}
.shortcut-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid transparent;
    transition: border-color .15s, transform .15s;
}
.shortcut-card:hover { border-color: var(--brand-700); transform: translateY(-2px); color: var(--text); }
.shortcut-card .fa {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--brand-100);
    color: var(--brand-700);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
}
.shortcut-card h3 { font-family: var(--font-display) !important; font-size: 18px; font-weight: 700; margin: 0; }
.shortcut-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Componentes gerais (todas as telas) ---------- */
.card {
    border: none !important;
    border-radius: var(--radius) !important;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(16, 40, 28, .05);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.card-header, .card-footer { background: transparent !important; border-color: var(--border) !important; }

.btn { border-radius: 10px !important; font-weight: 600; }
.btn-success {
    background-color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
    color: #FFFFFF !important;
}
.btn-success:hover, .btn-success:focus { background-color: var(--brand-900) !important; border-color: var(--brand-900) !important; }
.btn-danger { background-color: var(--danger) !important; border-color: var(--danger) !important; }

.form-control, .form-select {
    border-radius: 10px !important;
    border-color: #C6D3CB !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-700) !important;
    box-shadow: 0 0 0 3px rgba(14, 110, 72, .15) !important;
}
.form-label, label { color: var(--muted); font-weight: 600; }

.Select-control { border-radius: 10px !important; border-color: #C6D3CB !important; }
.is-focused:not(.is-open) > .Select-control { border-color: var(--brand-700) !important; box-shadow: 0 0 0 3px rgba(14,110,72,.15) !important; }

/* Tabelas (dash_table) */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background: var(--surface-2) !important;
    color: var(--muted) !important;
    font-weight: 700 !important;
}
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
    border-color: #EDF1EC !important;
    font-family: var(--font-body) !important;
}

/* Abas */
.nav-tabs .nav-link.active { color: var(--brand-700) !important; font-weight: 700; }

/* ---------- Sem permissão ---------- */
.denied-box {
    max-width: 480px;
    margin: 12vh auto 0;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 32px;
}
.denied-box h1 { font-family: var(--font-display) !important; font-size: 24px; color: var(--brand-900); }
.denied-box p { color: var(--muted); margin: 0; }
.denied-icon { font-size: 40px; color: var(--warning); margin-bottom: 12px; }

/* ---------- Login / registro ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: #F8F6EF;
}
.auth-brand {
    position: relative;
    overflow: hidden;
    flex: 1 1 420px;
    background: var(--brand-900);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 48px 32px;
    text-align: center;
}
/* imagem do ecossistema 360° do site (servida em /img/ pelo index.py), bem apagada */
.auth-brand::before { content: ''; position: absolute; inset: 0; background: url('/img/ecossistema.webp') center / cover no-repeat; opacity: .22; }
.auth-brand > * { position: relative; }
.brand-card-lg { padding: 24px 28px; margin: 0; border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
.brand-card-lg img { max-width: 300px; }
.auth-brand-sub { color: #E8F1EC; font-size: 18px; line-height: 1.5; max-width: 380px; margin: 0; }
.auth-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.auth-chip { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #FFFFFF; font-size: 14px; font-weight: 600; }
.auth-panel {
    flex: 1 1 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.auth-form {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 32px;
}
.auth-title { font-family: var(--font-display) !important; font-size: 26px; font-weight: 700; color: var(--brand-900); margin: 0; }
.auth-subtitle { color: var(--muted); font-size: 15px; margin: 6px 0 22px; }
.auth-form .form-label { font-size: 15px; margin-bottom: 6px; }
.auth-form .form-control { height: 48px; font-size: 16px; border-color: #74857C !important; }
.auth-submit { height: 50px; font-size: 16px; margin-top: 22px; }
.auth-submit:disabled { opacity: .75; cursor: not-allowed; }
.auth-label-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.auth-esqueci { font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-senha { position: relative; }
.auth-senha .form-control { padding-right: 56px; }
.auth-olho {
    position: absolute; right: 2px; top: 2px;
    width: 44px; height: 44px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted); font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.auth-olho:hover { background: var(--surface-2); color: var(--brand-900); }
.auth-erro { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; border-radius: 10px;
             background: #F8E3DB; color: #8A3014; font-size: 14px; font-weight: 600; }
.auth-erro .fa { font-size: 18px; margin-top: 1px; }
.auth-message:not(:empty) { margin-top: 14px; text-align: center; color: var(--danger); font-size: 14px; font-weight: 600; }
.auth-alt { margin-top: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-extra { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.auth-campo {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; border: 1px solid #74857C; border-radius: 10px;
    color: var(--brand-900); font-size: 15px; font-weight: 700; text-decoration: none;
}
.auth-campo .fa { font-size: 20px; }
.auth-campo:hover { background: var(--surface-2); color: var(--brand-900); }
.auth-page a:focus-visible, .auth-page button:focus-visible, .auth-page input:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }

/* ---------- Celular / tablet ---------- */
@media (max-width: 991px) {
    .row:has(> div > .app-sidebar) { flex-wrap: wrap; }
    div:has(> .app-sidebar),
    div:has(> .app-sidebar) + div {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    div:has(> .app-sidebar) + div { padding: 20px 16px !important; }
    .app-sidebar { position: static; height: auto; }
    .auth-brand { flex-basis: 100%; padding: 36px 24px 48px; gap: 14px; }
    .brand-card-lg { padding: 16px 20px; }
    .brand-card-lg img { max-width: 210px; }
    .auth-brand-sub { font-size: 16px; }
    .auth-chips { display: none; }
    .auth-panel { position: relative; flex-basis: 100%; padding: 0 16px 32px; margin-top: -16px; }
    .auth-form { padding: 24px 20px; }
    .auth-form .form-control { height: 52px; }
}

/* =====================================================================
   Componentes de página (padrão para todas as telas novas)
   ===================================================================== */
.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.page-crumb { font-size: 13px; color: var(--muted); font-weight: 600; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.period-select { height: 44px; min-width: 190px; font-weight: 600; }
.btn-action { height: 44px; padding: 0 20px !important; display: inline-flex; align-items: center; gap: 8px; }

/* Indicadores */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-family: var(--font-display) !important; font-size: 24px; font-weight: 700; color: var(--text); }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-hero { background: var(--brand-700); }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: #CFE6D8; }
.kpi-hero .kpi-value { color: #FFFFFF; font-size: 28px; }
#kpi_receitas { color: var(--brand-700); }
#kpi_despesas { color: var(--danger); }
#kpi_vencer { color: var(--warning); }
.kpi-bar { height: 6px; border-radius: 3px; background: #E3ECE6; overflow: hidden; }
.kpi-bar-fill { height: 6px; border-radius: 3px; background: var(--brand-700); transition: width .4s; }
#kpi_desp_bar { background: var(--danger); }

/* Painel com tabela */
.panel { background: var(--surface); border-radius: 16px; overflow: hidden; }
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
}
.table-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}
.table-total { font-weight: 700; color: var(--brand-900); }

/* Abas segmentadas (RadioItems) */
.seg-tabs { display: inline-flex !important; flex-wrap: wrap; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; }
.seg-tabs .form-check { margin: 0 !important; padding: 0 !important; }
.seg-tab {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600 !important;
    cursor: pointer;
    user-select: none;
}
.seg-tab:hover { color: var(--brand-900); }
.seg-tab.active { background: var(--surface); color: var(--brand-900); font-weight: 700 !important; box-shadow: 0 1px 2px rgba(16,40,28,.08); }
.modal .seg-tabs { background: var(--surface-2); }

/* Busca */
.search-box {
    flex: 0 1 300px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #C6D3CB;
    border-radius: 10px;
    color: var(--muted);
}
.search-box:focus-within { border-color: var(--brand-700); box-shadow: 0 0 0 3px rgba(14,110,72,.15); }
.search-input { border: none; outline: none; width: 100%; background: transparent; font-size: 14px; color: var(--text); }

/* AG Grid */
.grid-app.ag-theme-quartz {
    --ag-font-family: var(--font-body);
    --ag-font-size: 14px;
    --ag-foreground-color: var(--text);
    --ag-header-foreground-color: var(--muted);
    --ag-header-background-color: var(--surface-2);
    --ag-row-hover-color: #F3F8F4;
    --ag-border-color: #EDF1EC;
    --ag-row-border-color: #EDF1EC;
    --ag-wrapper-border-radius: 0;
    --ag-borders: none;
    --ag-active-color: var(--brand-700);
}
.grid-app .ag-header-cell-text { font-weight: 700; font-size: 12.5px; }
.grid-app .ag-root-wrapper { border: none; border-top: 1px solid #EDF1EC; }
.val-entrada { color: var(--brand-700); font-weight: 700; }
.val-saida { color: var(--danger); font-weight: 700; }
.badge-sit { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.6; }
.badge-ok { background: #DDF0D0; color: #2F5E12; }
.badge-pend { background: #FCEBC7; color: #6E4700; }
.grid-actions { display: flex; gap: 6px; align-items: center; height: 100%; }
.grid-btn {
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.grid-btn:hover { background: var(--brand-100); color: var(--brand-900); border-color: var(--brand-100); }
.grid-btn-ok { color: var(--brand-700); }
.grid-btn-danger:hover { background: #F8E3DB; color: var(--danger); border-color: #F8E3DB; }

/* Janelas (modais) */
.modal-content { border: none; border-radius: 18px; }
.modal-header, .modal-footer { border-color: var(--border); padding: 18px 24px; }
.modal-body { padding: 20px 24px; }
.modal-title { font-family: var(--font-display) !important; font-weight: 700; color: var(--brand-900); }
.modal .btn { height: 42px; padding: 0 20px; }
.btn-light { background: var(--surface-2) !important; border-color: var(--border) !important; color: var(--text) !important; }
.input-group-text { background: var(--surface-2); border-color: #C6D3CB; color: var(--muted); font-weight: 600; border-radius: 10px; }
.form-hint { display: block; color: var(--muted); margin-top: 6px; }
.form-error:not(:empty) { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: #F8E3DB; color: var(--danger); font-weight: 600; font-size: 14px; }
.confirm-item { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.modal .DateInput, .modal .SingleDatePicker, .modal .SingleDatePickerInput { width: 100%; }
.modal .DateInput_input { height: 38px !important; font-size: 15px; }

/* Aviso flutuante */
.app-toast { position: fixed; bottom: 24px; right: 24px; z-index: 2000; min-width: 280px; border: none; border-radius: 12px; box-shadow: 0 10px 30px rgba(16,40,28,.15); }

/* Ajustes */
.page-actions .form-select { width: auto; }
.modal .form-label { display: block; margin-bottom: 6px; }
.modal .seg-tabs { display: flex !important; width: fit-content; }
.brand-card img { mix-blend-mode: normal; }

/* =====================================================================
   Formulários em página (Novo serviço)
   ===================================================================== */
.service-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.service-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.service-side { position: sticky; top: 20px; }
@media (max-width: 1199px) {
    .service-grid { grid-template-columns: minmax(0, 1fr); }
    .service-side { position: static; }
}
.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head .panel-title { margin: 0; }
.panel-title { font-family: var(--font-display) !important; font-size: 18px; font-weight: 700; color: var(--brand-900); margin: 0 0 16px; }
.panel-subtitle { font-family: var(--font-display) !important; font-size: 15px; font-weight: 700; color: var(--brand-900); margin: 0 0 4px; }
.field-total {
    height: 38px; display: flex; align-items: center;
    font-weight: 700; color: var(--brand-700); font-size: 16px;
}
.btn-add.btn { height: 38px; border-color: var(--brand-700) !important; color: var(--brand-700) !important; background: transparent !important; }
.btn-add.btn:hover { background: var(--brand-100) !important; }
.grid-mini { margin-top: 4px; border: 1px solid #EDF1EC; border-radius: 12px; overflow: hidden; }
.grid-mini .ag-root-wrapper { border-top: none; }
.grid-mini .ag-overlay-no-rows-wrapper { padding: 18px 0; }
.grid-mini .ag-center-cols-viewport { min-height: 60px; }

.summary-card { display: flex; flex-direction: column; }
.summary-line { display: flex; justify-content: space-between; padding: 7px 0; color: var(--text); font-size: 14.5px; }
.summary-line span:last-child { font-weight: 600; }
.summary-muted { color: var(--muted); font-size: 13.5px; }
.summary-total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin: 10px 0 8px; padding: 14px 16px; border-radius: 12px; background: var(--brand-100);
    color: var(--brand-900); font-weight: 700;
}
.summary-total span:last-child { font-family: var(--font-display) !important; font-size: 22px; }
.summary-card hr { margin: 14px 0; border-color: var(--border); opacity: 1; }
.btn-save.btn { height: 48px; font-size: 15px; margin-top: 8px; }
.btn-clear.btn { color: var(--muted) !important; font-weight: 600; margin-top: 4px; text-decoration: none; }
.Select-menu-outer { z-index: 1050 !important; }

/* Campo de data no padrão dos demais campos */
.panel .SingleDatePicker, .panel .SingleDatePickerInput, .panel .DateInput,
.modal .SingleDatePicker, .modal .SingleDatePickerInput, .modal .DateInput { width: 100% !important; }
.panel .SingleDatePickerInput, .modal .SingleDatePickerInput { border-radius: 10px !important; border-color: #C6D3CB !important; overflow: hidden; }
.panel .SingleDatePicker .DateInput_input, .modal .SingleDatePicker .DateInput_input {
    height: 38px !important; font-size: 15px !important; padding: 0 12px; border-bottom: none;
}
.panel .DateInput_input__focused, .modal .DateInput_input__focused { border-bottom: 2px solid var(--brand-700); }
.SingleDatePicker_picker { z-index: 1060 !important; }

/* Menu lateral: cabeçalho e corpo (no celular o corpo vira menu recolhível) */
.sidebar-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-toggle { display: none; }
@media (max-width: 991px) {
    .app-sidebar { padding: 12px 16px; }
    .sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .sidebar-head .brand-card { margin: 0; padding: 8px 12px; }
    .sidebar-head .brand-card img { max-width: 120px; }
    .sidebar-toggle {
        display: inline-flex; align-items: center; gap: 8px;
        height: 44px; padding: 0 16px; border: none; border-radius: 10px;
        background: rgba(255,255,255,.12); color: #FFFFFF; font-weight: 700;
    }
    .sidebar-body { display: none; padding-top: 16px; }
    .app-sidebar.is-open .sidebar-body { display: flex; }
}

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
                margin: 8px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.success-banner {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 18px; border-radius: 14px;
    background: #E2F2E8; color: #0B4F35; border: 1px solid #BFE0CB;
}
.success-banner .fa { font-size: 22px; color: var(--brand-700); margin-top: 2px; }
.success-banner a { font-weight: 700; }
.success-banner { flex-wrap: wrap; }
.success-banner .btn .fa { font-size: inherit; margin-top: 0; color: inherit; }

/* Filtros em tabelas */
.filter-dd { flex: 0 1 280px; min-width: 200px; }
.table-toolbar .filter-dd .Select-control { height: 40px; }

/* Detalhe (modal) */
.detail-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 16px;
               padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.detail-head > div { display: flex; flex-direction: column; gap: 4px; }
.table-scroll { overflow-x: auto; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.detail-table td { padding: 9px 10px; border-bottom: 1px solid #EDF1EC; }
.detail-table th:nth-child(n+3), .detail-table td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.btn-action.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.form-check-input:checked { background-color: var(--brand-700); border-color: var(--brand-700); }
.badge-info { background: #E1ECF7; color: #1D4F7A; }

/* Dashboards */
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chart-head > div { display: flex; flex-direction: column; gap: 2px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.dash-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1199px) { .dash-grid, .dash-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters-row .filter-dd { min-width: 220px; }
.kpi-delta { font-size: 12.5px; font-weight: 700; }
.kpi-delta.up { color: var(--brand-700); }
.kpi-delta.down { color: var(--danger); }
.kpi-hero .kpi-delta.up, .kpi-hero .kpi-delta.down { color: #CFE6D8; }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #EDF1EC; }
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { display: flex; flex-direction: column; min-width: 0; }
.list-row .lr-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-sub { color: var(--muted); font-size: 12.5px; }
.list-row .lr-val { font-weight: 700; white-space: nowrap; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.list-empty { color: var(--muted); padding: 18px 0; text-align: center; }
.panel-link { font-size: 13.5px; font-weight: 700; text-decoration: none; }
.badge-late { background: #F8E3DB; color: #8A3014; }

/* Painel inicial */
.stock-tiles { display: flex; flex-direction: column; gap: 10px; }
.stock-tiles a { text-decoration: none; color: inherit; }
.stock-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px;
              background: var(--surface-2); border: 1px solid transparent; transition: border-color .15s; }
.stock-tile:hover { border-color: var(--brand-700); }
.stock-tile strong { font-family: var(--font-display) !important; font-size: 20px; color: var(--brand-900); }
.row-total { font-weight: 700; background: var(--surface-2) !important; }

/* Conta / usuários */
.profile-card { display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; background: var(--brand-700); color: #FFFFFF;
                  display: flex; align-items: center; justify-content: center; font-family: var(--font-display) !important;
                  font-size: 26px; font-weight: 700; }
.profile-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.profile-name { font-family: var(--font-display) !important; font-size: 22px; color: var(--brand-900); }
.form-feedback:not(:empty) { margin-top: 12px; font-weight: 600; font-size: 14px; }
.feedback-ok { color: var(--brand-700); }
.feedback-erro { color: var(--danger); }
.level-list { display: flex; flex-direction: column; gap: 12px; }
.level-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.auth-message-info:not(:empty) { color: var(--brand-900); font-weight: 600; }

/* Fazendas do cliente (lista dinâmica) */
.faz-lista { display: flex; flex-direction: column; gap: 8px; }
.faz-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 96px 38px; gap: 8px; align-items: center; }
@media (max-width: 575px) { .faz-row { grid-template-columns: minmax(0, 1fr) 96px 38px; } .faz-row .faz-nome { grid-column: 1 / -1; } }

/* Estoque: visão por botijão, canecas como botões */
.bot-area { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.bot-bloco { display: flex; flex-direction: column; gap: 8px; }
.bot-tabs { display: flex !important; flex-wrap: wrap; gap: 10px; }
.bot-tabs .form-check, .caneca-grid .form-check { margin: 0 !important; padding: 0 !important; }
.bot-btn { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 12px 16px; border-radius: 12px;
           border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.bot-btn strong { font-family: var(--font-display) !important; font-size: 17px; color: var(--brand-900); }
.bot-btn .bot-sub { font-size: 12.5px; color: var(--muted); }
.bot-btn:hover { border-color: var(--brand-700); }
.bot-btn.active { border-color: var(--brand-700); background: var(--brand-100); box-shadow: inset 0 0 0 1px var(--brand-700); }
.caneca-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.caneca-btn { display: block; width: 100%; cursor: pointer; }
.caneca-btn > span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 12px;
                     border-radius: 50% 50% 14px 14px / 22px 22px 14px 14px; border: 1.5px solid var(--border);
                     background: var(--surface); transition: border-color .15s, background .15s, transform .15s; }
.caneca-btn .can-nome { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.caneca-btn .can-qtd { font-family: var(--font-display) !important; font-size: 24px; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.caneca-btn .can-sub { font-size: 12px; color: var(--muted); }
.caneca-btn .can-cheia { background: linear-gradient(to top, var(--brand-100) 0 45%, var(--surface) 45%); }
.caneca-btn .can-vazia .can-qtd { color: #A9B8AF; }
.caneca-btn:hover > span { border-color: var(--brand-700); transform: translateY(-1px); }
.caneca-btn.active > span { border-color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-700), 0 6px 16px rgba(14,110,72,.18); }
.bot-btn > span { display: flex; flex-direction: column; gap: 2px; }
.nav-label-mod { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.grid-edit .cell-editavel { background: #F5F9F3; cursor: text; }
.grid-edit .cell-editavel:hover { box-shadow: inset 0 0 0 1px #9BD267; }
.alert-note { padding: 10px 14px; border-radius: 10px; background: #FCEBC7; color: #5A3B00; font-weight: 600; font-size: 14px; }
.grid-edit .cell-desconto { color: #A8401D; font-weight: 700; }
@media (min-width: 1200px) { .service-grid.service-grid-largo { grid-template-columns: minmax(0, 1fr) 290px; } }
.cell-quebra { line-height: 1.35 !important; padding-top: 8px; padding-bottom: 8px; }
.sel-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); background: #F5F8F4; }
.sel-txt { font-size: 14px; font-weight: 600; color: var(--brand-900); }
.sel-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sel-acoes .DateInput, .sel-acoes .SingleDatePicker { width: 150px; }
.nf-total { margin: 14px 0 6px; }
.sel-acoes .sel-data { width: 160px; flex: 0 0 160px; }
.filtros-linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.filtro-cliente { flex: 1 1 280px; max-width: 420px; }
.filtro-criterio { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.resultado-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 14px; margin-bottom: 20px; font-size: 14.5px; }
.resultado-banner.negativo { background: #F8E3DB; color: #6A2510; }
.resultado-banner.positivo { background: #DDF0D0; color: #234A0E; }
.resultado-banner .banner-valor { font-family: var(--font-display) !important; font-size: 22px; }
.cliente-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px; }
@media (max-width: 1199px) { .cliente-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 992px) { .kpi-grid.kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.btn-whatsapp { background: #1E9E57; border-color: #1E9E57; color: #FFFFFF !important; font-weight: 700; }
.btn-whatsapp:hover { background: #17824A; border-color: #17824A; }
.filtro-tipo { width: 220px; }
.txt-atraso { color: var(--danger); font-weight: 700; }

/* teste grátis: dias restantes / encerrado, no topo do menu lateral */
.faixa-teste { display: block; margin: 4px 0 12px; padding: 8px 10px; border-radius: 10px; background: rgba(226,190,110,.18);
  color: #F3DFA8; font-size: 13px; font-weight: 600; text-decoration: none; }
.faixa-teste:hover { color: #fff; background: rgba(226,190,110,.28); }
.faixa-teste.encerrado { background: rgba(248,227,219,.18); color: #F8E3DB; }
