/* =========================================================
   pointrepair.app — sistema de design
   Estilo: Minimalismo / Swiss (ui-ux-pro-max), modo claro
   ========================================================= */
/* Letra guardada no projeto (Plus Jakarta Sans, variável 400–800, licença SIL OFL) — funciona sem internet */
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Bandeiras dos países: tipo de letra só com as bandeiras (o Windows não as mostra sem isto). Twemoji, © Twitter/X, licença CC-BY 4.0 */
@font-face {
  font-family: "Twemoji Country Flags"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
}

:root {
  color-scheme: dark;

  /* Neutros (fundo preto) */
  --bg: #050708;
  --surface: #0a0f11;
  --panel-2: #121a1c;
  --ink: #f5f7f6;
  --ink-2: #d5dcda;
  --muted: #8e9a97;
  --border: #1a2528;
  --border-strong: #2a393c;

  /* Marca: --brand para fundos (botões), --teal para texto e realces */
  --brand: #19e6a6;
  --brand-hover: #5af0c1;
  --teal: #19e6a6;
  --teal-hover: #5af0c1;
  --teal-soft: rgba(25, 230, 166, .10);
  --teal-ring: rgba(25, 230, 166, .35);
  --primaria: var(--brand);
  --linha: var(--border);

  /* Estados */
  --amber-bg: rgba(245, 158, 11, .16);
  --amber-border: rgba(245, 158, 11, .45);
  --amber-ink: #fcd34d;
  --sky-ink: #7dd3fc;
  --sky-bg: rgba(56, 189, 248, .16);
  --emerald-ink: #6ee7b7;
  --emerald-bg: rgba(52, 211, 153, .16);
  --rose-ink: #fca5a5;
  --rose-bg: rgba(248, 113, 113, .16);
  --violet-ink: #c4b5fd;
  --violet-bg: rgba(167, 139, 250, .18);
  --zinc-ink: #a1a1aa;
  --zinc-bg: #27272a;

  /* Escalas */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .7);
  --t-fast: 150ms ease-out;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"], input[type="date"], label.file-label { cursor: pointer; }
button { touch-action: manipulation; }

/* Foco visível e consistente para teclado */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--r-sm); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page { display: flex; align-items: flex-start; flex: 1; }

/* ---------- Barra superior ---------- */
:root { --topbar-h: 52px; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-user { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); min-width: 0; }
.topbar-user .ico { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.topbar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-data { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar-sair {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-md);
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.topbar-sair:hover { background: var(--rose-bg); border-color: var(--rose-ink); color: var(--rose-ink); }

/* ---------- Barra lateral ---------- */
.sidebar {
  width: 248px; flex-shrink: 0; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: var(--topbar-h);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-icon {
  width: 36px; height: 36px; border-radius: var(--r-md); background: var(--brand); color: #04150f;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand h1 { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.25; letter-spacing: .04em; text-transform: uppercase; }
.brand p { font-size: 12px; margin: 0; color: var(--muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; border: none; background: transparent; text-align: left;
  min-height: 40px; padding: 8px 10px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); transition: color var(--t-fast); }
.nav-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-item:hover .ico { color: var(--ink-2); }
.nav-item.active { background: var(--teal-soft); color: var(--teal); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
.nav-item.active .ico { color: var(--teal); }
.badge {
  background: #b45309; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: var(--r-sm); padding: 3px 7px; margin-left: auto; font-variant-numeric: tabular-nums;
}

.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 19px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-sub:empty { display: none; }
#sidebar-lojas-faturacao-container:not(.aberto) { display: none; }
.nav-subitem {
  display: block; border: none; background: transparent; text-align: left; min-height: 34px; padding: 6px 10px;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--muted);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-subitem:hover { background: var(--panel-2); color: var(--ink); }
.nav-subitem.active { background: var(--panel-2); color: var(--teal); font-weight: 600; }

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Conteúdo ---------- */
.conteudo { flex: 1; min-width: 0; padding: 28px 32px 64px; max-width: 1280px; margin: 0 auto; }
.page-estreita { max-width: 780px; margin: 0 auto; }

.tela-login {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 50% 0%, var(--teal-soft), var(--bg) 60%);
}
.login-card { width: 100%; max-width: 360px; padding: 28px; box-shadow: var(--shadow-lg); gap: 16px; }
.login-card .brand { flex-direction: column; text-align: center; gap: 12px; margin-bottom: 8px; }
.login-card .brand-icon { width: 48px; height: 48px; border-radius: var(--r-lg); }
.login-card .brand-icon svg { width: 26px; height: 26px; }
.login-card .brand h1 { font-size: 18px; }
.login-card .btn-primary { margin-top: 4px; }

.alert {
  background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber-ink);
  font-size: 13px; border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 14px;
}
.alert code { background: var(--panel-2); border-radius: 4px; padding: 1px 5px; font-family: var(--font-mono); }

/* ---------- Cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 20px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px;
}
.card-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title-row .card-title { margin: 0; }

.row { display: grid; gap: 14px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.box { border: 1px solid var(--border); background: var(--bg); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.box.row { display: grid; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea,
.chip-add input, .chip-add select,
.filtros select, .lista-geral-acoes select, .input-pesquisa-os, .user-loja,
.linha-nova-fat input, .linha-nova-fat select {
  font-size: 14px; font-weight: 400; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 12px; min-height: 40px;
  background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:hover, .field select:hover, .field textarea:hover,
.chip-add input:hover, .chip-add select:hover,
.filtros select:hover, .lista-geral-acoes select:hover, .input-pesquisa-os:hover { border-color: #71717a; }
.field input:focus, .field select:focus, .field textarea:focus,
.chip-add input:focus, .chip-add select:focus,
.filtros select:focus, .lista-geral-acoes select:focus, .input-pesquisa-os:focus, .user-loja:focus,
.linha-nova-fat input:focus, .linha-nova-fat select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-ring);
}
.field input::placeholder, .field textarea::placeholder, .input-pesquisa-os::placeholder { color: #71717a; }
.field textarea { min-height: 72px; line-height: 1.45; }

.field small { font-weight: 400; font-size: 12px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input-com-botao { display: flex; gap: 8px; }
.input-com-botao input { flex: 1; min-width: 0; }
.btn-icone {
  flex-shrink: 0; width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--teal); border-radius: var(--r-md);
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.btn-icone:hover { background: var(--teal-soft); border-color: var(--teal); }
.btn-icone .ico { width: 18px; height: 18px; }
.btn-icone:disabled { opacity: .6; cursor: progress; }
.btn-icone.a-carregar .ico { animation: rodar 900ms linear infinite; }
@keyframes rodar { to { transform: rotate(360deg); } }

.acoes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 1000px; }
.acao-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 22px; color: var(--ink);
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.acao-card:hover { border-color: var(--teal); background: var(--panel-2); box-shadow: var(--shadow-md); }
.acao-card:active { transform: scale(.99); }
.acao-icone {
  width: 44px; height: 44px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.acao-icone .ico { width: 22px; height: 22px; }
.acao-titulo { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.acao-texto { font-size: 13px; color: var(--muted); line-height: 1.45; }

.acao-card.ativo { border-color: var(--teal); background: var(--panel-2); }

/* Painel de pesquisa: abre e fecha com animação de altura */
.painel-pesquisa {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; max-width: 1000px;
  transition: grid-template-rows 280ms ease, opacity 220ms ease, margin-top 280ms ease, visibility 0s linear 280ms;
}
.painel-pesquisa.aberto {
  grid-template-rows: 1fr; opacity: 1; visibility: visible; margin-top: 16px;
  transition: grid-template-rows 280ms ease, opacity 220ms ease 40ms, margin-top 280ms ease, visibility 0s;
}
.painel-pesquisa-clip { overflow: hidden; min-height: 0; }
.painel-pesquisa-card { margin-bottom: 0; }

.resultado-cliente {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg);
  margin-top: 8px;
}
.resultado-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resultado-nome { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.resultado-meta { color: var(--muted); font-size: 12px; }
.resultado-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resultado-aviso { color: var(--rose-ink); font-size: 13px; font-weight: 600; }
.btn-sec, .btn-perigo, .btn-amarelo {
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-md); font-size: 13px; font-weight: 600;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-sec { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); }
.btn-sec:hover { background: var(--panel-2); color: var(--ink); }
.btn-perigo { border: 1px solid var(--rose-ink); background: transparent; color: var(--rose-ink); }
.btn-perigo:hover { background: var(--rose-bg); }
.btn-amarelo { border: 1px solid var(--amber-ink); background: var(--amber-bg); color: var(--amber-ink); }
.btn-amarelo:hover { background: var(--amber-ink); color: #000; }

.field-compacto { max-width: 180px; }
.cliente-cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cliente-cabecalho-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cliente-id {
  font-size: 56px; font-weight: 800; line-height: .9; letter-spacing: -.03em; color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.field-inline { display: flex; flex-direction: column; justify-content: flex-end; }

.btn-toggle {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px;
  min-height: 40px; padding: 8px 12px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-toggle:hover { background: var(--panel-2); }
.btn-toggle.ativo { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-ink); }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.checkbox-line input, .linha-check { width: 16px; height: 16px; accent-color: var(--teal); }

.notas-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.label-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.link-btn {
  border: none; background: none; color: var(--teal); font-weight: 600; font-size: 13px;
  padding: 6px 8px; margin: -6px -8px; border-radius: var(--r-sm);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.link-btn:hover { background: var(--teal-soft); color: var(--teal-hover); }
.link-btn.danger { color: var(--rose-ink); }
.link-btn.danger:hover { background: var(--rose-bg); }
.link-btn.green { color: var(--emerald-ink); }
.link-btn.green:hover { background: var(--emerald-bg); }

.nota-linha { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.nota-linha textarea { flex: 1; resize: vertical; }
.btn-remover-nota, .chip-remover {
  border: none; background: none; color: var(--muted); font-weight: 700; border-radius: var(--r-sm);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.btn-remover-nota { padding: 8px 10px; min-height: 40px; }
.btn-remover-nota:hover, .chip-remover:hover { background: var(--rose-bg); color: var(--rose-ink); }

.file-label {
  display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--border-strong); background: var(--surface);
  min-height: 40px; padding: 8px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 10px; transition: background-color var(--t-fast), border-color var(--t-fast);
}
.file-label:hover { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }

.foto-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.foto-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }

/* ---------- Botões ---------- */
.btn-primary, .btn-add {
  background: var(--brand); color: #04150f; border: none; border-radius: var(--r-md); font-weight: 700;
  box-shadow: var(--shadow-sm); transition: background-color var(--t-fast), transform var(--t-fast);
}
.btn-primary { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.btn-add { min-height: 40px; padding: 8px 16px; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover, .btn-add:hover { background: var(--brand-hover); }
.btn-primary:active, .btn-add:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.secao-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 4px 10px; }
.vazio { color: var(--muted); font-size: 14px; padding: 24px 12px; text-align: center; }
.muted { color: var(--muted); font-weight: 400; }
.mono { font-family: var(--font-mono); font-size: .95em; }

/* ---------- Tickets ---------- */
.ticket {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 14px; margin-bottom: 8px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ticket:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.ticket-foto img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }
.ticket-body { flex: 1; min-width: 0; }
.ticket-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-peca { font-weight: 600; font-size: 15px; }
.ticket-qtd { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticket-urgente {
  font-size: 11px; font-weight: 700; color: var(--amber-ink); background: var(--amber-bg);
  border: 1px solid var(--amber-border); border-radius: var(--r-sm); padding: 1px 8px; text-transform: uppercase; letter-spacing: .03em;
}
.ticket-meta { display: flex; gap: 12px; margin-top: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ticket-linha { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--ink-2); }
.ticket-linha.muted { border-top: none; padding-top: 0; margin-top: 4px; color: var(--muted); }
.ticket-link { margin-top: 4px; font-size: 13px; }
.ticket-link a { color: var(--teal); overflow-wrap: anywhere; }
.ticket-notas { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ticket-notas li { background: var(--panel-2); border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.ticket-fornecedor { margin-top: 4px; font-size: 12px; color: var(--muted); }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.estado {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; border-radius: var(--r-sm); padding: 3px 10px; white-space: nowrap; line-height: 1.4;
}
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.estado-cor-branco { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.estado-cor-amarelo { background: var(--amber-bg); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-border); }
.estado-cor-azul { background: var(--sky-bg); color: var(--sky-ink); }
.estado-cor-verde { background: var(--emerald-bg); color: var(--emerald-ink); }
.estado-cor-vermelho { background: var(--rose-bg); color: var(--rose-ink); }
.estado-cor-roxo { background: var(--violet-bg); color: var(--violet-ink); }
.estado-cor-cinzento { background: var(--zinc-bg); color: var(--zinc-ink); box-shadow: inset 0 0 0 1px var(--border); }

.filtros { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Grupos ---------- */
.grupo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; }
.grupo-header {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  background: var(--panel-2); border-bottom: 1px solid var(--border); gap: 8px; flex-wrap: wrap;
}
.grupo-toggle { border: none; background: none; font-weight: 600; font-size: 14px; color: var(--ink); padding: 4px 0; }
.grupo-marcar { white-space: nowrap; }
.grupo-itens { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.grupo-itens .ticket { margin-bottom: 0; box-shadow: none; }

.ticket-edit {
  background: var(--surface); border: 1px solid var(--teal); border-radius: var(--r-lg);
  box-shadow: 0 0 0 3px var(--teal-ring); padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px;
}
.ticket-edit-actions { display: flex; justify-content: flex-end; gap: 16px; align-items: center; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 4px 4px 12px; font-size: 13px; color: var(--ink-2);
}
.chip-remover { padding: 4px 8px; line-height: 1; border-radius: var(--r-sm); }
.chip-add { display: flex; gap: 8px; }
.chip-add input, .chip-add select { flex: 1; }
.chip-add button { white-space: nowrap; }

.lista-estados { display: flex; flex-direction: column; }
.estado-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.estado-linha:last-child { border-bottom: none; }
.estado-linha-acoes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.user-reset-form { margin: 4px 0 10px; }

.badge-role { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-radius: var(--r-sm); padding: 2px 8px; margin-left: 6px; }
.badge-role-admin { background: var(--violet-bg); color: var(--violet-ink); }
.badge-role-funcionario { background: var(--zinc-bg); color: var(--zinc-ink); }

/* ---------- Listas / tabelas ---------- */
.lista-geral-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lista-geral-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#form-pesquisa-os { display: contents; }
.pesquisa-os-label { font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.input-pesquisa-os { width: 200px; }
.lista-geral-linhas {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow-x: auto; margin-bottom: 20px;
}

.tabela-encomendas { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tabela-encomendas thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--panel-2); color: var(--muted); text-align: left; padding: 10px 14px; white-space: nowrap;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.tabela-encomendas tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--ink-2); }
.tabela-encomendas tbody tr:last-child td { border-bottom: none; }
.tabela-encomendas tbody tr { transition: background-color var(--t-fast); }
.tabela-encomendas tbody tr:hover { background: var(--teal-soft); }

.linha-nova-fat, .linha-nova-fat:hover { background: var(--bg) !important; }
.linha-nova-fat td { padding: 8px 10px; }
.linha-nova-fat input, .linha-nova-fat select { width: 100%; font-size: 13px; padding: 6px 8px; min-height: 36px; }
.linha-nova-acoes { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

.dia-badge {
  display: inline-block; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; border-radius: var(--r-sm); padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cel-funcionario { white-space: nowrap; }
.cel-funcionario .avatar { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.urgente-slot { display: inline-block; width: 18px; text-align: center; }

.avatar { width: 26px; height: 26px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: #000; font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .page { flex-direction: column; align-items: stretch; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: var(--topbar-h); z-index: 10; flex-direction: row; align-items: center;
    gap: 16px; padding: 10px 16px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidebar .brand p { display: none; }
  .sidebar-nav { flex-direction: row; flex: none; }
  .nav-sub { display: none; }
  .nav-item { white-space: nowrap; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--teal); }
  .sidebar-footer { flex-direction: row; align-items: center; margin-left: auto; }
  .topbar { padding: 0 16px; }
  .conteudo { padding: 20px 16px 64px; width: 100%; margin: 0; }
}

@media (max-width: 560px) {
  .topbar-data { font-size: 12px; }
  .topbar-data { display: none; }
  .topbar-sair { margin-left: auto; }
  .row-3, .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .input-pesquisa-os { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---- Clientes: seletor de pesquisa, lista e ficha ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.seg-btn { border: none; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: var(--r-sm); transition: background-color var(--t-fast), color var(--t-fast); }
.seg-btn:hover { color: var(--ink); }
.seg-btn.ativo { background: var(--teal-soft); color: var(--teal); }
.th-ordenar { border: none; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; padding: 0; cursor: pointer; white-space: nowrap; }
.th-ordenar:hover { color: var(--ink); }
.linha-clicavel { cursor: pointer; }
.linha-clicavel:hover td, .linha-clicavel:focus-visible td { background: var(--panel-2); }
.paginacao { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.btn-sec:disabled { opacity: .45; cursor: not-allowed; }
.ficha-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; margin: 18px 0 4px; }
.ficha-dados dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ficha-dados dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.link-btn.amarelo { color: var(--amber-ink); }
.link-btn.amarelo:hover { background: var(--amber-bg); color: var(--amber-ink); }

/* ---- Abas de loja no topo das Ordens ---- */
.subabas { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.subaba {
  border: none; background: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 10px 18px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.subaba:hover { color: var(--ink); }
.subaba.ativa { color: var(--teal); border-bottom-color: var(--teal); }
.acao-card:disabled { opacity: .5; cursor: not-allowed; }
.acao-card:disabled:hover { border-color: var(--border); background: var(--surface); box-shadow: none; }

/* Ordens: ao abrir o formulário, os cartões encolhem para barras */
.acoes-grid.compacto .acao-card { flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; border-radius: var(--r-md); }
.acoes-grid.compacto .acao-icone { width: 30px; height: 30px; margin-bottom: 0; }
.acoes-grid.compacto .acao-icone .ico { width: 16px; height: 16px; }
.acoes-grid.compacto .acao-texto { display: none; }
.ordem-form-inline { margin: 0; }

/* =========================================================
   Tema "noite verde": preto esverdeado, verde menta, letra
   Plus Jakarta Sans, botões em pílula e cartões bem arredondados
   ========================================================= */
body {
  background:
    radial-gradient(ellipse 60% 45% at 10% -8%, rgba(25, 230, 166, .13), transparent 70%),
    radial-gradient(ellipse 45% 40% at 100% 105%, rgba(25, 230, 166, .07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .card-title { letter-spacing: -.02em; }
.card-title { font-weight: 800; font-size: 17px; }
.brand h1 { font-weight: 800; letter-spacing: .06em; }
.card, .acao-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 60%), var(--surface);
}
.secao-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 10px var(--teal); vertical-align: 1px;
}
.btn-sec, .btn-perigo, .btn-amarelo, .topbar-sair, .seg, .seg-btn { border-radius: var(--r-md); }
.btn-primary, .btn-add { box-shadow: 0 6px 20px -6px rgba(25, 230, 166, .55); }
.btn-primary:hover, .btn-add:hover { box-shadow: 0 8px 26px -6px rgba(25, 230, 166, .7); }
.nav-item { border-radius: 14px; }
.nav-item.active { box-shadow: none; background: var(--teal-soft); }
.subaba.ativa { text-shadow: 0 0 18px rgba(25, 230, 166, .45); }
.acao-icone { border-radius: 14px; }
.slot-largo { max-width: none; }

/* ---- Página Início ---- */
.inicio-titulo { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 8px 0 28px; max-width: 900px; }
.inicio-destaque { color: var(--teal); }
.inicio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; max-width: 1000px; }
.inicio-card { margin: 0; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.inicio-rotulo { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.inicio-hora { font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.inicio-data { font-size: 16px; color: var(--ink-2); }
.meteo-principal { display: flex; align-items: center; gap: 18px; }
.meteo-icone { width: 64px; height: 64px; color: var(--teal); flex-shrink: 0; filter: drop-shadow(0 0 14px rgba(25, 230, 166, .35)); }
.meteo-temp { font-size: clamp(40px, 6vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.meteo-unidade { font-size: .45em; font-weight: 700; color: var(--muted); margin-left: 2px; }
.meteo-texto { font-size: 16px; color: var(--ink-2); margin-top: 4px; }
.meteo-detalhes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 18px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.meteo-detalhes dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.meteo-detalhes dd { margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Troca de página: a página nova entra a subir e a ganhar opacidade ---- */
@keyframes pagina-entra {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.conteudo > section { animation: pagina-entra 340ms cubic-bezier(.2, .8, .2, 1) backwards; }

/* ---- Login → Início: o cartão sai e o esqueleto da aplicação entra ---- */
.login-card { transition: opacity 220ms ease, transform 220ms ease; }
.login-card.a-sair { opacity: 0; transform: translateY(-10px) scale(.96); pointer-events: none; }
.login-progresso { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; display: none; }
.login-card.a-entrar .login-progresso { display: block; }
.login-progresso span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.login-card.a-entrar .login-progresso span { animation: login-carregar 1s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes login-carregar { from { width: 0; } to { width: 100%; } }
.login-card.a-entrar .brand-icon { animation: login-pulsar 1s ease-in-out infinite; }
@keyframes login-pulsar { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 230, 166, .5); } 50% { transform: scale(1.08); box-shadow: 0 0 22px 4px rgba(25, 230, 166, .4); } }
.login-card.a-entrar .btn-primary:disabled { opacity: .85; cursor: progress; }

.carregamento { position: fixed; inset: 0; z-index: 1000; display: none; background: var(--bg); overflow: hidden; }
.a-carregar-app .carregamento { display: block; }
.carregamento.a-sair { opacity: 0; transition: opacity 300ms ease; pointer-events: none; }
.carr-bloco {
  display: block; border-radius: 12px;
  background: linear-gradient(100deg, var(--panel-2) 30%, #1c2a2d 50%, var(--panel-2) 70%) 0 0 / 220% 100%;
  animation: carr-brilho 1.4s linear infinite;
}
@keyframes carr-brilho { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.carr-topo { position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.carr-topo .carr-bloco:first-child { width: 110px; height: 14px; }
.carr-topo .carr-bloco:last-child { width: 220px; height: 14px; }
.carr-lateral { position: absolute; top: var(--topbar-h); bottom: 0; left: 0; width: 248px; padding: 20px 12px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px; }
.carr-marca { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.carr-icone { width: 36px; height: 36px; flex-shrink: 0; }
.carr-nome { height: 14px; width: 120px; }
.carr-itens { display: flex; flex-direction: column; gap: 10px; }
.carr-itens .carr-bloco { height: 30px; border-radius: 14px; margin: 0 4px; }
.carr-itens .carr-bloco:nth-child(odd) { width: 78%; }
.carr-principal { position: absolute; top: var(--topbar-h); left: 248px; right: 0; bottom: 0; padding: 28px 32px; max-width: 1280px; }
.carr-titulo { height: 48px; width: min(560px, 80%); margin: 8px 0 28px; }
.carr-cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 1000px; }
.carr-cartoes .carr-bloco { height: 190px; border-radius: 20px; }

/* Entrada animada (só antes do recarregamento): lateral e topo deslizam, o resto aparece */
.carregamento.entra .carr-lateral { animation: carr-lateral-entra 340ms cubic-bezier(.2, .8, .2, 1) backwards; }
.carregamento.entra .carr-topo { animation: carr-topo-entra 340ms cubic-bezier(.2, .8, .2, 1) 40ms backwards; }
.carregamento.entra .carr-principal { animation: carr-fade 350ms ease 140ms backwards; }
.carregamento.entra .carr-itens .carr-bloco { animation: carr-item-entra 280ms cubic-bezier(.2, .8, .2, 1) backwards, carr-brilho 1.4s linear infinite; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(1) { animation-delay: 155ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(2) { animation-delay: 190ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(3) { animation-delay: 225ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(4) { animation-delay: 260ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(5) { animation-delay: 295ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(6) { animation-delay: 330ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(7) { animation-delay: 365ms, 0s; }
.carregamento.entra .carr-itens .carr-bloco:nth-child(8) { animation-delay: 400ms, 0s; }
@keyframes carr-lateral-entra { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes carr-topo-entra { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes carr-item-entra { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes carr-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 860px) {
  .carr-lateral { display: none; }
  .carr-principal { left: 0; padding: 20px 16px; }
}

/* =========================================================
   Estilo "Vidro" (glassmorphism): fundo colorido desfocado, painéis
   translúcidos com contorno de luz. Liga-se pelo botão "Estilo" no topo.
   ========================================================= */
html[data-tema="vidro"] {
  --bg: #050a0b;
  --surface: rgba(255, 255, 255, .065);
  --panel-2: rgba(255, 255, 255, .105);
  --ink: #f5f7f6;
  --ink-2: #d9e2df;
  --muted: #93a29e;
  --border: rgba(255, 255, 255, .13);
  --border-strong: rgba(255, 255, 255, .24);
  --brand: #19e6a6;
  --brand-hover: #5af0c1;
  --teal: #19e6a6;
  --teal-hover: #5af0c1;
  --teal-soft: rgba(25, 230, 166, .14);
  --teal-ring: rgba(25, 230, 166, .4);
  --r-lg: 22px;
  --shadow-sm: 0 4px 18px rgba(0, 10, 8, .35);
  --shadow-md: 0 10px 34px rgba(0, 10, 8, .45);
  --shadow-lg: 0 24px 60px rgba(0, 10, 8, .6);
  --vidro-desfoque: blur(22px) saturate(170%);
  --vidro-luz: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
html[data-tema="vidro"] body {
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(25, 230, 166, .38), transparent 70%),
    radial-gradient(50% 45% at 92% 18%, rgba(20, 150, 140, .38), transparent 70%),
    radial-gradient(55% 50% at 70% 100%, rgba(25, 200, 140, .26), transparent 70%),
    linear-gradient(160deg, #08161a 0%, #050a0b 55%, #07161a 100%);
  background-attachment: fixed;
}
/* painéis de vidro */
html[data-tema="vidro"] .topbar,
html[data-tema="vidro"] .sidebar,
html[data-tema="vidro"] .card,
html[data-tema="vidro"] .acao-card,
html[data-tema="vidro"] .login-card,
html[data-tema="vidro"] .box,
html[data-tema="vidro"] .resultado-cliente,
html[data-tema="vidro"] .seg,
html[data-tema="vidro"] .ticket {
  background-color: var(--surface);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 55%);
  -webkit-backdrop-filter: var(--vidro-desfoque);
  backdrop-filter: var(--vidro-desfoque);
  box-shadow: var(--vidro-luz), var(--shadow-sm);
}
html[data-tema="vidro"] .topbar,
html[data-tema="vidro"] .sidebar { background-image: none; box-shadow: none; background-color: rgba(255, 255, 255, .05); }
html[data-tema="vidro"] .box,
html[data-tema="vidro"] .resultado-cliente { box-shadow: none; background-color: rgba(255, 255, 255, .045); }
html[data-tema="vidro"] .acao-card:hover { border-color: rgba(25, 230, 166, .6); background-color: var(--panel-2); box-shadow: var(--vidro-luz), 0 0 0 1px rgba(25, 230, 166, .25), var(--shadow-md); }
html[data-tema="vidro"] .acao-card.ativo { border-color: rgba(25, 230, 166, .65); background-color: var(--panel-2); }
/* campos */
html[data-tema="vidro"] .field input, html[data-tema="vidro"] .field select, html[data-tema="vidro"] .field textarea,
html[data-tema="vidro"] .chip-add input, html[data-tema="vidro"] .chip-add select,
html[data-tema="vidro"] .filtros select, html[data-tema="vidro"] .lista-geral-acoes select,
html[data-tema="vidro"] .input-pesquisa-os, html[data-tema="vidro"] .user-loja {
  background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18);
}
html[data-tema="vidro"] .field input:hover, html[data-tema="vidro"] .field select:hover, html[data-tema="vidro"] .field textarea:hover { border-color: rgba(255, 255, 255, .34); }
html[data-tema="vidro"] .field input::placeholder, html[data-tema="vidro"] .field textarea::placeholder { color: #6f8581; }
html[data-tema="vidro"] option { background: #0d1e22; color: var(--ink); }
/* botões */
html[data-tema="vidro"] .btn-primary, html[data-tema="vidro"] .btn-add, html[data-tema="vidro"] .brand-icon {
  background: linear-gradient(135deg, #3df2b8, #12c98f); color: #04150f; border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 24px -6px rgba(25, 230, 166, .6);
}
html[data-tema="vidro"] .btn-primary:hover, html[data-tema="vidro"] .btn-add:hover { background: linear-gradient(135deg, #6ff5c8, #19e6a6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 30px -6px rgba(25, 230, 166, .8); }
html[data-tema="vidro"] .btn-sec, html[data-tema="vidro"] .topbar-sair { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }
html[data-tema="vidro"] .btn-sec:hover, html[data-tema="vidro"] .topbar-sair:hover { background: rgba(255, 255, 255, .16); }
html[data-tema="vidro"] .topbar-sair:hover { color: var(--ink); border-color: rgba(255, 255, 255, .4); }
html[data-tema="vidro"] #btn-logout:hover { background: var(--rose-bg); border-color: var(--rose-ink); color: var(--rose-ink); }
/* menu lateral */
html[data-tema="vidro"] .nav-item.active { background: linear-gradient(135deg, rgba(25, 230, 166, .26), rgba(25, 230, 166, .08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); color: var(--teal); }
html[data-tema="vidro"] .nav-item.active .ico { color: var(--teal); }
html[data-tema="vidro"] .nav-item:hover { background: rgba(255, 255, 255, .09); }
html[data-tema="vidro"] .secao-title::before, html[data-tema="vidro"] .subaba.ativa { text-shadow: none; }
html[data-tema="vidro"] .secao-title::before { background: var(--teal); box-shadow: 0 0 12px var(--teal); }
html[data-tema="vidro"] .subaba.ativa { text-shadow: 0 0 18px rgba(25, 230, 166, .5); }
html[data-tema="vidro"] .inicio-destaque { color: var(--teal); }
html[data-tema="vidro"] .meteo-icone { filter: drop-shadow(0 0 14px rgba(25, 230, 166, .45)); }
html[data-tema="vidro"] .login-progresso span { background: linear-gradient(90deg, #12c98f, #6ff5c8); box-shadow: 0 0 14px var(--teal); }
/* tabelas */
html[data-tema="vidro"] .tabela-encomendas { background: transparent; }
html[data-tema="vidro"] .tabela-encomendas th { background: rgba(255, 255, 255, .08); }
html[data-tema="vidro"] .lista-geral-linhas { background: var(--surface); -webkit-backdrop-filter: var(--vidro-desfoque); backdrop-filter: var(--vidro-desfoque); box-shadow: var(--vidro-luz); }
/* esqueleto de carregamento */
html[data-tema="vidro"] .carr-lateral, html[data-tema="vidro"] .carr-topo { background: rgba(255, 255, 255, .05); }
html[data-tema="vidro"] .carr-bloco { background: linear-gradient(100deg, rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .07) 70%) 0 0 / 220% 100%; }
html[data-tema="vidro"] .carregamento { background: linear-gradient(160deg, #08161a, #050a0b); }

/* ---- Menu lateral recolhível: só os ícones ---- */
.topbar-menu {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border-strong); background: transparent; color: var(--ink-2); border-radius: var(--r-md);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.topbar-menu:hover { background: var(--panel-2); color: var(--ink); }
.topbar-menu .ico { width: 18px; height: 18px; }
html[data-tema="vidro"] .topbar-menu { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }
html[data-tema="vidro"] .topbar-menu:hover { background: rgba(255, 255, 255, .16); }

@media (min-width: 861px) {
  .sidebar { transition: width 280ms cubic-bezier(.2, .8, .2, 1), padding 280ms cubic-bezier(.2, .8, .2, 1); overflow-x: hidden; }
  .sidebar .nav-item { position: relative; }
  .sidebar .nav-item > span:not(.badge), .sidebar .brand > div:not(.brand-icon) {
    white-space: nowrap; overflow: hidden; max-width: 220px;
    transition: max-width 280ms cubic-bezier(.2, .8, .2, 1), opacity 160ms ease;
  }
  .sidebar .nav-item, .sidebar .brand { transition: gap 280ms cubic-bezier(.2, .8, .2, 1), padding 280ms cubic-bezier(.2, .8, .2, 1); }

  html.menu-recolhido .sidebar { width: 76px; }
  html.menu-recolhido .sidebar .nav-item > span:not(.badge),
  html.menu-recolhido .sidebar .brand > div:not(.brand-icon) { max-width: 0; opacity: 0; }
  html.menu-recolhido .sidebar .nav-item { gap: 0; padding-left: 0; padding-right: 0; justify-content: center; }
  html.menu-recolhido .sidebar .brand { gap: 0; padding: 0; justify-content: center; }
  html.menu-recolhido .sidebar .nav-sub { display: none; }
  /* o aviso de pendentes passa a um pontinho em cima do ícone */
  html.menu-recolhido .sidebar .badge {
    position: absolute; top: 6px; right: calc(50% - 16px); width: 10px; height: 10px; min-width: 0; padding: 0; margin: 0;
    font-size: 0; border: 2px solid var(--bg);
  }
}
@media (max-width: 860px) {
  .topbar-menu { display: none; }
}

/* ---- Mudar de utilizador (contas das lojas) ---- */
.topbar-user-troca { cursor: pointer; padding: 6px 10px; margin: 0 -10px; border-radius: var(--r-md); transition: background-color var(--t-fast); }
.topbar-user-troca:hover, .topbar-user-troca:focus-visible { background: var(--panel-2); }
.topbar-user-troca .topbar-seta { width: 14px; height: 14px; }
.modal-fundo {
  position: fixed; inset: 0; z-index: 900; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-caixa { width: 100%; max-width: 380px; margin: 0; box-shadow: var(--shadow-lg); animation: pagina-entra 240ms cubic-bezier(.2, .8, .2, 1) backwards; }
.troca-opcoes { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.troca-opcao { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); font-weight: 600; cursor: pointer; }
.troca-opcao input { accent-color: var(--teal); }
.troca-opcao:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }

/* Contactos do cliente: principal, secundário e (empresas) nome de contacto lado a lado */
.row-contactos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* Contacto preferencial: caixas de seleção com ícone */
.pref-contacto { border: none; margin: 0; padding: 0; min-width: 0; }
.pref-contacto legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.pref-opcoes { display: flex; flex-wrap: wrap; gap: 10px; }
.pref-opcao {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 40px; cursor: pointer; user-select: none;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  font-size: 14px; font-weight: 400; color: var(--ink);
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
html[data-tema="vidro"] .pref-opcao { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
.pref-opcao:hover { border-color: #71717a; }
html[data-tema="vidro"] .pref-opcao:hover { border-color: rgba(255, 255, 255, .34); }
.pref-opcao input { width: 16px; height: 16px; accent-color: var(--teal); margin: 0; }
.pref-opcao .ico { width: 17px; height: 17px; color: var(--muted); transition: color var(--t-fast); }
.pref-opcao:has(input:checked), html[data-tema="vidro"] .pref-opcao:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.pref-opcao:has(input:checked) .ico { color: var(--teal); }
.pref-opcao:has(input:focus-visible) { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-ring); }

/* ---- Indicativo do país junto ao contacto ---- */
.row-contactos { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.telefone-grupo { display: flex; align-items: stretch; }
.telefone-grupo input[type="text"] { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.pais-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 40px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md) 0 0 var(--r-md); background: var(--surface); color: var(--ink);
  font-size: 14px; position: relative; z-index: 1;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.pais-btn:hover, .pais-btn[aria-expanded="true"] { border-color: var(--teal); }
.pais-bandeira { font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 18px; line-height: 1; }
.pais-codigo { font-variant-numeric: tabular-nums; }
.pais-seta { width: 14px; height: 14px; color: var(--muted); }
html[data-tema="vidro"] .pais-btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
.pais-popover {
  position: fixed; z-index: 950; width: 300px; max-width: calc(100vw - 24px); display: none; flex-direction: column; gap: 8px; padding: 10px;
  background: #0f1819; border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
html[data-tema="vidro"] .pais-popover { background: rgba(14, 24, 26, .88); -webkit-backdrop-filter: var(--vidro-desfoque); backdrop-filter: var(--vidro-desfoque); }
.pais-popover.aberto { display: flex; animation: pagina-entra 160ms ease backwards; }
.pais-popover input { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: rgba(255, 255, 255, .06); color: var(--ink); font-size: 14px; }
.pais-popover input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-ring); }
.pais-lista { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pais-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.pais-item:hover, .pais-item.destaque { background: var(--panel-2); }
.pais-item[aria-selected="true"] { background: var(--teal-soft); color: var(--teal); }
.pais-item .pais-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pais-item .pais-cod { color: var(--muted); font-variant-numeric: tabular-nums; }
.pais-vazio { padding: 10px; color: var(--muted); font-size: 13px; }

/* Aviso de cliente já existente (aparece enquanto se escreve o NIF ou o contacto) */
.aviso-duplicado {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--amber-border); border-radius: var(--r-md); background: var(--amber-bg);
  color: var(--amber-ink); font-size: 13px;
}
.aviso-duplicado button { border: none; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }
.aviso-duplicado.aviso-erro { border-color: var(--rose-ink); background: var(--rose-bg); color: var(--rose-ink); }
.aviso-duplicado.aviso-nota { border-color: var(--border-strong); background: rgba(255, 255, 255, .05); color: var(--ink-2); }

/* Lista de clientes: filtros e botões em cada linha */
.lista-filtros { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lista-filtros .input-pesquisa-os { flex: 1; min-width: 220px; width: auto; }
.lista-filtros .seg { margin-bottom: 0; }
.btn-mini { min-height: 30px !important; padding: 3px 10px !important; font-size: 12px !important; }
.cel-acoes-cliente { white-space: nowrap; text-align: right; }
.cel-acoes-cliente > * + * { margin-left: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#cl-tabela td:nth-child(2) { min-width: 150px; }
#cl-tabela td:nth-child(4) { min-width: 170px; }

/* Número de ordens de cada cliente e janela com a lista */
.contagem-ordens {
  min-width: 34px; height: 28px; padding: 0 10px; border-radius: var(--r-sm); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--teal); background: var(--teal-soft); color: var(--teal);
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.contagem-ordens:hover { background: var(--teal); color: #04150f; }
.contagem-ordens:active { transform: scale(.95); }
.modal-larga { max-width: 520px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.moc-lista { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; margin-top: 4px; }
.moc-item {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; text-align: left; padding: 12px 14px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
html[data-tema="vidro"] .moc-item { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }
.moc-item:hover, .moc-item:focus-visible { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.moc-numero { font-weight: 700; font-variant-numeric: tabular-nums; }
.moc-equip { font-weight: 500; }
.moc-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.por-pagina { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.por-pagina select { min-height: 34px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 13px; }
html[data-tema="vidro"] .por-pagina select { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }

/* ---- Início: resumo de hoje ---- */
.inicio-resumo { max-width: 1000px; margin-bottom: 16px; }
.inicio-resumo-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.inicio-resumo-topo .inicio-rotulo { margin: 0; }
.resumo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.resumo-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
html[data-tema="vidro"] .resumo-tile {
  background-color: var(--surface); background-image: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 55%);
  -webkit-backdrop-filter: var(--vidro-desfoque); backdrop-filter: var(--vidro-desfoque); box-shadow: var(--vidro-luz), var(--shadow-sm);
}
.resumo-tile .acao-icone { margin-bottom: 8px; }
.resumo-valor { font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.resumo-rotulo { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.resumo-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Minhas Notas, agrupadas por loja */
.inicio-notas { max-width: 1000px; margin-top: 28px; }
.inicio-notas .inicio-rotulo { margin: 0 0 10px; }
.notas-grid { display: flex; flex-direction: column; gap: 22px; }
.notas-loja-nome { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.notas-grupo { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.chip .func-loja { margin: 0 4px; min-height: 26px; padding: 0 6px; font-size: 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); }
html[data-tema="vidro"] .chip .func-loja { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }

/* Minhas Notas: cartão pequeno com o nome, botão e lista de notas */
.nota-coluna { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nota-cabecalho {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
html[data-tema="vidro"] .nota-cabecalho {
  background-color: var(--surface); background-image: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 55%);
  -webkit-backdrop-filter: var(--vidro-desfoque); backdrop-filter: var(--vidro-desfoque); box-shadow: var(--vidro-luz), var(--shadow-sm);
}
.nota-cabecalho h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nota-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-soft); color: var(--teal); font-weight: 800; font-size: 16px;
}
.nota-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nota-item {
  padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: var(--r-md); background: var(--surface);
}
.nota-item.nova { animation: pagina-entra 260ms ease backwards; }
html[data-tema="vidro"] .nota-item { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); border-left-color: var(--teal); }
.nota-texto-lido { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.nota-item-rodape { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.nota-item-acoes { display: inline-flex; align-items: center; gap: 6px; }
.nota-item-acoes .link-btn { font-size: 12px; padding: 2px 6px; margin: 0; }
.nota-vazia { padding: 4px 4px; font-size: 13px; }
#nota-texto-novo { width: 100%; min-height: 160px; resize: vertical; }

/* Notas: estado de cada nota e histórico */
.nota-cabecalho h4 { flex: 1; min-width: 0; }
.nota-icone {
  position: relative; flex-shrink: 0; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: transparent; color: var(--ink-2);
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.nota-icone:hover { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.nota-icone .ico { width: 18px; height: 18px; }
.nota-historico-n {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--teal); color: #04150f; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.nota-item-topo { margin-bottom: 8px; }
.nota-estado-sel {
  min-height: 26px; padding: 0 26px 0 10px; border-radius: var(--r-sm); border: 1px solid; font-size: 12px; font-weight: 700; cursor: pointer;
  background-color: transparent; appearance: none; -webkit-appearance: none; text-transform: uppercase; letter-spacing: .03em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.nota-estado-sel[data-estado="pendente"] { color: var(--amber-ink); border-color: var(--amber-border); background-color: var(--amber-bg); }
.nota-estado-sel[data-estado="em_resolucao"] { color: var(--sky-ink); border-color: rgba(125, 211, 252, .5); background-color: var(--sky-bg); }
.nota-estado-sel[data-estado="resolvido"] { color: var(--emerald-ink); border-color: rgba(110, 231, 183, .5); background-color: var(--emerald-bg); }
.nota-estado-sel option { background: #0f1819; color: var(--ink); text-transform: none; }
.nota-estados { border: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nota-estados legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); float: none; }
.nota-estado-opcao { cursor: pointer; }
.nota-estado-opcao input { position: absolute; opacity: 0; pointer-events: none; }
.nota-estado-opcao span {
  display: inline-block; padding: 6px 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.nota-estado-opcao:hover span { border-color: #71717a; }
.nota-estado-opcao[data-estado="pendente"] input:checked + span { color: var(--amber-ink); border-color: var(--amber-border); background: var(--amber-bg); }
.nota-estado-opcao[data-estado="em_resolucao"] input:checked + span { color: var(--sky-ink); border-color: rgba(125, 211, 252, .5); background: var(--sky-bg); }
.nota-estado-opcao[data-estado="resolvido"] input:checked + span { color: var(--emerald-ink); border-color: rgba(110, 231, 183, .5); background: var(--emerald-bg); }
.nota-estado-opcao input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.hist-item { padding: 12px 14px; border: 1px solid var(--border-strong); border-left: 3px solid var(--emerald-ink); border-radius: var(--r-md); background: var(--surface); }
html[data-tema="vidro"] .hist-item { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); border-left-color: var(--emerald-ink); }

/* Transferir notas */
.nota-transferir {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--teal); transition: background-color var(--t-fast);
}
.nota-transferir:hover { background: var(--teal-soft); }
.nota-transferir .ico { width: 16px; height: 16px; }
.nota-transferida { margin-top: 6px; font-size: 12px; color: var(--sky-ink); }
.transf-nota { padding: 10px 12px; border-left: 3px solid var(--teal); border-radius: var(--r-sm); background: rgba(255, 255, 255, .05); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.transf-loja { padding: 0; margin: 6px 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#hist-abas { margin: 6px 0 4px; align-self: flex-start; }
.hist-transf { border-left-color: var(--sky-ink); }
html[data-tema="vidro"] .hist-transf { border-left-color: var(--sky-ink); }
.hist-transf-titulo { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--sky-ink); }

/* O botão de adicionar nota é um ícone ao lado do histórico, no cartão do nome */
.nota-cabecalho { gap: 8px; }
.nota-cabecalho .nota-avatar { margin-right: 4px; }
.nota-cabecalho .nota-adicionar { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.nota-cabecalho .nota-adicionar:hover { background: var(--teal); color: #04150f; }

/* Cadeado de cada cartão */
.nota-cadeado { width: auto; min-width: 36px; padding: 0 8px; gap: 6px; border-radius: var(--r-md); }
.nota-cadeado.aberto { border-color: var(--emerald-ink); color: var(--emerald-ink); background: var(--emerald-bg); }
.nota-cadeado.aberto:hover { background: var(--emerald-ink); color: #04150f; border-color: var(--emerald-ink); }
.nota-temporizador { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nota-coluna.bloqueado .nota-item-acoes, .nota-coluna.bloqueado .nota-estado-sel { opacity: .6; }
.cad-campos { display: flex; flex-direction: column; gap: 12px; }
.cad-campos:empty { display: none; }
#cad-acoes { flex-wrap: wrap; }
.cad-link { font-size: 12px; }

/* Registo de ações nas notas */
.hist-reg { border-left-color: var(--border-strong); }
.hist-reg-criada { border-left-color: var(--teal); }
.hist-reg-editada { border-left-color: var(--amber-ink); }
.hist-reg-estado { border-left-color: var(--sky-ink); }
.hist-reg-eliminada { border-left-color: var(--rose-ink); }
.hist-reg-transferida { border-left-color: var(--violet-ink); }
html[data-tema="vidro"] .hist-reg-criada { border-left-color: var(--teal); }
html[data-tema="vidro"] .hist-reg-editada { border-left-color: var(--amber-ink); }
html[data-tema="vidro"] .hist-reg-estado { border-left-color: var(--sky-ink); }
html[data-tema="vidro"] .hist-reg-eliminada { border-left-color: var(--rose-ink); }
html[data-tema="vidro"] .hist-reg-transferida { border-left-color: var(--violet-ink); }
.hist-reg-titulo { margin-bottom: 4px; font-size: 13px; font-weight: 700; }
.hist-reg-criada .hist-reg-titulo { color: var(--teal); }
.hist-reg-editada .hist-reg-titulo { color: var(--amber-ink); }
.hist-reg-estado .hist-reg-titulo { color: var(--sky-ink); }
.hist-reg-eliminada .hist-reg-titulo { color: var(--rose-ink); }
.hist-reg-transferida .hist-reg-titulo { color: var(--violet-ink); }
.nota-texto-lido.riscado { text-decoration: line-through; color: var(--muted); }
.reg-antes { margin-bottom: 4px; color: var(--muted); }

/* Cores das categorias das notas: Pendente amarelo, Em resolução laranja, Resolvido verde */
:root {
  --nota-pendente: #facc15; --nota-pendente-bg: rgba(250, 204, 21, .16); --nota-pendente-borda: rgba(250, 204, 21, .55);
  --nota-andamento: #fb923c; --nota-andamento-bg: rgba(251, 146, 60, .18); --nota-andamento-borda: rgba(251, 146, 60, .55);
  --nota-resolvido: #4ade80; --nota-resolvido-bg: rgba(74, 222, 128, .16); --nota-resolvido-borda: rgba(74, 222, 128, .55);
}
.nota-estado-sel[data-estado="pendente"] { color: var(--nota-pendente); border-color: var(--nota-pendente-borda); background-color: var(--nota-pendente-bg); }
.nota-estado-sel[data-estado="em_resolucao"] { color: var(--nota-andamento); border-color: var(--nota-andamento-borda); background-color: var(--nota-andamento-bg); }
.nota-estado-sel[data-estado="resolvido"] { color: var(--nota-resolvido); border-color: var(--nota-resolvido-borda); background-color: var(--nota-resolvido-bg); }
.nota-estado-opcao[data-estado="pendente"] input:checked + span { color: var(--nota-pendente); border-color: var(--nota-pendente-borda); background: var(--nota-pendente-bg); }
.nota-estado-opcao[data-estado="em_resolucao"] input:checked + span { color: var(--nota-andamento); border-color: var(--nota-andamento-borda); background: var(--nota-andamento-bg); }
.nota-estado-opcao[data-estado="resolvido"] input:checked + span { color: var(--nota-resolvido); border-color: var(--nota-resolvido-borda); background: var(--nota-resolvido-bg); }
/* a barra à esquerda de cada nota também mostra a categoria */
.nota-item[data-estado="pendente"], html[data-tema="vidro"] .nota-item[data-estado="pendente"] { border-left-color: var(--nota-pendente); }
.nota-item[data-estado="em_resolucao"], html[data-tema="vidro"] .nota-item[data-estado="em_resolucao"] { border-left-color: var(--nota-andamento); }
.nota-item[data-estado="resolvido"], html[data-tema="vidro"] .nota-item[data-estado="resolvido"] { border-left-color: var(--nota-resolvido); }
.hist-item:not(.hist-reg), html[data-tema="vidro"] .hist-item:not(.hist-reg) { border-left-color: var(--nota-resolvido); }
.cor-pendente { color: var(--nota-pendente); }
.cor-em_resolucao { color: var(--nota-andamento); }
.cor-resolvido { color: var(--nota-resolvido); }
.hist-reg-estado .hist-reg-titulo { color: var(--ink-2); }

/* Filtros do registo de notas */
.hist-filtros { align-self: flex-start; flex-wrap: wrap; margin: 0 0 4px; border-radius: var(--r-lg); }
.hist-filtros .seg-btn { padding: 5px 12px; font-size: 12px; }
.hist-filtros .seg-btn.vazio-filtro { opacity: .45; }

/* Início: cartões da hora e da meteorologia mais pequenos; os detalhes do tempo ficam ao lado da temperatura */
.inicio-cards { grid-template-columns: minmax(230px, 1fr) minmax(340px, 1.9fr); gap: 14px; align-items: stretch; }
.inicio-card { padding: 16px 22px 18px; gap: 6px; }
.inicio-hora { font-size: clamp(34px, 4.4vw, 48px); }
.inicio-data { font-size: 14px; }
#meteo-corpo { display: flex; align-items: center; justify-content: space-between; gap: 12px 26px; flex-wrap: wrap; }
.meteo-principal { gap: 14px; }
.meteo-icone { width: 54px; height: 54px; }
.meteo-temp { font-size: clamp(36px, 4.6vw, 48px); }
.meteo-texto { font-size: 14px; margin-top: 2px; }
.meteo-detalhes {
  grid-template-columns: repeat(2, minmax(86px, auto)); gap: 8px 26px; margin: 0; padding: 0 0 0 24px; border-top: none; border-left: 1px solid var(--border);
}
.meteo-detalhes dt { font-size: 11px; }
.meteo-detalhes dd { font-size: 14px; }
@media (max-width: 760px) {
  .inicio-cards { grid-template-columns: 1fr; }
  .meteo-detalhes { padding-left: 0; border-left: none; padding-top: 12px; border-top: 1px solid var(--border); width: 100%; }
}

/* Início: três cartões em linha (hora, meteorologia, localização), todos com ícone */
.inicio-cards { grid-template-columns: minmax(262px, 1fr) minmax(480px, 1.9fr) minmax(250px, 1fr); }
.inicio-linha { display: flex; align-items: center; gap: 14px; }
.inicio-icone { width: 54px; height: 54px; flex-shrink: 0; color: var(--teal); filter: drop-shadow(0 0 14px rgba(25, 230, 166, .35)); }
html[data-tema="vidro"] .inicio-icone { filter: drop-shadow(0 0 14px rgba(25, 230, 166, .45)); }
.inicio-linha .inicio-hora { font-size: clamp(28px, 2.9vw, 36px); white-space: nowrap; }
.local-nome { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.local-morada { margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.local-mapa { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--teal); text-decoration: none; }
.local-mapa:hover { text-decoration: underline; }
@media (max-width: 1290px) {
  .inicio-cards { grid-template-columns: minmax(262px, 1fr) minmax(400px, 1.7fr); }
  #card-local { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .inicio-cards { grid-template-columns: 1fr; }
}
.inicio-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.local-mapa { margin-top: 0; white-space: nowrap; }
.local-nome { font-size: 19px; }
.inicio-cards, .inicio-resumo, .inicio-notas { max-width: 1100px; }
.meteo-detalhes { gap: 8px 20px; padding-left: 20px; }
.meteo-principal { gap: 12px; }
@media (max-width: 1290px) {
  .inicio-cards { grid-template-columns: minmax(262px, 1fr) minmax(400px, 1.7fr); }
}

/* Localização por loja */
.local-linha + .local-linha { margin-top: 8px; }
.local-icone { width: 32px; height: 32px; flex-shrink: 0; color: var(--teal); }
.local-linha .local-nome { font-size: 16px; }
.local-linha .local-mapa { margin-left: 8px; font-size: 11px; }
.local-linha .local-morada { margin-top: 1px; }

/* Número de notas pendentes junto ao nome */
.nota-nome-bloco { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nota-nome-bloco h4 { flex: none; }
.nota-pendentes { font-size: 11px; font-weight: 700; color: var(--nota-pendente); line-height: 1.2; }
.local-linha .local-texto { flex: 1; min-width: 0; }
.local-linha .local-nome { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.local-linha .local-mapa { margin-left: 0; }
.local-linha .local-morada { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.local-linha .local-nome { font-size: 14px; white-space: nowrap; }
.local-linha .local-mapa { font-size: 11px; }
.local-icone { width: 28px; height: 28px; }

/* Data do cartão da hora: letra mais pequena para caber numa só linha */
.inicio-linha .inicio-data { font-size: 12px; white-space: nowrap; }
.inicio-cards { grid-template-columns: minmax(304px, 1fr) minmax(480px, 1.8fr) minmax(250px, 1fr); }
#card-relogio .inicio-icone { width: 46px; height: 46px; }
@media (max-width: 1290px) {
  .inicio-cards { grid-template-columns: minmax(304px, 1fr) minmax(380px, 1.5fr); }
}
@media (max-width: 760px) {
  .inicio-cards { grid-template-columns: 1fr; }
}

/* Ícones dos cartões da hora, do tempo e da localização: mesmo tamanho e à mesma altura */
.inicio-card > .inicio-rotulo, .inicio-card > .inicio-topo { display: flex; align-items: center; height: 18px; line-height: 18px; }
.inicio-card > .inicio-linha, .inicio-card > #meteo-corpo, .inicio-card > #local-corpo > .inicio-linha:only-child { min-height: 88px; }
.inicio-icone, .meteo-icone, #card-relogio .inicio-icone { width: 52px; height: 52px; }
.inicio-card > .inicio-linha, #meteo-corpo { align-items: center; }

/* Ordens: campo do cliente com o mesmo estilo dos outros campos */
.campo-lido {
  flex: 1; min-width: 0; display: flex; align-items: center; min-height: 40px; padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); font-size: 14px; color: var(--ink);
}
html[data-tema="vidro"] .campo-lido { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
.ord-cliente-opcoes {
  max-height: 220px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
}
html[data-tema="vidro"] .ord-cliente-opcoes { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }
.linha-cliente-opcao { padding: 9px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border); }
.linha-cliente-opcao:last-child { border-bottom: none; }
.linha-cliente-opcao:hover, .linha-cliente-opcao:focus-visible { background: var(--teal-soft); outline: none; }

/* Janela para escolher o cliente de uma ordem */
.campo-clicavel { cursor: pointer; }
.ec-resultados { display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 420px); overflow-y: auto; }
.ec-resultados .resultado-cliente { margin-top: 0; width: 100%; text-align: left; color: var(--ink); cursor: pointer; flex-wrap: nowrap; transition: border-color var(--t-fast), background-color var(--t-fast); }
.ec-resultados .resultado-cliente:hover, .ec-resultados .resultado-cliente:focus-visible { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.ec-escolher { flex-shrink: 0; pointer-events: none; }

/* Ordem de serviço: número e loja no canto superior direito */
.ordem-numero { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ordem-id { font-size: 44px; }
.ordem-loja { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); text-align: right; }
@media (max-width: 560px) { .ordem-id { font-size: 32px; } }

/* Ordens: o formulário ocupa a mesma largura dos cartões Nova ordem / Procurar ordem / Lista de Ordens */
#ordem-form-slot .ordem-form-inline { max-width: none; }

/* Ordem: o botão "Marcar urgente" fica por baixo do nome da loja, com a mesma largura */
.ordem-loja-bloco { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: fit-content; }
.ordem-loja-bloco .ordem-loja { text-align: center; }
.ordem-loja-bloco .btn-toggle { width: 100%; min-height: 30px; padding: 4px 12px; font-size: 12px; white-space: nowrap; border-radius: var(--r-md); }

/* Botão urgente da ordem: os dois textos partilham o mesmo espaço, para o botão (e o nome da loja) não mudarem de largura */
#btn-urgente-ordem { display: grid; }
#btn-urgente-ordem span { grid-area: 1 / 1; text-align: center; }
#btn-urgente-ordem .urg-on, #btn-urgente-ordem.ativo .urg-off { visibility: hidden; }
#btn-urgente-ordem.ativo .urg-on { visibility: visible; }

/* Ordem: notas de contacto */
.nota-contacto-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nota-contacto-topo > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
#ord-notas-contacto { margin-top: 2px; }

/* Título "Notas de contacto" e botão juntos, alinhados ao centro da linha */
.nota-contacto-topo { justify-content: flex-start; align-items: center; gap: 12px; }
.nota-contacto-topo > span { line-height: 1; }
.nota-contacto-topo .btn-mini { display: inline-flex; align-items: center; }

/* O botão de adicionar nota de contacto faz parte da fila "Preferência de Contacto" */
.pref-adicionar { font-family: inherit; color: var(--teal); border-style: dashed; border-color: var(--teal); background: transparent; }
.pref-adicionar:hover { background: var(--teal-soft); border-color: var(--teal); }
html[data-tema="vidro"] .pref-adicionar { background: transparent; border-color: var(--teal); }
.pref-contacto + .nota-lista:empty { display: none; }

/* Ordem: o botão de anexar foto fica por baixo da peritagem, no estilo dos botões do projeto */
.btn-com-icone { display: inline-flex; align-items: center; gap: 8px; }
.btn-com-icone .ico { width: 16px; height: 16px; }
.peritagem-fotos { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 4px; }
.peritagem-fotos #ord-fotos-wrap { display: flex; flex-wrap: wrap; gap: 10px; }

/* Ordem: painel de desbloqueio do equipamento */
.desbloqueio {
  flex: 1; min-width: 230px; display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface);
}
html[data-tema="vidro"] .desbloqueio { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.desbloqueio-topo { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.desbloqueio-topo .ico { width: 18px; height: 18px; color: var(--teal); }
.desbloqueio-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
html[data-tema="vidro"] .desbloqueio-seg { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
.desbloqueio-seg label { cursor: pointer; }
.desbloqueio-seg input { position: absolute; opacity: 0; pointer-events: none; }
.desbloqueio-seg span { display: block; text-align: center; padding: 7px 8px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--muted); transition: background-color var(--t-fast), color var(--t-fast); }
.desbloqueio-seg label:hover span { color: var(--ink); }
.desbloqueio-seg input:checked + span { background: var(--teal-soft); color: var(--teal); }
.desbloqueio-seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.desbloqueio-valor { display: flex; flex-direction: column; gap: 8px; }
.input-com-icone { position: relative; display: flex; }
.input-com-icone .ico { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.input-com-icone input { width: 100%; padding-left: 36px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.desbloqueio-dica { margin: 0; font-size: 12px; color: var(--muted); }
.padrao-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.padrao-svg {
  width: 168px; height: 168px; touch-action: none; cursor: pointer; border-radius: 18px;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .04);
}
.padrao-ponto { fill: rgba(255, 255, 255, .14); stroke: var(--border-strong); stroke-width: 1.5; transition: r 120ms ease, fill 120ms ease; }
.padrao-ponto.ativo { fill: var(--teal); stroke: var(--teal); filter: drop-shadow(0 0 6px rgba(25, 230, 166, .55)); }
.padrao-linha { stroke: var(--teal); stroke-width: 3.5; stroke-linecap: round; opacity: .8; }
.padrao-numero { font-size: 10px; font-weight: 800; fill: #04150f; pointer-events: none; }
.padrao-seq { min-height: 18px; font-size: 12px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.padrao-area .btn-mini:disabled { opacity: .45; cursor: not-allowed; }

/* Acessórios deixados pelo cliente */
.peritagem-acessorios { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
html[data-tema="vidro"] .peritagem-acessorios { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-sm); font: inherit; font-size: 13px; color: var(--text); background: rgba(25, 230, 166, 0.1); border: 1px solid rgba(25, 230, 166, 0.35); }
.ac-chip.ac-sug { cursor: pointer; background: transparent; border-color: var(--border, rgba(255,255,255,0.16)); color: var(--muted, inherit); }
.ac-chip.ac-sug:hover { border-color: var(--teal); }
.ac-chip.ac-sug.ativo { background: rgba(25, 230, 166, 0.14); border-color: var(--teal); color: var(--text); }
.ac-remover { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 12px; opacity: 0.7; }
.ac-remover:hover { opacity: 1; }
.ac-novo { display: flex; gap: 8px; margin: 14px 0; }
.ac-novo input { flex: 1; }
.ac-lista { min-height: 34px; margin-bottom: 14px; }

/* Botões de ícone nas linhas das listas (editar, imprimir) */
.acoes-linha { display: inline-flex; gap: 6px; }
.icone-acao { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.icone-acao .ico { width: 16px; height: 16px; }
.icone-acao:hover { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.icone-acao.linha-editar-ordem:hover { border-color: var(--amber-border); background: var(--amber-bg); color: var(--amber-ink); }

/* Tradução da avaria e da peritagem */
.traducao { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 4px; margin-bottom: 4px; }
.icone-acao:disabled { cursor: progress; opacity: .7; }
.icone-acao.a-trabalhar .ico { animation: icone-pulsar 1s ease-in-out infinite; }
@keyframes icone-pulsar { 50% { opacity: .35; } }

/* Ficha técnica da ordem */
.modal-ficha { max-width: 920px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; gap: 12px; }
.ft-corpo { display: flex; flex-direction: column; gap: 14px; }
.ficha-painel { max-width: 1120px; display: flex; flex-direction: column; gap: 14px; }
.ficha-painel > .card-title-row { padding: 0 4px; }
.ft-resumo { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.ft-resumo > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ft-resumo .rot { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ft-resumo b { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.ft-grelha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ft-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
html[data-tema="vidro"] .ft-card, html[data-tema="vidro"] .ft-resumo { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.ft-titulo { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.ft-titulo .ico { width: 16px; height: 16px; color: var(--teal); }
.ft-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-linhas { display: flex; flex-direction: column; gap: 8px; }
.ft-linha { display: grid; gap: 8px; align-items: center; }
.ft-teste { grid-template-columns: minmax(110px, 1fr) 130px 2fr 32px; }
.ft-teste-nome { font-weight: 600; font-size: 13px; }
.ft-peca { grid-template-columns: 3fr 80px 110px 32px; }
.ft-subtotal { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.ft-res-ok { color: var(--emerald-ink); }
.ft-res-falha { color: var(--rose-ink); }
.ft-totais { display: flex; align-items: flex-end; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.ft-totais .field { max-width: 160px; margin: 0; }
.ft-totais-v { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.ft-totais-v span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.ft-total b { font-size: 18px; color: var(--teal); }
.ft-historico { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.filtro-estado { margin-left: auto; margin-right: 12px; min-height: 32px; padding: 4px 10px; font-size: 13px; width: auto; }
.form-ordem-extras { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .ft-resumo, .ft-grelha-2 { grid-template-columns: 1fr; } .ft-teste, .ft-peca { grid-template-columns: 1fr 1fr; } }
.ft-resumo .ft-avaria { white-space: pre-line; }

/* Logotipo na página de login e no menu lateral */
.brand-logo { display: block; width: 100%; max-width: 168px; height: auto; }
.brand-simbolo { display: none; width: 40px; height: 40px; flex-shrink: 0; }
.brand > div > p { margin-top: 4px; }
.login-card .brand { gap: 6px; }
.login-card .brand-logo { max-width: 220px; margin: 0 auto; }
.login-card.a-entrar .brand-logo { animation: login-pulsar-logo 1s ease-in-out infinite; }
@keyframes login-pulsar-logo { 50% { opacity: .55; } }
@media (min-width: 861px) {
  .sidebar .brand > div:not(.brand-icon) { min-width: 0; }
  html.menu-recolhido .sidebar .brand-simbolo { display: block; }
  html.menu-recolhido .sidebar .brand > div { display: none; }
}

/* Login: botão que troca a cor das letras do logotipo (branco / preto) */
.login-tema { position: fixed; top: 16px; right: 16px; z-index: 5; }
.logo-p-preto { display: none; }
.logo-preto .logo-p-branco { display: none !important; }
.logo-preto .logo-p-preto { display: block; }

/* Botão da cor do logotipo, no menu lateral */
.sidebar .brand .botao-logo-cor { width: 26px; height: 26px; margin-left: auto; align-self: flex-start; }
.sidebar .brand .botao-logo-cor .ico { width: 13px; height: 13px; }
.sidebar .brand-logo { max-width: 148px; }
.sidebar .brand-simbolo.logo-p-preto { display: none; }
.logo-preto .sidebar .brand-simbolo.logo-p-preto { display: none; }
@media (min-width: 861px) {
  html.menu-recolhido .sidebar .botao-logo-cor { display: none; }
  html.menu-recolhido.logo-preto .sidebar .brand-simbolo.logo-p-preto { display: block; }
  html.menu-recolhido:not(.logo-preto) .sidebar .brand-simbolo.logo-p-branco { display: block; }
}

/* Página de login: password visível, aviso de Caps Lock e ajuda */
.tela-login { position: relative; flex-direction: column; }
.login-centro { position: relative; z-index: 1; width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.login-centro .login-card { max-width: none; }
.campo-password { position: relative; display: flex; }
.campo-password input { width: 100%; padding-right: 42px; }
.ver-password { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
.ver-password:hover { color: var(--teal); background: var(--teal-soft); }
.ver-password .ico { width: 17px; height: 17px; }
.ver-password .ico-esconder { display: none; }
.ver-password.ativo .ico-ver { display: none; }
.ver-password.ativo .ico-esconder { display: block; }
.login-aviso { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--amber-border); border-radius: var(--r-md); background: var(--amber-bg); color: var(--amber-ink); font-size: 12.5px; font-weight: 600; }
.login-aviso .ico { width: 15px; height: 15px; flex-shrink: 0; }
.login-ajuda { align-self: center; font-size: 12.5px; color: var(--muted); }
.login-ajuda-texto { text-align: center; font-size: 12.5px; color: var(--ink-2); padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
/* Com a ficha técnica aberta, desaparecem o menu das lojas, o título com o total e os cartões (Nova ordem, Procurar, Lista) */
#ordens-container.ficha-aberta .subabas, #ordens-container.ficha-aberta .pagina-titulo, #ordens-container.ficha-aberta > .acoes-grid, #ordens-container.ficha-aberta > .lista-geral-toolbar { display: none; }

/* Cabeçalho da ficha técnica */
.ft-cab { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
html[data-tema="vidro"] .ft-cab { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.ft-cab .rot { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.ft-cab b { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.ft-cab-topo { display: flex; align-items: center; gap: 16px; }
.ft-qr { width: 84px; height: 84px; padding: 6px; border-radius: var(--r-md); background: #fff; flex-shrink: 0; }
.ft-cab-os { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ft-cab-os .rot { color: var(--teal); font-weight: 700; margin: 0; }
.ft-cab-num { font-size: 26px !important; font-weight: 800 !important; letter-spacing: -.02em; line-height: 1.1; }
.ft-cab-cliente { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 600; }
.ft-cab-cliente .ico { width: 15px; height: 15px; color: var(--teal); }
.ft-cab-campos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 16px; padding-top: 14px; border-top: 1px solid var(--border); align-items: start; }
.ft-cab-desb { display: flex; flex-direction: column; align-items: flex-start; }
.ft-cab-textos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.ft-texto { white-space: pre-line; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 720px) { .ft-cab-campos { grid-template-columns: 1fr 1fr; } .ft-cab-textos { grid-template-columns: 1fr; } }

/* Estado da ordem: caixa de seleção no canto direito do cabeçalho da ficha */
.estado-cor-laranja { background: rgba(251, 146, 60, .16); color: #fdba74; box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .45); }
.ft-estados { margin-left: auto; align-self: flex-start; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-bottom: 0; }
.ft-cab .ft-estados .rot { margin: 0; }
.ft-estado-sel { appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; min-width: 190px; padding: 8px 34px 8px 14px; border: 0; border-radius: var(--r-md);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.ft-estado-sel option { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.ft-estado-sel:disabled { cursor: default; opacity: .8; }
@media (max-width: 720px) { .ft-cab-topo { flex-wrap: wrap; } .ft-estados { margin-left: 0; align-items: flex-start; } }
.ft-cab-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ft-cab-titulo h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }

/* Menu de páginas da área de trabalho (Diagnóstico, Orçamento, Peças) */
.ft-menu { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); width: fit-content; max-width: 100%; overflow-x: auto; }
html[data-tema="vidro"] .ft-menu { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.ft-menu-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.ft-menu-item .ico { width: 16px; height: 16px; }
.ft-menu-item:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.ft-menu-item.ativo { background: var(--teal-soft); color: var(--teal); box-shadow: inset 0 -2px 0 var(--teal); }
.ft-menu-n { min-width: 20px; padding: 1px 7px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .1); color: var(--ink-2); font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ft-menu-item.ativo .ft-menu-n { background: var(--teal); color: #04150f; }
.ft-cabecalho { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ft-cabecalho .ft-subtotal { text-align: right; }
.ft-resumo-linha { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--border); font-size: 13.5px; }
.ft-resumo-linha b { font-variant-numeric: tabular-nums; }

/* Menu da ficha com a largura do cartão de cima, e cabeçalho que fica sempre visível */
.ft-menu { width: 100%; }
.ft-menu-item { flex: 1; justify-content: center; }


/* Testes de bancada: nome + OK | ✕ */
.ft-teste { grid-template-columns: 130px 112px 1fr 32px; }
.ft-okx { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--r-md); }
.ft-okx button { min-height: 28px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.ft-okx button:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.ft-okx .ft-ok.ativo { background: var(--emerald-bg); color: var(--emerald-ink); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .55); }
.ft-okx .ft-x.ativo { background: var(--rose-bg); color: var(--rose-ink); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .55); }
@media (max-width: 720px) { .ft-teste { grid-template-columns: 1fr 112px; } .ft-teste input { grid-column: 1 / -1; } }

/* Testes de bancada sem notas: grelha de campos */
.ft-testes-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 20px; }
.ft-testes-grelha .ft-teste { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.ft-testes-grelha .ft-teste-nome { min-width: 96px; }
.ft-testes-grelha .ft-okx { width: 112px; flex-shrink: 0; }

/* Testes de bancada: quem fez (canto superior direito, pequeno) e notas por teste */
.ft-card-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ft-quem { display: flex; align-items: center; gap: 8px; }
.ft-quem .ft-mini-campo { margin: 0; }
.ft-quem .field select.ft-mini { width: auto; min-width: 150px; max-width: 190px; min-height: 32px; padding: 4px 28px 4px 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.ft-data { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.ft-data .ico { width: 13px; height: 13px; color: var(--teal); }
.ft-data.ao-vivo { border-style: dashed; }
.ft-notas-testes { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.ft-notas-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ft-notas-topo .rot { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.ft-titulo-grupo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ft-btn-nota { min-height: 32px; padding: 4px 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.ft-btn-nota .ico { width: 14px; height: 14px; }

/* Campos das peças com o mesmo aspeto dos restantes campos do projeto */
.ft-linha input { width: 100%; min-width: 0; font-size: 14px; font-weight: 400; color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 12px; min-height: 40px; background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.ft-linha input:hover { border-color: #71717a; }
.ft-linha input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-ring); }
.ft-linha input::placeholder { color: #71717a; }
html[data-tema="vidro"] .ft-linha input { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); }
html[data-tema="vidro"] .ft-linha input:hover { border-color: rgba(255, 255, 255, .34); }

/* Bolinha luminosa que pisca só no separador aberto do menu da ficha */
.ft-led { display: none; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #19e6a6; box-shadow: 0 0 4px 1px rgba(25, 230, 166, .75), 0 0 10px 3px rgba(25, 230, 166, .35); }
.ft-menu-item.ativo .ft-led { display: inline-block; animation: ft-led-brilho 1.6s ease-in-out infinite; }
@keyframes ft-led-brilho {
  0%, 100% { opacity: .35; box-shadow: 0 0 2px 0 rgba(25, 230, 166, .4), 0 0 6px 1px rgba(25, 230, 166, .15); }
  50% { opacity: 1; box-shadow: 0 0 6px 2px rgba(25, 230, 166, .95), 0 0 16px 6px rgba(25, 230, 166, .5); }
}
@media (prefers-reduced-motion: reduce) { .ft-menu-item.ativo .ft-led { animation: none; } }

/* Ficha técnica: página normal, tudo rola em conjunto */
.ft-conteudo { display: flex; flex-direction: column; gap: 14px; }
.ft-cab-titulo h3 { display: inline-flex; align-items: center; gap: 8px; }
.ft-cab-titulo h3 .ico { width: 18px; height: 18px; color: var(--teal); }
.ft-estados .ft-hist-estado { align-self: flex-end; margin-top: 2px; }

/* Caixa do estado + botão Gravar */
.ft-estado-linha { display: flex; align-items: center; gap: 8px; }
.ft-estado-gravar { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.ft-estado-gravar:disabled { opacity: .45; cursor: default; }

/* Botões Guardar e Fechar no topo da Área de Trabalho */
.ft-cab-botoes { display: flex; align-items: center; gap: 8px; }
.ft-cab-botoes .btn-primary, .ft-cab-botoes .btn-sec { min-height: 36px; padding: 6px 18px; font-size: 13px; }
.ft-cab-botoes .ft-fechar { color: #f87171; font-weight: 700; }
.ft-cab-botoes .ft-fechar:hover { background: var(--rose-bg); border-color: #f87171; color: #f87171; }
.ft-cab-botoes .ft-relatorio { padding: 6px 14px; }

/* Animação "Guardado" junto ao botão Guardar */
.ft-guardado { display: inline-flex; align-items: center; gap: 7px; color: var(--emerald-ink); font-size: 13px; font-weight: 700; animation: ft-g-entra .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.ft-guardado svg { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(52, 211, 153, .55)); }
.ft-g-circulo { stroke-dasharray: 63; stroke-dashoffset: 63; animation: ft-g-desenhar .5s ease-out .05s forwards; }
.ft-g-visto { stroke-dasharray: 16; stroke-dashoffset: 16; animation: ft-g-desenhar .35s ease-out .45s forwards; }
.ft-guardado.a-sair { animation: ft-g-sai .4s ease forwards; }
.ft-cab-botoes .ft-guardar.guardado { animation: ft-g-brilho 1s ease-out; }
@keyframes ft-g-desenhar { to { stroke-dashoffset: 0; } }
@keyframes ft-g-entra { from { opacity: 0; transform: translateX(14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes ft-g-sai { to { opacity: 0; transform: translateY(-6px); } }
@keyframes ft-g-brilho { 0% { box-shadow: 0 0 0 0 rgba(25, 230, 166, .7); } 100% { box-shadow: 0 0 0 14px rgba(25, 230, 166, 0); } }
@media (prefers-reduced-motion: reduce) { .ft-guardado, .ft-g-circulo, .ft-g-visto, .ft-cab-botoes .ft-guardar.guardado { animation: none; stroke-dashoffset: 0; } }

/* "Guardado" ao lado do título: não empurra os botões */
.ft-cab-titulo { justify-content: flex-start; }
.ft-cab-titulo .ft-guardado { margin-left: 16px; }
.ft-cab-titulo .ft-cab-botoes { margin-left: auto; }

/* Gerar relatório: fica amarelo e um rebordo de loading corre à volta do botão */
@property --ang-relatorio { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ft-cab-botoes .ft-relatorio { position: relative; transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
html .ft-cab-botoes .ft-relatorio.a-gerar, html[data-tema="vidro"] .ft-cab-botoes .ft-relatorio.a-gerar { background: rgba(245, 158, 11, .24); color: #fcd34d; border-color: rgba(245, 158, 11, .6); cursor: progress; opacity: 1; }
.ft-cab-botoes .ft-relatorio.a-gerar::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang-relatorio), transparent 0deg, transparent 230deg, #fbbf24 330deg, #fff3c4 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ft-rebordo 1s linear infinite;
}
@keyframes ft-rebordo { to { --ang-relatorio: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ft-cab-botoes .ft-relatorio.a-gerar::after { animation: none; background: #fbbf24; } }

/* "Guardado": balão por cima do botão Guardar, fora do card */
#ordem-ficha-slot.pronta .painel-pesquisa-clip { overflow: visible; }
.ft-cab { position: relative; }
.ft-cab .ft-guardado { position: absolute; bottom: calc(100% + 12px); translate: -50% 0; margin: 0; padding: 7px 14px 7px 10px; z-index: 30; white-space: nowrap;
  background: var(--surface); border: 1px solid rgba(52, 211, 153, .55); border-radius: var(--r-md); box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 14px rgba(52, 211, 153, .25); animation: ft-g-sobe .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.ft-cab .ft-guardado::after { content: ""; position: absolute; left: 50%; top: 100%; width: 10px; height: 10px; background: inherit; border: inherit; border-top: 0; border-left: 0; transform: translate(-50%, -50%) rotate(45deg); }
html[data-tema="vidro"] .ft-cab .ft-guardado { background: #0d1e22; }
.ft-cab .ft-guardado.a-sair { animation: ft-g-sai .4s ease forwards; }
@keyframes ft-g-sobe { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

/* Relatório numa janela por cima da ficha */
.modal-relatorio { width: min(940px, 96vw); height: 92vh; max-width: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.rel-frame { flex: 1; width: 100%; border: 0; border-radius: var(--r-md); background: #e9ecef; }

/* Fotos das anomalias */
.an-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.an-fotos:empty { display: none; }
.an-foto { position: relative; width: 64px; height: 64px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: zoom-in; }
.an-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-foto-rm { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; cursor: pointer; }
.modal-foto-caixa { position: relative; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.modal-foto-caixa img { max-width: 92vw; max-height: 84vh; border-radius: var(--r-md); box-shadow: var(--shadow-lg); background: #fff; }
/* Aviso de ordem parada em diagnóstico */
.alerta-dias { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ft-alerta-dias { display: inline-flex; margin-top: 4px; padding: 2px 9px; border-radius: var(--r-sm); background: var(--amber-bg); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-border); font-size: 12px; font-weight: 700; width: fit-content; }

/* Atraso em diagnóstico: 2 dias amarelo, 5 dias laranja, mais de 6 dias vermelho a luzir */
.alerta-amarelo { background: var(--amber-bg); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-border); }
.alerta-laranja { background: rgba(251, 146, 60, .18); color: #fdba74; box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .55); }
.alerta-vermelho { background: rgba(239, 68, 68, .2); color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .7); animation: alerta-luz 1.4s ease-in-out infinite; }
@keyframes alerta-luz { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .6), 0 0 4px 0 rgba(239, 68, 68, .35); } 50% { box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 1), 0 0 14px 3px rgba(239, 68, 68, .75); } }
@media (prefers-reduced-motion: reduce) { .alerta-vermelho { animation: none; } }
.ft-estado-linha .alerta-dias { margin: 0; padding: 6px 10px; font-size: 12px; }
/* Galeria de fotos da ordem */
.fts-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.fts-foto { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fts-ver { padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: zoom-in; aspect-ratio: 4 / 3; }
.fts-ver img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fts-foto figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; }
.fts-foto .link-btn { align-self: flex-start; padding: 0; margin: 2px 0 0; font-size: 12px; }

/* Estado e aviso de dias lado a lado, sem quebrar linha */
.estado-celula { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.estado-celula .alerta-dias { margin-left: 0; }

/* Orçamento: campos, totais, resposta do cliente */
.ft-orc-campos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ft-orc-rodape { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ft-orc-rodape .ft-totais { justify-content: flex-end; margin-left: auto; }
.ft-orc-resposta { display: flex; flex-direction: column; gap: 12px; }
.ft-orc-resposta .ft-estado-linha { flex-wrap: wrap; }
@media (max-width: 860px) { .ft-orc-campos { grid-template-columns: 1fr 1fr; } }
/* Botões "Gerar" com animação (relatório e orçamento) */
@property --ang-gerar { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn-gerar { position: relative; transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
html .btn-gerar.a-gerar, html[data-tema="vidro"] .btn-gerar.a-gerar { background: rgba(245, 158, 11, .24); color: #fcd34d; border-color: rgba(245, 158, 11, .6); cursor: progress; opacity: 1; }
.btn-gerar.a-gerar::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang-gerar), transparent 0deg, transparent 230deg, #fbbf24 330deg, #fff3c4 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ft-rebordo-g 1s linear infinite;
}
@keyframes ft-rebordo-g { to { --ang-gerar: 360deg; } }
@media (prefers-reduced-motion: reduce) { .btn-gerar.a-gerar::after { animation: none; background: #fbbf24; } }
.ft-orc-campos { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
@media (max-width: 860px) { .ft-orc-campos { grid-template-columns: 1fr 1fr; } .ft-orc-reparacao { grid-column: 1 / -1; } }

/* Linhas de reparação */
.ft-reparacoes { display: flex; flex-direction: column; gap: 8px; }
.ft-reparacoes > .rot { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ft-reparacao { grid-template-columns: 1fr 130px 32px; }
.ft-mais { width: 36px; height: 36px; }
.ft-orc-campos { grid-template-columns: 1fr 2fr; max-width: 640px; }
@media (max-width: 860px) { .ft-orc-campos { grid-template-columns: 1fr; } }

/* Orçamento: botão Gerar no canto superior direito; validade pequena e prazo ao lado, por baixo das linhas */
.ft-card-topo .ft-gerar-orc { margin-left: auto; }
.ft-orc-campos { grid-template-columns: 110px minmax(180px, 280px); max-width: none; justify-content: start; gap: 12px; }
.ft-orc-rodape { justify-content: flex-end; }
@media (max-width: 860px) { .ft-orc-campos { grid-template-columns: 110px 1fr; } }

/* Validade e prazo na mesma linha dos totais */
.ft-orc-rodape { justify-content: space-between; align-items: flex-end; }
.ft-orc-rodape .ft-orc-campos { margin: 0; }
@media (max-width: 860px) { .ft-orc-rodape { flex-direction: column; align-items: stretch; } .ft-orc-rodape .ft-totais { margin-left: 0; justify-content: flex-start; } }

/* Peças: botão Criar encomenda e marca "Encomendada" */
.ft-peca-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.ft-peca-desc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ft-peca-desc input { flex: 1; min-width: 0; }
.ft-encomendada { flex-shrink: 0; padding: 2px 8px; border-radius: var(--r-sm); background: var(--emerald-bg); color: var(--emerald-ink); font-size: 11.5px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .45); white-space: nowrap; }

/* Formulário "Adicionar encomenda" em janela */
.modal-pedido { max-width: 760px; max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.ft-peca-tit { display: inline-flex; align-items: center; gap: 6px; }

.ft-corpo { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 14px; align-items: start; }
.ft-corpo > * { grid-column: 1; }
.ft-corpo > .ft-lado { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 64px; z-index: 20; display: flex; flex-direction: column; gap: 8px; width: 110px; }
.ft-lado .btn-primary, .ft-lado .btn-sec { min-height: 36px; padding: 6px 18px; font-size: 13px; width: 100%; }
.ft-lado .ft-fechar { color: #f87171; font-weight: 700; }
.ft-lado .ft-fechar:hover { background: var(--rose-bg); border-color: #f87171; color: #f87171; }
.ft-lado .ft-guardar.guardado { animation: ft-g-brilho 1s ease-out; }
.ft-lado .ft-guardado { position: absolute; right: calc(100% + 14px); top: 0; margin: 0; padding: 7px 14px 7px 10px; z-index: 30; white-space: nowrap; background: var(--surface); border: 1px solid rgba(52, 211, 153, .55); border-radius: var(--r-md); box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 14px rgba(52, 211, 153, .25); animation: ft-g-sobe .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.ft-lado .ft-guardado::after { content: ""; position: absolute; top: 50%; left: 100%; width: 10px; height: 10px; background: inherit; border: inherit; border-bottom: 0; border-left: 0; transform: translate(-50%, -50%) rotate(45deg); }
html[data-tema="vidro"] .ft-lado .ft-guardado { background: #0d1e22; }
.ft-lado .ft-guardado.a-sair { animation: ft-g-sai .4s ease forwards; }
@media (max-width: 720px) { .ft-corpo { grid-template-columns: minmax(0, 1fr) 88px; } .ft-corpo > .ft-lado { width: 88px; } }
.ft-enc-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ft-enc-lista .rot { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ft-enc-item { display: grid; grid-template-columns: 2fr 2fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13px; }
.ft-enc-peca { font-weight: 600; }
.ft-cab-num { white-space: nowrap; }
.ft-enc-item { grid-template-columns: 2fr 2fr auto auto; }
.ft-enc-acoes { display: inline-flex; gap: 10px; }
.ft-enc-item { grid-template-columns: 2fr 2fr auto auto; }
.ft-enc-acoes { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.ft-enc-rodape { grid-column: 1 / -1; font-size: 12px; }
.ft-enc-arq { opacity: .75; border-style: dashed; }
.ft-enc-elim-tog { align-self: flex-start; margin-top: 4px; }
.ft-enc-aviso { padding: 8px 12px; border-radius: var(--r-md); font-size: 13px; border: 1px solid transparent; }
.ft-enc-aviso-ok { background: var(--emerald-bg); color: var(--emerald-ink); border-color: rgba(52, 211, 153, .45); }
.ft-enc-aviso-erro { background: var(--rose-bg); color: var(--rose-ink); border-color: rgba(248, 113, 113, .45); }
.ft-enc-aviso-roxo { background: rgba(168, 85, 247, .14); color: #d8b4fe; border-color: rgba(168, 85, 247, .45); }
.ft-enc-aviso-info { background: rgba(255, 255, 255, .05); color: var(--ink-2); border-color: var(--border-strong); }
.ft-enc-ico { width: 30px; height: 30px; }
.ft-enc-ico.danger:hover { border-color: #f87171; background: var(--rose-bg); color: #f87171; }
.ft-enc-acoes { gap: 6px; flex-wrap: nowrap; }

.enc-titulo { display: inline-flex; align-items: center; gap: 8px; }
.enc-titulo .ico { width: 18px; height: 18px; color: var(--teal); }
#enc-form-slot .ordem-form-inline { max-width: none; }
#notas-lista .nota-linha { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.nota-campo { flex: 1; min-width: 0; min-height: 72px; font: inherit; font-size: 14px; color: var(--ink); line-height: 1.45; resize: vertical; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.nota-campo:hover { border-color: var(--teal); }
.nota-campo:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.nota-campo::placeholder { color: #71717a; }
html[data-tema="vidro"] .nota-campo { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .16); }
.ft-foto-wrap { display: inline-flex; align-items: center; gap: 8px; }
.ft-foto-wrap label.ft-btn-nota { cursor: pointer; }
.ft-foto-mini { width: 32px; height: 32px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border-strong); }

/* ---- Lojas como cartões: nome, ordens em curso e alertas de atraso ---- */
.subabas.lojas-cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 1000px; padding: 0; border: 0; background: none; width: auto; overflow: visible; margin-bottom: 20px; }
.lojas-cartoes .subaba { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0; text-align: left; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink-2); box-shadow: none; text-shadow: none !important; overflow: hidden; transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
html[data-tema="vidro"] .lojas-cartoes .subaba { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
.lojas-cartoes .subaba:hover { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-1px); }
.lojas-cartoes .subaba.ativa { border-color: var(--teal); background: var(--teal-soft); color: var(--ink); box-shadow: 0 0 0 1px var(--teal), 0 8px 26px rgba(25, 230, 166, .16); }
.lojas-cartoes .subaba.ativa::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.lj-icone { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: rgba(255, 255, 255, .07); color: var(--muted); }
.lj-icone .ico { width: 20px; height: 20px; }
.lojas-cartoes .subaba.ativa .lj-icone { background: var(--teal); color: #04150f; }
.lj-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lj-nome { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.lj-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.lj-numero { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lojas-cartoes .subaba.ativa .lj-numero { color: var(--teal); }
.lj-alertas { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.lj-alertas:empty { display: none; }
.lj-alerta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.lj-alerta::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.lj-alerta-amarelo { color: #fbbf24; }
.lj-alerta-laranja { color: #fb923c; }
.lj-alerta-vermelho { color: #f87171; }
.lj-alerta-roxo { color: #c084fc; }
.lj-alerta-vermelho::before { animation: lj-pisca 1.4s ease-in-out infinite; }
@keyframes lj-pisca { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .lj-alerta-vermelho::before { animation: none; } }
/* o terceiro "lugar" vazio mantém as colunas iguais às dos cartões de ações por baixo */
.subabas.lojas-cartoes::after { content: ""; height: 0; margin-top: -16px; }
.lj-nome, .lj-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lojas-cartoes .subaba { min-height: 76px; }
.pagina-titulo { margin: 0 0 16px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.subabas.lojas-cartoes { margin-bottom: 16px; }
.subabas.lojas-cartoes { row-gap: 0; }
.subabas.lojas-cartoes::after { margin-top: 0; }
.pagina-titulo::before { content: ""; display: inline-block; width: .34em; height: .34em; margin-right: .45em; border-radius: 50%; background: var(--teal); box-shadow: 0 0 .5em var(--teal); vertical-align: .14em; }

/* ---------- Painel de Controlo ---------- */
.painel-controlo { max-width: 1120px; }
.pc-abas { margin-bottom: 16px; }
.pc-corpo { display: flex; flex-direction: column; gap: 14px; }
.pc-card .ft-card-topo { align-items: center; }
.pc-grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.pc-duas { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .pc-duas { grid-template-columns: 1fr; } }
.pc-ajuda { margin: -4px 0 4px; font-size: 12.5px; line-height: 1.45; }
.pc-rodape { display: flex; justify-content: flex-end; }
.pc-card .rot { display: block; margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pc-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-card .chip-add { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.pc-card .chip-add > input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.pc-card .chip-add > input:focus, .pc-card .chip-add > select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.pc-card .chip-add.row { display: grid; }
.pc-card .chip-add select { min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.pc-card .chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: rgba(255, 255, 255, .05); font-size: 13.5px; font-weight: 600; }
.pc-card .chip select { min-height: 28px; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; }
.pc-card .chip-remover { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.pc-card .chip-remover .ico { width: 14px; height: 14px; }
.pc-card .chip-remover:hover:not(:disabled) { background: var(--rose-bg); color: #f87171; }
.pc-card .chip-remover:disabled { opacity: .3; cursor: default; }
.pc-card .vazio { color: var(--muted); font-size: 13px; padding: 4px 0; }
.pc-card .lista-estados { display: flex; flex-direction: column; gap: 8px; }
.pc-card .estado-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pc-card .estado-linha-acoes { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-card .estado-linha-acoes .btn-sec { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.pc-card .user-loja { min-height: 32px; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; }
.pc-card .box { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; background: rgba(255, 255, 255, .03); }
.pc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.pc-tile { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
html[data-tema="vidro"] .pc-tile { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
.pc-tile-ico { grid-row: 1 / span 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--teal); }
.pc-tile-ico .ico { width: 20px; height: 20px; }
.pc-tile-n { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pc-tile-r { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pc-tile-s { font-size: 12px; color: var(--muted); }
.pc-tile-aviso .pc-tile-ico { background: rgba(251, 146, 60, .16); color: #fb923c; }
.pc-tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pc-tabela th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border-strong); }
.pc-tabela td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pc-compacta td { padding: 6px 10px; }
.pc-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.pc-perigo:hover { border-color: #f87171; background: var(--rose-bg); color: #f87171; }
.pc-tag { display: inline-block; min-width: 22px; padding: 1px 8px; border-radius: var(--r-sm); font-weight: 700; text-align: center; }
.pc-tag-aviso { background: rgba(251, 146, 60, .16); color: #fb923c; }
.pc-evento { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pc-evento:last-child { border-bottom: 0; }
.pc-evento-quando { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .pc-evento { grid-template-columns: 1fr; gap: 2px; } }
.pc-cores { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 16px; }
.pc-linha-cor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pc-linha-cor select { min-height: 34px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.pc-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pc-mini { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pc-mini b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-mini span { font-size: 12px; color: var(--muted); }
.pc-perms { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px 16px; }
.pc-perm { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13.5px; cursor: pointer; }
.pc-perm input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--teal); }
.pc-loja-doc { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.pc-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pc-kv:last-child { border-bottom: 0; }
.pc-kv span { color: var(--muted); }
.pc-copias-cfg { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.pc-bk-manter { width: 160px; margin: 0; }
.pc-copias-cfg .btn-sec, .pc-copias-cfg .btn-primary { min-height: 40px; }
.pc-card .field textarea { min-height: 120px; }
.pc-abas { flex-wrap: wrap; overflow: visible; width: 100%; }
.badge-role-dashboard { background: var(--teal-soft); color: var(--teal); }

/* ---------- Horário ---------- */
.horario-pagina { max-width: 1120px; }
.hor-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hor-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hor-semana { min-width: 220px; text-align: center; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.hor-tabela-wrap { overflow-x: auto; }
.hor-tabela { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0 6px; }
.hor-tabela thead th { padding: 4px 6px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hor-tabela thead th b { display: block; margin-top: 2px; font-size: 18px; letter-spacing: -.02em; color: var(--ink-2); }
.hor-tabela thead th.hoje b { color: var(--teal); }
.hor-nome { width: 150px; padding: 0 12px 0 4px; text-align: left; font-size: 14px; font-weight: 700; white-space: nowrap; }
.hor-cel { position: relative; min-width: 100px; height: 64px; padding: 6px; text-align: center; vertical-align: middle; border: 1px solid var(--border); background: rgba(255, 255, 255, .03); }
.hor-cel.hoje { border-color: var(--teal); background: var(--teal-soft); }
.hor-cel.editavel { cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.hor-cel.editavel:hover, .hor-cel.editavel:focus-visible { border-color: var(--teal); outline: none; background: var(--teal-soft); }
.hor-cel .estado { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hor-horas { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hor-nota { display: block; max-width: 100%; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.hor-nota .ico { width: 10px; height: 10px; margin-right: 3px; vertical-align: -1px; }
.hor-vazio { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); color: var(--muted); opacity: 0; transition: opacity var(--t-fast); }
.hor-vazio .ico { width: 16px; height: 16px; }
.hor-cel.editavel:hover .hor-vazio, .hor-cel.editavel:focus-visible .hor-vazio { opacity: 1; color: var(--teal); }
.hor-traco { color: var(--border-strong); }
.hor-total { width: 90px; padding: 0 4px 0 12px; text-align: right; font-variant-numeric: tabular-nums; }
.hor-total b { display: block; font-size: 16px; }
.hor-total span { font-size: 11.5px; color: var(--muted); }
.hor-legenda { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 6px; border-top: 1px solid var(--border); }
.hor-leg { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.hor-dica { margin: 0; font-size: 12.5px; }
.hor-turnos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.hor-opcao { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.hor-opcao:hover { border-color: var(--teal); }
.hor-opcao:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal); }
.hor-opcao input { position: absolute; opacity: 0; pointer-events: none; }
.hor-opcao small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pc-turnos { display: flex; flex-direction: column; gap: 8px; }
.pc-turno { display: grid; grid-template-columns: minmax(120px, 1.6fr) 130px 120px 120px auto; gap: 8px; align-items: center; }
.pc-turno input, .pc-turno select { min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.pc-turno input:focus, .pc-turno select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.pc-rodape-dividido { justify-content: space-between; }
@media (max-width: 720px) { .pc-turno { grid-template-columns: 1fr 1fr; } }
.hor-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hor-dia-opcao { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.hor-dia-opcao b { font-size: 16px; letter-spacing: -.02em; color: var(--ink-2); }
.hor-dia-opcao:hover { border-color: var(--teal); }
.hor-dia-opcao:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.hor-dia-opcao:has(input:checked) b { color: var(--teal); }
.hor-dia-opcao.hoje span::after { content: " •"; }
.hor-dia-opcao input { position: absolute; opacity: 0; pointer-events: none; }
.hor-atalhos { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

/* Horário mensal: células pequenas (uma letra por turno), fins de semana mais escuros */
.hor-tabela { min-width: 0; border-spacing: 0 4px; table-layout: fixed; }
.hor-tabela thead th { padding: 2px 0; font-size: 10px; letter-spacing: .02em; }
.hor-tabela thead th b { margin-top: 1px; font-size: 13px; }
.hor-tabela thead th.fds { color: var(--ink-2); opacity: .75; }
.hor-tabela thead th.hoje { color: var(--teal); }
.hor-tabela thead th:first-child { width: 140px; }
.hor-tabela thead th:last-child { width: 78px; }
.hor-tabela .hor-nome { width: 140px; }
.hor-cel { min-width: 0; height: 40px; padding: 2px; border-radius: 0; border-width: 1px 0 1px 1px; }
.hor-cel:last-of-type { border-right-width: 1px; }
.hor-cel.fds { background: rgba(255, 255, 255, .06); }
.hor-cel.hoje { background: var(--teal-soft); border-color: var(--teal); }
.hor-cel.editavel:hover, .hor-cel.editavel:focus-visible { background: var(--teal-soft); }
.hor-mini { position: relative; display: inline-grid; place-items: center; min-width: 22px; height: 24px; padding: 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0; }
.hor-mini::before { display: none; }
.hor-ponto { position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--bg); }
.hor-conta-nome { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hor-conta { height: 24px; text-align: center; font-size: 12px; font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }
.hor-conta.fds { opacity: .7; }
.hor-leg .hor-mini { height: 20px; }
.hor-mes-caixa { position: relative; }
.hor-mes-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.hor-mes-btn b { min-width: 150px; text-align: left; font-weight: 800; letter-spacing: -.01em; }
.hor-mes-btn .ico { width: 16px; height: 16px; color: var(--teal); }
.hor-mes-btn[aria-expanded="true"], .hor-mes-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
.hor-seletor { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 300px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
html[data-tema="vidro"] .hor-seletor { background: #0d1a1d; }
.hor-seletor-ano { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.hor-seletor-meses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hor-mes-opcao { min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.hor-mes-opcao:hover { border-color: var(--teal); background: var(--teal-soft); }
.hor-mes-opcao.atual { box-shadow: inset 0 -2px 0 var(--teal); }
.hor-mes-opcao.ativo { border-color: var(--teal); background: var(--teal); color: #04150f; }
.hor-seletor .link-btn { align-self: center; }
.hor-dias { grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hor-dias-cab { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hor-dia-opcao { padding: 6px 0; flex-direction: row; justify-content: center; }
.hor-dia-opcao b { font-size: 14px; }
.hor-dia-opcao.fds { background: rgba(255, 255, 255, .05); }
.hor-dia-opcao.hoje span::after { content: none; }
.hor-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hor-gravar-zona { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.hor-por-gravar { padding: 3px 10px; border-radius: var(--r-sm); background: rgba(251, 191, 36, .16); color: #fbbf24; font-size: 12.5px; font-weight: 700; animation: hor-pisca 1.8s ease-in-out infinite; }
@keyframes hor-pisca { 50% { opacity: .55; } }
.hor-gravar { min-height: 36px; padding: 6px 20px; font-size: 14px; }
.hor-gravar:disabled { opacity: .45; box-shadow: none; cursor: default; }
.hor-gravar.guardado { animation: ft-g-brilho 1s ease-out; }
.hor-gravar.a-gravar .ico { animation: hor-roda 1s linear infinite; }
@keyframes hor-roda { to { transform: rotate(360deg); } }
.hor-guardado { position: absolute; right: calc(100% + 12px); top: 50%; translate: 0 -50%; margin: 0; padding: 6px 14px 6px 10px; z-index: 30; white-space: nowrap; background: var(--surface); border: 1px solid rgba(52, 211, 153, .55); border-radius: var(--r-md); box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 14px rgba(52, 211, 153, .25); }
html[data-tema="vidro"] .hor-guardado { background: #0d1e22; }
.hor-cel.pendente { outline: 2px dashed #fbbf24; outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) { .hor-por-gravar, .hor-gravar.a-gravar .ico { animation: none; } }

/* Rebordos do horário: linhas só de cima e de baixo, e uma linha vertical entre dias (sempre completas, também no dia de hoje) */
.hor-cel { border-width: 1px 0; box-shadow: inset 1px 0 0 var(--border); }
.hor-cel.ult { box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border); }
.hor-cel.hoje { border-color: var(--teal); box-shadow: inset 1px 0 0 var(--teal), inset -1px 0 0 var(--teal); }
.hor-cel.hoje + .hor-cel { box-shadow: none; }
.hor-cel.hoje + .hor-cel.ult { box-shadow: inset -1px 0 0 var(--border); }
.hor-cel.editavel:hover, .hor-cel.editavel:focus-visible { border-color: var(--teal); box-shadow: inset 1px 0 0 var(--teal), inset -1px 0 0 var(--teal); }
.hor-cel.editavel:hover + .hor-cel, .hor-cel.editavel:focus-visible + .hor-cel { box-shadow: none; }
.chip-cartao { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip-cartao input { width: 14px; height: 14px; accent-color: var(--teal); }
