/* ============================================================
   Next Tag · Painel Financeiro Interno
   style.css — tema claro da marca (azul-marinho + verde-esmeralda)
   Layout: sidebar fixa + área de conteúdo + drawer de formulário
   Focado em desktop.
   ============================================================ */

/* ---------- Paleta extraída do logo Next Tag ---------- */
:root {
  --navy:        #16212e;   /* azul-marinho da marca (N e texto) */
  --navy-700:    #1f2f40;
  --navy-600:    #2b3f54;
  --teal:        #17b8a6;   /* verde-esmeralda (o ponto do logo) */
  --teal-600:    #12a091;
  --teal-050:    #e6f7f4;

  --bg:          #f4f5f6;   /* off-white do fundo do logo */
  --surface:     #ffffff;   /* cards e painéis */
  --surface-2:   #fafbfc;
  --border:      #e6e9ec;
  --border-2:    #eef1f3;

  --text:        #16212e;   /* texto principal (navy) */
  --text-soft:   #5b6b78;   /* texto secundário */
  --text-faint:  #93a1ac;   /* labels, dicas */

  --revenue:     #17b8a6;   /* receita = verde da marca */
  --revenue-bg:  #e6f7f4;
  --expense:     #e5544b;   /* gasto = vermelho */
  --expense-bg:  #fdecea;
  --info:        #3d7fd0;   /* azul auxiliar (links/saldo) */

  --radius:      14px;
  --radius-sm:   9px;
  --shadow-sm:   0 1px 2px rgba(22, 33, 46, 0.06);
  --shadow:      0 4px 16px rgba(22, 33, 46, 0.08);
  --shadow-lg:   -8px 0 40px rgba(22, 33, 46, 0.18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --sidebar-w:   248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   CONTROLE DE ACESSO (login x app)
   Por padrão o app fica oculto e o login visível. Quando o body
   recebe .authenticated, inverte-se.
   ============================================================ */
.app-shell { display: none; }
body.authenticated .app-shell { display: unset; }
body.authenticated .sidebar { display: flex; }   /* restaura o flex da sidebar */
body.authenticated .app { display: flex; }        /* restaura o flex do app */
body.authenticated .login-screen { display: none; }

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0e1a24 0%, #16212e 55%, #12312b 100%);
  z-index: 100;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 36px 32px;
  text-align: center;
}

.login-brand {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin: 0 auto 22px;
  width: fit-content;
}
.login-logo { display: block; width: 190px; max-width: 60vw; height: auto; }

.login-title { font-size: 22px; font-weight: 700; color: var(--navy); }
.login-sub { font-size: 13px; color: var(--text-soft); margin: 4px 0 26px; }

.login-card .field { text-align: left; margin-bottom: 16px; }
.login-card .field label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.login-card .field input { width: 100%; }

.login-error {
  background: var(--expense-bg);
  color: var(--expense);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.login-info {
  background: var(--teal-050);
  color: var(--teal-600);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-foot { font-size: 11px; color: var(--text-faint); margin-top: 22px; letter-spacing: 0.4px; }

/* Login responsivo em telas baixas */
@media (max-height: 560px) {
  .login-screen { align-items: flex-start; }
  .login-card { padding: 24px; }
  .login-brand { margin-bottom: 14px; }
  .login-sub { margin-bottom: 16px; }
}

/* ============================================================
   USUÁRIO LOGADO (rodapé da sidebar)
   ============================================================ */
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 10px;
  color: #cdd7df; font-size: 13px;
}
.sidebar-user .user-ico { color: var(--teal); }
.sidebar-user .user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link.logout:hover { background: rgba(229, 84, 75, 0.15); color: #ff8a80; }

/* Etiqueta "você" na tabela de usuários */
.tag-voce {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 20px; font-size: 10.5px; font-weight: 700;
  background: var(--teal-050); color: var(--teal-600);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #cdd7df;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 20;
}

.sidebar-brand {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
}
.sidebar-logo { width: 100%; max-width: 180px; height: auto; display: block; }

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: #aebac4;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: var(--teal); color: #04231f; font-weight: 600; }
.nav-ico { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.side-link {
  background: transparent; border: none; color: #aebac4;
  text-align: left; padding: 8px 10px; border-radius: 7px; font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-note { color: #6f7f8b; font-size: 11px; padding: 8px 10px 0; }

/* ============================================================
   ÁREA DE CONTEÚDO
   ============================================================ */
.app { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
  background: rgba(244, 245, 246, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.page-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Avatar do usuário + popover ---------- */
.user-menu { position: relative; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #04231f;
  font-weight: 700;
  font-size: 14px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.08s;
  text-transform: uppercase;
}
.avatar:hover { box-shadow: 0 0 0 3px var(--teal-050); }
.avatar:active { transform: translateY(1px); }
.avatar-lg { width: 46px; height: 46px; font-size: 16px; cursor: default; }

.user-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 30;
  animation: fade 0.15s ease;
}

.user-popover-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.user-popover-info { min-width: 0; }
.user-popover-name { font-weight: 700; color: var(--navy); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-popover-email { font-size: 12px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-popover-logout {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--expense);
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-popover-logout:hover { background: var(--expense-bg); border-color: var(--expense); }

/* Toggle segmentado (Mês atual / Geral) */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; box-shadow: var(--shadow-sm); }
.seg-btn { border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-soft); transition: all 0.15s; }
.seg-btn.active { background: var(--navy); color: #fff; }

/* ---------- Botões ---------- */
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; transition: transform 0.08s, background 0.15s, box-shadow 0.15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #04231f; box-shadow: 0 4px 12px rgba(23, 184, 166, 0.3); }
.btn-primary:hover { background: var(--teal-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--navy-600); color: var(--text); }

.link-btn { background: none; border: none; color: var(--teal-600); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.content { padding: 28px 32px 48px; flex: 1; }

/* ============================================================
   KPIs
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
/* faixa de cor no topo do card */
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.kpi-revenue::before { background: var(--revenue); }
.kpi-expense::before { background: var(--expense); }
.kpi-balance::before { background: var(--info); }
.kpi-count::before   { background: var(--navy-600); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-badge { font-size: 12px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.6px; }
.kpi-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 13px; }
.kpi-revenue .kpi-ico { background: var(--revenue-bg); color: var(--revenue); }
.kpi-expense .kpi-ico { background: var(--expense-bg); color: var(--expense); }
.kpi-balance .kpi-ico { background: #e8f1fb; color: var(--info); }
.kpi-count .kpi-ico   { background: #eef1f3; color: var(--navy-600); }

.kpi-value { font-size: 27px; font-weight: 750; letter-spacing: -0.5px; }
.kpi-revenue .kpi-value { color: var(--revenue); }
.kpi-expense .kpi-value { color: var(--expense); }
.kpi-balance .kpi-value { color: var(--info); }
.kpi-foot { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

/* ============================================================
   PAINÉIS / GRÁFICOS
   ============================================================ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-title { font-size: 16px; font-weight: 650; }
.panel-hint { font-size: 12px; color: var(--text-faint); }

.charts-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.charts-grid .panel { margin-bottom: 22px; }
.chart-wrap { position: relative; height: 300px; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-faint); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.col-actions { text-align: right; }

/* Badge de tipo */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-receita { background: var(--revenue-bg); color: var(--revenue); }
.badge-gasto   { background: var(--expense-bg); color: var(--expense); }

.val { font-weight: 650; font-variant-numeric: tabular-nums; }
.val-receita { color: var(--revenue); }
.val-gasto   { color: var(--expense); }

.cliente-cell { font-weight: 550; }
.cell-sub { display: block; font-weight: 400; font-size: 12px; color: var(--text-faint); margin-top: 1px; }

/* Linha clicável (resumo por cliente -> abre Lançamentos filtrado) */
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover { background: var(--teal-050); }
.go-hint { font-size: 11px; font-weight: 600; color: var(--teal-600); opacity: 0; transition: opacity 0.15s; }
.data-table tr.clickable:hover .go-hint { opacity: 1; }

.link-chip { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; text-decoration: none; color: var(--info); background: #eef4fb; transition: background 0.15s; }
.link-chip:hover { background: #dceafa; }
.muted { color: var(--text-faint); }

.obs-cell { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-soft); font-size: 13px; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); border-radius: 8px; padding: 6px 10px; font-size: 13px; transition: all 0.15s; }
.icon-btn:hover { color: var(--navy); border-color: var(--navy-600); }
.icon-btn.danger:hover { color: var(--expense); border-color: var(--expense); background: var(--expense-bg); }
.icon-label { display: none; } /* aparece só no celular (botões com texto) */

.empty-state { text-align: center; color: var(--text-faint); padding: 40px 0; font-size: 14px; }

/* ============================================================
   BARRA DE FILTROS
   ============================================================ */
.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field.grow { flex: 1; min-width: 180px; }
.filter-field label { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   CAMPOS DE FORMULÁRIO (compartilhado filtros + drawer)
   ============================================================ */
input, select, textarea { font-family: inherit; }
.filter-field input, .filter-field select,
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-field input:focus, .filter-field select:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-050);
}
.field textarea { resize: vertical; }

/* ============================================================
   DRAWER (FORMULÁRIO DESLIZANTE)
   ============================================================ */
.drawer-overlay { position: fixed; inset: 0; background: rgba(22, 33, 46, 0.4); z-index: 40; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer.open { transform: translateX(0); }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 18px; font-weight: 700; }
.drawer-close { border: none; background: var(--surface-2); width: 34px; height: 34px; border-radius: 8px; font-size: 15px; color: var(--text-soft); }
.drawer-close:hover { background: var(--expense-bg); color: var(--expense); }

.drawer-body { padding: 24px; overflow-y: auto; flex: 1; }

.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-soft); }

/* Seletor de tipo em botões (radio estilizado) */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; color: var(--text-soft); transition: all 0.15s;
}
#tipoReceita:checked + .type-receita { border-color: var(--revenue); background: var(--revenue-bg); color: var(--revenue); }
#tipoGasto:checked + .type-gasto     { border-color: var(--expense); background: var(--expense-bg); color: var(--expense); }
.type-opt:hover { border-color: var(--navy-600); }

.drawer-actions { display: flex; gap: 10px; margin-top: 8px; }
.drawer-actions .btn { flex: 1; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 13px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); z-index: 60;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--teal-600); }
.toast.danger { background: var(--expense); }

/* ============================================================
   BARRA DE TOPO (busca + botão adicionar) — Links e Usuários
   ============================================================ */
.qr-toolbar { display: flex; align-items: flex-end; gap: 14px; }
.qr-toolbar .filter-field.grow { flex: 1; }

.field-hint { font-size: 11.5px; color: var(--text-faint); }

/* Ícones nativos de date/time */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; }

/* ============================================================
   ELEMENTOS DO MENU MOBILE (base — escondidos no desktop)
   ============================================================ */
.topbar-left { display: flex; align-items: center; gap: 14px; }

/* Botão hamburguer: só aparece no mobile (ver media queries) */
.menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.menu-btn:hover { border-color: var(--navy-600); }

/* Overlay do menu (escurece o fundo) */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(22,33,46,0.45); z-index: 25; }

/* A sidebar desliza suavemente quando vira off-canvas */
.sidebar { transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1); }

/* ============================================================
   RESPONSIVIDADE
   Breakpoints: 1180 (laptop), 900 (tablet -> menu off-canvas),
   680 (celular -> tabelas viram cards), 380 (celular pequeno)
   ============================================================ */

/* ---- Laptops menores: KPIs 2 col, gráficos empilhados ---- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid, .report-grid { grid-template-columns: 1fr; }
}

/* ---- Tablet / celular: sidebar vira menu deslizante ---- */
@media (max-width: 900px) {
  .app { margin-left: 0; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: 260px;
    z-index: 45;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .menu-btn { display: grid; place-items: center; }

  .topbar { padding: 14px 18px; }
  .content { padding: 20px 18px 40px; }

  .page-title { font-size: 19px; }
  .page-sub { font-size: 12px; }

  /* O botão "Novo lançamento" mostra só o + para caber melhor */
  .topbar-actions { gap: 10px; }
  #btnNovo { padding: 10px 14px; }
}

/* ---- Celular: layout em coluna única e tabelas em cards ---- */
@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .topbar-actions { justify-content: space-between; }
  .segmented { flex: 1; }
  .seg-btn { flex: 1; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 22px; }

  .panel { padding: 16px; }
  .chart-wrap { height: 240px; }

  /* Filtros empilhados, cada um ocupando a linha toda */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-field, .filter-field.grow { width: 100%; }
  .filter-bar .btn { width: 100%; }

  /* Drawer ocupa a tela inteira no celular */
  .drawer { width: 100vw; max-width: 100vw; }

  /* Esconde a dica de clique (o toque já resolve) */
  .panel-hint { display: none; }

  /* ---- Tabelas viram cards empilhados ---- */
  .data-table, .data-table thead, .data-table tbody,
  .data-table th, .data-table td, .data-table tr { display: block; }

  /* Esconde o cabeçalho (cada célula ganha rótulo próprio) */
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .data-table tr {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .data-table tbody tr:hover { background: var(--surface-2); }
  .data-table tbody tr:last-child td { border-bottom: 1px solid var(--border-2); }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-2);
    text-align: right;
  }
  .data-table td:last-child { border-bottom: none; }

  /* Rótulo à esquerda de cada célula, vindo do atributo data-label */
  .data-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-faint);
    text-align: left;
    flex-shrink: 0;
  }

  .obs-cell { max-width: none; white-space: normal; text-align: right; }
  .go-hint { opacity: 1; } /* no toque, mostra sempre a dica */

  /* Botões de ação maiores e com texto, melhores para o toque */
  .row-actions { justify-content: flex-end; gap: 8px; }
  .icon-btn { padding: 9px 14px; font-size: 14px; }
  .icon-label { display: inline; }

  /* Barra de topo (Links/Usuários) empilha no celular */
  .qr-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .qr-toolbar .btn { width: 100%; }

  /* Popover do avatar não estoura em telas estreitas */
  .user-popover { width: min(260px, 86vw); }
}

/* ---- Celular pequeno ---- */
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
