@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Flexpell — Design System (Fase 2)
   Paleta teal/slate, tipografia Inter, cantos suaves.
   ============================================================ */
:root {
    /* Marca */
    --brand:        #0d9488;
    --brand-600:    #0f766e;
    --brand-700:    #115e59;
    --brand-050:    #f0fdfa;
    --brand-100:    #ccfbf1;

    /* Neutros (slate) */
    --ink:          #0f172a;
    --body:         #334155;
    --muted:        #64748b;
    --line:         #e2e8f0;
    --line-strong:  #cbd5e1;
    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --bg:           #f1f5f9;

    /* Estados */
    --success:      #16a34a;
    --danger:       #dc2626;
    --warning:      #d97706;
    --info:         #0ea5e9;

    --radius:       .625rem;
    --radius-sm:    .375rem;
    --radius-lg:    1rem;
    --shadow-sm:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.10);
    --shadow:       0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.06);
    --shadow-lg:    0 10px 25px -5px rgba(15,23,42,.12), 0 8px 10px -6px rgba(15,23,42,.08);

    /* Bootstrap overrides */
    --bs-primary:       var(--brand);
    --bs-primary-rgb:   13,148,136;
    --bs-body-color:    var(--body);
    --bs-body-bg:       var(--bg);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --bs-border-color:  var(--line);
    --bs-link-color:    var(--brand-600);
    --bs-link-hover-color: var(--brand-700);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 14.5px;
    color: var(--body);
    background: var(--bg);
    line-height: 1.55;
}

h1,h2,h3,h4,h5,h6 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; } h5 { font-size: .95rem; }

a { color: var(--brand-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-700); }

.container { max-width: 1200px; }

/* ---------- Botões ---------- */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .5rem .95rem;
    transition: all .15s ease;
    display: inline-flex; align-items: center; gap: .4rem;
}
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: var(--shadow-sm);
}
.btn-success {
    --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
    --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-warning {
    --bs-btn-bg: var(--warning); --bs-btn-border-color: var(--warning);
    --bs-btn-hover-bg: #b45309; --bs-btn-hover-border-color: #b45309;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-danger {
    --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-outline-secondary {
    --bs-btn-color: var(--muted); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: var(--line-strong);
}
.btn-light {
    --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--line); --bs-btn-color: var(--body);
}
.btn-info {
    --bs-btn-bg: var(--info); --bs-btn-border-color: var(--info);
    --bs-btn-hover-bg: #0284c7; --bs-btn-hover-border-color: #0284c7;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-secondary {
    --bs-btn-bg: #475569; --bs-btn-border-color: #475569;
    --bs-btn-hover-bg: #334155; --bs-btn-hover-border-color: #334155;
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}

/* Toolbar de busca + acoes (clientes, novo orcamento, consultar) */
.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}
.page-toolbar .input-group { max-width: 460px; }
.page-toolbar .btn-sm { min-height: 2rem; }

/* Lista em linhas — mesmo padrao em clientes e novo orcamento */
.lista-registro {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    margin-bottom: .65rem;
    box-shadow: var(--shadow-sm);
    overflow-wrap: anywhere;
}
.lista-registro:hover { background: var(--brand-050); }
.lista-registro.lista-alerta {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}
.lista-registro.lista-alerta:hover { background: #fee2e2; }
.lista-acoes {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.lista-acoes .btn {
    width: 100%;
    justify-content: center;
    min-height: 2rem;
}
/* Bloco de info do registro (checkbox de selecao + dados) — tela de Clientes */
.registro-info { display: flex; align-items: flex-start; gap: .5rem; }
.registro-info .registro-check { flex-shrink: 0; margin-top: .2rem; }
/* No celular as colunas empilham; tira o checkbox do fluxo (canto sup. direito)
   para o texto alinhar pela mesma borda esquerda do bloco de localizacao abaixo. */
@media (max-width: 767.98px) {
    .registro-info { display: block; position: relative; padding-right: 1.6rem; }
    .registro-info .registro-check { position: absolute; top: .1rem; right: 0; margin: 0; }
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card-header { background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 600; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-color: var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    padding: .5rem .75rem;
    background-color: var(--surface);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled {
    background-color: var(--surface-2);
    opacity: 1;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(13,148,136,.15);
}
.form-control::placeholder { color: #94a3b8; }
label, .form-label { color: var(--body); font-weight: 500; font-size: .85rem; }
.form-label { margin-bottom: .3rem; }
.form-floating > label { color: var(--muted); }
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }

/* Padroniza labels "soltos" dentro de formularios de modal (alinhamento consistente) */
.modal-body label:not(.form-check-label):not(.visually-hidden):not(.btn) {
    display: block;
    margin-bottom: .3rem;
    font-weight: 500;
    font-size: .82rem;
    color: var(--body);
}
/* Uniformiza o espacamento vertical entre campos empilhados nos modais */
.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea { margin-bottom: .9rem; }
/* Quando os campos estao em grid (.row > .col), o espaco vem do gap: zera a margem dupla */
.modal-body .row .form-control,
.modal-body .row .form-select,
.modal-body .row textarea { margin-bottom: 0; }
.modal-body .row [class^="col"], .modal-body .row [class*=" col"] { margin-bottom: .25rem; }

/* ---------- Visualizacao de orcamento/pedido (modal) — embeleza snapshots antigos "secos" ----------
   O seletor "> table" atinge apenas o conteudo ANTIGO (tabela direta, com bordas pretas inline);
   os orcamentos novos ficam dentro de .orc-doc e mantem o proprio estilo embutido. */
.tabela-orcamento { font-family: 'Inter', system-ui, sans-serif; }
.tabela-orcamento > table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--body); }
.tabela-orcamento > table th,
.tabela-orcamento > table td {
    border: 1px solid var(--line) !important;
    padding: 8px 11px !important;
    text-align: left !important;
    vertical-align: top;
    /* Neutraliza o striping do Bootstrap (.table-striped), que pinta a celula com
       box-shadow inset por cima do nosso background e deixava o cabecalho de colunas
       branco (texto branco em fundo branco = ilegivel). */
    box-shadow: none !important;
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
}
.tabela-orcamento > table th { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.tabela-orcamento > table tbody.itens tr:nth-child(even) > td { background: var(--surface-2); }
.tabela-orcamento > table .linha-colunas th { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; text-transform: uppercase; font-size: 11px; letter-spacing: .02em; }
.tabela-orcamento > table .dinheiro { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela-orcamento > table .total_produtos,
.tabela-orcamento > table .total_ipi,
.tabela-orcamento > table .total_icms,
.tabela-orcamento > table .total_st { font-weight: 700; color: var(--ink); }
.tabela-orcamento > table .total_geral { background: var(--brand-100) !important; color: var(--brand-700) !important; font-weight: 800 !important; font-size: 15px !important; }

/* ---------- Tabelas ---------- */
.table {
    --bs-table-bg: var(--surface);
    border-color: var(--line);
    margin-bottom: 0;
}
.table > thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line-strong);
    padding: .7rem .75rem;
    white-space: nowrap;
}
.table > tbody td { padding: .7rem .75rem; vertical-align: middle; border-color: var(--line); color: var(--ink); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: var(--surface-2); }
.table tbody tr:hover > * { background: var(--brand-050); }

/* Envolve tabelas grandes: fica com scroll horizontal no mobile em vez de estourar a pagina */
.table-responsive, .table-resposive { /* aceita tambem o typo legado */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.table-responsive > .table, .table-resposive > .table { border: 0; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; font-size: .72rem; }
.badge.bg-success { background: #dcfce7 !important; color: #166534 !important; }
.badge.bg-danger  { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-secondary { background: var(--line) !important; color: var(--body) !important; }

/* ---------- Modais ---------- */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; background: var(--surface); }
.modal-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1.1rem 1.35rem; }
.modal-title { font-weight: 700; }
.modal-body { padding: 1.35rem; }
.modal-footer { background: var(--surface-2); border-top: 1px solid var(--line); }
/* Modais longos (ex.: confirmação/visualização de orçamento): o CORPO rola por dentro,
   com cabeçalho e rodapé fixos. Fixa a altura via 100vh para não depender da cadeia de
   alturas, evitando o modal gigante que "não rola" e volta ao topo.
   Obs.: nesses modais o <form> envolve header/body/footer, então ele também precisa ser
   um flex-column para a cadeia de altura chegar até o corpo. */
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); }
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }

/* Larguras de modal mais confortaveis em todo o sistema (Bootstrap: sm=300, padrao=500, lg=800, xl=1140).
   Aplicadas so a partir de >=576px para nao afetar o layout de celular (onde o modal ja ocupa a tela). */
@media (min-width: 576px) {
    .modal-sm { --bs-modal-width: 440px; }
    .modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl) { --bs-modal-width: 620px; }
    .modal-lg { --bs-modal-width: 880px; }
    .modal-xl { --bs-modal-width: 1200px; }
}

/* Botoes de acao nas tabelas: mantem na mesma linha e com respiro (evita amontoado) */
td.text-end { white-space: nowrap; }
td.text-end .btn + .btn { margin-left: .375rem; }

/* Item "Orcamentos Site": icone branco como os demais; apenas o traco ativo em roxo */
.sidebar-link[href="leads-site"].active { box-shadow: inset 3px 0 0 #a78bfa; }

/* Diferenciacao visual entre orcamento e pedido na consulta (barra lateral colorida) */
tr.linha-pedido    > td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
tr.linha-orcamento > td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }

/* ---------- Montagem de orcamento (grade de selecao de produtos) ---------- */
.montagem-cliente { font-size: 1rem; font-weight: 600; color: var(--ink); line-height: 1.5; margin: 0; }
.montagem-cliente strong { color: var(--brand-700); }
.montagem-cabecalho {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin: 0;
    padding: .55rem 0;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
    color: var(--muted);
}
.produtos {
    margin: 0;
    border: 1px solid var(--line); border-top: 0;
    padding: .5rem 0;
    font-size: .85rem;
}
.produtos:hover { background: var(--brand-050); }
.produtos.text-success { background: var(--brand-050); }
.produtos .form-control { padding: .3rem .5rem; font-size: .85rem; min-height: auto; }
.produtos .input-group-text { padding: .3rem .5rem; font-size: .78rem; }
.produtos small { font-size: .72rem; line-height: 1.25; display: inline-block; }
.produtos .badge { font-weight: 600; }

/* Barra de busca/filtros da montagem */
.montagem-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: .55rem .7rem; margin-bottom: .75rem;
}
.montagem-toolbar .form-check-label { color: var(--body); cursor: pointer; }

/* Linha de produto: imagem + descricao alinhadas */
.produto-info {
    display: flex; align-items: center; gap: .6rem; margin: 0; cursor: pointer; width: 100%;
}
.produto-info .selecionar-produto { height: 20px; width: 20px; flex: 0 0 auto; margin: 0; }
.produto-thumb {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface-2); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.produto-thumb.produto-thumb-sm { width: 40px; height: 40px; display: inline-flex; }
.produto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.produto-thumb .thumb-fallback { color: var(--muted); font-size: 1.1rem; align-items: center; justify-content: center; width: 100%; height: 100%; }
.produto-desc { min-width: 0; line-height: 1.3; }
.produto-desc .produto-nome { font-weight: 600; color: var(--ink); font-size: .85rem; }
.produtos.text-success .produto-desc .produto-nome { color: var(--brand-700); }
/* destaque mais claro do item selecionado */
.produtos.text-success { background: var(--brand-050); box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Kanban (modo de visualização em quadro) ---------- */
#viewToggle .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.kanban-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban-col { flex: 0 0 300px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 240px); }
.kanban-col-head { padding: .55rem .8rem; font-weight: 700; font-size: .9rem; border-top: 3px solid; border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; align-items: center; background: var(--surface); }
.kanban-cards { padding: .55rem; overflow-y: auto; flex: 1; min-height: 80px; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .65rem; margin-bottom: .55rem; box-shadow: var(--shadow-sm); font-size: .82rem; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.dragging { opacity: .45; }
.kanban-cards.drop-hover { background: var(--brand-050); outline: 2px dashed var(--brand-100); outline-offset: -4px; }
.kanban-card .cod { font-weight: 700; color: var(--ink); }
.kanban-card .meta { color: var(--muted); font-size: .74rem; margin-top: .2rem; }
.kanban-card .val { font-weight: 700; color: var(--brand-700); }
.kanban-card-acoes { display: flex; gap: .3rem; margin-top: .45rem; flex-wrap: wrap; }
.kanban-card-acoes .btn { padding: .2rem .45rem; font-size: .75rem; }
.kanban-count { background: var(--line); color: var(--body); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; }

/* ---------- Alerts ---------- */
.alert { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-success { background: #f0fdf4; color: #166534; }

/* ---------- Layout com sidebar ---------- */
:root { --sidebar-w: 256px; --sidebar-collapsed-w: 76px; --topbar-h: 60px; }

body { padding-left: var(--sidebar-w); }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--brand-700), #0b3b38);
    color: #fff; display: flex; flex-direction: column; z-index: 1040;
    box-shadow: var(--shadow); transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; justify-content: center; padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
/* logo-texto.png ja e a versao recortada (so a parte escrita); aqui so escala proporcional */
.sidebar-brand .logo-full { height: 30px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand .logo-mini { display: none; height: 26px; width: auto; filter: brightness(0) invert(1); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .6rem; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; width: 0; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem; padding: .58rem .85rem; margin-bottom: 1px;
    color: rgba(255,255,255,.8); border-radius: var(--radius-sm); font-weight: 500; font-size: .9rem;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link i { font-size: 1.15rem; width: 1.4rem; text-align: center; }
.sidebar-link span { white-space: nowrap; }
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-100); }
/* Divisor entre grupos de itens da sidebar */
.sidebar-sep { border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: .5rem .85rem; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user .avatar { width: 38px; height: 38px; border-radius: 999px; background: rgba(255,255,255,.16); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-info .name { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info a { color: rgba(255,255,255,.75); font-size: .8rem; }
.sidebar-user-info a:hover { color: #fff; }
.sidebar-collapse-btn {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    background: none; border: 0; border-top: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.65); padding: .6rem .95rem; font-size: .82rem; font-weight: 500;
    cursor: pointer; transition: background .15s ease, color .15s ease;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-collapse-btn i { font-size: 1.1rem; width: 1.4rem; text-align: center; transition: transform .2s ease; }

.topbar {
    position: sticky; top: 0; height: var(--topbar-h); z-index: 1030;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
}
.topbar-title { font-size: 1.15rem; margin: 0; }
.topbar-toggle, .sidebar-toggle { background: none; border: 0; font-size: 1.5rem; color: var(--ink); padding: .25rem .4rem; line-height: 1; cursor: pointer; }
.topbar-olho { background: none; border: 0; font-size: 1.25rem; color: var(--muted); padding: .25rem .5rem; line-height: 1; cursor: pointer; border-radius: var(--radius-sm); }
.topbar-olho:hover { color: var(--brand-700); background: var(--brand-050); }
/* Modo privacidade: borra os valores monetarios */
body.valores-ocultos .valor-monetario { filter: blur(7px); user-select: none; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }

main { min-height: 60vh; padding: 1rem 0 1.5rem; }
/* Conteudo ocupa a largura util (menos borda em volta) e cola no topo */
main > .container, main > .container-fluid {
    max-width: 100%;
    margin-top: 0 !important; margin-bottom: 0 !important;
    padding-left: 1.25rem; padding-right: 1.25rem;
}

/* ---------- Sidebar recolhida (desktop) ---------- */
@media (min-width: 992px) {
    body.sidebar-collapsed { padding-left: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .sidebar-brand { padding: .85rem .3rem; }
    body.sidebar-collapsed .sidebar-brand .logo-full { display: none; }
    body.sidebar-collapsed .sidebar-brand .logo-mini { display: block; }
    body.sidebar-collapsed .sidebar-link { justify-content: center; padding: .7rem 0; }
    body.sidebar-collapsed .sidebar-link span { display: none; }
    body.sidebar-collapsed .sidebar-link i { width: auto; font-size: 1.3rem; }
    body.sidebar-collapsed .sidebar-user { justify-content: center; padding: .9rem .3rem; }
    body.sidebar-collapsed .sidebar-user-info { display: none; }
    body.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; }
    body.sidebar-collapsed .sidebar-collapse-btn span { display: none; }
    body.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
    body.sidebar-collapsed .sidebar-sep { margin: .5rem .3rem; }
}

/* ---------- Cards de KPI (dashboard) ---------- */
.kpi-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.kpi-icon { width: 52px; height: 52px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.kpi-icon.teal { background: var(--brand-050); color: var(--brand-700); }
.kpi-icon.amber { background: #fef3c7; color: #b45309; }
.kpi-icon.blue { background: #e0f2fe; color: #0369a1; }
.kpi-icon.violet { background: #ede9fe; color: #6d28d9; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-label { color: var(--muted); font-size: .82rem; font-weight: 500; }

/* Mobile: sidebar off-canvas */
@media (max-width: 991.98px) {
    body { padding-left: 0; }
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-collapse-btn { display: none; }
}

/* ---------- Paginacao ---------- */
.pagination { --bs-pagination-color: var(--muted); --bs-pagination-hover-color: var(--brand-700); }
.page-link { color: var(--muted); border-color: var(--line); border-radius: var(--radius-sm) !important; margin: 0 2px; }
.page-link:hover { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-100); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Login ---------- */
.bg-login {
    background: linear-gradient(120deg, rgba(15,94,89,.92), rgba(13,148,136,.85)), url(../img/bg.png);
    background-size: cover; background-position: center;
}
.bg-login h1 { font-size: 3rem; color: #fff; }
.bg-login .text-secondary { color: var(--brand-100) !important; }
@media (max-width: 768px) {
    .bg-login.min-vh-100 { min-height: 220px !important; background-position: top !important; }
    .bg-login h1 { font-size: 2rem; }
}

/* ---------- Preloader ---------- */
#preloader { display: none; z-index: 1000000000; backdrop-filter: blur(8px); background: rgba(15,23,42,.55); }
#preloader .loader {
    border: 5px solid rgba(255,255,255,.25); border-radius: 50%; border-top-color: var(--brand-100);
    width: 64px; height: 64px; top: calc(50% - 32px); left: calc(50% - 32px); position: absolute;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Utilitarios ---------- */
.text-muted { color: var(--muted) !important; }
.shadow-soft { box-shadow: var(--shadow) !important; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Modo de edicao do conteudo do orcamento */
.tabela-orcamento.editando {
    outline: 2px dashed var(--brand);
    outline-offset: 4px;
    background: var(--brand-050);
    border-radius: var(--radius-sm);
    padding: .5rem;
}
.tabela-orcamento.editando:focus { outline-color: var(--brand-700); }
