/* ==========================================================
   Qualivida Helpdesk — Design System
   Base neutra + identidade laranja (#EF7C00) e azul (#2F52A0).
   Complementa o Tailwind (CDN). Tema claro apenas.
   ========================================================== */

:root {
  --brand-orange: #EF7C00;
  --brand-orange-600: #d96f00;
  --brand-orange-050: #fff4e8;
  --brand-blue: #2F52A0;
  --brand-blue-600: #294a91;
  --brand-blue-050: #eef2fb;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6e9f0;
  --text: #1e2433;
  --text-muted: #667085;
  --text-soft: #94a3b8;
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout / app shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar__brand { padding: 12px 12px 8px; text-align: center; }
.sidebar__brand a { display: inline-block; }
.sidebar__brand img { height: 72px; width: auto; max-width: 100%; display: block; margin: 0 auto; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }
.sidebar__section { margin-top: 18px; }
.sidebar__section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-soft); padding: 4px 12px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
  background: var(--brand-orange-050);
  color: var(--brand-orange-600);
  font-weight: 600;
}
.nav-link .badge-count {
  margin-left: auto; background: var(--brand-orange); color: #fff;
  font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 700;
}

.main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; position: sticky; top: 0; z-index: 40;
}
.content { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand-orange); color: #fff; }
.btn-primary:hover { background: var(--brand-orange-600); box-shadow: var(--shadow-sm); }
.btn-blue { background: var(--brand-blue); color: #fff; }
.btn-blue:hover { background: var(--brand-blue-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #e2483d; color: #fff; }
.btn-danger:hover { background: #c93c32; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-weight: 700; font-size: 15px; }

/* ---------- KPI tiles ---------- */
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi__label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.kpi__value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.kpi__icon {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.kpi__icon svg { width: 21px; height: 21px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-orange { background: var(--brand-orange-050); color: var(--brand-orange-600); }
.badge-blue { background: var(--brand-blue-050); color: var(--brand-blue); }
.badge-sky { background: #e6f4fd; color: #0369a1; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-red, .badge-rose { background: #fee2e2; color: #b91c1c; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-slate { background: #eef1f6; color: #475569; }
.badge-teal { background: #ccfbf1; color: #0f766e; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
/* Prefixo `body` eleva a especificidade acima do Preflight do Tailwind (CDN),
   que reseta padding/margin dos campos e é injetado após o app.css. */
body .form-control, body input[type=text], body input[type=email], body input[type=password],
body input[type=number], body input[type=date], body input[type=datetime-local],
body input[type=time], body select, body textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text);
  font-size: 14.5px; font-family: inherit; transition: border .15s, box-shadow .15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(239, 124, 0, 0.14);
}
/* Altura consistente para todos os campos de linha única */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=time], select {
  height: 44px;
}
/* Selects: remover aparência nativa e usar seta própria (padrão em todo o sistema) */
body select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 10px 40px 10px 14px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  text-overflow: ellipsis;
}
select::-ms-expand { display: none; }
textarea { resize: vertical; min-height: 96px; height: auto; }
.form-hint { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; }
.form-error { font-size: 12.5px; color: #dc2626; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-soft); margin: 4px 0 12px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-soft); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 6px; }
.tl-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 17px; top: 38px; bottom: 0;
  width: 2px; background: var(--border);
}
.tl-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--brand-blue);
}
.tl-body { flex: 1; min-width: 0; }
.tl-bubble {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; font-size: 14px;
}

/* ---------- Toasts ---------- */
#toast-root {
  position: fixed; top: 76px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brand-blue); border-radius: 12px;
  padding: 13px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px; font-size: 14px;
  animation: toast-in .25s ease;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.toast.info { border-left-color: var(--brand-blue); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 300px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .18s; z-index: 60;
}
.dropdown.open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }

/* ---------- Badge de notificações ---------- */
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  box-sizing: border-box;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: #dc2626; color: #fff;
  border: 2px solid var(--surface); border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1;
  display: none; align-items: center; justify-content: center; text-align: center;
}

/* ---------- Avatar ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: var(--brand-orange);
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty svg { width: 46px; height: 46px; color: var(--text-soft); margin-bottom: 12px; }

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.grid-cards { display: grid; gap: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- Mobile ---------- */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  z-index: 45; opacity: 0; visibility: hidden; transition: opacity .2s;
}
.sidebar-backdrop.open { opacity: 1; visibility: visible; }
.menu-toggle { display: none; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 16px; padding-bottom: 84px; }
  /* Barra inferior de navegação por polegar (mobile-first para manutenção) */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 44; padding: 6px 4px; box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10.5px; color: var(--text-muted); font-weight: 600; border-radius: 10px;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand-orange); }
  .fab {
    position: fixed; right: 18px; bottom: 80px; z-index: 44;
    width: 56px; height: 56px; border-radius: 50%; background: var(--brand-orange);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg); border: none;
  }
  .fab svg { width: 26px; height: 26px; }
}
@media (min-width: 901px) { .fab { display: none; } }

/* ---------- Notificações / busca / uploads / estrelas ---------- */
.notif-item {
  display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--brand-orange-050); }

#quick-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; display: none; max-height: 340px; overflow-y: auto;
}
.quick-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.quick-item:hover { background: var(--surface-2); }

.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-chip {
  display: flex; align-items: center; gap: 6px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; font-size: 12px;
}
.upload-chip img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.upload-chip svg { width: 18px; height: 18px; color: var(--brand-blue); }

.stars { display: inline-flex; gap: 4px; }
.star { cursor: pointer; color: var(--text-soft); font-size: 26px; line-height: 1; transition: color .1s; }
.star.on { color: var(--brand-orange); }

.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.attachment-thumb {
  position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb .doc { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; padding: 8px; text-align: center; }

/* ---------- Progress / SLA bar ---------- */
.sla-track { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.sla-fill { height: 100%; border-radius: 999px; }

/* ---------- Toggle de emergência ---------- */
.emergency-toggle {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.emergency-toggle:hover { border-color: #f0a35a; }
.emergency-toggle input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: #dc2626; }
.emergency-toggle:has(input:checked) { border-color: #dc2626; background: rgba(220, 38, 38, .05); }
.emergency-toggle__body { display: flex; flex-direction: column; gap: 3px; }
.emergency-toggle__title { font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.emergency-toggle__title svg { width: 17px; height: 17px; color: #dc2626; }
.emergency-toggle__hint { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }

/* ---------- Select estilizado (pill) ---------- */
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap__icon {
  position: absolute; left: 13px; width: 17px; height: 17px;
  color: var(--text-soft); pointer-events: none;
}
.select-pill {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  min-width: 210px; width: auto;
  padding: 10px 40px 10px 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background-color: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
  transition: border .15s, box-shadow .15s;
}
.select-pill:hover { border-color: var(--text-soft); }
.select-pill:focus {
  outline: none; border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(239, 124, 0, 0.14);
}

/* ---------- Card de filtros ---------- */
.filter-card { padding: 16px 18px; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-grid > select {
  flex: 1 1 160px; min-width: 0; height: 42px;   /* uniforme, quebra no mobile */
}
.filter-search { position: relative; flex: 1 1 100%; min-width: 0; }  /* linha inteira */
/* Lucide troca <i> por <svg> ao renderizar — mirar em ambos */
.filter-search > svg, .filter-search > i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-soft); pointer-events: none;
}
/* `body` eleva a especificidade acima do reset global dos inputs */
body .filter-search input { width: 100%; height: 42px; padding-left: 40px; }
.filter-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}

/* ---------- Barra de resultados (contagem + ordenação) ---------- */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 12px;
}
.sort-select { height: 38px; min-width: 165px; width: auto; }

/* ---------- Filtros ao vivo ---------- */
.is-loading { position: relative; opacity: .55; transition: opacity .15s; pointer-events: none; }
.is-loading::after {
  content: ''; position: absolute; top: 20px; left: 50%; width: 26px; height: 26px;
  margin-left: -13px; border: 3px solid var(--border); border-top-color: var(--brand-orange);
  border-radius: 50%; animation: qv-spin .7s linear infinite; z-index: 5;
}
@keyframes qv-spin { to { transform: rotate(360deg); } }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Grades responsivas reutilizáveis ----------
   Substituem os `style="grid-template-columns:..."` inline, que não
   colapsavam no mobile por terem precedência sobre as media queries. */
.grid-2, .grid-3, .grid-4, .grid-21 { display: grid; gap: 14px; }
.grid-2  { grid-template-columns: 1fr 1fr; }
.grid-21 { grid-template-columns: 2fr 1fr; }
.grid-3  { grid-template-columns: 1fr 1fr 1fr; }
.grid-4  { grid-template-columns: 2fr 2fr 1fr 1fr; }
@media (max-width: 820px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-21, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Área segura (iPhone com barra de gestos) ---------- */
@media (max-width: 900px) {
  .bottom-nav {
    height: auto; min-height: 64px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Toasts não devem cobrir a topbar nem vazar na lateral no celular */
  #toast-root { top: 72px; left: 12px; right: 12px; max-width: none; }
  /* Menus suspensos nunca mais largos que a tela */
  .dropdown__menu { min-width: 0; width: min(92vw, 340px); }
}

/* ---------- Toque confortável (mínimo 44px) ---------- */
@media (hover: none) {
  .btn-sm { padding: 9px 13px; }
  .bottom-nav a { min-height: 50px; }
}

/* ---------- Lista de checkboxes (ex.: unidades de um usuário) ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px;
  max-height: 260px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; background: var(--surface-2); }
.check-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check-list input[type=checkbox] { width: 18px; height: 18px; flex: none;
  accent-color: var(--brand-orange); margin: 0; }
.check-list label { cursor: pointer; }

/* ---------- Tabelas que viram cartões no celular ---------- */
@media (max-width: 700px) {
  table.data.stacked thead { display: none; }
  table.data.stacked, table.data.stacked tbody, table.data.stacked tr,
  table.data.stacked td { display: block; width: 100%; }
  table.data.stacked tr {
    border-bottom: 1px solid var(--border); padding: 12px 14px;
  }
  table.data.stacked tr:last-child { border-bottom: none; }
  table.data.stacked td {
    border: none; padding: 3px 0; display: flex; gap: 10px;
    align-items: center; justify-content: space-between;
  }
  table.data.stacked td::before {
    content: attr(data-label); color: var(--text-soft); font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
    flex: none;
  }
  table.data.stacked td[data-label=""]::before { content: none; }
}

/* ---------- Busca na topbar ---------- */
.topbar-search { position: relative; flex: 1 1 auto; max-width: 420px; }
.topbar-search > svg, .topbar-search > i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-soft); pointer-events: none; z-index: 1;
}
body .topbar-search input { height: 40px; padding-left: 38px; background: var(--surface-2); }
@media (max-width: 700px) {
  /* No celular a busca fica na própria página; a topbar guarda espaço p/ ações */
  .topbar-search { display: none; }
}
