:root {
  /* Fundos */
  --bg-app:          #101722;
  --bg-sidebar:      #0c131c;
  --bg-header:       #131b26;
  --bg-card:         #1a2430;
  --bg-card-hover:   #202b38;
  --bg-input:        #131b26;

  /* Bordas e divisórias */
  --border:          #2a3542;
  --border-subtle:   rgba(255,255,255,0.06);

  /* Texto */
  --text-primary:    #e8edf2;
  --text-secondary:  #8b98a5;
  --text-muted:      #808c99;

  /* Paleta de dados */
  --c-green:   #57ba5e;
  --c-blue:    #2b95e8;
  --c-red:     #e94f4f;
  --c-yellow:  #f2b53c;
  --c-orange:  #f0824e;
  --c-purple:  #a25bc4;
  --c-magenta: #e94f9c;
  --c-gray:    #7a8996;
  --c-cyan:    #29b6c9;

  /* Ação em destaque */
  --accent:        #ffffff;
  --accent-text:   #101722;

  /* Raios e sombras */
  --radius-card:   8px;
  --radius-ctrl:   6px;
  --radius-chip:   3px;
  --shadow-card:   0 1px 3px rgba(0,0,0,.35);

  /* Espaçamento */
  --gap:           16px;
  --card-pad:      16px;

  /* Compat (nomes antigos usados como fallback em alguns templates) */
  --sidebar-w: 240px;
  --radius: var(--radius-card);
  --gray-light: var(--bg-input);
  --gray: var(--text-secondary);

  /* Cores semânticas (status/prioridade) — Parte 2 */
  --success:  var(--c-green);
  --info:     var(--c-blue);
  --warning:  var(--c-yellow);
  --danger:   var(--c-red);
  --neutral:  var(--c-gray);

  --success-bg: rgba(87,186,94,0.14);
  --info-bg:    rgba(43,149,232,0.14);
  --warning-bg: rgba(242,181,60,0.14);
  --danger-bg:  rgba(233,79,79,0.14);
  --neutral-bg: rgba(122,137,150,0.14);

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.30);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.35);
  --ring:       0 0 0 3px rgba(43,149,232,0.35);

  --row-h:      48px;
  --cell-pad-x: 16px;

  --t-fast: 120ms ease;
  --t-base: 160ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-app);
  display: flex;
  min-height: 100vh;
}

::selection { background: var(--c-blue); color: #fff; }

/* Scrollbars */
* { scrollbar-color: #38434f var(--bg-app); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #38434f; border-radius: 20px; border: 2px solid var(--bg-app); }
::-webkit-scrollbar-thumb:hover { background: #47535f; }

/* Foco acessível */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  border-right: 1px solid var(--border-subtle);
}
.sidebar-brand {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.brand-logo { height: 26px; width: auto; max-width: 120px; object-fit: contain; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: .01em; }
.sidebar-cta { margin: 0 14px 12px; justify-content: center; }
.sidebar-live { display: flex; flex-direction: column; gap: 6px; margin: 0 14px 10px; }
.live-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-ctrl);
  background: var(--success-bg);
  color: var(--text-primary);
  font-size: 12.5px;
  text-decoration: none;
}
.live-chip:hover { text-decoration: none; background: rgba(87,186,94,.22); }
.live-chip strong { color: var(--c-green); font-weight: 600; }
.live-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); flex-shrink: 0; animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(87,186,94,.55); }
  70% { box-shadow: 0 0 0 7px rgba(87,186,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(87,186,94,0); }
}
.nav-scroll { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.nav-group {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 14px 18px 4px;
}
.nav-links { list-style: none; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 8px;
  padding: 7px 10px;
  border-radius: var(--radius-ctrl);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-links li a .i { width: 17px; height: 17px; opacity: .8; }
.nav-links li a:hover { background: rgba(255,255,255,.05); color: var(--text-primary); text-decoration: none; }
.nav-links li a.active { background: var(--info-bg); color: var(--text-primary); font-weight: 600; }
.nav-links li a.active .i { color: var(--c-blue); opacity: 1; }
.sidebar-footer {
  padding: 10px 14px 10px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.sidebar-user { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; }

/* ── Ícones ── */
.i { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.btn .i { width: 15px; height: 15px; vertical-align: 0; }
.btn-lg .i { width: 18px; height: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Main content ── */
.content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 58px;
}
.topbar .menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  color: var(--text-primary);
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.topbar .menu-toggle .i { width: 20px; height: 20px; }
.page-title-wrap { flex: 1; min-width: 0; }
.breadcrumb { font-size: 12px; color: var(--text-secondary); margin-bottom: 1px; display: block; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--c-blue); }
.page-title { font-size: 16px; font-weight: 600; letter-spacing: .005em; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page-body { padding: 24px; flex: 1; width: 100%; max-width: 1280px; }

/* ── Alerts ── */
.flash-stack { margin: 12px 24px 0; display: flex; flex-direction: column; gap: 6px; max-width: 1232px; }
.alert { padding: 10px 14px; border-radius: var(--radius-ctrl); font-size: 13px; border: 1px solid transparent; transition: opacity .3s ease, transform .3s ease; }
.alert-hide { opacity: 0; transform: translateY(-4px); pointer-events: none; height: 0; padding: 0; margin: 0; border: 0; overflow: hidden; }
.alert-success { background: rgba(87,186,94,.12); color: #7fd085; border-color: rgba(87,186,94,.3); }
.alert-info { background: rgba(43,149,232,.12); color: #74b9f0; border-color: rgba(43,149,232,.3); }
.alert-error { background: rgba(233,79,79,.12); color: #f08a8a; border-color: rgba(233,79,79,.3); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-ctrl);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, filter .15s;
  white-space: nowrap;
}
.btn-primary { background: #1d72bd; color: #fff; }
.btn-primary:hover { filter: brightness(1.1); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-success { background: var(--c-green); color: #0b1a0d; font-weight: 600; }
.btn-success:hover { filter: brightness(1.08); }
.btn-warning { background: var(--c-orange); color: #1e0f06; font-weight: 600; }
.btn-warning:hover { filter: brightness(1.08); }
.btn-block { width: 100%; justify-content: center; }
.btn-outline { background: transparent; color: var(--c-blue); border-color: var(--c-blue); }
.btn-outline:hover { background: rgba(43,149,232,.1); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-danger { background: transparent; color: #f08a8a; border-color: rgba(233,79,79,.45); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: var(--c-red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

/* ── Cards dashboard (KPIs) ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); margin-bottom: 24px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--card-pad) 20px;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--t-fast);
}
.card:hover { background: var(--bg-card-hover); }
.card-icon { display: block; font-size: 16px; opacity: .55; margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.card-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.card-link { font-size: 12px; color: var(--c-blue); text-decoration: none; display: inline-block; margin-top: 8px; }
.card-blue .card-value { color: var(--c-blue); }
.card-green .card-value { color: var(--c-green); }
.card-orange .card-value { color: var(--c-orange); }
.card-red .card-value { color: var(--c-red); }
.card-teal .card-value { color: var(--c-cyan); }

/* ── Panels ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-header h2 { font-size: 13.5px; font-weight: 500; letter-spacing: .01em; color: var(--text-primary); }
.panel-footer { padding: 12px 18px; border-top: 1px solid var(--border-subtle); background: rgba(255,255,255,.02); }
.panel-body-center { padding: 24px 18px; text-align: center; }
.panel-success { border-top: 3px solid var(--c-green); }
.panel-warning { border-top: 3px solid var(--c-orange); }
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: 20px; }
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.panel-stack { display: flex; flex-direction: column; }

/* ── Tables ── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-height: min(640px, 70vh);
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px var(--cell-pad-x);
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  background: color-mix(in srgb, var(--bg-card) 65%, var(--bg-app) 35%);
}
.table td {
  height: var(--row-h);
  padding: 8px var(--cell-pad-x);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
}
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.table tbody tr:hover { background: var(--bg-card-hover); }
.row-danger td { background: rgba(233,79,79,.08) !important; }
.actions-cell { white-space: nowrap; }
.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.cell-id { color: var(--text-muted); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; }

/* ── Forms ── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: 760px;
  box-shadow: var(--shadow-card);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text-secondary); }
.form-row { display: flex; gap: 16px; }
.form-col-3 { flex: 3; min-width: 0; }
.form-col-4 { flex: 4; min-width: 0; }
.form-col-6 { flex: 6; min-width: 0; }
.form-col-8 { flex: 8; min-width: 0; }
.input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--c-blue); outline: none; box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 80px; }
.input-search {
  width: 100%;
  padding: 8px 11px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  font-size: 13px;
  color: var(--text-primary);
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  flex: 1;
  max-width: 320px;
}
.input-search::placeholder { color: var(--text-muted); }
.input-search:focus { border-color: var(--c-blue); box-shadow: var(--ring); }
.input-sm { width: auto; }
.input-xs { width: 130px; padding: 4px 8px; }
select.input { appearance: auto; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-weight: 400 !important; color: var(--text-secondary); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }

/* ── Badges / pílulas soft ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.7;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
/* Status de Ordem de Serviço: Aberta → neutral, Em Andamento → info, Concluída → success, Cancelada → danger */
.badge-ativo { background: var(--success-bg); color: var(--success); }
.badge-inativo { background: var(--neutral-bg); color: var(--neutral); }
.badge-aberta { background: var(--neutral-bg); color: var(--neutral); }
.badge-em-andamento { background: var(--info-bg); color: var(--info); }
.badge-concluída { background: var(--success-bg); color: var(--success); }
.badge-cancelada { background: var(--danger-bg); color: var(--danger); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-pendente { background: var(--warning-bg); color: var(--warning); }
.badge-tipo-pf { background: var(--info-bg); color: var(--info); }
.badge-tipo-pj { background: rgba(162,91,196,.14); color: var(--c-purple); }
/* Prioridade da OS (4 níveis: Baixa/Normal/Alta/Urgente) — escala de severidade */
.badge-prioridade-baixa { background: var(--neutral-bg); color: var(--neutral); }
.badge-prioridade-normal { background: var(--info-bg); color: var(--info); }
.badge-prioridade-alta { background: var(--warning-bg); color: var(--warning); }
.badge-prioridade-urgente { background: var(--danger-bg); color: var(--danger); }
/* Status de Orçamento */
.badge-orc-pendente { background: var(--warning-bg); color: var(--warning); }
.badge-orc-aprovado { background: var(--success-bg); color: var(--success); }
.badge-orc-recusado { background: var(--danger-bg); color: var(--danger); }
/* Utilitários semânticos genéricos (reutilizáveis fora dos badges de domínio) */
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral); }

/* ── Data lists ── */
.data-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 14px 18px; }
.data-list dt { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }
.data-list dd { font-size: 13px; color: var(--text-primary); }
.data-list .pre-wrap { white-space: pre-wrap; }

/* ── Lists ── */
.item-list { list-style: none; }
.item-list li { padding: 10px 18px; border-bottom: 1px solid var(--border-subtle); }
.item-list li:last-child { border-bottom: none; }
.item-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.os-list { list-style: none; }
.os-list li { padding: 10px 18px; border-bottom: 1px solid var(--border-subtle); }
.os-list li a { font-size: 13px; font-weight: 500; color: var(--text-primary); text-decoration: none; }
.os-list li a:hover { color: var(--c-blue); }
.os-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ── Finance ── */
.finance-bars { padding: 14px 18px; }
.finance-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.finance-row-total { border-top: 1px solid var(--border-subtle); margin-top: 8px; padding-top: 8px; }
.progress-bar-wrap { background: var(--border); border-radius: 20px; height: 8px; margin: 6px 0 10px; overflow: hidden; }
.progress-bar { background: var(--c-green); height: 100%; border-radius: 20px; transition: width .4s; min-width: 0; }
.finance-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.mes-selector { display: flex; align-items: center; gap: 8px; }

/* ── Orcamento items ── */
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-desc { flex: 1; min-width: 180px; }
.item-qtd { width: 70px; }
.item-un { width: 60px; }
.item-val { width: 120px; }
.item-subtotal { width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--c-green); font-weight: 600; white-space: nowrap; }
.total-box {
  background: rgba(43,149,232,.1);
  border: 1px solid rgba(43,149,232,.25);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.total-box strong { font-size: 18px; color: var(--c-blue); font-variant-numeric: tabular-nums; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 20px 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

/* ── Misc ── */
.text-green { color: var(--c-green); }
.text-orange { color: var(--c-orange); }
.text-muted { color: var(--text-secondary); }
.text-block { padding: 14px 18px; font-size: 13px; line-height: 1.6; color: var(--text-primary); }
.pre-wrap { white-space: pre-wrap; }
.search-bar { margin-bottom: 16px; display: flex; gap: 8px; }
.filters-bar { margin-bottom: 16px; }
.filters-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.info-banner { background: rgba(43,149,232,.1); border: 1px solid rgba(43,149,232,.25); border-radius: var(--radius-ctrl); padding: 10px 14px; margin-bottom: 20px; font-size: 13px; color: var(--text-primary); }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.empty-state p { color: var(--text-secondary); margin-bottom: 16px; }
.empty-msg { padding: 14px 18px; color: var(--text-secondary); font-size: 13px; }
.quick-actions { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 18px 20px; box-shadow: var(--shadow-card); }
.quick-actions h2 { font-size: 13.5px; font-weight: 500; margin-bottom: 12px; color: var(--text-primary); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
a { color: var(--c-blue); }

/* ── Locais & Pontos ── */
.locais-list { padding: 8px 0; }
.local-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-card); margin: 8px 14px; padding: 12px 14px; background: rgba(255,255,255,.02); }
.local-card.local-inativo { opacity: .6; }
.local-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.local-title { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-primary); }
.local-icon { font-size: 16px; }
.local-actions { display: flex; gap: 6px; }
.local-addr { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }

/* ── Links (sem sublinhado fixo, hover na cor de dados) ── */
a { text-decoration: none; transition: color var(--t-fast); }
a:hover { text-decoration: underline; }
.card-link, .os-list li a { text-decoration: none; }
.link-title {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.link-title:hover { color: var(--c-blue); text-decoration: underline; }
.link-muted {
  color: var(--text-secondary);
  text-decoration: none;
}
.link-muted:hover { color: var(--c-blue); text-decoration: underline; }

/* ── Cabeçalho de página com subtítulo/contador ── */
.page-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 10px;
}

/* ── Skeleton (preparado; usar quando houver estado de loading) ── */
.skeleton-row td { padding: 10px var(--cell-pad-x); }
.skeleton-bar {
  height: 14px;
  border-radius: var(--radius-chip);
  background: linear-gradient(90deg, var(--bg-card-hover) 25%, rgba(255,255,255,.08) 37%, var(--bg-card-hover) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.pontos-area { margin-top: 8px; }
.pontos-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ponto-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(43,149,232,.12);
  border: 1px solid rgba(43,149,232,.3);
  color: var(--text-primary);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}
.ponto-remove { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 11px; padding: 0 2px; line-height: 1; }
.ponto-remove:hover { color: var(--c-red); }
.ponto-add-form { display: inline-flex; gap: 5px; align-items: center; }
.ponto-input { width: 200px; padding: 4px 9px; font-size: 12px; }
.field-hint { font-size: 12px; margin-top: 4px; color: var(--text-secondary); }

/* ── Legenda de dados ── */
.data-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 10px 18px; }
.data-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.data-legend-chip { width: 10px; height: 10px; border-radius: var(--radius-chip); flex-shrink: 0; }
.data-legend-item strong { color: var(--text-primary); font-weight: 600; }

/* ── Preventivas ── */
.badge-prev-pendente { background: var(--neutral-bg); color: var(--neutral); }
.badge-prev-ok { background: var(--success-bg); color: var(--success); }
.badge-prev-atenção { background: var(--warning-bg); color: var(--warning); }
.badge-prev-problema { background: var(--danger-bg); color: var(--danger); }
.prev-row { display: flex; align-items: center; gap: 12px; }
.pc-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.pc-pick { padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-ctrl); }
.ck-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.ck-list { display: flex; flex-direction: column; gap: 6px; }
.ck-row { display: flex; gap: 8px; align-items: center; }
.ck-teste { flex: 2; min-width: 0; }
.ck-obs { flex: 3; min-width: 0; }
.ck-opts { display: flex; border: 1px solid var(--border); border-radius: var(--radius-ctrl); overflow: hidden; flex-shrink: 0; }
.ck-opt { background: transparent; border: none; color: var(--text-secondary); padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ck-opt + .ck-opt { border-left: 1px solid var(--border); }
.ck-opt:hover { background: var(--bg-card-hover); }
.ck-opt.ck-ok.on { background: var(--success-bg); color: var(--success); }
.ck-opt.ck-falha.on { background: var(--danger-bg); color: var(--danger); }
.ck-opt.ck-na.on { background: var(--neutral-bg); color: var(--text-primary); }
.anexo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.anexo-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-card); overflow: hidden; background: rgba(255,255,255,.02); }
.anexo-card img { width: 100%; height: 130px; object-fit: cover; display: block; background: #000; }
.anexo-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 130px; font-size: 32px; text-decoration: none; }
.anexo-file span { font-size: 12px; color: var(--text-secondary); padding: 0 8px; text-align: center; word-break: break-all; }
.anexo-meta { display: flex; gap: 4px; padding: 6px; }
.anexo-meta .input { flex: 1; min-width: 0; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-card); padding: 22px; text-align: center; cursor: pointer; color: var(--text-secondary); font-size: 13px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: var(--c-blue); background: rgba(43,149,232,.06); outline: none; }
.dropzone kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; font-size: 11px; }
.fila-anexos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fila-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 120px; padding: 6px; border: 1px solid var(--border-subtle); border-radius: var(--radius-ctrl); }
.fila-item img { width: 100%; height: 70px; object-fit: cover; border-radius: 3px; }
.fila-item small { font-size: 10px; color: var(--text-secondary); word-break: break-all; text-align: center; }

/* ══ Repaginação 2026-11: OS, orçamentos, painel ══════════════════════════ */

/* Abas de status com contagem */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--radius-ctrl);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
}
.tab:hover { color: var(--text-primary); background: rgba(255,255,255,.04); text-decoration: none; }
.tab.on { color: var(--text-primary); background: var(--bg-card); border-color: var(--border); }
.tab-count { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--text-muted); background: rgba(255,255,255,.06); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.tab.on .tab-count { color: var(--text-primary); background: rgba(43,149,232,.25); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-search { max-width: 340px; }
.toolbar .input-sm { max-width: 240px; }

/* Células ricas em tabelas */
.cell-main { min-width: 220px; }
.cell-main .link-title { max-width: 420px; display: block; }
.cell-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cell-sub .i { width: 13px; height: 13px; vertical-align: -2px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-chip);
  padding: 0 6px; line-height: 18px; white-space: nowrap;
}
.chip .i { width: 12px; height: 12px; vertical-align: 0; }
.chip-contrato { color: #9fcdf3; border-color: rgba(43,149,232,.4); }
.chip-orcamento { color: #cfa6e2; border-color: rgba(162,91,196,.45); }
.chip-avulso { color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-red { color: #f08a8a; }
.text-yellow { color: var(--c-yellow); }
.text-blue { color: var(--c-blue); }
.muted-dash { color: var(--text-muted); }

/* Layout de detalhe: conteúdo + lateral */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.detail-main, .detail-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-main .panel, .detail-aside .panel { margin-bottom: 0; }

/* Cabeçalho da OS */
.os-hero {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.os-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.os-num { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-secondary); }
.os-hero h2 { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--text-primary); margin-bottom: 8px; text-wrap: balance; }
.os-meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-secondary); }
.os-meta-row span, .os-meta-row a { display: inline-flex; align-items: center; gap: 6px; }
.os-meta-row a { color: var(--text-primary); }
.os-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }

/* Caixa "em campo" */
.campo {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(0deg, rgba(87,186,94,.08), rgba(87,186,94,.08)), var(--bg-card);
  border: 1px solid rgba(87,186,94,.35);
  border-radius: var(--radius-card);
  padding: 16px 20px;
}
.campo-info { flex: 1; min-width: 180px; }
.campo-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #7fd085; font-weight: 600; }
.campo-tempo { font-size: 28px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
.campo-desde { font-size: 12.5px; color: var(--text-secondary); }

/* Visitas */
.visit-table td { height: auto; padding-top: 10px; padding-bottom: 10px; }
.visit-open td { background: rgba(87,186,94,.06); }
.visit-edit { display: none; }
.visit-edit.on { display: table-row; }
.visit-edit td { background: rgba(43,149,232,.05); }
.visit-form { display: grid; grid-template-columns: 150px 105px 105px 90px minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.visit-form label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.visit-add { padding: 14px 18px; border-top: 1px solid var(--border-subtle); }
.visit-sum { display: flex; gap: 20px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-secondary); }
.visit-sum strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
details.disclosure > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--c-blue); font-size: 13px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 12px; }

/* Valores */
.money { padding: 6px 18px 14px; }
.money-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--text-secondary); border-bottom: 1px dashed var(--border-subtle); }
.money-row small { display: block; font-size: 12px; color: var(--text-muted); }
.money-row span:last-child { color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; font-size: 13px; color: var(--text-secondary); }
.money-total strong { font-size: 22px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.money-note { font-size: 12px; color: var(--text-secondary); padding: 0 18px 14px; }

/* Controles segmentados (radio) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-ctrl); overflow: hidden; background: var(--bg-input); max-width: 100%; }
.seg label { margin: 0 !important; display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.seg label + label span { border-left: 1px solid var(--border); }
.seg span:hover { color: var(--text-primary); background: rgba(255,255,255,.03); }
.seg input:checked + span { background: var(--info-bg); color: var(--text-primary); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--c-blue); }
.form-card-wide { max-width: 900px; }
.form-section { padding-top: 4px; }
.form-hint-box { font-size: 12.5px; color: var(--text-secondary); background: rgba(255,255,255,.03); border: 1px solid var(--border-subtle); border-radius: var(--radius-ctrl); padding: 10px 12px; margin-bottom: 16px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }
.input-prefix > .input { padding-left: 34px; }
.calc-preview { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(43,149,232,.08); border: 1px solid rgba(43,149,232,.25); border-radius: var(--radius-ctrl); padding: 12px 14px; margin-bottom: 16px; }
.calc-preview small { color: var(--text-secondary); font-size: 12.5px; }
.calc-preview strong { font-size: 18px; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Painel (dashboard) */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-col .panel { margin-bottom: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.stat { padding: 14px 18px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border-subtle); }
.stat-label { font-size: 12px; color: var(--text-secondary); }
.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rows { list-style: none; }
.rows > li { border-bottom: 1px solid var(--border-subtle); }
.rows > li:last-child { border-bottom: none; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 11px 18px; color: inherit; text-decoration: none; transition: background-color var(--t-fast); }
.row-link:hover { background: var(--bg-card-hover); text-decoration: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { text-align: right; flex-shrink: 0; font-size: 12.5px; color: var(--text-secondary); }
.row-end strong { display: block; color: var(--text-primary); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.date-pill { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-ctrl); background: rgba(255,255,255,.04); border: 1px solid var(--border-subtle); flex-shrink: 0; line-height: 1.1; }
.date-pill b { font-size: 15px; color: var(--text-primary); }
.date-pill small { font-size: 10.5px; color: var(--text-secondary); }
.date-pill.hoje { background: var(--info-bg); border-color: rgba(43,149,232,.45); }
.date-pill.hoje small, .date-pill.hoje b { color: #9fcdf3; }
.date-pill.atrasada { background: var(--danger-bg); border-color: rgba(233,79,79,.45); }
.date-pill.atrasada small, .date-pill.atrasada b { color: #f08a8a; }
.date-pill.sem { color: var(--text-muted); }
.panel-header .panel-link { font-size: 12.5px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.panel-header .panel-link:hover { color: var(--c-blue); }
.panel-header h2 { display: flex; align-items: center; gap: 8px; }
.panel-header h2 .i { color: var(--text-secondary); }
.panel-count { font-size: 12px; color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.empty-inline { padding: 18px; font-size: 13px; color: var(--text-secondary); }
.empty-inline a { white-space: nowrap; }

/* Barra fixa de ação no celular */
.mobile-actionbar { display: none; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .detail-grid, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border-subtle); }
}

@media (max-width: 900px) {
  .row-two, .profile-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .item-row { flex-wrap: wrap; }
  .ck-row { flex-wrap: wrap; }
  .ck-teste, .ck-obs { flex-basis: 100%; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .topbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .menu-toggle { display: inline-flex; }
  .page-body { padding: 16px 14px 24px; }
  .flash-stack { margin: 10px 14px 0; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-actions .btn-hide-mobile { display: none; }
  .visit-form { grid-template-columns: 1fr 1fr 1fr; }
  .visit-form .vf-obs, .visit-form .vf-data, .visit-form .vf-btn { grid-column: 1 / -1; }

  /* Tabelas que viram cartões */
  .table-stack { max-height: none; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .table-stack tbody tr:nth-child(even) { background: none; }
  .table-stack td { height: auto; padding: 0; border: none; width: auto; }
  .table-stack td.cell-main { width: 100%; min-width: 0; }
  .table-stack td.cell-main .link-title { max-width: 100%; white-space: normal; }
  .table-stack td.hide-stack { display: none; }
  .table-stack td.text-right { margin-left: auto; }
  .table-stack td.actions-cell { width: 100%; display: flex; gap: 6px; }

  /* Ações principais da OS fixas no rodapé */
  .mobile-actionbar {
    display: flex; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(12,19,28,.94);
    backdrop-filter: saturate(140%) blur(10px);
    border-top: 1px solid var(--border);
  }
  .mobile-actionbar .btn { flex: 1; justify-content: center; min-height: 48px; font-size: 15px; }
  .has-actionbar { padding-bottom: 84px; }
  .os-hero-actions .hide-mobile, .has-actionbar .os-hero-actions .ab-dup, .has-actionbar .campo form { display: none; }
  .visit-table .col-cob { display: none; }
  .btn { min-height: 38px; }
  .btn-xs, .btn-sm { min-height: 32px; }
  .seg { display: flex; }
  .seg label { flex: 1; }
  .seg span { justify-content: center; }
}
@media (max-width: 520px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 18px; }
  .os-hero h2 { font-size: 18px; }
  .campo-tempo { font-size: 24px; }
  .campo .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Cabeçalho das colunas de itens do orçamento */
.item-head { display: flex; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.item-head .item-subtotal { color: var(--text-muted); font-weight: 400; }
.btn-remove-item { width: 34px; justify-content: center; padding: 5px; }
@media (max-width: 860px) {
  .item-head { display: none; }
  .item-row { flex-wrap: wrap; padding: 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-ctrl); }
  .item-row .item-desc { flex-basis: 100%; }
  .item-row .item-qtd, .item-row .item-un { width: 64px; }
  .item-row .item-val { flex: 1; width: auto; }
}
@media (max-width: 860px) {
  .visit-table { table-layout: fixed; }
  .visit-table th, .visit-table td { padding-left: 8px; padding-right: 8px; white-space: normal; }
  .visit-table th:last-child, .visit-table td:last-child { width: 46px; }
  .seg span { white-space: normal; text-align: center; padding: 8px 6px; line-height: 1.25; }
  .table-wrap:has(.table-stack) { max-height: none; }
  .toolbar .input-search { max-width: none; flex-basis: 100%; }
  .toolbar .input-sm { max-width: none; flex: 1; }
}
input, select, textarea, button { font-family: inherit; }
.table th.text-right { text-align: right; }

.visit-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.visit-form .input { height: 38px; }
.visit-sum { row-gap: 4px; }
@media (max-width: 860px) {
  .visit-table th { font-size: 10.5px; letter-spacing: 0; padding-left: 6px; padding-right: 6px; }
  .visit-table td { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
  .visit-table td.num { white-space: nowrap; }
  .visit-table th:last-child, .visit-table td:last-child { width: 40px; }
}
@media (max-width: 860px) { .visit-table .wd { display: none; } }

/* Escolha de OS para fechamento */
.pick-row { cursor: pointer; }
.pick-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c-blue); flex-shrink: 0; }
.pick-row:has(input:not(:checked)) .row-main, .pick-row:has(input:not(:checked)) .row-end { opacity: .55; }
.fec-row { align-items: center; }
.fec-row > span:first-child { flex: 1; min-width: 0; }
.fec-row form { flex-shrink: 0; }
.fec-rm { min-height: 0 !important; padding: 2px 4px; }

/* 2FA */
.steps-2fa { padding-left: 20px; display: flex; flex-direction: column; gap: 16px; font-size: 13.5px; color: var(--text-primary); line-height: 1.5; }
.qr-box { background: #fff; border-radius: var(--radius-card); padding: 6px; width: 210px; margin: 10px 0; }
.qr-box svg { display: block; width: 100%; height: auto; }
.chave-2fa, .rec-codes code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-ctrl); padding: 6px 10px; display: inline-block; word-break: break-all; user-select: all; }
.rec-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 8px; }
.rec-codes code { text-align: center; font-size: 14px; letter-spacing: .05em; }
.sidebar-user { color: var(--text-secondary); text-decoration: none; } .sidebar-user:hover { color: var(--text-primary); text-decoration: none; }

/* ══ Modo campo ══════════════════════════════════════════════════════════ */
.campo-page { max-width: 620px; display: flex; flex-direction: column; gap: 14px; }
.cp-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cp-title { font-size: 17px; font-weight: 600; line-height: 1.3; margin-top: 4px; text-wrap: balance; }
.cp-sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.cp-live { border-color: rgba(87,186,94,.4); background: linear-gradient(0deg, rgba(87,186,94,.07), rgba(87,186,94,.07)), var(--bg-card); }
.cp-timer { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; letter-spacing: -.01em; }
.cp-saida { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.cp-pausa { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.cp-pausa .input { height: 48px; font-size: 16px; }
.cp-saida .btn { min-height: 48px; padding-left: 22px; padding-right: 22px; }
.cp-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.cp-links a { display: inline-flex; align-items: center; gap: 5px; }
.cp-saiu { border-color: rgba(43,149,232,.4); }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cp-actions .btn { flex: 1; justify-content: center; }
.cp-nova { padding: 0; }
.cp-nova > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 16px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.cp-nova > summary::-webkit-details-marker { display: none; }
.cp-nova > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.cp-nova > summary .i { color: var(--c-blue); }
.cp-chev .i { transition: transform var(--t-base); color: var(--text-muted) !important; }
.cp-nova[open] .cp-chev .i { transform: rotate(90deg); }
.cp-form { padding: 0 16px 16px; }
.cp-form .input { height: 46px; font-size: 16px; }
.cp-form .lbl { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text-secondary); }
.cp-check { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-ctrl); cursor: pointer; }
.cp-check input { width: 22px; height: 22px; accent-color: var(--c-green); flex-shrink: 0; }
.cp-check span { display: flex; flex-direction: column; font-size: 14px; }
.cp-check small { color: var(--text-secondary); font-size: 12.5px; }
.cp-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.cp-list-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cp-item { padding: 0; overflow: hidden; }
.cp-item-main { display: flex; gap: 12px; align-items: center; padding: 14px 16px 10px; color: inherit; text-decoration: none; }
.cp-item-main:hover { text-decoration: none; background: var(--bg-card-hover); }
.cp-item-actions { display: flex; gap: 8px; padding: 0 16px 14px; }
.cp-item-actions form { flex: 1; display: flex; }
.cp-item-actions .btn { flex: 1; justify-content: center; min-height: 44px; }

/* ══ Barra de abas (celular / app) ═══════════════════════════════════════ */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(12,19,28,.96); backdrop-filter: saturate(140%) blur(10px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 56px; font: inherit; font-size: 11px; color: var(--text-secondary); text-decoration: none;
    background: none; border: 0; cursor: pointer;
  }
  .tabbar .i { width: 21px; height: 21px; }
  .tabbar .on { color: var(--text-primary); }
  .tabbar .on .i { color: var(--c-blue); }
  .tab-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 2px var(--bg-sidebar); }
  .page-body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mobile-actionbar { bottom: calc(56px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .has-actionbar { padding-bottom: 84px; }
  .topbar .menu-toggle { display: none; }
  .sidebar { z-index: 120; }
  .sidebar-scrim { z-index: 110; }
  .campo-page { max-width: none; }
}
@media (max-width: 860px) and (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}
@media (max-width: 860px) { .seg label span { width: 100%; } }
