/* ============================================================
   style.css
   CSS base da aplicação — ajusta à tua medida
   ============================================================ */

/* --- Reset e base ------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f4f7;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Topbar ------------------------------------------------- */
.topbar {
    background: #263238;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.topbar-logo {
    height: 48px;
    width: auto;
    display: block;
    border-radius: 4px;
}

.topbar-appname {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.topbar-loja {
    font-size: 1.13rem;
    opacity: 0.65;
    cursor: pointer;
    transition: opacity 0.15s;
}

.topbar-loja:hover {
    opacity: 1;
}

/* Título centrado na topbar (oculto por defeito) */
.topbar {
    position: relative;
}

.topbar-titulo {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
}

/* Activar título na topbar e suprimir page-header para páginas específicas */
body:has(.tl-page)    .topbar-titulo { display: block; }
body:has(.tl-page)    .page-header   { display: none; }
body:has(.mapa-wrap)  .topbar-titulo { display: block; }
body:has(.mapa-wrap)  .page-header   { display: none; }
body:has(.mt-wrap)    .topbar-titulo { display: block; }
body:has(.mt-wrap)    .page-header   { display: none; }
body:has(.lc-wrap)    .topbar-titulo { display: block; }
body:has(.lc-wrap)    .page-header   { display: none; }
body:has(.mapa-wrap)  .mapa-titulo   { display: none; }

.mapa-nav-mes {
    font-size: 1.05rem;
    font-weight: 700;
    color: #263238;
    text-transform: capitalize;
    white-space: nowrap;
}
body:has(.lp-wrap)    .topbar-titulo { display: block; }
body:has(.lp-wrap)    .page-header   { display: none; }
body:has(.lp-wrap)    .lp-titulo     { display: none; }
body:has(.dashboard)  .page-header   { display: none; }
body:has(.dashboard)  .topbar-titulo { display: block; }
body:has(.cfg-wrap)    .topbar-titulo { display: block; }
body:has(.cfg-wrap)    .page-header   { display: none; }
body:has(.clp-wrap)    .topbar-titulo { display: block; }
body:has(.clp-wrap)    .page-header   { display: none; }
body:has(.cprod-wrap)  .topbar-titulo { display: block; }
body:has(.cprod-wrap)  .page-header   { display: none; }
body:has(.cfat-wrap)   .topbar-titulo { display: block; }
body:has(.cfat-wrap)   .page-header   { display: none; }
body:has(.mol-wrap)    .topbar-titulo { display: block; }
body:has(.mol-wrap)    .page-header   { display: none; }
body:has(.cli-wrap)    .topbar-titulo { display: block; }
body:has(.cli-wrap)    .page-header   { display: none; }
body:has(.com-wrap)    .topbar-titulo { display: block; }
body:has(.la-wrap)     .topbar-titulo { display: block; }
body:has(.la-wrap)     .page-header   { display: none; }
body:has(.com-wrap)    .page-header   { display: none; }

/* --- Conteúdo principal ------------------------------------ */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #263238;
}

/* --- Rodapé ------------------------------------------------ */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 0.8rem;
    color: #aaa;
    border-top: 1px solid #e0e0e0;
}

/* --- Login ------------------------------------------------- */
.login-body {
    background: #263238;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 20vh;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 24px 16px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
    color: #fff;
}

.login-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-brand h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.login-brand p {
    font-size: 0.85rem;
    opacity: 0.55;
    margin-top: 4px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-erro {
    background: #fdecea;
    color: #b71c1c;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.login-aviso {
    background: #fff8e1;
    color: #e65100;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* --- Campos de formulário ---------------------------------- */
.campo {
    margin-bottom: 16px;
}

.campo label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin-bottom: 6px;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #222;
    background: #fafafa;
    transition: border-color 0.15s;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    outline: none;
    border-color: #263238;
    background: #fff;
}

/* --- Botões ------------------------------------------------ */
.btn-primary {
    background: #263238;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #2d2d4e;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* --- Dashboard --------------------------------------------- */
.dashboard-boas-vindas {
    font-size: 1rem;
    color: #444;
    margin-bottom: 28px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-boas-vindas strong {
    color: #263238;
    font-size: 1.1rem;
}

.dash-data {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
    text-transform: capitalize;
}

/* ── KPIs ── */
.dash-kpis {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dash-kpi {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dash-kpi-valor {
    font-size: 1.4rem;
    font-weight: 700;
    color: #263238;
    line-height: 1.2;
}

.dash-kpi-label {
    font-size: 0.72rem;
    color: #777;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-kpi--alerta .dash-kpi-valor { color: #c62828; }
.dash-kpi--alerta { border-color: #ffcdd2; background: #fff8f8; }

/* ── Barra de progresso ── */
.dash-progresso-wrap {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dash-progresso-topo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.dash-progresso-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.dash-progresso-pct {
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
}

.dash-progresso-fundo {
    height: 18px;
    background: #eee;
    border-radius: 9px;
    overflow: hidden;
}

.dash-progresso-barra {
    height: 100%;
    border-radius: 9px;
    transition: width 0.4s ease, background 0.4s ease;
    min-width: 4px;
}

.dash-progresso-rodape {
    font-size: 0.78rem;
    color: #888;
    margin-top: 6px;
    text-align: right;
}

/* ── Entregas do dia ── */
.dash-entregas-wrap {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dash-entregas-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dash-entregas-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dash-entregas-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 0;
    text-transform: none;
}

.dash-entregas-toggle {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    background: #f4f4f7;
    border: 1px solid #dde;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.dash-entregas-toggle:hover { background: #e8e8f0; }

.dash-entregas-lista { margin-top: 10px; }

.dash-entregas-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-entregas-legenda {
    font-size: 0.72rem;
    font-weight: 400;
    color: #aaa;
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.dash-entrega-btn {
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 400;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.15s;
}

.dash-entrega-btn--hoje {
    border-color: #81c784;
    background: #f1f8f1;
    color: #388e3c;
}
.dash-entrega-btn--hoje:hover { background: #dcedc8; }

.dash-entrega-btn--atraso {
    border-color: #ffb74d;
    background: #fffaf4;
    color: #e65100;
}
.dash-entrega-btn--atraso:hover { background: #ffe0b2; }

/* Contexto do talão no popup de confirmação de entrega */
.entr-ctx {
    background: #f8f8fc;
    border: 1px solid #dde;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.entr-ctx-loading { color: #aaa; text-align: center; }

.entr-ctx-num {
    font-size: 0.75rem;
    color: #888;
    font-family: monospace;
    margin-bottom: 2px;
}

.entr-ctx-nome {
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
    margin-bottom: 6px;
}

.entr-ctx-linha {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #555;
    font-size: 0.83rem;
    flex-wrap: wrap;
}

.entr-ctx-falta {
    margin-top: 8px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e65100;
    font-weight: 700;
    font-size: 0.85rem;
}

.dash-entrega-btn--manual {
    border-color: #ccd;
    background: #f4f4f7;
    color: #666;
    font-family: inherit;
    font-style: italic;
}
.dash-entrega-btn--manual:hover { background: #e8e8f0; color: #333; }

.dashboard-data {
    font-size: 0.85rem;
    color: #888;
}

.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.menu-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #ececec;
    transition: box-shadow 0.15s, transform 0.15s;
    cursor: pointer;
}

.menu-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.menu-card-icone {
    font-size: 2rem;
    margin-bottom: 12px;
    filter: saturate(0.2);
}

.menu-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #263238;
}

.menu-card--sair {
    border-color: #c8c8d4;
    background: #e8e8f0;
}

.menu-card--sair .menu-card-label {
    color: #3a3a5c;
}

/* --- Botão voltar ------------------------------------------ */
.btn-voltar {
    font-size: 0.9rem;
    color: #263238;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.btn-voltar:hover {
    opacity: 1;
}

/* --- PIN overlay ------------------------------------------- */
.pin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.pin-overlay--visivel {
    display: flex;
}

.pin-modal {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    text-align: center;
}

.pin-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #263238;
    margin-bottom: 6px;
}

.pin-subtitulo {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
}

.pin-erro {
    background: #fdecea;
    color: #b71c1c;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.pin-display {
    font-size: 1.8rem;
    letter-spacing: 0.3em;
    color: #263238;
    background: #f4f4f7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.pin-tecla {
    background: #f4f4f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #263238;
    cursor: pointer;
    transition: background 0.12s;
}

.pin-tecla:hover {
    background: #e8e8f0;
}

.pin-tecla:active {
    background: #d0d0e0;
}

.pin-tecla--vazia {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

/* --- Toolbar de página ------------------------------------- */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Botões secundários ------------------------------------ */
.btn-secondary {
    background: #fff;
    color: #263238;
    border: 1px solid #ddd;
    border-radius: 7px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.12s;
}

.btn-secondary:hover {
    background: #f0f0f5;
}

.btn-perigo {
    background: #b71c1c;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-perigo:hover {
    background: #c62828;
}

.btn-orcamento {
    background: #9e9e9e;
    color: #212121;
    border: none;
    border-radius: 7px;
    padding: 8px 14px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-orcamento:hover { background: #757575; }

/* Gestão de Orçamentos */
.orc-pesquisa {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}
.cfg-wrap.orc-wrap { max-width: 1280px; }
.orc-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.orc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
}
.orc-card-info { flex: 1; }
.orc-card-cliente {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: .95rem;
}
.orc-card-tlm { color: #666; font-size: .88rem; }
.orc-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .82rem;
    color: #888;
}
.orc-card-total { color: #263238; font-size: .95rem; }
.orc-card-acoes { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Alertas ----------------------------------------------- */
.alerta {
    padding: 12px 16px;
    border-radius: 7px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.alerta-ok {
    background: #e8f5e9;
    color: #1b5e20;
}

.alerta-erro {
    background: #fdecea;
    color: #b71c1c;
}

.alerta-aviso {
    background: #fff8e1;
    color: #e65100;
    font-size: 0.85rem;
}

/* --- Tabelas ----------------------------------------------- */
.tabela-wrap {
    overflow-x: auto;
    margin-bottom: 32px;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.tabela thead {
    background: #263238;
    color: #fff;
}

.tabela th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tabela td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.tabela tbody tr:last-child td {
    border-bottom: none;
}

.tabela tbody tr:hover td {
    background: #f8f8fc;
}

.col-preco {
    text-align: right;
    white-space: nowrap;
}

.col-acoes {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.tabela-vazia {
    text-align: center;
    color: #aaa;
    padding: 28px !important;
}

.btn-tabela {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #333;
    margin-left: 4px;
    transition: background 0.12s;
}

.btn-tabela:hover {
    background: #f0f0f5;
}

.btn-tabela--perigo {
    border-color: #e57373;
    color: #b71c1c;
}

.btn-tabela--perigo:hover {
    background: #fdecea;
}

.secao-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: #263238;
    margin-bottom: 12px;
}

/* --- Modais ------------------------------------------------ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal--visivel {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #263238;
}

.modal-fechar {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-fechar:hover {
    color: #333;
}

code {
    background: #f4f4f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* --- Preçário ---------------------------------------------- */
.secao-bloco {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.secao-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.precario-filtro-acoes {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.precario-filtro-select {
    border: 1px solid #ddd;
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #222;
    background: #fafafa;
    cursor: pointer;
    min-height: 48px;
}

.btn-criar-servico {
    background: #3d6b5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-criar-servico:hover {
    background: #2f5347;
}

/* --- Botões de modal --------------------------------------- */
.modal-botoes {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.btn-cancelar {
    background: #f4f4f7;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 7px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}

.btn-cancelar:hover {
    background: #e8e8f0;
}

/* --- Botões touch-friendly --------------------------------- */
/* Tamanho base para ecrãs touch — mínimo 48px de altura     */

.btn-touch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn-touch:active {
    opacity: 0.8;
}

/* Verde — ação principal */
.btn-primario {
    background: #3d6b5c;
    color: #fff;
}
.btn-primario:hover {
    background: #2f5347;
}

/* Branco com borda — ação secundária */
.btn-secundario {
    background: #fff;
    color: #263238;
    border: 1.5px solid #ccc;
}
.btn-secundario:hover {
    background: #f0f0f5;
}

/* Vermelho — ação destrutiva */
.btn-perigo-touch {
    background: #b71c1c;
    color: #fff;
}
.btn-perigo-touch:hover {
    background: #c62828;
}

/* Versão menor para linhas de tabela — mantém altura touch */
.btn-sm {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ============================================================
   Novo Talão — Página 2
   ============================================================ */

.s2-wrap {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1.2vh, 16px);
    padding-bottom: clamp(8px, 2vh, 32px);
}

body:has(.s2-wrap) .page-header {
    display: none;
}

body:has(.s2-wrap) .topbar {
    display: none;
}

body:has(.s2-wrap) .main-content {
    padding: 8px 16px;
}

.s2-secao {
    background: #fff;
    border-radius: 12px;
    padding: clamp(8px, 1.5vh, 16px) 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.s2-secao-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 14px;
}

/* Secção 1 — Resumo */
.s2-resumo-linha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.s2-resumo-bloco {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #f4f4f7;
    border-radius: 8px;
    padding: 7px 12px;
    min-width: 90px;
}

.s2-resumo-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
}

.s2-resumo-valor {
    font-size: 0.95rem;
    font-weight: 700;
    color: #263238;
}

.s2-resumo-sep {
    width: 1px;
    height: 36px;
    background: #ddd;
    margin: 0 4px;
}

.s2-distribuir-bloco {
    background: #fff;
    border: 2px solid #263238;
    border-radius: 10px;
    padding: 6px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.s2-distribuir-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.s2-distribuir-valor {
    font-size: 1.45rem;
    font-weight: 800;
    color: #263238;
    display: block;
    line-height: 1.2;
}

.s2-distribuir-bloco.s2-distribuir--zero {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.s2-distribuir-bloco.s2-distribuir--zero .s2-distribuir-valor { color: #2e7d32; }
.s2-distribuir-bloco.s2-distribuir--zero .s2-distribuir-label { color: #558b2f; }
.s2-valor-final      { color: #263238; }

/* Secção 2 — Entrega (linha única) */
.s2-entrega-linha {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.s2-entrega-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    white-space: nowrap;
}

.s2-data-entrega {
    font-size: 1.1rem;
    font-weight: 700;
    color: #263238;
    min-width: 100px;
    text-align: center;
}

.s2-periodos {
    display: flex;
    gap: 14px;
    margin-left: 8px;
    flex-wrap: wrap;
}

.s2-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.s2-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3d6b5c;
    cursor: pointer;
}

/* Secção 3 — Tiles */
.s2-tiles-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.s2-tiles-grid {
    overflow-x: auto;
}

.s2-tiles-header {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.s2-tile-header-data {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: #263238;
    color: #fff;
    padding: 6px 4px;
    border-radius: 6px;
    min-width: 90px;
}

.s2-tile-header-fds {
    background: #b0bec5;
    color: #37474f;
}

.s2-tiles-mes-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    align-self: center;
    white-space: nowrap;
}

.s2-tiles-mes {
    font-size: 1.2rem;
    font-weight: 700;
    color: #263238;
    white-space: nowrap;
    align-self: center;
}

.s2-tile-row {
    display: flex;
    gap: 6px;
    margin-bottom: clamp(2px, 0.5vh, 6px);
}

.s2-tile {
    flex: 1;
    background: #f4f4f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: clamp(2px, 0.5vh, 6px) 8px;
    cursor: pointer;
    transition: background 0.12s;
    min-width: 90px;
    text-align: center;
    user-select: none;
}

.s2-tile:hover { background: #e8e8f0; }

.s2-tile--expresso {
    background: #fff3e0;
    border-color: #ffcc80;
}

.s2-tile--expresso:hover { background: #ffe0b2; }

.s2-tile-oper {
    font-size: 0.9rem;
    font-weight: 700;
    color: #263238;
}

.s2-tile--expresso .s2-tile-oper { color: #7f3f00; }

/* Tile valores (Reg / Falta) */
.s2-tile-valores {
    margin-top: 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.s2-tile-val-linha {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
}

.s2-tile-vlabel {
    font-size: 0.68rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.s2-tile-reg,
.s2-tile-falta {
    font-size: 0.82rem;
    font-weight: 700;
    color: #333;
}

/* Cores de estado dos tiles */
.s2-tile--verde  { background: #e8f5e9; border-color: #a5d6a7; }
.s2-tile--verde:hover  { background: #c8e6c9; }
.s2-tile--amarelo { background: #fffde7; border-color: #ffe082; }
.s2-tile--amarelo:hover { background: #fff9c4; }
.s2-tile--folga  { background: #ffb74d; border-color: #fb8c00; cursor: default; }
.s2-tile--folga .s2-tile-oper { color: #4a2000; }
.s2-tile--folga .s2-tile-vlabel { color: #7f4000; }
.s2-tile--folga .s2-tile-falta { color: #4a2000; }
.s2-tile--cheio  { background: #fce4ec; border-color: #f48fb1; }
.s2-tile--cheio:hover  { background: #f8bbd0; }
.s2-tile--alocado { box-shadow: 0 0 0 3px #1565c0; border-color: #1565c0 !important; }

/* Popup distribuição */
.distrib-modal {
    max-width: 420px;
    width: 92vw;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
}

.distrib-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
    text-align: center;
    line-height: 1.4;
}

.distrib-subtitulo {
    font-size: 0.88rem;
    color: #555;
    text-align: center;
}

.distrib-botoes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.distrib-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
    padding: 14px 10px;
}

.btn-distrib-tudo {
    background: #fce4ec;
    color: #880e4f;
    border: 1.5px solid #f48fb1;
}

/* Secção 4 — Botões */
.s2-secao-botoes {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.s2-secao-botoes .btn-touch {
    min-height: 34px;
    padding: 6px 20px;
    font-size: 0.88rem;
}

.btn-s2-cancelar {
    background: #fce4ec;
    color: #880e4f;
    border: 1px solid #f8bbd0;
}

.btn-s2-cancelar:hover { background: #f8bbd0; }

.btn-s2-automatico {
    background: #ffd600;
    color: #4a3800;
    border: 1.5px solid #b8a000;
}

.btn-s2-automatico:hover { background: #ffc800; }

/* --- Operadores -------------------------------------------- */
.linha-inativa td {
    opacity: 0.5;
}

.estado-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.estado-ativo {
    background: #e8f5e9;
    color: #1b5e20;
}

.estado-inativo {
    background: #f4f4f7;
    color: #999;
}

/* --- Campos de formulário extra ---------------------------- */
.campo-ajuda {
    display: block;
    font-size: 0.78rem;
    color: #999;
    margin-top: 4px;
}

.campo-check {
    margin-top: 8px;
}

.campo-secao-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 8px;
    display: block;
}

.campo-checks-grupo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: #f8f8fc;
    border: 1px solid #e0e0ee;
    border-radius: 8px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.check-label input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: #3d6b5c;
    flex-shrink: 0;
}

/* --- Máximos Alternativos ---------------------------------- */
.maxalt-linha {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.maxalt-campo {
    flex: 1;
    min-width: 140px;
}

.maxalt-campo label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin-bottom: 6px;
}

.maxalt-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fafafa;
    overflow: hidden;
}

.maxalt-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #222;
    min-width: 0;
}

.maxalt-input-wrap input:focus {
    outline: none;
}

.maxalt-input-wrap:focus-within {
    border-color: #263238;
    background: #fff;
}

.maxalt-euro {
    padding: 0 12px;
    color: #888;
    font-size: 0.95rem;
    font-weight: 600;
}

.maxalt-botao {
    display: flex;
    justify-content: flex-end;
}

/* --- Mapa de Folgas ---------------------------------------- */
.mapa-wrap {
    padding-bottom: 32px;
}

.mapa-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.mapa-titulo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #263238;
    margin: 0;
    text-align: center;
    flex: 1;
}

.mapa-legenda {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.leg-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.leg-normal { background: #d4edda; color: #155724; }
.leg-folga  { background: #ffe0b2; color: #7f3f00; }
.leg-alt    { background: #fff9c4; color: #7f6000; }
.leg-fds    { background: #e0e0e0; color: #555; }

.mapa-tabela-wrap {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.mapa-tabela {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    font-size: 0.85rem;
}

.mapa-tabela thead th {
    background: #263238;
    color: #fff;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

.mapa-tabela thead th:first-child,
.mapa-tabela thead th:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #263238;
}

.col-dia-header { width: 40px; }

.mapa-tabela td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    white-space: nowrap;
}

.col-dia {
    font-weight: 700;
    color: #263238;
    background: #f8f8fc;
    position: sticky;
    left: 0;
    z-index: 1;
}

.col-sem {
    color: #888;
    font-size: 0.78rem;
    background: #f8f8fc;
    position: sticky;
    left: 40px;
    z-index: 1;
}

/* Estados das células */
.celula {
    cursor: pointer;
    min-width: 80px;
    height: 36px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: filter 0.1s;
    user-select: none;
}

.celula:hover {
    filter: brightness(0.92);
}

.celula:active {
    filter: brightness(0.82);
}

.celula-normal {
    background: #d4edda;
    color: #155724;
}

.celula-folga {
    background: #ffe0b2;
    color: #7f3f00;
}

.celula-alt {
    background: #fff9c4;
    color: #7f6000;
}

/* Fim de semana */
.linha-fds .col-dia,
.linha-fds .col-sem {
    background: #ececec;
    color: #888;
}

.celula-fds.celula-normal {
    background: #e0e0e0;
    color: #888;
}

.celula-fds.celula-folga {
    background: #ffcc80;
    color: #7f3f00;
}

.celula-manual {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 600;
}

.celula-fds.celula-manual {
    background: #c8e6c9;
    color: #1b5e20;
}

.celula-fds.celula-alt {
    background: #fff176;
    color: #7f6000;
}

/* ============================================================
   Novo Talão — layout 3 colunas
   ============================================================ */

/* A página do talão não deve fazer scroll global.
   Sobrepõe o main-content para ocupar altura disponível. */
body:has(.talao-layout) {
    overflow: hidden; /* impede scroll na página inteira */
    height: 100vh;
}

body:has(.talao-layout) .footer {
    display: none; /* rodapé ocultado na página de talão */
}

body:has(.talao-layout) .main-content {
    padding: 0;
    max-width: 100%;
    height: calc(100vh - 56px); /* 56px = topbar */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body:has(.talao-layout) .page-header {
    display: none; /* esconde o h1 padrão do layout */
}

.talao-layout {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    gap: 0;
}

/* --- Coluna base ------------------------------------------ */
.talao-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
}

.talao-col:last-child {
    border-right: none;
}

.talao-col-header {
    background: #263238;
    color: #fff;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* --- Coluna 1: Categorias (estreita ~15%) ----------------- */
.talao-col-cat {
    width: 15%;
    min-width: 120px;
    background: #f8f8fc;
}

.cat-lista {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    flex: 1;
}

.cat-item {
    padding: 14px 14px;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    color: #333;
    user-select: none;
    transition: background 0.15s;
}

.cat-item:hover {
    background: #ededf5;
}

.cat-item--spacer {
    pointer-events: none;
    background: #f8f8fc;
    border-bottom: none;
}

.cat-item--minicial {
    background: #d0d0dc !important;
    color: #333 !important;
    font-weight: 600;
    border-bottom: none;
}
.cat-item--minicial:hover {
    background: #b8b8c8 !important;
}


.cat-vazia {
    color: #aaa;
    font-style: italic;
}


/* --- Coluna 2: Serviços (larga ~55%, só esta faz scroll) -- */
.talao-col-servicos {
    flex: 1;
    background: #fff;
}

.servico-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;  /* ÚNICO scroll da página */
    flex: 1;
    min-height: 0; /* necessário para o scroll funcionar dentro de flex */
}

.servico-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
    min-height: 56px;
}

.servico-item:hover {
    background: #f0f7f4;
}

.servico-item:active {
    background: #d4edda;
}

.servico-item--flash {
    background: #b8dfc8 !important;
    transition: none;
}

.servico-descr {
    flex: 1;
    font-size: 1.05rem;
    color: #222;
}

.servico-preco {
    font-size: 1.05rem;
    font-weight: 700;
    color: #3d6b5c;
    margin-left: 12px;
    white-space: nowrap;
}

.servico-vazio {
    padding: 24px 16px;
    color: #aaa;
    font-style: italic;
    font-size: 0.88rem;
}

/* --- Coluna 3: Detalhe do talão (~30%) -------------------- */
.talao-col-detalhe {
    width: 30%;
    min-width: 220px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.talao-detalhe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #263238;
    flex-shrink: 0;
    gap: 8px;
}

.talao-numero {
    color: #fff;
    font-size: 0.9rem;
}

.talao-numero strong {
    font-size: 1rem;
}

/* Lista de itens adicionados — ~1/3 da altura disponível */
.talao-itens-lista {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 0 0 clamp(120px, 28vh, 33vh);
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
}

.talao-itens-vazio {
    padding: 16px 12px;
    color: #bbb;
    font-size: 0.8rem;
    font-style: italic;
}

.talao-item-linha {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.talao-item-clicavel {
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.talao-item-clicavel:hover {
    background: #f0f7f4;
}

.talao-item-clicavel:active {
    background: #d4edda;
}

.talao-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.talao-item-descr {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    flex: 1;
}

.talao-item-preco {
    font-size: 0.92rem;
    font-weight: 700;
    color: #3d6b5c;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Totais */
.talao-totais {
    padding: clamp(4px, 1vh, 10px) 12px;
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.6vh, 6px);
    flex-shrink: 0;
}

.talao-totais-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
}

.talao-totais-label {
    color: #555;
    font-weight: 600;
}

.talao-totais-valor {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
}


.talao-pecas-ctrl {
    display: flex;
    align-items: center;
    gap: 10px;
}

.talao-pecas-btn {
    min-width: 36px;
    padding: 6px 10px;
}

.talao-desconto-ctrl {
    justify-content: center;
    gap: 10px;
}

.desconto-pct {
    font-weight: 700;
    font-size: 0.9rem;
    color: #263238;
    min-width: 36px;
    text-align: center;
}

.talao-totais-final {
    padding: 8px 12px 6px;
    margin: 2px -12px 0;
    background: #e8f5e9;
    border-radius: 6px;
}

.talao-totais-final .talao-totais-label {
    font-weight: 700;
    color: #263238;
    font-size: 1rem;
}

.talao-totais-final strong {
    font-size: 1.15rem;
    color: #263238;
}

/* Botão avançar — cola no fundo da coluna 3 */
.talao-avancar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 0 4px;
}

#btn-avancar {
    flex-shrink: 0;
    padding-left: 48px;
    padding-right: 48px;
}

#btn-avancar.btn-avancar--inativo {
    opacity: 0.45;
}

.talao-avancar-erro {
    font-size: 0.82rem;
    font-weight: 600;
    color: #b71c1c;
    text-align: center;
    min-height: 1.2em;
    padding: 4px 8px 0;
}

/* --- Linhas de totais clicáveis (desconto / urgência) ------ */
.talao-totais-linha--clicavel {
    cursor: pointer;
    border-radius: 7px;
    padding: 6px 8px;
    margin: 0 -8px;
    transition: background 0.12s;
}

.talao-totais-linha--desconto {
    background: #fff8e1;
}

.talao-totais-linha--desconto:hover {
    background: #fff0b3;
}

.talao-totais-linha--urgencia {
    background: #fce4ec;
}

.talao-totais-linha--urgencia:hover {
    background: #f8bbd0;
}

.talao-totais-linha--clicavel .talao-totais-label {
    font-weight: 600;
}

.talao-totais-linha--clicavel .talao-clique-hint {
    font-size: 0.68rem;
    color: #999;
    display: block;
    margin-top: 1px;
}

/* --- Popup numérica (valor em euros) ----------------------- */
.valor-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.valor-overlay--visivel {
    display: flex;
}

.valor-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    text-align: center;
}

.valor-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #263238;
    margin-bottom: 16px;
}

.valor-display {
    font-size: 2rem;
    font-weight: 700;
    color: #263238;
    background: #f4f4f7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    letter-spacing: 0.02em;
}

.valor-teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.valor-tecla {
    background: #f4f4f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #263238;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.valor-tecla:hover {
    background: #e8e8f0;
}

.valor-tecla:active {
    background: #d0d0e0;
}

.valor-tecla--apagar {
    background: #fdecea;
    border-color: #f5c6c6;
    color: #b71c1c;
    font-size: 1rem;
}

.valor-tecla--apagar:hover {
    background: #f8c8c8;
}

.valor-tecla--duplo {
    background: #e8f0fe;
    border-color: #c5d5f8;
    color: #1a3a8e;
    font-size: 1rem;
    font-weight: 700;
}

.valor-tecla--duplo:hover {
    background: #d0e0fc;
}

.valor-tecla--ok {
    background: #2e7d32;
    border-color: #1b5e20;
    color: #fff;
    font-weight: 700;
}

.valor-tecla--ok:hover {
    background: #388e3c;
}

.valor-botoes {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.valor-botoes .btn-touch {
    flex: 1;
}

/* --- Dois campos de preço na popup de item ---------------- */
.item-precos {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.item-preco-bloco {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-preco-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.valor-display--readonly {
    font-size: 1.3rem;
    padding: 8px 10px;
    min-height: 46px;
    background: #ececec;
    color: #777;
}

.valor-display--novo {
    font-size: 1.3rem;
    padding: 8px 10px;
    min-height: 46px;
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 700;
}

/* --- Popup de confirmação ---------------------------------- */
.item-confirm-msg {
    font-size: 1rem;
    color: #333;
    text-align: center;
    line-height: 1.5;
}


/* ============================================================
   Página 3 — Finalizar Talão
   ============================================================ */

body:has(.s3-wrap) .page-header { display: none; }
body:has(.s3-wrap) .main-content { padding: 8px 16px; }

.s3-wrap {
    display: flex;
    gap: clamp(8px, 1.5vw, 20px);
    align-items: flex-start;
}

/* Coluna principal 2/3 */
.s3-main {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 14px);
}

/* Coluna lateral 1/3 */
.s3-side {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 14px);
}

.s3-secao {
    background: #fff;
    border-radius: 10px;
    padding: clamp(8px, 1.2vh, 14px) 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.s3-side-secao {
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.s3-secao-titulo {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 8px;
}

/* Grid de campos cliente */
.s3-cliente-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    margin-bottom: 8px;
}

.s3-campo {
    background: #f4f4f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.12s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    user-select: none;
}

.s3-campo:hover { background: #e8e8f0; }

.s3-campo-texto { cursor: default; background: #fff; }
.s3-campo-texto:hover { background: #fff; }

.s3-campo-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.s3-campo-valor {
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
}

.s3-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
    font-family: inherit;
    outline: none;
    padding: 0;
    margin-top: 2px;
}

.s3-input::placeholder { font-weight: 400; color: #bbb; }

.btn-s3-apagar {
    background: #fce4ec;
    color: #880e4f;
    border: 1px solid #f8bbd0;
    font-size: 0.8rem;
}

.btn-s3-apagar:hover { background: #f8bbd0; }

/* Textarea observações */
.s3-textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.92rem;
    color: #222;
    resize: vertical;
    min-height: 60px;
    background: #fafafa;
    outline: none;
}

.s3-textarea:focus { border-color: #263238; background: #fff; }

/* Tipo de serviço */
.s3-radios-linha {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.s3-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Atributos */
.s3-atrib-linha {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.s3-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.s3-pag-linha {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.s3-campo-pag {
    cursor: pointer;
    padding: 6px 10px;
}

.s3-campo-valor-pag {
    font-size: 0.95rem;
}

.s3-retif-linha {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-s3-retif {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1.5px solid #90caf9;
    font-size: 0.82rem;
}

.s3-retif-num {
    font-size: 0.9rem;
    color: #555;
}

.s3-retif-num strong {
    color: #263238;
    font-size: 1rem;
}

/* Botões finais */
.s3-botoes {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Coluna lateral — serviços */
.s3-servicos-lista {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.s3-servico-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
    font-size: 0.85rem;
}

.s3-servico-descr { color: #333; flex: 1; }
.s3-servico-preco { font-weight: 700; color: #3d6b5c; white-space: nowrap; }

/* Resumo de valores */
.s3-resumo-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    font-size: 0.88rem;
}

.s3-r-label { color: #666; font-weight: 600; }
.s3-r-val   { text-align: right; font-weight: 700; color: #263238; }
.s3-r-desc  { color: #c62828; }
.s3-r-total-label, .s3-r-total {
    border-top: 2px solid #263238;
    padding-top: 4px;
    margin-top: 2px;
    font-size: 1rem;
}
.s3-r-total  { color: #263238; }
.s3-r-data   { font-size: 0.8rem; font-weight: 600; color: #3d6b5c; }

.s3-talao-num {
    font-size: 1rem;
    color: #555;
    margin-bottom: 2px;
}

.s3-talao-num strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: #263238;
}

/* Tabela alocação */
.s3-aloc-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.s3-aloc-tabela th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    padding: 3px 4px;
    border-bottom: 1px solid #e0e0e0;
}

.s3-aloc-tabela td {
    padding: 4px 4px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.s3-aloc-val { text-align: right; font-weight: 700; color: #3d6b5c; }

/* Popup numérico pág. 3 */
.s3-popup-modal {
    max-width: 300px;
    width: 90vw;
}

.s3-popup-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
    text-align: center;
}

.s3-popup-display {
    font-size: 1.8rem;
    font-weight: 800;
    color: #263238;
    text-align: center;
    margin-bottom: 14px;
    min-height: 2.2rem;
    letter-spacing: 0.02em;
}

.s3-pin-display {
    letter-spacing: 0.3em;
}

.pin-erro {
    font-size: 0.82rem;
    font-weight: 600;
    color: #b71c1c;
    text-align: center;
    min-height: 1.1em;
    margin-top: -8px;
    margin-bottom: 4px;
}

.s2-alerta-modal {
    max-width: 360px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
}

.s2-alerta-titulo {
    font-size: 1rem;
    font-weight: 800;
    color: #b71c1c;
}

.s2-alerta-msg {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

.s2-alerta-btn {
    width: 100%;
    justify-content: center;
}


/* ============================================================
   Config — Registo Automático
   ============================================================ */

.cfg-aviso {
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.cfg-aviso--ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.cfg-ra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.cfg-ra-campo {
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfg-ra-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #263238;
}

.cfg-ra-desc {
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

.cfg-ra-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cfg-ra-input {
    width: 110px;
    border: 1.5px solid #ccc;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #263238;
    text-align: right;
    background: #f9f9fc;
    transition: border-color 0.15s;
}

.cfg-ra-input:focus {
    outline: none;
    border-color: #263238;
    background: #fff;
}

.cfg-ra-unidade {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.cfg-ra-default {
    font-size: 0.75rem;
    color: #aaa;
    font-style: italic;
}

.cfg-ra-botoes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-voltar-config {
    background: #e8e8f0;
    color: #3a3a5c;
    border: 1px solid #c8c8d4;
    font-weight: 700;
}

.btn-voltar-config:hover { background: #d8d8e8; }

/* ── Impressora ── */
.cfg-ra-campo--full {
    grid-column: 1 / -1;
}

.cfg-impr-grid {
    grid-template-columns: 1fr 1fr;
}

.cfg-impr-text--sm {
    width: auto;
    max-width: 260px;
}

.cfg-impr-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cfg-impr-inline .cfg-ra-desc {
    margin: 0;
}

.cfg-impr-text {
    width: 100%;
    border: 1.5px solid #ccc;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.95rem;
    color: #263238;
    background: #f9f9fc;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.cfg-impr-text:focus {
    outline: none;
    border-color: #263238;
    background: #fff;
}

.cfg-impr-radio-grupo {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.cfg-impr-radio-grupo--inline {
    flex-direction: row;
    gap: 24px;
}
.cfg-impr-sublabel { display: block; font-size: 0.82rem; font-weight: 600; color: #444; margin-bottom: 2px; }
.cfg-impr-secao .cfg-impr-inline { gap: 32px; }
.cfg-impr-input-num {
    width: 90px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.cfg-impr-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.cfg-impr-radio-label input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.cfg-impr-radio-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cfg-impr-radio-texto strong {
    font-size: 0.88rem;
    color: #263238;
}

.cfg-impr-radio-texto small {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.3;
}

.cfg-impr-linhas {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.cfg-impr-linha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cfg-impr-linha-num {
    width: 20px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #aaa;
    flex-shrink: 0;
}


/* ============================================================
   Registo Automático — modal de proposta
   ============================================================ */

.regauto-modal {
    max-width: 480px;
    width: 94vw;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 20px;
    max-height: 90vh;
}

.regauto-titulo {
    font-size: 1rem;
    font-weight: 800;
    color: #263238;
    text-align: center;
}

.regauto-subtitulo {
    font-size: 0.85rem;
    color: #555;
    text-align: center;
}

.regauto-tabela-wrap {
    overflow-y: auto;
    max-height: 50vh;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.regauto-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.regauto-tabela th {
    position: sticky;
    top: 0;
    background: #263238;
    color: #fff;
    padding: 7px 10px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ============================================================
   Lista de Talões
   ============================================================ */

/* A página ocupa toda a altura disponível abaixo da topbar */
body:has(.tl-page) {
    height: 100vh;
    overflow: hidden;
}

body:has(.tl-page) .footer { display: none; }

body:has(.tl-page) .main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    max-width: none;
}

body:has(.tl-page) .page-header { display: none; }

.tl-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Filtros ── */
.tl-filtros {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 2px solid #dde;
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tl-filtros-campos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: flex-end;
}

.tl-campo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 110px;
}

.tl-campo--wide { min-width: 200px; flex: 1; }

.tl-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.tl-input {
    height: 38px;
    border: 1px solid #ccd;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 0.92rem;
    background: #f8f8fc;
    width: 100%;
}

.tl-input:focus { outline: 2px solid #5c6bc0; border-color: #5c6bc0; background: #fff; }

/* Campo display clicável (abre popup numérico) */
.tl-display-campo {
    height: 38px;
    border: 1px solid #ccd;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 0.92rem;
    background: #f8f8fc;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: #222;
    min-width: 110px;
    transition: border-color 0.15s, background 0.15s;
}
.tl-display-campo:hover { border-color: #5c6bc0; background: #fff; }

.tl-filtros-acoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tl-rapidos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tl-btn-rapido {
    height: 36px;
    padding: 0 12px;
    font-size: 0.83rem;
    background: #f0f0f8;
    border: 1px solid #ccd;
    border-radius: 20px;
    color: #444;
    white-space: nowrap;
}

.tl-btn-rapido--ativo {
    background: #3949ab;
    border-color: #283593;
    color: #fff;
    font-weight: 700;
}

.tl-btns-acao {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Tabela ── */
.tl-tabela-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

.tl-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tl-tabela thead th {
    position: sticky;
    top: 0;
    background: #263238;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    z-index: 2;
}

.tl-tabela tbody tr { border-bottom: 1px solid #eee; }
.tl-tabela tbody tr:last-child { border-bottom: none; }

.tl-linha {
    cursor: pointer;
    transition: background 0.12s;
}
.tl-linha:hover { background: #f0f0f8; }
.tl-linha--deleted { opacity: 0.45; }

.tl-tabela td {
    padding: 9px 12px;
    white-space: nowrap;
}

.tl-col-num { text-align: right; }
.tl-col-flag { text-align: center; width: 44px; }

.tl-flag { font-size: 1rem; }
.tl-flag--x    { color: #c62828; font-weight: 700; }
.tl-flag--bola      { color: #c62828; font-size: 1.6rem; line-height: 1; }
.tl-flag--bola-cinza { color: #d8d8d8; font-size: 1.6rem; line-height: 1; }

/* Divisórias verticais nas colunas de flag */
.tl-tabela .tl-col-flag {
    border-left: 1px solid #dde;
}

/* Colunas de detalhes extra (ocultas por defeito via JS) */
.tl-col-extra {
    display: none;
    white-space: nowrap;
    border-left: 1px solid #dde;
    font-size: 0.88rem;
}

/* Switch "Detalhes extra" */
.tl-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-left: 4px;
}

.tl-switch-txt {
    font-size: 0.83rem;
    color: #555;
    white-space: nowrap;
}

.tl-switch {
    position: relative;
    width: 42px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.tl-switch--on { background: #3949ab; }

.tl-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: left 0.2s;
}

.tl-switch--on .tl-switch-knob { left: 21px; }

.tl-vazio {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 0.95rem;
}

/* ── Totalizadores ── */
.tl-totais {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    border-top: 2px solid #dde;
    background: #fff;
}

.tl-total-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border-right: 1px solid #eee;
}
.tl-total-item:last-child { border-right: none; }

.tl-total-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.tl-total-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #263238;
    margin-top: 2px;
}

.tl-total-val--caixa { color: #2e7d32; }


/* ============================================================
   Livro de Ponto
   ============================================================ */

.lp-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lp-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lp-titulo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #263238;
}

.lp-oper-card {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 20px 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.lp-oper-nome {
    font-size: 1.5rem;
    font-weight: 700;
    color: #263238;
}

.lp-oper-data {
    margin-top: 6px;
    font-size: 1rem;
    color: #555;
}

.lp-botoes {
    display: flex;
    gap: 16px;
}

.lp-btn-entrada,
.lp-btn-saida {
    flex: 1;
    min-height: 72px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
}

.lp-btn-entrada {
    background: #2e7d32;
    border-color: #1b5e20;
    color: #fff;
}
.lp-btn-entrada:hover:not(:disabled) { background: #388e3c; }

.lp-btn-saida {
    background: #c62828;
    border-color: #b71c1c;
    color: #fff;
}
.lp-btn-saida:hover:not(:disabled) { background: #d32f2f; }

.lp-btn-entrada:disabled,
.lp-btn-saida:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lp-nav-mes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.lp-nav-label {
    font-size: 1rem;
    font-weight: 700;
    color: #263238;
    text-transform: capitalize;
}

.lp-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f4f4f7;
    border: 1px solid #dde;
    font-size: 1.5rem;
    color: #263238;
    text-decoration: none;
    user-select: none;
    transition: background 0.15s;
}

.lp-nav-btn:hover { background: #e0e0ee; }

.lp-nav-btn--inativo {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

.lp-mapa-wrap {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.lp-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.lp-tabela th {
    background: #263238;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lp-tabela td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.lp-tabela tr:last-child td { border-bottom: none; }

.lp-row-entrada { background: #f1faf2; }
.lp-row-saida   { background: #fff8f8; }

.lp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.lp-badge-entrada { background: #c8e6c9; color: #1b5e20; }
.lp-badge-saida   { background: #ffcdd2; color: #b71c1c; }

.lp-vazio {
    text-align: center;
    color: #999;
    padding: 24px;
}

/* PIN overlay no dashboard */
.pin-display {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    color: #263238;
    margin: 0 0 8px;
    padding: 8px;
    background: #f4f4f7;
    border-radius: 6px;
}

.pin-erro {
    min-height: 20px;
    text-align: center;
    color: #c62828;
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.pin-teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.regauto-tabela td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.regauto-tabela tr:last-child td { border-bottom: none; }
.regauto-tabela tr:nth-child(even) td { background: #fafafa; }

.regauto-val {
    text-align: right;
    font-weight: 700;
    color: #3d6b5c;
}


/* ============================================================
   Detalhe de Talão (.td-*)
   ============================================================ */

body:has(.td-wrap) .page-header  { display: none; }
body:has(.td-wrap) .topbar-titulo::before { content: 'Detalhes de Talão de Serviço'; }
body:has(.td-wrap) .main-content  { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 56px); overflow: hidden; }

.td-wrap {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- Coluna principal (2/3) -------------------------------- */
.td-main {
    flex: 2;
    overflow-y: auto;
    padding: 16px 20px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Coluna lateral (1/3) ---------------------------------- */
.td-side {
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    overflow-y: auto;
    padding: 16px 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Cabeçalho do talão ------------------------------------ */
.td-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.td-num {
    font-size: 1.15rem;
    color: #263238;
}

.td-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.td-badge--elim {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #e57373;
}

.btn-td-voltar {
    background: #fff8e1;
    color: #5d4037;
    border: 1px solid #ffe082;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
}
.btn-td-voltar:hover { background: #ffecb3; }
.td-nav { display: flex; gap: 4px; margin-left: auto; }
.btn-td-nav { min-width: 36px; padding: 6px 10px; font-size: 1.2rem; line-height: 1; text-align: center; text-decoration: none; background: #f5f5f5; color: #444; border: 1px solid #ddd; border-radius: 6px; }
.btn-td-nav:hover { background: #e8e8e8; color: #111; }
.btn-td-nav--inativo { color: #ccc; cursor: default; pointer-events: none; }
.btn-export-xlsx {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}
.btn-export-xlsx:hover { background: #c8e6c9; }

/* --- Secções ------------------------------------------------ */
.td-secao {
    border-bottom: 1px solid #eee;
    padding: 14px 0;
}
.td-secao:last-of-type { border-bottom: none; }

.td-secao-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 10px;
}

.td-secao-titulo--lista {
    font-size: 0.95rem;
    color: #222;
    letter-spacing: 0.01em;
}

.td-side-secao {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}
.td-side-secao:last-child { border-bottom: none; }

/* --- Grid de campos ---------------------------------------- */
.td-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.td-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.td-campo--full { grid-column: 1 / -1; }

.td-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.td-valor {
    font-size: 0.95rem;
    color: #263238;
}

.td-observ {
    background: #f8f8fc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.4;
}

/* --- Flags -------------------------------------------------- */
.td-flags-linha {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.td-flag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.td-flag--ativo  { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.td-flag--alerta { background: #fde8e8; color: #c0392b; border: 1px solid #ef9a9a; }
.td-flag--inativo { background: #f5f5f5; color: #bbb; border: 1px solid #e0e0e0; }
.td-flag--auto   { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* --- Pagamento em falta ------------------------------------ */
.td-pag-falta {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
}
.td-pag-falta-label { font-size: 0.9rem; font-weight: 600; color: #e65100; }
.td-pag-falta-valor { font-size: 1rem; font-weight: 700; color: #c0392b; }

/* --- Retificação ------------------------------------------ */
.td-retif {
    margin-top: 8px;
    font-size: 0.88rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 10px;
}

/* --- Por concluir / entregar ------------------------------ */
.td-por-concluir { color: #e65100; font-style: italic; font-size: 0.88rem; }
.td-por-entregar { color: #888; font-style: italic; font-size: 0.88rem; }
.td-valor--elim  { color: #c0392b; font-weight: 600; }
.td-periodo      { color: #888; font-size: 0.82rem; font-style: italic; }

/* --- Botões de ação --------------------------------------- */
.td-botoes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.btn-td-acao {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.btn-td-reimprimir { background: #e8eaf6; color: #3949ab; border-color: #c5cae9; }
.btn-td-reimprimir:hover { background: #c5cae9; }

.btn-td-concluir { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.btn-td-concluir:hover { background: #c8e6c9; }

.btn-td-notificar { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.btn-td-notificar:hover { background: #bbdefb; }

.btn-td-eliminar { background: #fde8e8; color: #c0392b; border-color: #ef9a9a; }
.btn-td-eliminar:hover { background: #ffcdd2; }

.btn-td-entregar { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.btn-td-entregar:hover { background: #c8e6c9; }

.btn-td-pagamento { background: #fff8e1; color: #e65100; border-color: #ffe082; }
.btn-td-pagamento:hover { background: #fff3cd; }

.btn-td-moloni { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.btn-td-moloni:hover { background: #c8e6c9; }

.td-fatura-emitida { display:flex; align-items:center; gap:8px; padding:10px 14px; background:#e8f5e9; border:1px solid #a5d6a7; border-radius:8px; font-size:.9rem; }
.td-fatura-emitida-label { color:#555; }
.td-fatura-emitida strong { color:#1b5e20; font-size:1rem; }

.td-fatura-num-side { display:flex; align-items:center; gap:6px; padding:8px 0; font-size:.9rem; margin-bottom:8px; }
.td-fatura-label-side { color:#777; }
.td-fatura-num-side strong { color:#1b5e20; }

.btn-td-email-fatura { width:100%; background:#e3f2fd; color:#0d47a1; border-color:#90caf9; margin-top:0; }
.btn-td-email-fatura:hover { background:#bbdefb; }

.td-email-edit-btn { background:none; border:none; cursor:pointer; font-size:.9rem; padding:2px 4px; opacity:.6; }
.td-email-edit-btn:hover { opacity:1; }

.btn-td-acao--feito {
    opacity: 0.55;
    cursor: default;
}

/* --- Coluna lateral: serviços ----------------------------- */
.td-talao-num {
    font-size: 1rem;
    color: #263238;
    margin-bottom: 4px;
}

.td-servicos-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 33vh;
    overflow-y: auto;
}
.td-servico-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
}
.td-servico-item:last-child { border-bottom: none; }
.td-servico-descr { color: #333; flex: 1; padding-right: 8px; }
.td-servico-preco { color: #263238; font-weight: 600; white-space: nowrap; }

/* --- Resumo de valores ------------------------------------ */
.td-resumo-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 0.88rem;
}
.td-r-label { color: #888; }
.td-r-val   { text-align: right; color: #263238; font-weight: 500; }
.td-r-desc  { color: #e53935; }
.td-r-total-label { font-weight: 700; color: #263238; padding-top: 6px; border-top: 1px solid #eee; }
.td-r-total { font-weight: 700; font-size: 1rem; color: #263238; text-align: right; padding-top: 6px; border-top: 1px solid #eee; }
.td-r-total-linha { background: #e8f5e9; padding: 6px 8px; margin: 2px -8px 0; }
.td-r-falta-label { color: #c0392b; font-weight: 600; }
.td-r-falta { color: #c0392b; font-weight: 700; text-align: right; }

/* --- Tabela de alocação ----------------------------------- */
.td-aloc-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.td-aloc-tabela th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #aaa;
    padding: 4px 4px 6px;
    border-bottom: 1px solid #e0e0e0;
}
.td-aloc-tabela td {
    padding: 5px 4px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.td-aloc-val { text-align: right; font-weight: 600; }

/* --- Botão Alterar Execução ------------------------------- */
.btn-td-altexec {
    width: 100%;
    background: #f5f5f5;
    color: #444;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-td-altexec:hover { background: #e8e8e8; }

/* --- Modal Alterar Execução ------------------------------- */
.td-altexec-modal {
    max-width: 420px;
    width: 95vw;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.td-altexec-atual-label {
    font-size: 0.88rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 8px 12px;
}
.td-altexec-opers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}
.td-altexec-oper-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d0d0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #263238;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}
.td-altexec-oper-btn:hover {
    background: #eeeef8;
    border-color: #a0a0c8;
}

/* --- Modal Notificar Cliente ------------------------------ */
.td-notif-modal {
    width: 100%;
    max-width: 440px;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
}
.td-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #263238;
    color: #fff;
    padding: 14px 18px;
}
.td-notif-titulo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.td-notif-fechar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    opacity: .7;
}
.td-notif-fechar:hover { opacity: 1; }
.td-notif-step {
    padding: 20px 22px;
}
.td-notif-voltar {
    background: none;
    border: none;
    color: #546e7a;
    font-size: .82rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    display: block;
}
.td-notif-voltar:hover { color: #263238; }
.td-notif-label {
    font-size: .88rem;
    color: #555;
    margin: 0 0 14px;
    font-weight: 600;
}
.td-notif-opcoes {
    display: flex;
    gap: 14px;
}
.td-notif-opcao-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.td-notif-opcao-btn:hover {
    border-color: #546e7a;
    background: #f0f4f8;
}
.td-notif-opcao-btn--verde:hover  { border-color: #2e7d32; background: #f1f8e9; }
.td-notif-opcao-btn--laranja:hover { border-color: #e65100; background: #fff3e0; }
.td-notif-opcao-btn--indisponivel {
    opacity: .45;
    cursor: not-allowed;
}
.td-notif-opcao-btn--indisponivel:hover {
    border-color: #e0e0e0;
    background: #fafafa;
}
.td-notif-icone {
    font-size: 1.8rem;
    line-height: 1;
}
.td-notif-opcao-nome {
    font-size: .9rem;
    font-weight: 700;
    color: #263238;
}
.td-notif-opcao-sub {
    font-size: .75rem;
    color: #999;
}
.td-notif-indisponivel-label {
    font-size: .68rem;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.td-notif-aviso {
    background: #fff3e0;
    color: #e65100;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: .82rem;
}
.td-notif-periodos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.td-notif-periodo-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    white-space: nowrap;
}
.td-notif-periodo-btn:hover { border-color: #546e7a; background: #f0f4f8; }
.td-notif-periodo-btn--ativo {
    border-color: #1565c0;
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
}
.td-notif-enviar-btn { margin-top: 16px; }

/* --- Popup confirmação ------------------------------------ */
.td-confirm-modal {
    max-width: 360px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.td-confirm-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #263238;
}
.td-confirm-texto {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.4;
}
.td-confirm-botoes {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}
.btn-td-confirm-ok {
    background: #263238;
    color: #fff;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
}
.btn-td-confirm-cancel {
    background: #f0f0f8;
    color: #555;
    border: 1px solid #d0d0e0;
    border-radius: 8px;
    padding: 10px 20px;
}

/* ── Gestão de Clientes ─────────────────────────────────────── */
.cli-wrap   { max-width: 1300px; margin: 0 auto; padding: 16px; }
.cli-titulo { font-size: 1rem; font-weight: 700; color: #333; margin-bottom: 16px; }

.cli-pesquisa {
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    padding: 16px; margin-bottom: 16px;
    display: grid; grid-template-columns: 1fr 2fr 1fr 2fr; gap: 10px; align-items: end;
}
.cli-pesquisa .full { grid-column: 1 / -1; }
.cli-campo { display: flex; flex-direction: column; gap: 4px; }
.cli-campo label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; }
.cli-campo input {
    padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px;
    font-size: .9rem; outline: none; background: #fafafa;
}
.cli-campo input:focus { border-color: #555; background: #fff; }
.cli-hint { font-size: .72rem; color: #bbb; margin-top: 2px; }

.cli-ok  { background: #f1f8f1; color: #2e6b2e; border: 1px solid #b2d9b2; border-radius: 5px; padding: 9px 14px; margin-bottom: 12px; font-size: .88rem; }
.cli-err { background: #fdf3f3; color: #9b2020; border: 1px solid #e8b4b4; border-radius: 5px; padding: 9px 14px; margin-bottom: 12px; font-size: .88rem; }

.cli-tabela-wrap { background: #fff; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.cli-total { font-size: .78rem; color: #999; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
table.cli-tabela { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.cli-tabela th { background: #f5f5f5; padding: 8px 12px; text-align: left; font-size: .72rem; font-weight: 700; color: #777; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e0e0e0; white-space: nowrap; }
table.cli-tabela td { padding: 8px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
table.cli-tabela tr:last-child td { border-bottom: none; }
table.cli-tabela tr:hover td { background: #fafafa; }
.cli-empty { padding: 32px; text-align: center; color: #bbb; font-size: .9rem; }

.cli-edit-row td { background: #f9f5ff !important; }
.cli-edit-row input[type="text"],
.cli-edit-row input[type="email"] {
    width: 100%; padding: 5px 8px; border: 1px solid #b39ddb;
    border-radius: 4px; font-size: .88rem; background: #fff; outline: none;
}
.cli-edit-row input:focus { border-color: #7e57c2; }

.btn-cli        { padding: 6px 14px; border: none; border-radius: 4px; font-size: .82rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-cli-prim   { background: #424242; color: #fff; }
.btn-cli-prim:hover { background: #303030; }
.btn-cli-sec    { background: #fff; color: #555; border: 1px solid #ccc; }
.btn-cli-sec:hover  { background: #f5f5f5; }
.btn-cli-edit   { background: #f0f0f0; color: #444; border: 1px solid #ddd; padding: 4px 10px; font-size: .78rem; }
.btn-cli-edit:hover { background: #e0e0e0; }
.btn-cli-save   { background: #2e7d32; color: #fff; padding: 4px 10px; font-size: .78rem; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; }
.btn-cli-cancel { background: #fff; color: #888; border: 1px solid #ccc; padding: 4px 10px; font-size: .78rem; border-radius: 4px; text-decoration: none; display: inline-block; }
.btn-cli-del    { background: #fff; color: #c62828; border: 1px solid #e57373; padding: 4px 8px; font-size: .78rem; border-radius: 4px; cursor: pointer; }
.btn-cli-del:hover { background: #ffebee; }

/* ── Moloni Connect ── */
.mol-wrap { display: flex; gap: 24px; align-items: flex-start; }
.mol-painel {
    flex: 1; min-width: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.mol-painel-titulo {
    background: #263238;
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    padding: 12px 20px;
    letter-spacing: .02em;
}
.mol-secao {
    padding: 20px 20px 6px;
    border-bottom: 1px solid #f0f0f0;
}
.mol-secao:last-child { border-bottom: none; }
.mol-secao-titulo {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #888;
    margin-bottom: 14px;
}
.mol-campo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.mol-campo-label {
    width: 120px;
    flex-shrink: 0;
    font-size: .88rem;
    color: #555;
    font-weight: 500;
}
.mol-campo input[type="text"],
.mol-campo input[type="email"],
.mol-campo input[type="password"],
.mol-campo input[type="number"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: .92rem;
    color: #222;
    outline: none;
    transition: border-color .15s;
}
.mol-campo input:focus { border-color: #263238; }
.mol-campo input[type="number"] { max-width: 110px; flex: none; }
.mol-campo-wrap { display:flex; flex-direction:column; flex:1; min-width:0; }
.mol-campo-desc { font-size:.76rem; color:#999; margin-top:3px; line-height:1.35; }
.mol-campo--inline { flex-direction: column; gap: 0; }
.mol-check-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.mol-check-label input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: #263238; }
.mol-check-nome { display: block; font-size: .9rem; font-weight: 600; color: #263238; }
.mol-check-desc { display: block; font-size: .8rem; color: #888; margin-top: 2px; }
.mol-ok  { background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; border-radius:6px; padding:10px 16px; margin-bottom:18px; font-size:.9rem; }
.mol-err { background:#fce4ec; color:#880e4f; border:1px solid #f48fb1; border-radius:6px; padding:10px 16px; margin-bottom:18px; font-size:.9rem; }
.mol-botoes {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}
.mol-test-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
#mol-resultado { display:none; }
#mol-resultado-titulo { font-size:.8rem; font-weight:700; color:#555; margin-bottom:6px; }
#mol-resultado-json {
    background:#f5f5f5;
    border:1px solid #e0e0e0;
    border-radius:6px;
    padding:12px;
    font-size:.75rem;
    max-height:340px;
    overflow:auto;
    white-space:pre-wrap;
    word-break:break-all;
    margin:0;
}

/* ── Comunicações ── */
.com-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 1140px;
}
.com-painel {
    flex: 1 1 420px;
    min-width: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.com-painel--full {
    flex: 1 1 100%;
}
.com-painel-titulo {
    background: #263238;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    letter-spacing: 0.02em;
}
.com-secao {
    padding: 20px 20px 4px;
    border-bottom: 1px solid #f0f0f0;
}
.com-secao:last-child { border-bottom: none; }
.com-secao-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 14px;
}
.com-check-ativo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
}
.com-check-ativo input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #263238;
    cursor: pointer;
    flex-shrink: 0;
}
.com-check-ativo-label {
    font-size: 1rem;
    font-weight: 600;
    color: #263238;
    cursor: pointer;
    user-select: none;
}
.com-campo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.com-campo-label {
    width: 110px;
    flex-shrink: 0;
    font-size: 0.88rem;
    color: #555;
    font-weight: 500;
}
.com-campo input[type="text"],
.com-campo input[type="email"],
.com-campo input[type="password"],
.com-campo input[type="number"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.com-campo input:focus { border-color: #263238; }
.com-campo input[type="number"] { max-width: 90px; flex: none; }
.com-check-linha {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}
.com-check-linha input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #263238;
    cursor: pointer;
    flex-shrink: 0;
}
.com-check-linha span { font-size: 0.9rem; color: #444; cursor: pointer; user-select: none; }
.com-ok  { background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; border-radius:6px; padding:10px 16px; margin-bottom:18px; font-size:.9rem; }
.com-err { background:#fce4ec; color:#880e4f; border:1px solid #f48fb1; border-radius:6px; padding:10px 16px; margin-bottom:18px; font-size:.9rem; }
.com-botoes {
    display: flex;
    gap: 10px;
    padding: 20px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}
.com-placeholder { padding: 40px 20px; text-align: center; color: #aaa; font-size: 0.9rem; }
.com-placeholder svg { display: block; margin: 0 auto 16px; opacity: .3; }

/* ── Mapa Produtividade ── */
.cprod-wrap {
    max-width: 806px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cprod-filtros { display: flex; align-items: center; gap: 16px; }
.cprod-nav-mes { display: flex; align-items: center; gap: 6px; }
.cprod-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 1.3rem;
    color: #333;
    text-decoration: none;
}
.cprod-nav-btn--inativo { opacity: 0.35; pointer-events: none; }
.cprod-nav-label {
    font-weight: 700;
    font-size: 1rem;
    min-width: 150px;
    text-align: center;
    color: #263238;
    text-transform: capitalize;
}
.cprod-totais { display: flex; gap: 12px; }
.cprod-total-item {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.cprod-total-val { display: block; font-size: 1.4rem; font-weight: 700; color: #263238; }
.cprod-total-label { display: block; font-size: 0.73rem; color: #888; margin-top: 2px; }
.cprod-tabela-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.cprod-tabela { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.cprod-tabela thead th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}
.cprod-th-num, .cprod-td-num { text-align: center; }
.cprod-th-val, .cprod-td-val { text-align: right; }
.cprod-td-sem-horas { color: #bbb; }
.cprod-tabela tbody tr td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; }
.cprod-tabela tbody tr:last-child td { border-bottom: none; }
.cprod-tabela tbody tr:hover { background: #fafafa; }
.cprod-tfoot td { padding: 10px 14px; border-top: 2px solid #e0e0e0; background: #f9f9f9; }
.cprod-vazio { padding: 40px; text-align: center; color: #aaa; }

/* ── Livro de Ponto ── */
.clp-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.clp-filtros { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.clp-nav-mes { display: flex; align-items: center; gap: 6px; }
.clp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 1.3rem;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}
.clp-nav-btn--inativo { opacity: 0.35; pointer-events: none; }
.clp-nav-label {
    font-weight: 700;
    font-size: 1rem;
    min-width: 130px;
    text-align: center;
    color: #263238;
    text-transform: capitalize;
}
.clp-form-oper { display: flex; align-items: center; }
.clp-select { padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; background: #fff; }
.clp-totais { display: flex; gap: 12px; }
.clp-total-item {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.clp-total-item--alerta { background: #fff3e0; border-color: #ffcc80; }
.clp-total-val { display: block; font-size: 1.5rem; font-weight: 700; color: #263238; }
.clp-total-item--alerta .clp-total-val { color: #e65100; }
.clp-total-label { display: block; font-size: 0.75rem; color: #888; margin-top: 2px; }
.clp-tabela-wrap { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.clp-tabela { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.clp-tabela thead th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}
.clp-row { cursor: pointer; transition: background 0.1s; }
.clp-row td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; }
.clp-row:last-child td { border-bottom: none; }
.clp-row:hover { background: #f9f9f9; }
.clp-row-alerta { background: #fff8f0; }
.clp-row-alerta:hover { background: #fff0e0; }
.clp-dia-sem { color: #888; font-size: 0.82rem; margin-right: 4px; }
.clp-badge-inv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    background: #ff6f00;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}
.clp-vazio { padding: 40px; text-align: center; color: #aaa; }
.clp-detalhe-modal { min-width: 280px; max-width: 360px; }
.clp-detalhe-titulo {
    font-weight: 700;
    font-size: 1rem;
    color: #263238;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.clp-detalhe-tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.clp-detalhe-tabela th {
    text-align: left;
    padding: 6px 10px;
    background: #f5f5f5;
    color: #555;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}
.clp-detalhe-tabela td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }
.clp-detalhe-tabela tr:last-child td { border-bottom: none; }
.clp-badge-entrada { color: #2e7d32; font-weight: 600; }
.clp-badge-saida   { color: #c62828; font-weight: 600; }
.clp-badge-inv-row td { background: #fff3e0; }

/* ── Configurações Várias ── */
.cfg-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cfg-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; border-radius: 6px; padding: 10px 14px; font-weight: 600; }
.cfg-erro { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; border-radius: 6px; padding: 10px 14px; }
.cfg-secao {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cfg-secao-titulo { font-weight: 700; font-size: 0.95rem; color: #333; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.cfg-secao-desc { font-size: 0.82rem; color: #888; margin: -6px 0 0; }
.cfg-linha { display: flex; align-items: center; gap: 12px; }
.cfg-label { width: 120px; font-size: 0.9rem; color: #555; flex-shrink: 0; }
.cfg-input-pin { width: 160px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; letter-spacing: 4px; }
.cfg-check-linha {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}
.cfg-check-linha:hover { background: #f9f9f9; }
.cfg-check-linha input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #37474f;
    cursor: pointer;
}
.cfg-check-nome { display: block; font-weight: 600; font-size: 0.9rem; color: #222; }
.cfg-check-desc { display: block; font-size: 0.8rem; color: #888; margin-top: 2px; }
.cfg-check-linha.cv-disabled { opacity: 0.45; pointer-events: none; }
.cfg-check-linha--indented { margin-left: 32px; border-left: 3px solid #e0e0e0; padding-left: 14px; }
.cfg-botoes { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Lista de Compras ── */
.lc-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}
.lc-barra { display: flex; align-items: center; gap: 12px; }
.lc-btn-minicial {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    text-decoration: none;
}
.lc-lista { display: flex; flex-direction: column; gap: 6px; }
.lc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
}
.lc-item-descr { flex: 1; font-size: 1rem; color: #222; }
.lc-item-meta { font-size: 0.78rem; color: #888; white-space: nowrap; }
.lc-btn-elim { flex-shrink: 0; }
.lc-vazio { color: #aaa; text-align: center; padding: 40px 0; }
.lc-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}

/* ── Mapa de Trabalho ── */
.mt-wrap { display: flex; flex-direction: column; gap: 12px; padding: 12px; height: 100%; }
.mt-barra {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px 14px;
}
.mt-barra-linha1 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.mt-data-ctrl { display: flex; align-items: center; gap: 8px; }
.mt-data-label { font-size: 1.05rem; font-weight: bold; min-width: 130px; text-align: center; }
.mt-nav { font-size: 1.3rem; padding: 2px 22px; }
.mt-hoje { font-size: 0.8rem; padding: 4px 10px; background: #e0e0e0; }
.mt-total-dia { font-size: 0.82rem; color: #555; padding: 2px 0; flex-shrink: 0; margin-left: auto; }
.mt-btn-minicial {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.mt-switches { display: flex; gap: 18px; align-items: center; }
.mt-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 12px;
}
.mt-switch-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #37474f; }
.mt-switch-modo { color: #c0392b; font-weight: 600; border-color: #e57373; }
.mt-switch-modo input[type="checkbox"] { accent-color: #c0392b; }
.mt-oper-ativo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
}
.mt-oper-instrucao { font-size: 0.75rem; font-weight: normal; color: #856404; margin-top: 2px; }
.mt-colunas { display: flex; gap: 10px; flex: 1; overflow-x: auto; align-items: flex-start; }
.mt-coluna {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 160px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mt-col-header {
    background: #212121;
    color: #fff;
    padding: 6px 8px;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.mt-col-header-count { font-size: 0.75rem; font-weight: normal; color: #bbb; white-space: nowrap; }
.mt-btn-imprimir { font-size: 0.88rem; padding: 3px 8px; border: 1px solid #555 !important; white-space: nowrap; margin-left: auto; line-height: 1.2; }
.mt-lista { overflow-y: auto; flex: 1; }
.mt-talao-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s;
}
.mt-talao-item:hover { background: #f5f5f5; }
.mt-talao-item.mt-concluido { opacity: 0.45; }
.mt-talao-num { font-weight: 600; color: #333; }
.mt-talao-val { color: #555; font-size: 0.82rem; }
.mt-vazio { color: #888; text-align: center; padding: 40px 0; width: 100%; }

/* ── LojasAdmin ─────────────────────────────────────────────── */
.la-wrap { padding: 16px; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.la-vazio { color: #888; text-align: center; padding: 60px 0; font-size: 1rem; }
.la-nav { display: flex; align-items: center; gap: 16px; }
.la-nav-mes { display: flex; align-items: center; gap: 6px; }
.la-nav-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #ccc; border-radius: 6px; background: #fff; font-size: 1.3rem; color: #333; text-decoration: none; }
.la-nav-btn--inativo { opacity: 0.35; pointer-events: none; }
.la-nav-label { font-weight: 700; font-size: 1rem; min-width: 150px; text-align: center; color: #263238; text-transform: capitalize; }
.la-secao-titulo { font-size: 0.75rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.la-lojas { display: flex; flex-direction: column; gap: 16px; }
.la-loja-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 14px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.la-loja-nome { font-size: 1rem; font-weight: 700; color: #212121; margin-bottom: 6px; }
.la-loja-acoes { display: flex; justify-content: flex-end; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid #eee; }
.la-btn-backup { font-size: 0.75rem; padding: 4px 10px; background: #f5f5f5; color: #555; border: 1px solid #ddd; border-radius: 5px; text-decoration: none; }
.la-btn-backup:hover { background: #e8e8e8; color: #222; }
.la-loja-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.la-link { font-size: .8rem; padding: 5px 12px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 5px; color: #444; text-decoration: none; transition: background .15s, border-color .15s; }
.la-link:hover { background: #e8e8e8; border-color: #bbb; color: #111; }
.la-admin-voltar { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 4px 10px; background: #fff3e0; border: 1px solid #ffe0b2; border-radius: 5px; color: #e65100; text-decoration: none; white-space: nowrap; }
.la-admin-voltar:hover { background: #ffe0b2; }
.la-ferramentas { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.la-ferramenta-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 16px 20px; min-width: 240px; flex: 1; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.la-ferramenta-titulo { font-size: .95rem; font-weight: 700; color: #212121; margin-bottom: 6px; }
.la-ferramenta-desc { font-size: .8rem; color: #666; margin-bottom: 14px; line-height: 1.5; }
.la-ferramenta-acoes { display: flex; gap: 10px; }
.la-badge-legacy { background: #e65100; color: #fff; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 4px; letter-spacing: .03em; }
.la-badge-offline { background: #1565c0; color: #fff; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 4px; letter-spacing: .03em; }
.la-loja-card--offline { border-color: #90caf9; background: #f5faff; }
.la-sync-info { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e0e0e0; }
.la-sync-badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: .03em; }
.la-sync-badge--ativo   { background: #e8f5e9; color: #2e7d32; }
.la-sync-badge--inativo { background: #f5f5f5; color: #aaa; }
.la-erro { color: #c62828; font-size: 0.9rem; padding: 6px 0; }

/* Homólogo */
.la-homol-col { color: #c62828 !important; background: #fff5f5; }
.la-row-destaque .la-homol-col { background: #ffeaea; }
.la-homol-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.la-homol-switch input { display: none; }
.la-homol-track { position: relative; width: 34px; height: 18px; background: #ccc; border-radius: 9px; transition: background .2s; flex-shrink: 0; }
.la-homol-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .2s; }
.la-homol-switch input:checked ~ .la-homol-track { background: #c62828; }
.la-homol-switch input:checked ~ .la-homol-track::after { left: 18px; }
.la-homol-label { font-size: .78rem; font-weight: 600; color: #c62828; }
.la-tabela-wrap { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow-x: auto; }
.la-tabela { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.la-tabela thead th { background: #f5f5f5; padding: 9px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #e0e0e0; white-space: nowrap; }
.la-th-c { text-align: center; }
.la-th-r { text-align: right; }
.la-tabela tbody tr td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.la-tabela tbody tr:last-child td { border-bottom: none; }
.la-tabela tbody tr:hover { background: #fafafa; }
.la-td-c { text-align: center; }
.la-td-r { text-align: right; }
.la-td-total { font-weight: 600; color: #1b5e20; }
.la-elim { color: #b71c1c; }
.la-urg  { color: #e65100; font-weight: 600; }
.la-pagar { color: #e65100; font-weight: 600; }
.la-erro-inline { color: #c62828; font-size: 0.85rem; }
.la-tfoot td { padding: 10px 12px; border-top: 2px solid #e0e0e0; background: #f9f9f9; white-space: nowrap; }
.la-tabela-diaria .la-subhead th { font-size: 0.75rem; color: #888; font-weight: 500; padding: 3px 10px; background: #fafafa; border-bottom: 1px solid #e8e8e8; }
.la-tabela-diaria .la-sub { border-left: 1px solid #eee; }
.la-tabela-diaria th.la-col-sep,
.la-tabela-diaria td.la-col-sep { border-left: 2px solid #d0d0d0; }
.la-td-dia { font-weight: 600; color: #444; }
.la-td-sem { color: #999; font-size: 0.8rem; }
.la-td-vazio { color: #ccc; }
.la-fds td { background: #f7f7f7; }
.la-fds:hover td { background: #f0f0f0; }
.la-tabela-header { display: flex; align-items: center; justify-content: space-between; }
.la-td-metrica { font-weight: 600; color: #555; white-space: nowrap; }
.la-row-destaque td { background: #f1f8e9; border-top: 1px solid #c5e1a5; }
.la-row-destaque:hover td { background: #e8f5e9; }
