/* =====================================================================
   Visual novo do ERP (10/11/2026) - roxo + laranja, caixas redondas.
   Arquivo IGUAL nos ramos saas e sublima: mudou aqui, copia no outro.
   Carregado depois do <style> principal; o prefixo "html" nas regras
   ganha dos blocos <style> que vem depois no arquivo (modal da O.S.).
   ===================================================================== */
:root {
    --v-roxo: #2f2a7a;          /* menu lateral */
    --v-roxo-2: #4b42a8;        /* destaque escuro, links */
    --v-roxo-claro: #eceafb;
    --v-laranja: #f59e0b;       /* destaque */
    --v-laranja-bt: #e8830c;    /* botao (texto branco) */
    --v-laranja-hover: #d0720a;
    --v-coral: #f25f6b;
    --v-ceu: #5cc6de;
    --v-verde: #2fb67c;
    --v-fundo: #f4f3fa;
    --v-cartao: #ffffff;
    --v-texto: #1f1d3d;
    --v-texto-2: #6e6b8f;
    --v-borda: #e8e6f3;
    --v-raio: 20px;
    --v-raio-p: 12px;
    --v-sombra: 0 10px 30px rgba(47, 42, 122, 0.07);
    --v-sombra-forte: 0 18px 40px rgba(47, 42, 122, 0.14);

    /* tokens antigos apontando para a paleta nova */
    --cor-fundo: var(--v-fundo);
    --cor-sidebar: var(--v-roxo);
    --cor-texto-sidebar: #bdb8ea;
    --cor-ativo: var(--v-laranja-bt);
    --cor-texto: var(--v-texto);
    --cor-borda: var(--v-borda);
    --cor-sucesso: var(--v-verde);
    --cor-alerta: var(--v-laranja);
    --cor-erro: var(--v-coral);
    --cor-secundaria: var(--v-texto-2);
    --sombra: var(--v-sombra);
}

html body { background: var(--v-fundo); }

/* ---------- Login ---------- */
html #telaLogin { --tema: var(--v-roxo-2) !important; background-color: #1d1950; }
html .login-box { background: #fff; color: var(--v-texto); border-radius: 26px; border-top: 0; box-shadow: var(--v-sombra-forte); }
html .login-box h2 { color: var(--v-texto); }
html .login-box input { background: var(--v-fundo); border: 1px solid var(--v-borda); color: var(--v-texto); border-radius: 14px; }
html .login-box input::placeholder { color: #9a97b8; }
html .login-box button { background: var(--v-laranja-bt); border-radius: 14px; font-weight: 700; }
html #loginTitulo span { color: var(--v-laranja) !important; }

/* ---------- Menu lateral (flutuante, roxo, arredondado) ---------- */
html .sidebar { background: var(--v-roxo); }
html .logo { border-bottom: 0; color: #fff; padding: 22px 16px 10px; }
/* cartao do usuario: iniciais + nome + perfil (11/11/2026) */
html .perfil-info { background: rgba(255, 255, 255, 0.1); border-bottom: 0; color: #fff; margin: 6px 14px 4px;
    padding: 10px; border-radius: 16px; justify-content: flex-start; gap: 10px; }
html .perfil-av { width: 40px; height: 40px; border-radius: 50%; background: var(--v-laranja-bt); color: #fff; flex: none;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
html .perfil-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
html .perfil-nome { font-size: 14px; font-weight: 700; color: #fff; }
html .perfil-cargo { font-size: 12px; font-weight: 500; color: #c9c5ee; white-space: nowrap; }
/* botao de recolher: redondo, na borda direita do menu, na altura do cartao */
html .btn-recolher { position: absolute; right: -14px; top: 87px; z-index: 5; width: 28px; height: 28px; padding: 0;
    border-radius: 50%; background: #fff; color: var(--v-roxo); border: 2px solid var(--v-roxo); cursor: pointer;
    align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(47, 42, 122, 0.25); transition: transform .2s, background .15s; }
html .btn-recolher svg { display: block; }
html .btn-recolher:hover { background: var(--v-laranja-bt); border-color: var(--v-laranja-bt); color: #fff; }
@media (min-width: 769px) {
    html .sidebar { position: relative; }   /* so' no computador: no celular o menu e' fixed */
    html .btn-recolher { display: flex; }
    html .sidebar.recolhida .perfil-info { margin: 6px 10px 4px; padding: 6px 0; background: none; justify-content: center; }
    html .sidebar.recolhida .perfil-txt { display: none; }
    html .sidebar.recolhida .btn-recolher { top: 18px; }
}
/* rolagem sem barra visivel: a barra comia a ponta do item ativo, que tem que encostar no conteudo */
html .menu { padding: 22px 0 24px; scrollbar-width: none; }
html .menu::-webkit-scrollbar { width: 0; height: 0; }
html .menu li { color: #bdb8ea; border-left: 0; margin: 2px 0 2px 14px; padding: 11px 16px; border-radius: 16px 0 0 16px; position: relative; transition: background .2s, color .2s; }
html .menu li .mi-ico svg path { fill: currentColor; }   /* icones na cor do texto */
html .menu li:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-left: 0; }
html .menu li.ativo { background: var(--v-fundo); color: var(--v-roxo); font-weight: 700; border-left: 0; }
html .menu li.ativo .mi-ico svg path { fill: var(--v-laranja-bt); }
/* cantinhos curvos que "colam" o item ativo no conteudo */
html .menu li.ativo::before,
html .menu li.ativo::after { content: ''; position: absolute; right: 0; width: 20px; height: 20px; pointer-events: none; }
html .menu li.ativo::before { top: -20px; background: radial-gradient(circle at 0 0, transparent 20px, var(--v-fundo) 20.5px); }
html .menu li.ativo::after { bottom: -20px; background: radial-gradient(circle at 0 100%, transparent 20px, var(--v-fundo) 20.5px); }
html .btn-sair { border-top: 0; color: #ffb4ba; margin: 6px 14px 16px; border-radius: 14px; }
html .btn-sair .mi-ico svg path { fill: currentColor; }
html .btn-sair:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

@media (min-width: 769px) {
    html .sidebar { margin: 14px 0 14px 14px; border-radius: 28px; height: calc(100% - 28px); box-shadow: var(--v-sombra-forte); }
    html .sidebar.recolhida .menu li { margin-left: 10px; padding: 12px 0; }
    html .sidebar.recolhida .btn-sair { margin: 6px 10px 16px; }
    html .main-content { padding: 28px 32px; }
}
@media (max-width: 768px) {
    html .menu li { margin-left: 12px; }
    html #mobile-header { background: var(--v-roxo); border-radius: 0 0 20px 20px; }
    html #mobile-header .marca-mobile { color: #fff !important; }
}

/* ---------- Cabecalho e botoes ---------- */
html .header h1 { font-size: 26px; font-weight: 800; color: var(--v-texto); letter-spacing: -0.01em; }
html .btn-novo { background-color: var(--v-laranja-bt); color: #fff; border-radius: 14px; padding: 11px 22px; font-weight: 700; box-shadow: 0 8px 18px rgba(232, 131, 12, 0.28); }
html .btn-novo:hover { background-color: var(--v-laranja-hover); }
/* botoes do topo com cor propria (Mural, Modo TV, Novo Orcamento...): viram secundarios
   brancos; so' o principal (sem cor propria) fica laranja */
html .header .btn-novo[style*="background"] { background: #fff !important; color: var(--v-roxo-2) !important; border: 1px solid var(--v-borda) !important; box-shadow: 0 4px 12px rgba(47, 42, 122, 0.07) !important; }
html .header .btn-novo[style*="background"]:hover { background: var(--v-roxo-claro) !important; }
html .btn-salvar { background: var(--v-verde); border-radius: 14px; font-weight: 700; }
html .btn-salvar:hover { background: #27a06c; }
html .btn-acao-modal { border-radius: 14px; }
html .btn-acao { border-radius: 10px; background: #fff; border-color: var(--v-borda); color: var(--v-texto-2); }
html .btn-acao:hover { background: var(--v-roxo-claro); color: var(--v-roxo-2); }
html .btn-acao.ico { border-radius: 10px; }
html .btn-adicionar-item { background: var(--v-laranja-bt); border-radius: 14px; }
html .btn-adicionar-item:hover { background: var(--v-laranja-hover); }
html .calc-btn-acao { background: var(--v-roxo-2); border-radius: 12px; }
html .calc-btn-acao:hover { background: var(--v-roxo); }

/* ---------- Cartoes de numero ---------- */
html .cards { gap: 18px; }
html .card { border-left: 0; border-radius: var(--v-raio); padding: 22px 22px 20px; box-shadow: var(--v-sombra); }
html .card::before { content: ''; display: block; width: 38px; height: 7px; border-radius: 7px; margin-bottom: 14px; background: var(--v-roxo-2); }
html .card:nth-child(2)::before { background: var(--v-laranja); }
html .card:nth-child(3)::before { background: var(--v-coral); }
html .card:nth-child(4)::before { background: var(--v-ceu); }
html .card h3 { color: var(--v-texto-2); letter-spacing: .03em; font-size: 12px; }
html .card p { font-weight: 800; }
html .card-fin { border-top: 0; border-radius: 18px; box-shadow: var(--v-sombra); }

/* ---------- Caixas, tabelas, busca ---------- */
html .box { border-radius: var(--v-raio); box-shadow: var(--v-sombra); padding: 24px 26px; }
html .box h2 { font-weight: 700; }
html .search-bar { border-radius: 14px; background: var(--v-fundo); border-color: transparent; padding: 10px 16px; }
html .search-bar:focus { background: #fff; border-color: var(--v-laranja-bt); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
html th { color: #9a97b8; letter-spacing: .03em; border-bottom-color: var(--v-borda); }
html td { color: #4a4766; border-bottom-color: #f0eef8; }
html tr:hover td { background-color: #f8f7fd; }
html .aba-lista .box > table thead th { background: #fff; box-shadow: inset 0 -1px 0 var(--v-borda); }
html .select-status { border-radius: 10px; }
html .mensagem-vazia { color: #9a97b8; }

/* ---------- Kanban ---------- */
html .k-col { background: #ecebf6; border: 0; border-radius: var(--v-raio); }
html .k-col-header { border-radius: 16px; margin: 8px 8px 0; border-bottom: 0; border-left: 5px solid; background: #fff !important; box-shadow: 0 2px 8px rgba(47, 42, 122, 0.06); }
html .k-items { padding: 10px 8px; }
html .k-card { border-radius: 16px; border: 0; box-shadow: 0 3px 10px rgba(47, 42, 122, 0.08); }
html .k-card:hover { box-shadow: 0 10px 22px rgba(47, 42, 122, 0.13); }
html .k-card h4 { color: var(--v-roxo-2); }
html .k-card .desc { background: var(--v-fundo); border-radius: 10px; }
html .btn-kanban-mais { border-radius: 12px; background: #fff; border-color: #cfcbe8; color: var(--v-roxo-2); }

/* ---------- Modais e formularios ---------- */
html .modal { background-color: rgba(31, 29, 61, 0.55); }
html .modal-content { border-radius: 24px; box-shadow: var(--v-sombra-forte); }
html .modal-header { border-bottom-color: var(--v-borda); }
html .modal-header h2 { font-weight: 800; color: var(--v-texto); }
html .form-group label { color: var(--v-texto-2); }
html .form-group input, html .form-group select, html .form-group textarea { border-radius: 12px; border-color: var(--v-borda); background-color: #fff; }
html .form-group input:focus, html .form-group select:focus, html .form-group textarea:focus,
html .input-inline-tabela:focus { border-color: var(--v-laranja-bt); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); outline: none; }
html .ts-control { border-radius: 12px; }
html .calculadora-box { background: var(--v-fundo); border-color: var(--v-borda); border-radius: 18px; }
html .financeiro-box { background: #fff7ea; border-color: #fbd9a6; border-radius: 16px; }
html .grid-permissoes { background: var(--v-fundo); border-color: var(--v-borda); border-radius: 16px; }
html .grid-permissoes input[type="checkbox"] { accent-color: var(--v-laranja-bt); }
html .tabela-itens-os th { background: var(--v-fundo); }
html .total-display { color: var(--v-laranja-bt); }
html .chart-container { border-radius: var(--v-raio); }

/* modal da O.S. (bloco os2css) */
html #modalNovaOs .calculadora-box { background: var(--v-fundo); border-color: var(--v-borda); border-radius: 18px; }
html #modalNovaOs .os-seg { background: #e6e4f3; border-radius: 14px; }
html #modalNovaOs .os-seg button { border-radius: 11px; color: var(--v-texto-2); }
html #modalNovaOs .os-seg button.on { color: var(--v-roxo); }
html #modalNovaOs .os-sec-t svg { color: var(--v-laranja-bt); }
html #modalNovaOs .form-group input, html #modalNovaOs .form-group select, html #modalNovaOs .form-group textarea { border-color: #dcd9ee; border-radius: 10px; }
html #modalNovaOs .ts-control { border-radius: 10px; }
html #modalNovaOs .calc-btn-acao { background: var(--v-roxo-2); border-radius: 12px; }
html #modalNovaOs .calc-btn-acao:hover { background: var(--v-roxo); }
html #modalNovaOs .btn-adicionar-item { background: var(--v-laranja-bt); border-radius: 12px; }
html #modalNovaOs .btn-adicionar-item:hover { background: var(--v-laranja-hover); }
html #modalNovaOs .tabela-itens-os th { background: var(--v-fundo); color: var(--v-texto-2); }
html #modalNovaOs .os-fin-head .os-fin-t { color: var(--v-roxo-2); }
html #modalNovaOs .os-check input { accent-color: var(--v-laranja-bt); }
@media (max-width: 768px) {
    html #modalNovaOs .modal-content.xl { border-radius: 0; }
    /* iPhone (11/11/2026): 100vh e' maior que a area visivel do Safari (conta por baixo das barras) e o
       modal centralizado jogava o topo — titulo e o X de fechar — para fora da tela. 100dvh = so' a
       parte visivel; o modal encosta no topo em vez de centralizar. */
    html #modalNovaOs { align-items: flex-start; }
    html #modalNovaOs .modal-content.xl { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; }
    html #modalNovaOs .modal-header { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
    html #modalNovaOs .close { width: 40px; height: 40px; font-size: 24px; }
    html #modalNovaOs .os-cliente-band { padding-top: 18px; }
}

/* ---------- Inicio (boas-vindas) ---------- */
.bv-topo { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; margin-bottom: 18px; }
.bv-ola { background: var(--v-laranja-bt); color: #fff; border-radius: 24px; padding: 26px 30px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; box-shadow: 0 14px 30px rgba(232, 131, 12, 0.25); }
.bv-ola h1 { font-size: 30px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.bv-ola p { font-size: 15px; margin: 0; opacity: .95; }
.bv-atalhos { display: flex; gap: 8px; flex-wrap: wrap; }
.bv-at { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 12px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.bv-at:hover { background: #fff; color: var(--v-laranja-hover); }
.bv-relogio { background: #fff; border-radius: 24px; box-shadow: var(--v-sombra); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; }
.bv-hora { font-size: 46px; font-weight: 800; color: var(--v-roxo); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.bv-dia { font-size: 13px; color: var(--v-texto-2); margin-top: 8px; font-weight: 600; }
.bv-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.bv-num { background: #fff; border: 0; border-radius: 20px; box-shadow: var(--v-sombra); padding: 18px 20px; text-align: left; cursor: pointer; font: inherit; transition: transform .15s, box-shadow .15s; }
.bv-num:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(47, 42, 122, 0.12); }
.bv-num i { display: block; width: 34px; height: 7px; border-radius: 7px; margin-bottom: 12px; }
.bv-num b { display: block; font-size: 30px; font-weight: 800; color: var(--v-texto); line-height: 1.1; }
.bv-num b.bv-vermelho { color: #d9434f; }
.bv-num span { font-size: 13px; color: var(--v-texto-2); font-weight: 600; }
.bv-dupla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.bv-dupla .box h2 { font-size: 17px; margin: 0 0 12px; }
.bv-cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bv-cal-top h2 { margin: 0 !important; }
.bv-seta { border: 0; background: var(--v-fundo); color: var(--v-roxo-2); width: 34px; height: 34px; border-radius: 12px; font-size: 20px; cursor: pointer; }
.bv-seta:hover { background: var(--v-roxo-claro); }
.bv-cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.bv-sem { font-size: 11px; font-weight: 700; color: #9a97b8; padding: 4px 0; }
.bv-d { position: relative; border: 0; background: none; font: inherit; font-size: 14px; color: var(--v-texto); height: 40px; border-radius: 12px; cursor: pointer; }
.bv-d:hover { background: var(--v-fundo); }
.bv-d i { position: absolute; left: 50%; bottom: 5px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--v-laranja); }
.bv-d.atras i { background: #f25f6b; }
.bv-d.hoje { background: var(--v-laranja-bt); color: #fff; font-weight: 800; }
.bv-d.hoje i { background: #fff; }
.bv-d.sel { box-shadow: inset 0 0 0 2px var(--v-roxo-2); }
.bv-legenda { font-size: 12px; color: #9a97b8; margin: 10px 0 0; }
.bv-lista { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.bv-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--v-fundo); cursor: pointer; transition: background .15s; }
.bv-item:hover { background: var(--v-roxo-claro); }
.bv-item b { color: var(--v-roxo-2); font-size: 13px; min-width: 52px; }
.bv-cli { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--v-texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-cli small { display: block; font-size: 12px; font-weight: 500; color: var(--v-texto-2); overflow: hidden; text-overflow: ellipsis; }
.bv-quando { font-size: 12px; font-weight: 700; color: var(--v-texto-2); white-space: nowrap; }
.bv-vazio { color: #9a97b8; font-size: 13px; padding: 10px 2px; }
.bv-aviso { background: #fff7ea; border-radius: 14px; padding: 11px 14px; font-size: 14px; color: #7a4a06; }
.bv-aviso.bv-alerta { background: #fdecee; color: #a3262f; }
.bv-click { cursor: pointer; }
.bv-click:hover { filter: brightness(0.97); }
@media (max-width: 1100px) { .bv-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .bv-topo, .bv-dupla { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
    .bv-ola { padding: 20px; border-radius: 20px; }
    .bv-ola h1 { font-size: 24px; }
    .bv-hora { font-size: 36px; }
    .bv-nums { gap: 10px; }
    .bv-num { padding: 14px; }
    .bv-num b { font-size: 24px; }
    .bv-dupla { gap: 0; }
}

/* ---------- Letreiro da TV ---------- */
html .ticker-wrap { background-color: var(--v-roxo); border-top-color: var(--v-laranja); }
html .ticker-text b, html .ticker-text-fixo b { color: var(--v-laranja); }
