/* ============================================================
 * Mecânica Santos — tema visual v3.2
 * Asfalto + Aço + Azul Solda (cores da logo).
 * Elemento-assinatura: a placa Mercosul (.placa).
 * ============================================================ */
:root {
    --asfalto:    #0e1420;
    --asfalto-2:  #17223a;
    --asfalto-3:  #22324f;
    --aco:        #eef1f5;
    --aco-2:      #e2e7ee;
    --cromo:      #a9b3c1;
    --grafite:    #5b6577;
    --tinta:      #141a26;
    --azul:       #1463e3;
    --azul-escuro:#0d49ad;
    --azul-claro: #e7effd;
    --faisca:     #5aa2ff;
    --verde:      #138a43;
    --verde-claro:#e5f5eb;
    --vermelho:   #c62828;
    --ambar:      #b45309;
    --ambar-claro:#fff6e5;
    --linha:      #d9dfe8;

    --raio-s: 8px;
    --raio:   12px;
    --raio-l: 18px;
    --sombra-flutua: 0 10px 30px -12px rgba(14,20,32,.35);
    --toque: 46px;

    /* compatibilidade com nomes usados nas telas e no documento */
    --s-ink: var(--asfalto); --s-navy: var(--asfalto-2); --s-navy-2: var(--asfalto-3);
    --s-blue: var(--azul); --s-blue-d: var(--azul-escuro); --s-blue-l: var(--azul-claro);
    --s-silver: var(--cromo); --s-steel: var(--grafite); --s-line: var(--linha);
    --s-bg: var(--aco); --s-ok: var(--verde); --s-danger: var(--vermelho);

    --bs-primary: var(--azul);
    --bs-primary-rgb: 20, 99, 227;
    --bs-link-color: var(--azul);
    --bs-link-color-rgb: 20, 99, 227;
    --bs-link-hover-color: var(--azul-escuro);
    --bs-link-hover-color-rgb: 13, 73, 173;
    --bs-body-font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-bg: var(--aco);
    --bs-body-color: var(--tinta);
    --bs-border-color: var(--linha);
    --bs-border-radius: var(--raio-s);
    --bs-secondary-color: var(--grafite);
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--aco); color: var(--tinta); font-family: var(--bs-body-font-family); font-size: 1rem; line-height: 1.45; }
body.tem-abas { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4, h5, h6, .t-cond, .modal-title, .navbar-brand {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 700; letter-spacing: .005em; line-height: 1.1;
}
.t-cond { font-family: 'Barlow Condensed', sans-serif; }
.t-num  { font-family: 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; }
.s-money { font-variant-numeric: tabular-nums; }
.text-muted, .s-muted { color: var(--grafite) !important; }
a { text-underline-offset: 2px; }

/* Título de seção: frase normal, peso e tamanho fazem a hierarquia */
.s-sec, .s-title {
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--tinta);
    margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none;
}
.s-sec i { color: var(--azul); font-size: .95rem; width: 18px; text-align: center; }
.s-sec .s-sec-extra { margin-left: auto; font-family: 'Barlow', sans-serif; font-size: .95rem; font-weight: 600; color: var(--tinta); }
.s-sec:first-child { margin-top: 4px; }

/* ---------- Bootstrap no azul da marca ---------- */
.btn { font-weight: 600; border-radius: var(--raio-s); min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .45em; }
.btn-sm { min-height: 34px; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-primary {
    --bs-btn-bg: var(--azul); --bs-btn-border-color: var(--azul);
    --bs-btn-hover-bg: var(--azul-escuro); --bs-btn-hover-border-color: var(--azul-escuro);
    --bs-btn-active-bg: var(--azul-escuro); --bs-btn-active-border-color: var(--azul-escuro);
    --bs-btn-disabled-bg: var(--azul); --bs-btn-disabled-border-color: var(--azul);
}
.btn-outline-primary {
    --bs-btn-color: var(--azul); --bs-btn-border-color: var(--azul);
    --bs-btn-hover-bg: var(--azul); --bs-btn-hover-border-color: var(--azul); --bs-btn-active-bg: var(--azul-escuro);
}
.btn-dark {
    --bs-btn-bg: var(--asfalto); --bs-btn-border-color: var(--asfalto);
    --bs-btn-hover-bg: var(--asfalto-3); --bs-btn-hover-border-color: var(--asfalto-3);
    --bs-btn-active-bg: var(--asfalto-2);
}
.btn-success {
    --bs-btn-bg: var(--verde); --bs-btn-border-color: var(--verde);
    --bs-btn-hover-bg: #0f7236; --bs-btn-hover-border-color: #0f7236; --bs-btn-active-bg: #0d6430;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--linha); --bs-btn-hover-bg: var(--aco-2); --bs-btn-hover-border-color: var(--cromo); }
.btn-whats { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn-whats:hover, .btn-whats:focus { background: #178a48; border-color: #178a48; color: #fff; }

.form-control, .form-select { border-color: var(--linha); border-radius: var(--raio-s); min-height: 44px; background-color: #fff; }
.form-control-sm, .form-select-sm { min-height: 36px; }
.form-control-lg { min-height: 52px; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--azul); box-shadow: 0 0 0 .22rem rgba(20,99,227,.18); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--tinta); }
.form-text, .s-ajuda { font-size: .8rem; color: var(--grafite); }
.input-group-text { background: var(--aco); border-color: var(--linha); color: var(--grafite); }
.text-primary { color: var(--azul) !important; }
.bg-primary { background-color: var(--azul) !important; }
.border-primary { border-color: var(--azul) !important; }
.page-link { color: var(--azul); }
.page-item.active .page-link { background: var(--azul); border-color: var(--azul); }
.alert { border-radius: var(--raio); border: 0; }
.badge { font-weight: 600; }
.list-group { --bs-list-group-border-color: var(--linha); border-radius: var(--raio); }
.table { --bs-table-border-color: var(--linha); }
.modal-content { border: 0; border-radius: var(--raio-l); overflow: hidden; }

/* Foco visível para teclado */
:focus-visible { outline: 3px solid var(--faisca); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; box-shadow: 0 0 0 .25rem rgba(90,162,255,.55); }

/* ---------- Barra superior ---------- */
.s-nav {
    background: var(--asfalto); color: #fff; position: sticky; top: 0; z-index: 1030;
    border-bottom: 2px solid var(--azul);
    padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
}
.s-nav-inner { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; min-height: 44px; }
.s-nav a { color: #fff; text-decoration: none; }
.s-back { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
          background: var(--asfalto-2); flex-shrink: 0; color: #fff; border: 1px solid var(--asfalto-3); }
.s-back:hover { background: var(--asfalto-3); }
.s-nav-title { flex: 1; min-width: 0; line-height: 1.1; }
.s-nav-title strong { display: block; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.35rem;
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-nav-title small { color: var(--cromo); font-size: .82rem; display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.s-nav-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.s-chip { text-decoration: none !important; color: #fff !important; font-size: .88rem; font-weight: 600; background: var(--asfalto-2); border: 1px solid var(--asfalto-3);
          padding: 0 12px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.s-chip:hover { background: var(--asfalto-3); }
.s-nav-links { display: none; gap: 2px; margin-left: 12px; }
.s-nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--cromo); font-weight: 600; font-size: .95rem; }
.s-nav-links a:hover { color: #fff; background: var(--asfalto-2); }
.s-nav-links a.ativo { color: #fff; background: var(--asfalto-3); box-shadow: inset 0 -2px 0 var(--faisca); }
.s-nav-logo { height: 46px; width: auto; display: block; }

/* ---------- Abas inferiores (celular) ---------- */
.s-abas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--asfalto);
    border-top: 1px solid var(--asfalto-3); display: grid; grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
}
.s-abas a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 64px;
            color: var(--cromo); text-decoration: none; font-size: .74rem; font-weight: 600; position: relative; }
.s-abas a i { font-size: 1.2rem; }
.s-abas a.ativo { color: #fff; }
.s-abas a.ativo::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--faisca); }
.s-abas .s-abas-badge { position: absolute; top: 8px; left: calc(50% + 6px); background: var(--ambar); color: #fff; font-size: .62rem;
                        min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

@media (min-width: 900px) {
    .s-abas { display: none; }
    body.tem-abas { padding-bottom: 0; }
    .s-nav-links { display: flex; }
}

/* ---------- Placa Mercosul (elemento-assinatura) ---------- */
.placa {
    --pl-h: 26px;
    display: inline-flex; flex-direction: column; vertical-align: middle; background: #fff; color: var(--tinta);
    border: 1.5px solid var(--tinta); border-radius: 4px; overflow: hidden; line-height: 1; height: var(--pl-h);
    min-width: calc(var(--pl-h) * 3.3); text-align: center; box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.placa-faixa { background: #0b3fa8; color: #fff; font-size: calc(var(--pl-h) * .2); font-weight: 700; letter-spacing: .14em;
               height: 28%; display: flex; align-items: center; justify-content: center; font-family: 'Barlow', sans-serif; }
.placa-num { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 6px;
             font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: calc(var(--pl-h) * .58); letter-spacing: .08em; }
.placa.sem { border-style: dashed; color: var(--grafite); }
.placa.sem .placa-faixa { background: var(--cromo); }
.placa-g { --pl-h: 44px; }

/* Entrada rápida: o campo É a placa */
.placa-entrada { background: #fff; border: 3px solid var(--tinta); border-radius: 10px; overflow: hidden; max-width: 460px; margin: 0 auto;
                 box-shadow: var(--sombra-flutua); }
.placa-entrada .placa-faixa { height: 26px; font-size: .78rem; justify-content: space-between; padding: 0 12px; letter-spacing: .18em; }
.placa-entrada .linha { display: flex; align-items: stretch; }
.placa-entrada input { flex: 1; min-width: 0; border: 0; outline: 0; text-align: center; text-transform: uppercase; background: transparent;
                       font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: clamp(2.2rem, 11vw, 3.1rem);
                       letter-spacing: .1em; color: var(--tinta); padding: 4px 8px; height: 76px; }
.placa-entrada input::placeholder { color: #c4cad4; }
.placa-entrada button { border: 0; background: var(--azul); color: #fff; width: 76px; font-size: 1.4rem; }
.placa-entrada button:hover { background: var(--azul-escuro); }
.placa-entrada:focus-within { border-color: var(--azul); }

/* ---------- Superfícies ---------- */
.s-card { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); }
.s-pad { padding: 14px 16px; }
.s-accent-l { border-left: 4px solid var(--azul) !important; }
.s-wrap { max-width: 980px; margin: 0 auto; }
.s-wrap-sm { max-width: 640px; margin: 0 auto; }
.s-lista > * + * { border-top: 1px solid var(--linha); }

/* Linha de dado: rótulo pequeno + valor */
.s-dado small { display: block; font-size: .78rem; color: var(--grafite); }
.s-dado strong { font-weight: 600; }

/* ---------- Cabeçalho da tela inicial ---------- */
.s-hero { background: var(--asfalto); color: #fff; position: relative; overflow: hidden;
          padding: calc(10px + env(safe-area-inset-top)) 14px 0; }
.s-hero::before { /* brilho de solda atrás da logo */
    content: ""; position: absolute; left: 50%; top: 58px; width: 420px; height: 260px; transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(90,162,255,.38), rgba(20,99,227,.12) 55%, transparent 75%); pointer-events: none; }
.s-hero-top { display: flex; justify-content: space-between; align-items: center; max-width: 980px; margin: 0 auto; position: relative; }
.s-hero-top .ola { color: var(--cromo); font-size: .95rem; }
.s-hero-top .ola strong { color: #fff; }
.s-hero-logo { display: block; width: min(300px, 74vw); height: auto; margin: 4px auto 0; position: relative;
               filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)); }
.s-hero-placa { position: relative; margin: 6px auto 0; padding: 0 0 22px; max-width: 980px; }
.s-hero-placa p { text-align: center; color: var(--cromo); font-size: .88rem; margin: 10px 0 0; }

/* ---------- Atalhos ---------- */
.s-atalhos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.s-atalho { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); min-height: 74px; padding: 10px 8px;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
            text-decoration: none; color: var(--tinta); font-weight: 600; font-size: .92rem; text-align: center; }
.s-atalho i { font-size: 1.35rem; color: var(--azul); }
.s-atalho:hover { border-color: var(--azul); color: var(--azul-escuro); }

/* ---------- Avisos ---------- */
.s-aviso-linha { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--raio); text-decoration: none;
                 color: var(--tinta); border: 1px solid; margin-bottom: 8px; }
.s-aviso-linha i { font-size: 1.2rem; width: 22px; text-align: center; }
.s-aviso-linha .fa-chevron-right { margin-left: auto; font-size: .85rem; opacity: .6; }
.s-aviso-ambar { background: var(--ambar-claro); border-color: #f6d9a6; }
.s-aviso-ambar i { color: var(--ambar); }
.s-aviso-verm { background: #fdecec; border-color: #f5c2c2; }
.s-aviso-verm i { color: var(--vermelho); }

/* ---------- Cartão de OS ---------- */
.card-os { display: block; background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); text-decoration: none; color: var(--tinta);
           position: relative; padding: 12px 14px 12px 18px; overflow: hidden; }
.card-os::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cor-status, var(--cromo)); }
.card-os:hover { border-color: var(--cromo); color: var(--tinta); }
.card-os .topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-os .modelo { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.card-os .cliente { color: var(--grafite); font-size: .92rem; }
.card-os .base { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.card-os .base .valor { margin-left: auto; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.3rem; }
.card-os .meta { color: var(--grafite); font-size: .85rem; }

/* Etiqueta de status */
.s-status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 10px 3px 8px;
            border-radius: 999px; white-space: nowrap; background: var(--aco); color: var(--tinta); }
.s-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cor-status, var(--cromo)); }
.badge-status { font-size: .72rem; padding: 5px 10px; border-radius: 50px; }

/* ---------- Barra fixa inferior (OS) ---------- */
.sticky-bot { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--asfalto); color: #fff; z-index: 1020;
              padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(14,20,32,.25); }
.sticky-bot .inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.sticky-bot .total small { display: block; color: var(--cromo); font-size: .8rem; }
.sticky-bot .total strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.sticky-bot .acoes { margin-left: auto; display: flex; gap: 8px; }
.sticky-bot .btn { min-height: 50px; }
.sticky-bot .btn-ver { background: var(--asfalto-2); border: 1px solid var(--asfalto-3); color: #fff; width: 50px; }

/* ---------- Modais ---------- */
.modal-header.s-modal-head { background: var(--asfalto); color: #fff; border-bottom: 2px solid var(--azul); }
.modal-header.s-modal-head .btn-close { filter: invert(1) grayscale(1) brightness(2); }

/* ---------- Abas internas ---------- */
.s-tabs { display: flex; gap: 4px; background: var(--aco-2); padding: 4px; border-radius: 12px; overflow-x: auto; }
.s-tabs .nav-link { flex: 1; white-space: nowrap; border: 0; border-radius: 9px; color: var(--grafite); font-weight: 600; padding: 9px 12px; background: none; }
.s-tabs .nav-link.active { background: #fff; color: var(--tinta); box-shadow: 0 1px 2px rgba(14,20,32,.12); }

/* Página de aviso / erro */
.s-aviso { max-width: 460px; }

/* Recomendações (destaque âmbar usado em várias telas) */
.s-recom { background: var(--ambar-claro); border: 1px solid #f6d9a6; border-left: 4px solid #f59e0b; border-radius: var(--raio-s);
           padding: 10px 12px; white-space: pre-wrap; font-size: .92rem; }
.s-recom .t { display: block; font-weight: 700; color: var(--ambar); white-space: normal; margin-bottom: 2px; }

/* Vazio */
.s-vazio { text-align: center; padding: 34px 16px; color: var(--grafite); }
.s-vazio i { font-size: 2rem; color: var(--cromo); display: block; margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .s-nav, .s-abas, .no-print { display: none !important; } body { background: #fff !important; padding: 0 !important; } }
.min-w-0 { min-width: 0; }
.form-control::placeholder { color: #9aa4b2; opacity: 1; }
