/* ==========================================================
   Suplemento de Pessoal — PMPE
   Folha de estilo única do sistema
   ========================================================== */

:root {
  --accent: #1e3a5f;
  --accent-text: #1e3a5f;
  --accent-contrast: #ffffff;
  --gold: #a8842f;
  --ink: #1b2430;
  --bg: #eef1f5;
  --surface: #ffffff;
  --text: #1b2430;
  --text-muted: #5b6777;
  --border: #d5dce6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20,40,63,0.06);
  --space: 16px;
  --success: #1d6b3a;
  --danger: #9b1c1c;
  --warning: #8a5a00;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
*, ::before, ::after { margin: 0; padding: 0; border: 0 solid; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
ol, ul, menu { list-style: none; }
svg, video, canvas, iframe { display: block; vertical-align: middle; }
button, input, select, textarea { color: inherit; background-color: transparent; border-radius: 0; font: inherit; }
table { border-collapse: collapse; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }

/* ---------- Estrutura ---------- */
.shell-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.shell-section { padding: calc(var(--space) * 2) 0; }
.shell-grid { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shell-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: var(--space); }
.shell-footer { padding: 24px 0 40px; color: var(--text-muted); font-size: 13px; }
.main-wrap { margin-top: -36px; position: relative; z-index: 2; }

/* ---------- Cabeçalho do app ---------- */
.app-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #14283f 100%);
  color: #ffffff;
  padding: 28px 0 56px;
  border-bottom: 3px solid var(--gold);
}
.app-header .muted { color: #cfd9e6; }
.app-header .eyebrow { background: rgba(255,255,255,0.12); color: #f2e3b5; border-color: rgba(255,255,255,0.25); }
.brand-mark {
  width: 52px; height: 52px; border-radius: 12px;
  background: #ffffff; color: #1e3a5f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.app-header .btn[data-variant="outline"] { color: #ffffff; border-color: rgba(255,255,255,0.5); }
.app-header .btn[data-variant="outline"]:hover { background: rgba(255,255,255,0.12); }
.app-header .btn.secondary-light { background: #ffffff; color: #1e3a5f; }

/* ---------- Painéis e KPIs ---------- */
.panel { background: #ffffff; border: 1px solid #d5dce6; border-radius: 12px; box-shadow: 0 1px 3px rgba(20,40,63,0.06); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi-card { background: #ffffff; border: 1px solid #d5dce6; border-top: 3px solid #1e3a5f; border-radius: 10px; padding: 16px; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20,40,63,0.1); }
.kpi-card .kv { font-size: 1.7rem; font-weight: 700; color: #1e3a5f; line-height: 1.1; }
.kpi-card .kl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: #5b6777; font-weight: 600; }
.kpi-card .kc { font-size: 0.75rem; color: #5b6777; margin-top: 4px; }
.gold-line { color: var(--gold); font-weight: 600; }

/* ---------- Formulários ---------- */
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.78rem; font-weight: 600; color: #3a4658; }
.helper { font-size: 0.72rem; color: #66717f; }
.hint-line { font-size: 0.75rem; color: #66717f; }
.input, select.input { background: #ffffff; border: 1px solid #c4ccd8; border-radius: 8px; padding: 8px 10px; font-size: 0.875rem; color: var(--ink); width: 100%; }
.input::placeholder { color: #8a94a3; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus-visible, button:focus-visible, .tab-btn:focus-visible, th[tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---------- Botões ---------- */
.btn-primary { background: #1e3a5f; color: #fff; border: 1px solid #1e3a5f; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.btn-primary:hover { background: #14283f; }
.btn-ghost { background: transparent; color: #1e3a5f; border: 1px solid #c4ccd8; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.btn-ghost:hover { background: #f1f4f8; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; border: 1px solid #1e3a5f; background: #ffffff; color: #1e3a5f; font-weight: 600; cursor: pointer; }
.btn-sm:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm:hover:not(:disabled) { background: #1e3a5f; color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.btn:hover { background: #14283f; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn[data-variant="secondary"] { background: #eef1f5; color: var(--ink); }
.btn[data-variant="outline"] { background: #fff; color: var(--ink); border-color: var(--border); }
.btn[data-variant="ghost"] { background: transparent; color: var(--ink); }
.btn[data-variant="outline"]:hover, .btn[data-variant="ghost"]:hover { background: #f1f4f8; }
.btn[data-variant="destructive"] { background: var(--danger); color: #fff; }
.btn[data-size="sm"] { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[data-size="lg"] { height: 42px; padding: 0 20px; font-size: 15px; }

/* ---------- Abas ---------- */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid #d5dce6; overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 12px 16px; font-size: 0.9rem; font-weight: 600; color: #4a5566; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: #1e3a5f; }
.tab-btn[aria-selected="true"] { color: #1e3a5f; border-bottom-color: var(--gold); }
.view { display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.data th { background: #f3f5f9; color: #2d3a4d; text-align: left; font-weight: 600; padding: 10px 8px; border-bottom: 2px solid #d5dce6; white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; }
table.data th .sort { color: #9aa5b5; font-size: 0.7rem; margin-left: 4px; }
table.data th[aria-sort="ascending"] .sort, table.data th[aria-sort="descending"] .sort { color: var(--gold); }
table.data td { padding: 9px 8px; border-bottom: 1px solid #e6ebf2; vertical-align: top; }
table.data tbody tr:hover { background: #f7f9fc; }
table.data tbody tr.clickable { cursor: pointer; }
.name-link { color: #1e3a5f; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(168,132,47,.6); text-underline-offset: 3px; background: none; border: 0; padding: 0; font-size: inherit; text-align: left; cursor: pointer; }
.ref-cell { max-width: 320px; }
.ref-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #3a4658; font-size: 0.76rem; }
.ref-text.expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
.ref-toggle { background: none; border: 0; color: #1e3a5f; font-size: 0.72rem; font-weight: 600; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.badge-status { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-ativa { background: #e3f4ea; color: #1d6b3a; }
.st-sem { background: #fbe4e4; color: #9b1c1c; }
.st-err { background: #fdf1d6; color: #8a5a00; }
.cat-tag { display: inline-block; font-size: 0.7rem; padding: 2px 7px; border-radius: 6px; background: #e7edf6; color: #1e3a5f; font-weight: 600; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px; font-size: 0.85rem; }
.empty-state { text-align: center; padding: 40px 12px; color: #66717f; }

/* ---------- Gráficos de barra ---------- */
.chart-row { display: grid; grid-template-columns: 170px 1fr 56px; gap: 10px; align-items: center; font-size: 0.8rem; margin-bottom: 8px; }
.chart-row .lbl { color: #2d3a4d; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-row .track { background: #edf1f6; border-radius: 4px; height: 14px; overflow: hidden; }
.chart-row .fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1e3a5f, #3d6592); transition: width .5s ease; }
.chart-row .fill.gold { background: linear-gradient(90deg, #a8842f, #d4b15e); }
.chart-row .val { font-weight: 600; color: #1e3a5f; text-align: right; }
.chart-card-head { margin-bottom: 12px; }
.chart-card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; color: #1b2430; }
.chart-card-head p { font-size: 0.78rem; color: #66717f; margin: 2px 0 0; }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,25,40,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 80; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(520px, 100%); background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .3s ease; z-index: 81; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 20px; border-bottom: 1px solid #d5dce6; background: #f6f8fb; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ---------- Linha do tempo ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: #d5dce6; }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #1e3a5f; border: 2px solid #fff; box-shadow: 0 0 0 1px #1e3a5f; }
.tl-item.sem::before { background: #9b1c1c; box-shadow: 0 0 0 1px #9b1c1c; }
.tl-item.err::before { background: #a8842f; box-shadow: 0 0 0 1px #a8842f; }
.tl-card { background: #f7f9fc; border: 1px solid #e0e6ef; border-radius: 8px; padding: 10px 12px; }

/* ---------- Glossário e siglas ---------- */
.glossary-item { border-bottom: 1px solid #e6ebf2; padding: 12px 0; }
.glossary-item dt { font-weight: 700; color: #1e3a5f; font-size: 0.9rem; }
.glossary-item dd { margin: 4px 0 0; font-size: 0.85rem; color: #3a4658; }
.sigla-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; font-size: 0.82rem; }
.sigla-grid div { padding: 6px 0; border-bottom: 1px dashed #e0e6ef; }
.sigla-grid strong { color: #1e3a5f; display: inline-block; min-width: 86px; }

/* ---------- Avisos e alertas ---------- */
.notice { font-size: 0.78rem; color: #5b6777; background: #fbf7ea; border: 1px solid #efe2b8; border-radius: 8px; padding: 8px 12px; }
.toast-custom { position: fixed; bottom: 20px; right: 20px; background: #14283f; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.25); z-index: 100; font-size: 0.85rem; max-width: 340px; animation: fadeIn .25s ease; }
.toast-custom.ok { border-left: 4px solid var(--gold); }
.alert { display: grid; gap: 4px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; }
.alert h2, .alert h3 { margin: 0; font-size: 14px; font-weight: 600; }
.alert p, .alert section { margin: 0; color: var(--text-muted); }
.alert[data-variant="destructive"] { border-color: #e0b4b4; background: #fdf2f2; color: var(--danger); }
.alert[data-variant="success"] { border-color: #b4dcc4; background: #f0f9f4; color: var(--success); }
.app-footer { color: #5b6777; font-size: 0.78rem; border-top: 1px solid #d5dce6; padding: 18px 0 30px; margin-top: 32px; }

/* ---------- Login ---------- */
.tela-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #1e3a5f 0%, #14283f 100%); }
.cartao-login { width: 100%; max-width: 400px; background: #fff; border: 1px solid #d5dce6; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 32px; display: grid; gap: 16px; border-top: 3px solid var(--gold); }
.cartao-login h1 { font-size: 20px; font-weight: 700; color: #1e3a5f; letter-spacing: -0.01em; }
.cartao-login .subtitulo { color: #5b6777; font-size: 14px; margin: 0; }

/* ---------- Utilitários ---------- */
.muted { color: var(--text-muted); }
.accent { color: var(--accent-text); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: var(--space); }
.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.cols-2, .cols-3, .cols-4 { display: grid; gap: var(--space); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .cols-2, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) { .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; }
.text-xs { font-size: 12px; } .text-sm { font-size: 14px; } .text-base { font-size: 16px; }
.text-lg { font-size: 18px; } .text-xl { font-size: 20px; line-height: 1.35; }
.text-2xl { font-size: 24px; line-height: 1.25; } .text-3xl { font-size: 30px; line-height: 1.2; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.w-full { width: 100%; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(30,58,95,0.08); color: var(--accent-text); width: fit-content; max-width: 100%; }

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .chart-row { grid-template-columns: 110px 1fr 44px; }
  .app-header { padding-bottom: 48px; }
  .kpi-card .kv { font-size: 1.4rem; }
  .shell-container { padding: 0 14px; }
  .main-wrap { margin-top: -24px; }
}

/* ==========================================================
   Página: Consulta de movimentações
   ========================================================== */
.sup-link {
  color: #1e3a5f;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sup-link:hover {
  color: #b8860b;
}
.sit-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ==========================================================
   Página: Ficha do militar
   ========================================================== */
/* Cabeçalho e rodapé institucionais — visíveis apenas na impressão */
.print-only { display: none; }

/* Ajustes de tela para a ficha aberta em página inteira */
.ficha-drawer .drawer-head { background: #f6f8fb; }
.ficha-drawer .drawer-body { padding: 22px 24px 28px; }

/* ==========================================================
   Impressão — Ficha do militar
   ========================================================== */
@media print {
  /* Esconde navegação, backdrop e controles de ação */
  .app-header .btn,
  .no-print,
  .tab-bar,
  .filters-section,
  .drawer-backdrop,
  .drawer-head .row.gap-2,
  .drawer-head a.btn-ghost,
  .toast-custom {
    display: none !important;
  }

  /* Libera o drawer para fluir na página inteira */
  .drawer {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .drawer-body {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .drawer-head {
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: 8px;
    margin-bottom: 12px;
    background: #fff !important;
  }

  /* Evita cortar um card no meio da página */
  .tl-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-only { display: block !important; }

  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 10pt;
  }

  .panel { box-shadow: none !important; }

  @page {
    size: A4 portrait;
    margin: 15mm 12mm;
  }
}

/* ==========================================================
   Painel — mesmo visual do consulta.php
   ========================================================== */
.painel {
  background: #ffffff;
  border: 1px solid #d5dce6;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(20,40,63,0.06);
}
.painel.p-4 { padding: 20px 24px; }
.painel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(30,58,95,0.08);
  color: #1e3a5f;
  width: fit-content;
  margin-bottom: 6px;
}
.painel h2.text-xl { font-size: 20px; line-height: 1.35; font-weight: 700; color: #1b2430; margin: 0; }
.painel h3.text-lg { font-size: 18px; line-height: 1.35; font-weight: 700; color: #1b2430; margin: 0; }
.painel .text-sm.muted,
.painel .text-xs.muted { color: #5b6777; line-height: 1.55; }
.painel .field { display: grid; gap: 6px; }
.painel .field label { font-size: 0.78rem; font-weight: 600; color: #3a4658; }
.painel .field input,
.painel .field select,
.painel .field textarea {
  background: #ffffff;
  border: 1px solid #c4ccd8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.875rem;
  color: #1b2430;
  width: 100%;
  height: auto;
  box-sizing: border-box;
}
.painel .field input::placeholder { color: #8a94a3; }
.painel .field input:focus,
.painel .field select:focus,
.painel .field textarea:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.15);
}
.painel .field textarea { min-height: 84px; resize: vertical; }
.painel .row.gap-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}
.painel .row.gap-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.painel .btn-primary {
  background: #1e3a5f;
  color: #fff;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.painel .btn-primary:hover { background: #14283f; }
.painel .btn-ghost {
  background: transparent;
  color: #1e3a5f;
  border: 1px solid #c4ccd8;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.painel .btn-ghost:hover { background: #f1f4f8; }
.painel > .row.between > form.row {
  flex: 1 1 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6ebf2;
}
.painel .table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e6ebf2;
  background: #fff;
}
.painel table.data { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.painel table.data th {
  background: #f3f5f9;
  color: #2d3a4d;
  text-align: left;
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 2px solid #d5dce6;
  white-space: nowrap;
  position: static;
  cursor: default;
}
.painel table.data td {
  padding: 9px 8px;
  border-bottom: 1px solid #e6ebf2;
  vertical-align: top;
  color: #1b2430;
}
.painel table.data tbody tr:hover { background: #f7f9fc; }
.painel table.data td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: #3a4658;
}
.painel table.data td a {
  color: #1e3a5f;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(168,132,47,.6);
  text-underline-offset: 3px;
}
.painel table.data td a:hover { text-decoration-color: #a8842f; }
.painel table.data td .muted { color: #c4ccd8; }
.painel .alerta {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid #d5dce6;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}
.painel .alerta[data-variante="sucesso"] { border-color: #b4dcc4; background: #f0f9f4; color: #1d6b3a; }
.painel .alerta[data-variante="destrutivo"] { border-color: #e0b4b4; background: #fdf2f2; color: #9b1c1c; }
@media (max-width: 720px) {
  .painel.p-4 { padding: 16px; }
  .painel .row.gap-3 { grid-template-columns: 1fr; }
  .painel .btn-primary,
  .painel .btn-ghost { width: 100%; }
}

/* ==========================================================
   Menu hambúrguer responsivo
   ========================================================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.menu-toggle:hover { background: rgba(255,255,255,0.22); }
.menu-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle.aberto .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.aberto .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle.aberto .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-principal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .menu-principal {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    gap: 8px;
  }
  .menu-principal.aberto { display: flex; }
  .menu-principal .btn-ghost,
  .menu-principal .btn-primary { width: 100%; justify-content: center; height: 42px; }
  .app-header { padding: 20px 0 44px; }
  .app-header h1.text-2xl { font-size: 18px; line-height: 1.3; }
  .app-header .brand-mark { width: 44px; height: 44px; font-size: 0.95rem; }
  .app-header .row.between { align-items: flex-start; }
  .app-header .row.between > .row.gap-3 { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 420px) {
  .app-header h1.text-2xl { font-size: 16px; }
  .app-header .eyebrow { font-size: 10px; padding: 2px 8px; }
  .app-header .text-sm.muted { font-size: 12px; }
}