/* BOAZ Oficina — folha de estilo única, sem etapa de build.
   Cores tiradas do logo: azul elétrico #057DFB sobre grafite #0F1016. */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f1016;
  --ink-2: #3f4655;
  --muted: #6f7787;
  --line: #e2e6ec;
  --line-2: #cfd5de;
  --brand: #057dfb;
  --brand-600: #0066d6;
  --brand-50: #e8f2ff;
  --dark: #0f1016;
  --dark-2: #191b25;
  --dark-3: #252836;
  --dark-ink: #c9cede;
  --ok: #12804a;
  --ok-50: #e5f5ec;
  --warn: #9a5b00;
  --warn-50: #fff3dc;
  --danger: #c22a2a;
  --danger-50: #fdebeb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 16, 22, .06), 0 1px 1px rgba(15, 16, 22, .04);
  --shadow-lg: 0 10px 30px rgba(15, 16, 22, .14);
  --sidebar: 244px;
  --topbar: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--dark);
  color: var(--dark-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__marca { display: block; padding: 18px 22px 14px; }
.sidebar__marca img { width: 150px; height: auto; display: block; }
.sidebar__sistema { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #7d8496; margin-top: 4px; }
.nav { padding: 6px 12px 16px; flex: 1; }
.nav__grupo { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #6c7385; padding: 16px 10px 6px; }
.nav__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--dark-ink); font-weight: 500; font-size: .93rem;
}
.nav__item:hover { background: var(--dark-2); color: #fff; text-decoration: none; }
.nav__item.ativo { background: var(--dark-3); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav__item svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav__item .em-breve { margin-left: auto; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: #6c7385; }
.sidebar__usuario { border-top: 1px solid var(--dark-3); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem;
}
.sidebar__usuario .nome { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.sidebar__usuario .perfil { font-size: .75rem; color: #8a91a3; }
.sidebar__usuario form { margin-left: auto; }
.btn-icone {
  background: none; border: 0; color: #8a91a3; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center;
}
.btn-icone:hover { color: #fff; background: var(--dark-2); }
.btn-icone svg { width: 18px; height: 18px; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
}
.topbar__marca { display: none; }
.busca-global { flex: 1; max-width: 560px; position: relative; }
.busca-global svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.busca-global input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  font: inherit; color: var(--ink);
}
.busca-global input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.topbar__acoes { margin-left: auto; display: flex; gap: 8px; }

.conteudo { padding: 26px 28px 48px; max-width: 1180px; width: 100%; }

.cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cabecalho__texto p { color: var(--muted); margin: 4px 0 0; }
.cabecalho__acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.trilha { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.trilha a { color: var(--muted); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card__cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card__corpo { padding: 20px; }
.card__corpo--sem-padding { padding: 0; }
.grade { display: grid; gap: 18px; }
.grade--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grade--lateral { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.indicador { padding: 18px 20px; }
.indicador__rotulo { font-size: .8rem; color: var(--muted); font-weight: 500; }
.indicador__valor { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.indicador__nota { font-size: .8rem; color: var(--muted); }

.dados { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.dados dt { color: var(--muted); font-size: .88rem; }
.dados dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 9px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn svg { width: 18px; height: 18px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-50), 0 0 0 1px var(--brand); }
.btn--primario { background: var(--brand); color: #fff; }
.btn--primario:hover { background: var(--brand-600); }
.btn--secundario { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--secundario:hover { background: var(--surface-2); border-color: #b8c0cc; }
.btn--fantasma { background: transparent; color: var(--ink-2); }
.btn--fantasma:hover { background: #eceff3; }
.btn--perigo { background: var(--danger); color: #fff; }
.btn--grande { height: 52px; padding: 0 22px; font-size: 1rem; border-radius: 11px; }
.btn--bloco { width: 100%; }
.btn--pequeno { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 7px; }

/* ---------- Formulários ---------- */
.form-grade { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.col-12 { grid-column: span 12; } .col-9 { grid-column: span 9; } .col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; } .col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.campo label, .rotulo { display: block; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.campo .opcional { font-weight: 400; color: var(--muted); }
.campo input[type=text], .campo input[type=email], .campo input[type=password], .campo input[type=tel],
.campo input[type=date], .campo input[type=datetime-local], .campo input[type=number], .campo input[type=file], .campo select, .campo textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  font: inherit; color: var(--ink);
}
.campo textarea { min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.campo.erro input, .campo.erro select, .campo.erro textarea { border-color: var(--danger); }
.campo .msg-erro { color: var(--danger); font-size: .82rem; margin-top: 5px; }
.campo .ajuda { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.secao-form { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; grid-column: span 12; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.secao-form:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.checagem { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.checagem input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form-acoes { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filtros .campo { min-width: 160px; }

/* ---------- Tabelas ---------- */
.tabela-wrap { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th { text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tabela td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: #fafbfd; }
.tabela .linha-link { color: var(--ink); font-weight: 600; }
.tabela td.acoes { text-align: right; white-space: nowrap; }
.tabela tr.inativo td { color: var(--muted); }

/* ---------- Selos e avisos ---------- */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo--ok { background: var(--ok-50); color: var(--ok); }
.selo--aviso { background: var(--warn-50); color: var(--warn); }
.selo--perigo { background: var(--danger-50); color: var(--danger); }
.selo--info { background: var(--brand-50); color: var(--brand-600); }
.selo--neutro { background: #eef0f4; color: var(--ink-2); }

.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; border: 1px solid; font-size: .93rem; }
.alerta svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alerta--sucesso { background: var(--ok-50); border-color: #b9e3cb; color: #0c5c35; }
.alerta--erro { background: var(--danger-50); border-color: #f3c3c3; color: #8f1d1d; }
.alerta--aviso { background: var(--warn-50); border-color: #f1d7a2; color: #6e4100; }
.alerta--info { background: var(--brand-50); border-color: #bcd9fb; color: #0a4a94; }
.alerta ul { margin: 6px 0 0; padding-left: 18px; }

.vazio { text-align: center; padding: 44px 20px; color: var(--muted); }
.vazio svg { width: 42px; height: 42px; color: var(--line-2); margin-bottom: 10px; }
.vazio h3 { color: var(--ink); margin-bottom: 4px; }

/* ---------- Listas em cartões (veículos etc.) ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista__icone { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; }
.lista__icone svg { width: 22px; height: 22px; }
.lista__texto { flex: 1; min-width: 0; }
.lista__titulo { font-weight: 600; }
.lista__sub { font-size: .85rem; color: var(--muted); }

/* ---------- Paginação ---------- */
.paginacao { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.paginacao__botoes { display: flex; gap: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login__marca { background: var(--dark); display: grid; place-items: center; padding: 40px; position: relative; overflow: hidden; }
.login__marca::after { content: ""; position: absolute; inset: auto -20% -40% -20%; height: 70%; background: radial-gradient(closest-side, rgba(5, 125, 251, .22), transparent); }
.login__marca img { width: min(380px, 80%); position: relative; z-index: 1; }
.login__marca p { color: #8a91a3; text-align: center; margin-top: 18px; position: relative; z-index: 1; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; }
.login__form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login__caixa { width: 100%; max-width: 380px; }
.login__caixa h1 { margin-bottom: 6px; }
.login__caixa .muted { margin-bottom: 24px; }
.login__caixa .campo { margin-bottom: 16px; }

/* ---------- Duplicidade ---------- */
.duplicados { list-style: none; margin: 8px 0 12px; padding: 0; }
.duplicados li { padding: 6px 0; border-bottom: 1px dashed #f1d7a2; }

/* Véu do menu no celular: fora do grid no desktop. */
.veu { display: none; }

/* ---------- Barra inferior (celular) ---------- */
.barra-inferior { display: none; }

/* ---------- Permissões ---------- */
.permissoes-grupo { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; }
.permissoes-grupo h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.permissoes-grupo .checagem { padding: 4px 0; }
.permissoes-grupo .checagem.do-perfil { color: var(--muted); }

/* ---------- Auditoria ---------- */
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.55; }
.diff .de { color: var(--danger); text-decoration: line-through; }
.diff .para { color: var(--ok); }
details.diff-detalhe summary { cursor: pointer; color: var(--brand-600); font-size: .85rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .grade--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade--lateral { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .menu-aberto .sidebar { transform: none; }
  .menu-aberto .veu { display: block; position: fixed; inset: 0; background: rgba(15, 16, 22, .45); z-index: 40; }
  .topbar { padding: 0 14px; }
  .topbar__marca { display: block; }
  .topbar__marca img { height: 30px; width: auto; display: block; }
  .topbar__acoes .rotulo-desktop { display: none; }
  .conteudo { padding: 18px 14px 96px; }
  .grade--2, .grade--3 { grid-template-columns: 1fr; }
  .form-grade > [class*="col-"] { grid-column: span 12; }
  .dados { grid-template-columns: 1fr; gap: 2px; }
  .dados dd { margin-bottom: 10px; }
  .login { grid-template-columns: 1fr; }
  .login__marca { padding: 36px 24px 28px; }
  .login__marca img { width: 220px; }
  .form-acoes { flex-direction: column-reverse; }
  .form-acoes .btn { width: 100%; height: 48px; }
  .cabecalho__acoes { width: 100%; }
  .cabecalho__acoes .btn { flex: 1; }

  /* Tabelas viram cartões empilhados */
  table.tabela--responsiva thead { display: none; }
  table.tabela--responsiva, .tabela--responsiva tbody, .tabela--responsiva tr, .tabela--responsiva td { display: block; width: 100%; }
  .tabela--responsiva tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tabela--responsiva td { border: 0; padding: 2px 0; }
  .tabela--responsiva td[data-rotulo]::before { content: attr(data-rotulo) ": "; color: var(--muted); font-size: .82rem; }
  .tabela--responsiva td.acoes { text-align: left; padding-top: 8px; }

  .barra-inferior {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--dark); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .barra-inferior a, .barra-inferior button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #8a91a3; font-size: .7rem; font-weight: 600; padding: 6px 2px; border-radius: 8px;
    background: none; border: 0; font-family: inherit; cursor: pointer; text-decoration: none;
  }
  .barra-inferior svg { width: 23px; height: 23px; }
  .barra-inferior .ativo { color: #fff; }
  .barra-inferior .ativo svg { color: var(--brand); }
}

@media print {
  .sidebar, .topbar, .barra-inferior, .cabecalho__acoes { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}

/* =========================================================
   Fase 2 — Ordens de serviço
   ========================================================= */

/* Painel da recepção */
.raia { margin-bottom: 18px; }
.raia__cabeca { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.raia__cabeca h2 { font-size: 1rem; }
.contador { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; background: #e7eaf0; color: var(--ink-2); font-size: .78rem; font-weight: 700; }
.contador--ativo { background: var(--brand); color: #fff; }
.os-linha { display: grid; grid-template-columns: 112px minmax(0, 1.4fr) minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.os-linha:last-child { border-bottom: 0; }
.os-linha:hover { background: #fafbfd; }
.os-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: .01em; }
.os-num a { color: inherit; }
.os-linha .sub { font-size: .82rem; color: var(--muted); }
.os-linha .acoes { text-align: right; }
.tempo { font-size: .82rem; color: var(--muted); }
.tempo--alerta { color: var(--warn); font-weight: 600; }

/* Ficha da OS */
.os-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.os-topo h1 { font-variant-numeric: tabular-nums; }
.barra-acoes { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; background: var(--brand-50); border: 1px solid #bcd9fb; border-radius: var(--radius); margin-bottom: 18px; align-items: center; }
.barra-acoes__texto { flex: 1; min-width: 200px; color: #0a4a94; font-size: .92rem; }
.barra-acoes__texto strong { display: block; color: var(--ink); }
.bloco-texto { white-space: pre-line; }

.linha-tempo { list-style: none; margin: 0; padding: 0; position: relative; }
.linha-tempo li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; }
.linha-tempo li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.linha-tempo li::after { content: ""; position: absolute; left: 8px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.linha-tempo li:last-child::after { display: none; }
.linha-tempo .quando { color: var(--muted); font-size: .78rem; }
.linha-tempo .motivo { color: var(--ink-2); font-style: italic; }

.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.fotos a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }

table.itens { width: 100%; border-collapse: collapse; font-size: .9rem; }
.itens th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.itens td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.itens .valor { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.itens tfoot td { font-weight: 700; border-bottom: 0; }

/* Edição de itens (diagnóstico e orçamento) */
.editor-itens { display: flex; flex-direction: column; gap: 10px; }
.item-linha { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px 130px 40px; gap: 8px; align-items: start; }
.item-linha select, .item-linha input { width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; background: #fff; }
.item-linha input:focus, .item-linha select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.item-linha .remover { height: 44px; width: 40px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--danger); cursor: pointer; font-size: 1.2rem; }
.item-cabeca { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.total-itens { text-align: right; font-size: 1.05rem; font-weight: 700; padding-top: 6px; font-variant-numeric: tabular-nums; }

/* Opções grandes (rádio em forma de botão) */
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcao { position: relative; }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-weight: 600; font-size: .93rem; cursor: pointer; user-select: none; }
.opcao input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand); }
.opcao input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-50), inset 0 0 0 1px var(--brand); }

/* Cartões de diagnóstico do mecânico */
.cartoes-os { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cartao-os { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.cartao-os:hover { border-color: var(--brand); text-decoration: none; }
.cartao-os__topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cartao-os__veiculo { font-weight: 650; }
.cartao-os__problema { font-size: .9rem; color: var(--ink-2); }
.cartao-os__rodape { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: auto; }
.prioridade-urgente { border-left: 4px solid var(--danger); }
.prioridade-alta { border-left: 4px solid var(--warn); }

/* Seleção de cliente na abertura */
.escolha-veiculo { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.escolha-veiculo .opcao span { width: 100%; min-height: 64px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 10px 14px; }
.escolha-veiculo .opcao small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.garantia-lista { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
.garantia-lista label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.garantia-lista label:last-child { border-bottom: 0; }
.garantia-lista input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }

dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(15, 16, 22, .5); }
.modal__cabeca { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal__corpo { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal .form-acoes { border-radius: 0 0 14px 14px; }

@media (max-width: 860px) {
  .os-linha { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .os-linha > :nth-child(3), .os-linha > :nth-child(4) { grid-column: 1; }
  .os-linha .acoes { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .item-linha { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
  .item-linha > .descricao { grid-column: 1 / -1; order: -1; }
  .item-linha .remover { width: 100%; grid-column: 1 / -1; }
  .item-cabeca { display: none; }
  .barra-acoes .btn { flex: 1 1 100%; height: 48px; }
}
