/* =====================================================================
   style.css v2 — visual do app Reboque
   ---------------------------------------------------------------------
   • Layout de aplicativo: topo fixo, abas (desktop) / barra inferior (celular)
   • Componentes: cartões, passos, estatísticas, badges, formulários, modal
   • Tema claro e escuro automáticos (prefers-color-scheme)
   • Sem fontes/ícones externos: só o sistema e emojis (CSP 'self')
   ===================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #e8efff;
  --btn-bg: #2563eb;
  --btn-bg-hover: #1d4ed8;
  --success: #047857;
  --success-soft: #e7f7ef;
  --warning: #b45309;
  --warning-soft: #fff6e5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .06);
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2b;
    --surface-2: #182338;
    --text: #e6ecf6;
    --muted: #94a3b8;
    --border: #26344d;
    --brand: #60a5fa;
    --brand-2: #93c5fd;
    --brand-soft: #172554;
    --btn-bg: #2f6fed;
    --btn-bg-hover: #3b82f6;
    --success: #34d399;
    --success-soft: #052e22;
    --warning: #fbbf24;
    --warning-soft: #3a2a08;
    --danger: #f87171;
    --danger-soft: #3f1212;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 34px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

/* ---------------------------------------------------------------------
   Botões
   --------------------------------------------------------------------- */
.btn,
button:not(.tab):not(.link):not(.btn):not(.sec) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--btn-bg);
  color: #fff;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover,
button:not(.tab):not(.link):not(.btn):not(.sec):hover { background: var(--btn-bg-hover); }
.btn:active,
button:not(.tab):not(.link):not(.btn):not(.sec):active { transform: translateY(1px); }

.btn-primary { background: var(--btn-bg); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .22); }
.btn-primary:hover { background: var(--btn-bg-hover); }

.btn-ghost,
button.sec {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn-ghost:hover,
button.sec:hover { background: var(--surface-2); border-color: var(--border); }

.btn-soft { background: var(--brand-soft); color: var(--brand-2); }
.btn-soft:hover { background: var(--brand-soft); filter: brightness(.97); }

.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); filter: brightness(.96); }

.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled,
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

button.link {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 650;
  text-decoration: underline;
}

.btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Campos
   --------------------------------------------------------------------- */
label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13.5px;
  font-weight: 650;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
  outline: none;
}
textarea { min-height: 170px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[type="file"] { padding: 10px; background: var(--surface-2); }
input[type="checkbox"] { width: auto; min-height: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { margin: 0; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid .full { grid-column: 1 / -1; }

.section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.section-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--btn-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.form-actions .btn { margin: 0; }

/* ---------------------------------------------------------------------
   Estrutura (topo, abas, conteúdo)
   --------------------------------------------------------------------- */
.shell { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 11px 20px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 21px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.brand-text { min-width: 0; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 650;
}
.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.user-role { color: var(--muted); font-weight: 600; }
.help-ico {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.tabs-wrap { background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.on { background: var(--brand-soft); color: var(--brand-2); }
.tab-ico { font-size: 16px; line-height: 1; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.content-narrow { max-width: 920px; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head .page-text { min-width: 0; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { margin-top: 4px; font-size: 14.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Cartões, grids, badges
   --------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 0; }
.card-title { font-size: 17px; font-weight: 800; }
.card-sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.grid-2, .grid-3 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-rascunho { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-conferido { background: var(--brand-soft); color: var(--brand-2); }
.badge-enviado { background: var(--success-soft); color: var(--success); }

.muted { color: var(--muted); }
.center { text-align: center; }
.err { margin-top: 10px; color: var(--danger); font-size: 14px; font-weight: 650; }
.ok { color: var(--success); font-weight: 650; }
.aviso {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13.5px;
  font-weight: 600;
}
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 650;
}
.banner.ok { background: var(--success-soft); color: var(--success); }
.banner.erro { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------------
   Estatísticas e primeiros passos
   --------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.stat-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--brand-soft);
  font-size: 18px;
}
.stat.warn .stat-ico { background: var(--warning-soft); }
.stat-num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--muted); }

.onboarding {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: var(--border);
}
.onboarding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onboarding-title { font-size: 18px; font-weight: 800; }

progress.progress {
  display: block;
  width: 100%;
  height: 9px;
  margin: 12px 0 14px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
  appearance: none;
}
progress.progress::-webkit-progress-bar { background: var(--border); }
progress.progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }

.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.step.done { opacity: .72; }
.step-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
}
.step.done .step-ico { background: var(--success-soft); color: var(--success); }
.step-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.step-body b { font-size: 14.5px; }
.step-body span { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Barra de busca e filtros
   --------------------------------------------------------------------- */
.toolbar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.toolbar select { min-width: 170px; }
@media (max-width: 720px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search-wrap { grid-column: 1 / -1; }
}
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  border: 2px solid var(--muted);
  border-radius: 50%;
  font-size: 0;
  opacity: .8;
  pointer-events: none;
}
.search-wrap .search-ico::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}
.search-wrap input[type="search"] { padding-left: 40px; }

/* ---------------------------------------------------------------------
   Grupos e cartões de serviço
   --------------------------------------------------------------------- */
details.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.group + details.group { margin-top: 12px; }
.group-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  user-select: none;
}
.group-summary::-webkit-details-marker { display: none; }
.group-summary:hover { background: var(--surface-2); }
.group-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--brand-soft);
  font-size: 17px;
}
.group-name { font-size: 15.5px; }
.group-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.group-count { margin-left: auto; }
.chev { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s ease; }
details[open] > summary .chev { transform: rotate(90deg); }
.group-body { display: grid; gap: 10px; padding: 12px 14px 16px; border-top: 1px solid var(--border); }

details.service {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.service-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.service-summary::-webkit-details-marker { display: none; }
.service-summary:hover { background: var(--surface-2); }
.service-title { font-weight: 750; font-size: 15px; }
.service-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 13px; }
.service-body { padding: 0 14px 14px; border-top: 1px dashed var(--border); }

dl.kv {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 6px 14px;
  margin: 14px 0;
}
dl.kv dt { color: var(--muted); font-size: 12px; font-weight: 600; }
dl.kv dd { margin: 0; font-size: 14px; font-weight: 650; word-break: break-word; }
@media (max-width: 700px) { dl.kv { grid-template-columns: auto 1fr; } }

.service-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------------------------------------------------------------------
   Estados vazios, seguradoras, planilhas
   --------------------------------------------------------------------- */
.empty {
  padding: 38px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--brand-soft);
  font-size: 30px;
}
.empty-title { font-size: 18px; font-weight: 800; }
.empty-text { max-width: 460px; margin: 6px auto 16px; color: var(--muted); font-size: 14px; }

.seg-card { display: flex; flex-direction: column; gap: 12px; }
.seg-head { display: flex; align-items: center; gap: 12px; }
.seg-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 19px;
}
.seg-name { font-size: 16px; font-weight: 800; }
.seg-meta { font-size: 13px; color: var(--muted); }
.seg-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.wizard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .wizard { grid-template-columns: 1fr; } }
.wizard-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.wizard-step .step-ico { background: var(--brand); color: #fff; }
.wizard-step b { display: block; font-size: 14px; }
.wizard-step span { font-size: 12.5px; color: var(--muted); }

/* Mapa de colunas da planilha */
.col {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.col b { display: block; margin-bottom: 6px; font-size: 14px; }
.col select { margin-bottom: 8px; }
.col input + input { margin-top: 8px; }

/* ---------------------------------------------------------------------
   Login e estados de carga
   --------------------------------------------------------------------- */
.login-shell {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(37, 99, 235, .16), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(124, 58, 237, .12), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { margin: 4px 0 6px; color: var(--muted); font-size: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }

.skeleton {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: esqueleto 1.3s ease infinite;
}
@keyframes esqueleto {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------------------------------------------------------------
   Modal de ajuda
   --------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 12, 24, .55);
  backdrop-filter: blur(3px);
}
.modal {
  width: min(600px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 20px 22px; font-size: 14.5px; }
.modal-body ol { display: grid; gap: 12px; margin: 0; padding-left: 20px; }
.modal-body li b { display: block; }
.modal-body li span { color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------------
   Utilidades antigas mantidas por compatibilidade
   --------------------------------------------------------------------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
.manual { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Celular: barra inferior e ajustes
   --------------------------------------------------------------------- */
@media (max-width: 820px) {
  .tabs-wrap { background: transparent; border: 0; }
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    gap: 4px;
    max-width: none;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
  }
  .tab {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-height: 54px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 650;
    border-radius: 10px;
  }
  .tab-ico { font-size: 18px; }
  .content { padding: 18px 14px 104px; }
  .topbar-inner { padding: 10px 14px; }
  .brand-sub { display: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
  .brand-title { font-size: 16px; }
  .page-title { font-size: 22px; }
  .page-head { margin-bottom: 14px; }
  .card { padding: 15px; border-radius: 14px; }
  .hide-sm { display: none; }
  .user-role { display: none; }
  dl.kv { grid-template-columns: auto 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
}

@media (max-width: 420px) {
  .user-chip { padding: 4px; }
  .user-chip .avatar { width: 28px; height: 28px; }
}

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

/* Ajustes finos de layout (grupos e serviços) */
.group-main { flex: 0 1 auto; min-width: 0; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-meta { margin-right: auto; }
.service-main { min-width: 0; }
@media (max-width: 520px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .search-wrap { grid-column: auto; }
  .group-summary {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 2px;
    column-gap: 10px;
  }
  .group-ico { grid-row: 1 / 3; }
  .group-main { grid-column: 2; grid-row: 1; }
  .group-meta { grid-column: 2 / 4; grid-row: 2; width: auto; margin-right: 0; }
  .chev { grid-column: 3; grid-row: 1; }
}

@media (max-width: 520px) {
  .step { display: grid; grid-template-columns: 30px 1fr; gap: 8px 10px; align-items: center; }
  .step-ico { grid-row: 1 / 3; }
  .step .btn, .step .badge { grid-column: 2; justify-self: start; }
}
