/* =====================================================================
   SIO-PDF — DESIGN SYSTEM (única fonte de verdade visual)
   Identidade: "ateliê técnico de precisão" — prancheta de desenho,
   papel quente, azul-planta (blueprint) e latão. Tipografia de engenharia
   (Space Grotesk) + corpo legível (Inter) + dados em mono (medidas, chaves).
   Os nomes de classe são estáveis: telas/JS não mudam — só a aparência.
   ===================================================================== */

:root {
  /* Base — papel de prancheta, tinta grafite */
  --bg:        #fbfaf7;  /* papel quente */
  --surface:   #ffffff;
  --ink:       #131820;  /* grafite (quase preto, leve frio) */
  --ink-2:     #3a4452;  /* aço */
  --muted:     #6b7480;
  --line:      #e8e3d8;  /* fio quente (linha de papel) */
  --line-2:    #f3f0e9;

  /* Primary — azul-planta (blueprint) */
  --primary:     #1c3d5a;
  --primary-500: #2a5378;
  --primary-700: #142c42;
  --primary-800: #0e2030;
  --sky:         #2a5378;
  --primary-tint:#eaf0f5; /* azul-papel para hovers/realces */

  /* Accent — latão (usado com parcimônia: eyebrow, assinatura) */
  --accent:      #b5841f;
  --accent-700:  #8a6315;
  --accent-tint: #f7efd9;

  /* Estados (semântica preservada, levemente aquecida) */
  --success: #2f8a57;
  --danger:  #c0392b;
  --warning: #c8860d;

  /* Estrutura — raios mais justos (precisão), sombras quentes e quietas */
  --radius-sm: .4rem;
  --radius:    .55rem;   /* botões/inputs */
  --radius-lg: .8rem;    /* cards/modais */
  --shadow-sm: 0 1px 2px 0 rgba(19,24,32,.05);
  --shadow-md: 0 6px 18px -6px rgba(19,24,32,.14), 0 2px 6px -3px rgba(19,24,32,.08);
  --shadow-lg: 0 24px 56px -16px rgba(14,32,48,.28);
  --ring:      0 0 0 3px rgba(28,61,90,.28);

  /* Espaçamento / movimento */
  --space:     1rem;
  --transition: .18s cubic-bezier(.4,0,.2,1);

  /* Tipografia */
  --font-display: "Space Grotesk","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-body:    "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-mono:    "Spline Sans Mono","JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;

  /* Aliases de compatibilidade (telas legadas) — apontam para a nova paleta */
  --brand:     var(--primary);
  --brand-600: var(--primary-700);
  --brand-300: #9db4c6;
  --navy-900:  #0e2030;
  --navy-800:  #142c42;
  --navy-700:  #1c3d5a;
}

/* ---------- Base / tipografia ---------- */
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .ds-h1, .ds-h2 { font-family: var(--font-display); }
.ds-h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.ds-h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.ds-sub { font-size: .875rem; color: var(--muted); }
.text-muted { color: var(--muted); }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-700); }
.ds-mono, .mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #dcd5c6; }
.card-pad { padding: 1.25rem; }

/* ---------- Botões ---------- */
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .875rem; line-height: 1;
  padding: .625rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  user-select: none;
}
.btn svg, .btn-primary svg, .btn-secondary svg, .btn-ghost svg, .btn-danger svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.btn-primary   { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-2); border-color: #dcd5c6; }
.btn-ghost     { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-ghost:active, .btn-danger:active { transform: scale(.97); }
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn-primary[disabled], .btn-secondary[disabled], .btn-ghost[disabled], .btn-danger[disabled],
.btn.is-loading, .btn-primary.is-loading { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn-sm { padding: .4rem .7rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-spinner { width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: ds-spin .7s linear infinite; }

/* ---------- Inputs / formulários ---------- */
.ds-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.input, .ds-field, select.input, textarea.input {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .625rem .75rem; font-size: .9rem; font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder { color: #9aa2ac; }
.input:hover { border-color: #cfc8b9; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input:disabled { background: var(--line-2); color: var(--muted); cursor: not-allowed; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192,57,43,.16); }
.input.is-valid   { border-color: var(--success); }
.ds-helper { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.ds-helper.is-invalid { color: var(--danger); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-mono); font-size: .68rem; font-weight: 600; letter-spacing: .02em; padding: .2rem .55rem; border-radius: 999px; }
.badge-neutral { background: var(--line-2); color: var(--ink-2); }
.badge-primary { background: var(--primary-tint); color: var(--primary-700); }
.badge-success { background: #dcf2e6; color: #1f6b43; }
.badge-danger  { background: #fae3e0; color: #a93226; }
.badge-warning { background: var(--accent-tint); color: var(--accent-700); }

/* ---------- Tabelas ---------- */
.ds-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ds-table thead th { position: sticky; top: 0; background: var(--line-2); color: var(--muted); font-family: var(--font-mono); font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: .7rem .85rem; z-index: 1; }
.ds-table tbody td { padding: .8rem .85rem; border-top: 1px solid var(--line); color: var(--ink-2); }
.ds-table tbody tr { transition: background var(--transition); }
.ds-table tbody tr:hover { background: var(--primary-tint); }

/* ---------- Modais ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(14,32,48,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ds-fade .2s ease both; }
.modal-overlay:not(.hidden) { display: flex; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 32rem; animation: ds-modal-in .24s cubic-bezier(.21,1.02,.73,1) both; }
.modal-head { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head h2, .modal-head h3 { font-family: var(--font-display); }
.modal-body { padding: 1.25rem; }
.modal-foot { padding: 1rem 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .6rem; }

/* ---------- Estado vazio ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1.25rem; color: var(--muted); }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--primary-tint); color: var(--primary); margin-bottom: .9rem; }
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink-2); margin-bottom: .25rem; }
.empty-state p { font-size: .85rem; max-width: 22rem; }

/* ---------- Skeleton / shimmer ---------- */
.skeleton { position: relative; overflow: hidden; background: #ece8df; border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: ds-shimmer 1.3s infinite; }
.skeleton-text { height: .8rem; margin: .4rem 0; }
.skeleton-line { height: 1rem; border-radius: 999px; }
.skeleton-card { height: 7rem; border-radius: var(--radius-lg); }
.skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 999px; }

/* ---------- Imagens (lazy + fade + fallback) ---------- */
.img-wrap { position: relative; overflow: hidden; background: var(--line-2); }
.img-wrap > img { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .4s ease, transform .4s ease; transform: scale(1.02); }
.img-wrap > img.is-loaded { opacity: 1; transform: scale(1); }
.img-wrap .img-skeleton { position: absolute; inset: 0; }
img.ds-fade { opacity: 0; transition: opacity .4s ease; }
img.ds-fade.is-loaded { opacity: 1; }

/* ---------- Animações de entrada ---------- */
.anim-fade { animation: ds-fade .25s ease both; }
.anim-slide-up { animation: ds-slide-up .28s cubic-bezier(.21,1.02,.73,1) both; }
.anim-pop { animation: ds-modal-in .24s cubic-bezier(.21,1.02,.73,1) both; }

@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shimmer { 100% { transform: translateX(100%); } }
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ds-modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .anim-fade, .anim-slide-up, .anim-pop, .modal-overlay, .modal-card { animation: none !important; }
  .card-hover:hover { transform: none; }
  .skeleton::after { animation: none; }
}

/* ---------- Spinner utilitário ---------- */
.ds-spinner { width: 1.5rem; height: 1.5rem; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: ds-spin .7s linear infinite; }

/* =====================================================================
   PROFUNDIDADE & SEÇÕES
   ===================================================================== */

/* Fundo: papel quente com leve "luz de prancheta" e grade técnica sutil */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 380px at 100% -5%, rgba(28,61,90,.06), transparent 60%),
    radial-gradient(700px 320px at -10% 0%, rgba(181,132,31,.05), transparent 55%),
    linear-gradient(rgba(19,24,32,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19,24,32,.028) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-attachment: fixed, fixed, fixed, fixed;
}

.section { padding: 3.5rem 1rem; position: relative; }
.section-sm { padding: 2.25rem 1rem; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tint { background: linear-gradient(180deg, var(--primary-tint), #fff); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-accent { background: linear-gradient(180deg, var(--accent-tint), #fff); border-top: 1px solid #ecdcb4; border-bottom: 1px solid #ecdcb4; }
.section-muted { background: var(--line-2); }
.section-dark { background: linear-gradient(135deg, #0e2030 0%, #1c3d5a 100%); color: #fff; }
.section-dark .ds-h1, .section-dark .ds-h2, .section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .ds-sub, .section-dark p { color: #c4d0db; }

.section-pattern::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(19,24,32,.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(19,24,32,.03) 1px, transparent 1px);
  background-size: 26px 26px; -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.section > * { position: relative; z-index: 1; }

.section-head { text-align: center; max-width: 44rem; margin: 0 auto 2rem; }

/* Eyebrow — assinatura: rótulo em latão, mono, com tique de prancheta */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-700);
  background: var(--accent-tint); padding: .25rem .6rem; border-radius: 999px; margin-bottom: .75rem;
}
.eyebrow { border: 1px solid #e6d5a8; }
.eyebrow::before { content: ""; width: 14px; height: 2px; background: var(--accent); display: inline-block; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, #d8cfbb, transparent); border: 0; margin: 0; }

/* Cabeçalho de página com tique de latão (bloco-título de prancheta) */
.page-head { position: relative; padding: 1.25rem 0 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.page-head::before { content: ""; position: absolute; left: 0; top: 1.45rem; width: 26px; height: 3px; background: var(--accent); border-radius: 2px; }
.page-head > * { padding-left: 38px; }

.container-page { max-width: 72rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }

.card-feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.card-tint { background: linear-gradient(180deg, var(--primary-tint), #fff); border: 1px solid #d6e0ea; border-radius: var(--radius-lg); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.reveal-in { opacity: 1; transform: none; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  body { background-attachment: scroll; }
}

/* =====================================================================
   NAVEGAÇÃO & ÍCONES EM BOTÕES (consistência + acessibilidade)
   ===================================================================== */

/* Ícone dentro de qualquer botão: alinhado, tamanho fixo, herda a cor */
.btn [data-icon], .btn-primary [data-icon], .btn-secondary [data-icon], .btn-ghost [data-icon], .btn-danger [data-icon],
.nav-link [data-icon], .menu-item [data-icon] { display: inline-flex; align-items: center; }
.btn [data-icon] svg, .btn-primary [data-icon] svg, .btn-secondary [data-icon] svg, .btn-ghost [data-icon] svg, .btn-danger [data-icon] svg { width: 1rem; height: 1rem; }

/* Botão só-ícone (ações compactas em listas/toolbars) */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition); }
.btn-icon:hover { background: var(--line-2); color: var(--ink); border-color: #d8d2c5; }
.btn-icon svg { width: 1.05rem; height: 1.05rem; }
.btn-icon.is-danger:hover { background: #fae3e0; color: #a93226; border-color: #f0c9c3; }

/* Contraste: torna secundário e fantasma mais visíveis (sem ruído) */
.btn-secondary { border-color: #ddd6c8; }
.btn-secondary:hover { border-color: #c9c1b1; }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }

/* ── Header / navegação principal (sobre fundo navy) ── */
.nav-link { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-body); font-size: .875rem; font-weight: 500; color: #c4d0db; padding: .42rem .7rem; border-radius: .5rem; transition: color var(--transition), background var(--transition); white-space: nowrap; }
.nav-link svg { width: 1.05rem; height: 1.05rem; opacity: .9; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; background: rgba(181,132,31,.16); box-shadow: inset 0 -2px 0 0 var(--accent); }
.nav-link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(181,132,31,.45); }

/* ── Itens de menu (dropdown da conta) ── */
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .55rem .9rem; font-size: .875rem; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; transition: background var(--transition), color var(--transition); }
.menu-item svg { width: 1.05rem; height: 1.05rem; color: var(--muted); flex-shrink: 0; }
.menu-item:hover { background: var(--primary-tint); color: var(--primary); }
.menu-item:hover svg { color: var(--primary); }
.menu-item.is-danger { color: #a93226; }
.menu-item.is-danger svg { color: #c0392b; }
.menu-item.is-danger:hover { background: #fae3e0; }
.menu-sep { height: 1px; background: var(--line); margin: .3rem 0; border: 0; }

/* Painel de menu (dropdown) com profundidade do design system */
.menu-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; }

/* Grade de atalhos/seções escalável (dashboard e hubs) */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
.nav-tile { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); }
.nav-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #dcd5c6; }
.nav-tile .tile-ic { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: var(--radius); background: var(--primary-tint); color: var(--primary); }
.nav-tile .tile-ic svg { width: 1.3rem; height: 1.3rem; }
.nav-tile .tile-title { font-weight: 600; font-size: .9rem; color: var(--ink); }
.nav-tile .tile-sub { font-size: .78rem; color: var(--muted); }

/* =====================================================================
   LOADING GLOBAL — barra de progresso para QUALQUER requisição ao backend
   (complementa o overlay de pontos, os skeletons e o estado de botão)
   ===================================================================== */
#sio-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999; opacity: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent)); box-shadow: 0 0 8px rgba(181,132,31,.5); }
#sio-progress.run  { opacity: 1; animation: sio-prog 2.2s cubic-bezier(.2,.8,.2,1) forwards; }
#sio-progress.done { width: 100% !important; opacity: 0; transition: width .2s ease, opacity .35s ease .15s; animation: none; }
@keyframes sio-prog { 0%{width:0} 45%{width:55%} 80%{width:82%} 100%{width:92%} }
@media (prefers-reduced-motion: reduce){ #sio-progress.run{ animation: none; width: 80%; } }

/* Três pontos pulando — utilitário reutilizável (mesma linguagem do overlay) */
.dots-loading { display: inline-flex; gap: 5px; align-items: center; }
.dots-loading > span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: sio-bounce 1s infinite ease-in-out both; }
.dots-loading > span:nth-child(2){ animation-delay: .15s; }
.dots-loading > span:nth-child(3){ animation-delay: .3s; }
@keyframes sio-bounce { 0%,80%,100%{ transform: scale(.5); opacity:.5 } 40%{ transform: scale(1); opacity:1 } }

/* =====================================================================
   CONTRASTE / VISIBILIDADE DE CONTROLES (revisão WCAG)
   Botões secundários antes "sumiam" no branco (borda ~1.4:1). Agora têm
   preenchimento sutil + borda perceptível, lendo claramente como botão.
   (sobrescreve regras anteriores — mesma especificidade, vence por ordem)
   ===================================================================== */
.btn-secondary { background: var(--line-2); color: var(--ink-2); border-color: #b2a892; }
.btn-secondary:hover { background: #ece6da; border-color: #9e937e; color: var(--ink); }
.btn-icon { border-color: #b2a892; }
.btn-icon:hover { border-color: #9e937e; }
.input, .ds-field, select.input, textarea.input { border-color: #c2b9a6; }
.input:hover { border-color: #a99f8d; }
.card { border-color: #e0dacb; }
/* Fantasma (terciário) ganha contorno só no hover/focus para virar botão visível */
.btn-ghost:hover { background: var(--line-2); color: var(--ink); border-color: #ddd6c8; }

/* =====================================================================
   IMPRESSÃO — preserva fundos/tons escuros (navegador por padrão remove)
   ===================================================================== */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  body { background: #fff !important; }
}
/* também no corpo (Chrome respeita fora do @media em alguns casos) */
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* =====================================================================
   HEADER — menu hambúrguer (drawer lateral animado)
   ===================================================================== */
.hamb { display: inline-flex; align-items: center; gap: .55rem; background: transparent; border: 0; color: #fff; cursor: pointer; padding: .3rem .5rem; border-radius: .5rem; }
.hamb:hover { background: rgba(255,255,255,.10); }
.hamb .bars { width: 22px; height: 16px; position: relative; display: inline-block; }
.hamb .bars span { position: absolute; left: 0; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .28s ease, opacity .2s ease, top .28s ease; }
.hamb .bars span:nth-child(1){ top: 0; } .hamb .bars span:nth-child(2){ top: 7px; } .hamb .bars span:nth-child(3){ top: 14px; }
.hamb.open .bars span:nth-child(1){ top: 7px; transform: rotate(45deg); }
.hamb.open .bars span:nth-child(2){ opacity: 0; }
.hamb.open .bars span:nth-child(3){ top: 7px; transform: rotate(-45deg); }

.drawer-overlay { position: fixed; inset: 0; background: rgba(14,32,48,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 70; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 300px; max-width: 86vw; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); z-index: 71; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #0e2030, #1c3d5a); color: #fff; }
.drawer-head .dh-name { font-weight: 700; font-family: var(--font-display); line-height: 1.1; }
.drawer-head .dh-sub { font-size: .72rem; color: #c4d0db; }
.drawer-head .dh-close { margin-left: auto; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.drawer-body { overflow-y: auto; flex: 1; padding: .5rem; }
.drawer-body .grp { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; padding: .8rem .8rem .3rem; }
.drawer-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: .5rem; color: var(--ink-2); font-size: .9rem; font-weight: 500; transition: background var(--transition), color var(--transition); }
.drawer-link svg { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.drawer-link:hover { background: var(--primary-tint); color: var(--primary); }
.drawer-link:hover svg { color: var(--primary); }
.drawer-link.active { background: rgba(181,132,31,.14); color: var(--primary); box-shadow: inset 3px 0 0 0 var(--accent); }
.drawer-foot { padding: .6rem; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce){ .drawer, .drawer-overlay, .hamb .bars span { transition: none !important; } }

/* =====================================================================
   RESPONSIVIDADE — rede de segurança global (qualquer dispositivo)
   ===================================================================== */
img, svg, video, canvas { max-width: 100%; height: auto; }
table { max-width: 100%; }
.ds-table { display: block; overflow-x: auto; white-space: nowrap; }
.ds-table thead, .ds-table tbody, .ds-table tr { width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; }
input, select, textarea, button { max-width: 100%; }

@media (max-width: 640px) {
  .ds-h1 { font-size: 1.3rem; }
  .ds-h2 { font-size: 1.05rem; }
  .card-pad { padding: 1rem; }
  .section { padding: 2rem 1rem; }
  .section-sm { padding: 1.5rem .9rem; }
  .modal-card { max-width: 100%; }
  .page-head > * { padding-left: 30px; }
  .page-head::before { top: 1.35rem; }
  /* Botões em telas estreitas: evitam estourar a largura */
  .btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger { padding: .55rem .8rem; font-size: .84rem; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .drawer { width: 100%; max-width: 100%; }
}
/* Evita overflow horizontal acidental em qualquer viewport */
#app, main, .container-page { max-width: 100%; }
