@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --blue: #0A117C;
  --blue-dark: #010438;
  --blue-mid: #020659;
  --blue-lt: #EAEBFA;
  --green: #09C627;
  --green-hover: #07aa21;
  --green-lt: rgba(9, 198, 39, 0.12);
  --slate: #64748B;
  /* ATENÇÃO: 2,56:1 sobre branco — reprova no WCAG AA (mínimo 4,5). Use
     apenas sobre fundo ESCURO (barra lateral, telas do assinante) ou em
     decoração sem texto (borda, barra de rolagem). Texto em fundo claro
     usa --slate (#64748B, 4,76:1). */
  --slate-lt: #94A3B8;
  --bg: #F4F5FA;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #010438;
  --red: #DC2626;
  --yellow: #D97706;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(10, 17, 124, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 17, 124, 0.08);

  /* ---- Escala tipográfica (raiz = 16px) ----
     Oito degraus fixos no lugar dos ~30 tamanhos avulsos que existiam.
     fs-2xs (11px) é o piso legível: nada abaixo disso. */
  --fs-2xs: 0.6875rem;  /* 11px — selos, rótulos minúsculos */
  --fs-xs:  0.75rem;    /* 12px — legendas, textos de apoio */
  --fs-sm:  0.8125rem;  /* 13px — tabelas, formulários */
  --fs-md:  0.875rem;   /* 14px — corpo padrão */
  --fs-lg:  1rem;       /* 16px — destaque em bloco */
  --fs-xl:  1.125rem;   /* 18px — título de página/cartão */
  --fs-2xl: 1.375rem;   /* 22px — números de destaque */
  --fs-3xl: 1.75rem;    /* 28px — display */

  /* ---- Espaçamento e larguras de página ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --page-pad: 24px;
  --page-max: 1180px;      /* leitura confortável em telas largas */
  --page-max-narrow: 900px;
  --page-max-wide: 1560px;
  --sidebar-w: 260px;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* App Wrapper Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}

/* Sidebar Drawer System */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.25s ease;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  position: relative;
}

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin-left: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 56, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-brand {
  height: 65px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card);
}

.sidebar-brand img {
  height: 36px;
  width: auto;
}

.brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--blue-dark);
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 0.65rem;
  background: var(--green-lt);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--green-lt);
  color: var(--green);
  font-weight: 700;
  border-left: 4px solid var(--green);
  border-radius: 0 8px 8px 0;
  margin-left: -12px;
  padding-left: 20px;
}

.btn-toggle-sidebar {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--blue-dark);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-right: 10px;
  flex-shrink: 0;
}

.btn-toggle-sidebar:hover {
  background: var(--blue-lt);
  border-color: var(--blue);
  color: var(--blue);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  transition: all 0.25s ease;
}

.content-header,
.topbar {
  flex-shrink: 0;
  min-height: 70px;
  height: auto;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-title,
.topbar h1,
.content-title h1,
.content-title h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-body,
.page-body {
  padding: var(--page-pad);
  flex: 1;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--blue-lt); color: var(--blue); }
.stat-icon.yellow { background: rgba(217, 119, 6, 0.1); color: var(--yellow); }
.stat-icon.green { background: var(--green-lt); color: var(--green); }

.stat-info .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-info .lbl {
  font-size: 0.75rem;
  color: var(--slate);
  font-weight: 600;
  margin-top: 2px;
}

/* Cards & Tables */
.card-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  gap: 12px;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--green);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--green-hover);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--slate);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-lt);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(244, 245, 250, 0.6);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-draft { background: #E2E8F0; color: #475569; }
.badge-pending { background: rgba(217, 119, 6, 0.12); color: var(--yellow); }
.badge-completed { background: var(--green-lt); color: var(--green); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  padding: 16px;
  background: rgba(1, 4, 56, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-dark);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--slate);
  padding: 4px 8px;
}

/* Quando um <form> envolve o corpo e o rodapé, ele é o item flex do
   .modal-box — e, não sendo flex por sua vez, crescia além do max-height do
   modal. Com o .modal-box em overflow:hidden, o rodapé (com o botão Salvar)
   simplesmente sumia. */
.modal-box > form,
.modal-box > .modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;          /* sem isso o flexbox não deixa encolher para rolar */
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  flex-shrink: 0;          /* o rodapé nunca é comprimido para fora da tela */
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border 0.15s;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-lt);
}

.file-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #F8FAFC;
  transition: all 0.2s;
}

.file-dropzone:hover {
  border-color: var(--green);
  background: var(--green-lt);
}

/* Signature Drag and Drop Editor Canvas */
.editor-layout {
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 110px);
}

.editor-sidebar {
  width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  height: calc(100vh - 110px);
  overflow-y: auto;
}

.editor-canvas-container {
  flex: 1;
  background: #cbd5e1; /* Premium PDF Viewer gray backdrop */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 180px 24px;
  box-shadow: var(--shadow);
  height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
}

.pdf-page-wrapper {
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  margin-bottom: 30px;
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.pdf-page-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sig-box-target {
  position: absolute;
  border: 2px dashed var(--green);
  background: rgba(9, 198, 39, 0.18);
  border-radius: 6px;
  cursor: move;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
  z-index: 10;
  transition: box-shadow 0.15s;
  touch-action: none;
}

.sig-box-target:hover {
  box-shadow: 0 0 10px rgba(9, 198, 39, 0.5);
}

.sig-box-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--blue-dark);
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  text-align: center;
  pointer-events: none;
}

.sig-box-sub {
  font-size: 0.62rem;
  color: #1e293b;
  font-weight: 600;
  pointer-events: none;
}

/* Signer Pad Portal */
.signer-card {
  max-width: 680px;
  margin: 30px auto;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.sig-canvas-pad {
  width: 100%;
  height: 220px;
  border: 2px dashed var(--blue);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: crosshair;
  touch-action: none;
  margin-top: 10px;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Mobile & Small Screens Responsiveness */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px !important;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
    width: 270px !important;
  }

  .content-header {
    padding: 0 16px;
  }

  .container-body {
    padding: 16px;
  }

  .editor-layout {
    flex-direction: column;
  }

  .editor-sidebar {
    width: 100%;
  }

  .editor-canvas-container {
    padding: 12px;
  }

  .hide-mobile {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .signer-card {
    margin: 16px auto;
    padding: 16px;
  }
}

/* ============================================================
   Signature Placement Stage — scrolling document viewer
   ============================================================ */
.pl-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pl-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #0f172a;
  color: #e2e8f0;
  flex-shrink: 0;
}

.pl-bar-title {
  font-size: 0.82rem;
  font-weight: 800;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f1f5f9;
}

.pl-iconbtn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.pl-iconbtn:hover { background: rgba(255, 255, 255, 0.16); }
.pl-iconbtn:disabled { opacity: 0.3; cursor: default; }
.pl-zoomlabel { font-size: 0.72rem; letter-spacing: -0.3px; }

.pl-pageind {
  font-size: 0.78rem;
  font-weight: 800;
  color: #cbd5e1;
  min-width: 46px;
  text-align: center;
  flex-shrink: 0;
}

/* Signer chips = signer picker inside the stage */
.pl-chips {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.pl-chips::-webkit-scrollbar { display: none; }

.pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
}

.pl-chip .pl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pl-chip.active { background: #fff; color: var(--blue-dark); border-color: #fff; }
.pl-chip.done { border-color: rgba(9, 198, 39, 0.6); }
.pl-chip .pl-chip-state { font-size: 0.68rem; opacity: 0.75; font-weight: 800; }

/* Scrolling document area */
.pl-stagearea {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.pl-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #475569;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pl-viewport::-webkit-scrollbar { width: 14px; height: 14px; }
.pl-viewport::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); }
.pl-viewport::-webkit-scrollbar-thumb {
  background: rgba(226, 232, 240, 0.35);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.pl-viewport::-webkit-scrollbar-thumb:hover { background: rgba(226, 232, 240, 0.55); background-clip: content-box; }

.pl-canvas {
  --page-w: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 14px 17px 40px;
  min-height: 100%;
  box-sizing: border-box;
}

.pl-page { display: flex; flex-direction: column; gap: 6px; }

.pl-page-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.3px;
}

.pl-canvas .pdf-page-wrapper {
  position: relative;
  width: var(--page-w);
  height: auto;
  margin: 0;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  cursor: crosshair;
  touch-action: auto;
  user-select: none;
}

.pl-canvas .pdf-page-img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pl-canvas .page-boxes-container {
  position: absolute;
  inset: 0;
}

/* Floating controls (outside the scroller, so they stay put) */
.pl-zoom {
  position: absolute;
  right: 18px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 25;
}
.pl-zoom .pl-iconbtn {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.pl-hud {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 25;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  display: none;
  pointer-events: none;
}
.pl-hud.on { display: block; }

.pl-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #f59e0b;
  display: none;
  z-index: 24;
  pointer-events: none;
}
.pl-guide.on { display: block; }

/* Toolbar */
.pl-toolbar {
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.pl-hint {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.4;
  display: block;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}
.pl-hint i { margin-right: 6px; }
.pl-hint strong { color: #f8fafc; }

.pl-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.pl-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 0 12px;
}

.pl-btn-primary { background: var(--green); color: #032c0a; }
.pl-btn-primary:disabled { background: #475569; color: #94a3b8; cursor: default; }
.pl-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.pl-btn-danger { background: rgba(220, 38, 38, 0.16); color: #fecaca; border: 1px solid rgba(220, 38, 38, 0.4); }

.pl-nudge { display: flex; gap: 6px; flex: 1; }
.pl-nudge .pl-iconbtn { flex: 1; min-width: 0; height: 44px; }

.pl-only-mobile { display: none !important; }

/* Signature boxes */
.sig-box-target.selected {
  border-style: solid;
  box-shadow: 0 0 0 2px #fff, 0 8px 22px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.sig-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  right: -13px;
  bottom: -13px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue-dark);
  color: var(--blue-dark);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 22;
}
.sig-box-target.selected .sig-handle { display: flex; }

@media (max-width: 768px) {
  .pl-only-mobile { display: inline-flex !important; }
  .pl-chips { padding: 8px; }
  .pl-toolbar { padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .pl-btn { font-size: 0.8rem; }
  .pl-canvas { padding: 10px 12px 30px; gap: 18px; }
  .pl-zoom { right: 10px; bottom: 10px; }
}

/* Wide screens: one compact toolbar row so the document keeps the height */
@media (min-width: 900px) {
  .pl-toolbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px;
  }
  .pl-hint { flex: 1 1 260px; margin: 0; max-width: none; }
  .pl-row { width: auto; max-width: none; margin: 0; }
  .pl-btn { flex: 0 0 auto; min-width: 150px; min-height: 42px; }
  .pl-nudge { flex: 0 0 auto; }
  .pl-nudge .pl-iconbtn { flex: 0 0 auto; width: 42px; height: 42px; }
  .pl-bar, .pl-chips { padding: 7px 12px; }
  .pl-chip { min-height: 36px; padding: 7px 12px; }
}

/* ============================================================
   SHELL DE PÁGINA — um único padrão para todas as telas
   ============================================================ */

/* A página de e-mail usava .topbar / .page-body / .btn-icon, que não existiam
   no CSS: o cabeçalho dela ficava sem fundo, sem borda e sem sticky. Os aliases
   abaixo alinham essa tela ao resto do sistema sem precisar reescrevê-la. */

.btn-icon {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--blue-dark);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--fs-lg);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--blue-lt);
  border-color: var(--blue);
  color: var(--blue);
}

/* Faixa fina abaixo do cabeçalho para subtítulo/descrição da tela. */
.content-subtitle {
  font-size: var(--fs-xs);
  color: var(--slate);
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.45;
}

/* Limita a largura do conteúdo e centraliza. Substitui os max-width avulsos
   (820/900/1000px) que cada tela definia por conta própria. */
.page-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

.page-shell.narrow {
  max-width: var(--page-max-narrow);
}

.page-shell.wide {
  max-width: var(--page-max-wide);
}

/* O atributo `hidden` é só `display:none` na folha do navegador: qualquer
   `display` declarado pelo autor (.btn, .aviso, etc.) o anula em silêncio.
   Esta linha faz `hidden` valer sempre — já custou dois defeitos visíveis. */
[hidden] { display: none !important; }

/* ---- Menu de ações (•••) das tabelas ----
   O menu é levado para o <body> ao abrir (ver static/js/menu-acoes.js): dentro
   da tabela ele seria recortado pelo overflow do .table-responsive. */
.menu-acoes { position: relative; display: inline-flex; }

.btn-kebab { color: var(--slate); background: #f8fafc; border-color: var(--border); }
.btn-kebab:hover { background: #e2e8f0; color: var(--text); }
.btn-kebab[aria-expanded="true"] { background: var(--blue-dark); color: #fff; border-color: var(--blue-dark); }

.menu-flutuante {
  position: fixed;
  z-index: 1200;
  min-width: 216px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 6px;
  text-align: left;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover, .menu-item:focus { background: #f1f5f9; outline: none; }
.menu-item i { width: 16px; text-align: center; color: var(--slate); flex-shrink: 0; }
.menu-item:hover i { color: var(--text); }

/* Excluir é separado do resto de propósito: é o único que não tem volta. */
.menu-item.perigo { color: #b91c1c; }
.menu-item.perigo i { color: #dc2626; }
.menu-item.perigo:hover, .menu-item.perigo:focus { background: #fef2f2; }
.menu-separador { height: 1px; background: var(--border); margin: 5px 4px; }

/* Compact Table Action Buttons */
.table-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.btn-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-action:hover {
  transform: translateY(-2px);
}

/* 1. Download / Sucesso (Verde vibrante) */
.btn-action-download,
.btn-action-success {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.btn-action-download:hover,
.btn-action-success:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.38);
}

/* 2. Acompanhar / Visualizar (Índigo elegante) */
.btn-action-view,
.btn-action-primary {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}
.btn-action-view:hover,
.btn-action-primary:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.38);
}

/* 3. Lembrete / Reenviar (Azul celeste vivo) */
.btn-action-send,
.btn-action-info {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}
.btn-action-send:hover,
.btn-action-info:hover {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.38);
}

/* 4. Posicionar (Laranja / Âmbar vivo) */
.btn-action-position,
.btn-action-warning {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.btn-action-position:hover,
.btn-action-warning:hover {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.38);
}

/* 5. Compartilhar (Roxo / Violeta vibrante) */
.btn-action-share {
  background: #faf5ff;
  color: #9333ea;
  border-color: #e9d5ff;
}
.btn-action-share:hover {
  background: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.38);
}

/* 6. Mover para Pasta (Amarelo ouro / Ocre) */
.btn-action-folder {
  background: #fefce8;
  color: #ca8a04;
  border-color: #fef08a;
}
.btn-action-folder:hover {
  background: #eab308;
  color: #ffffff;
  border-color: #eab308;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.38);
}

/* 7. Validar Autenticidade (Teal / Turquesa vivo) */
.btn-action-verify {
  background: #f0fdfa;
  color: #0d9488;
  border-color: #99f6e4;
}
.btn-action-verify:hover {
  background: #14b8a6;
  color: #ffffff;
  border-color: #14b8a6;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.38);
}

/* 8. Editar (Azul royal vibrante) */
.btn-action-edit {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-action-edit:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.38);
}

/* 9. Excluir (Vermelho / Rose vibrante) */
.btn-action-danger {
  background: #fef2f2;
  color: #e11d48;
  border-color: #fecdd3;
}
.btn-action-danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.38);
}

/* 10. Promover para Usuário (Esmeralda) */
.btn-action-promote {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.btn-action-promote:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.38);
}

.badge-readonly-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.85rem;
  border: 1px solid #e2e8f0;
}

.badge-compact {
  padding: 3px 9px;
  font-size: 0.72rem;
  border-radius: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.signers-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Cabeçalho com título + ações: em telas estreitas as ações caem para baixo
   em vez de espremer o título. */
.content-header {
  flex-wrap: wrap;
  row-gap: 10px;
}

.content-header > * {
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ============================================================
   SUB-NAVEGAÇÃO DA CENTRAL DE COMUNICAÇÃO
   ============================================================ */
.subnav {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: var(--shadow);
}

.subnav::-webkit-scrollbar { display: none; }

.subnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--slate);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}

.subnav a:hover {
  background: var(--bg);
  color: var(--blue);
}

.subnav a.active {
  background: var(--blue-lt);
  color: var(--blue);
}

.subnav a.active i { color: var(--blue); }

/* ============================================================
   NORMALIZAÇÃO TIPOGRÁFICA DOS COMPONENTES
   ============================================================ */
body { font-size: var(--fs-md); line-height: 1.5; }

.content-title   { font-size: var(--fs-xl); }
.card-title      { font-size: var(--fs-lg); }
.stat-info .val  { font-size: var(--fs-2xl); }
.stat-info .lbl  { font-size: var(--fs-xs); }
.btn             { font-size: var(--fs-md); }
.btn-sm          { font-size: var(--fs-sm); }
.btn-xs          { font-size: var(--fs-xs); padding: 4px 9px; border-radius: 6px; }
.data-table th   { font-size: var(--fs-2xs); }
.data-table td   { font-size: var(--fs-sm); }
.form-label      { font-size: var(--fs-sm); }
.form-control    { font-size: var(--fs-md); }
.tab-btn         { font-size: var(--fs-sm); }
.brand-text      { font-size: var(--fs-lg); }
.brand-badge     { font-size: var(--fs-2xs); }

/* Qualquer tabela em cartão rola sozinha em vez de esticar a página. */
.card-panel table { width: 100%; }
.card-panel > .table-responsive,
.card-panel .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   RESPONSIVIDADE — 4 faixas em vez de uma só
   ============================================================ */

/* Telas largas: mais respiro nas laterais. */
@media (min-width: 1500px) {
  :root { --page-pad: 32px; }
}

/* Notebook estreito: o conteúdo ficava espremido entre a sidebar de 260px
   e as bordas. Reduz a sidebar e o respiro antes de virar gaveta. */
@media (max-width: 1200px) {
  :root { --sidebar-w: 226px; --page-pad: 20px; }
  .sidebar { width: var(--sidebar-w); }
}

/* Tablet e notebook pequeno: a sidebar vira gaveta. Antes isso só acontecia
   abaixo de 768px, e entre 769–1024px o conteúdo ficava sem espaço. */
@media (max-width: 1024px) {
  .app-wrapper { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px !important;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
    width: 270px !important;
  }

  .main-content { height: auto; min-height: 100vh; }
}

/* Celular. */
@media (max-width: 768px) {
  :root { --page-pad: 16px; }

  .content-header { padding: 12px var(--page-pad); }
  .content-title  { font-size: var(--fs-lg); }
  .container-body,
  .page-body { padding: var(--page-pad) !important; }

  /* Telas que fixavam max-width inline não podem estourar a largura. */
  .container-body > div[style*="max-width"],
  .page-body > div[style*="max-width"] { max-width: 100% !important; }

  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; justify-content: center; }

  .card-header { padding: 14px 16px; flex-wrap: wrap; }
  .card-body   { padding: 16px; }

  /* Grades declaradas inline com colunas fixas viram uma coluna. */
  .form-grid,
  .wpp-grid { grid-template-columns: 1fr !important; }

  .modal-box {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }

  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  .subnav { border-radius: 10px; }
  .subnav a { padding: 8px 11px; font-size: var(--fs-xs); }
}

/* Celular pequeno. */
@media (max-width: 480px) {
  :root { --page-pad: 12px; }

  .content-title { font-size: var(--fs-md); gap: 6px; }
  .stat-card { padding: 14px; }
  .stat-icon { width: 38px; height: 38px; font-size: var(--fs-lg); }
  .stat-info .val { font-size: var(--fs-xl); }
  .btn { padding: 9px 14px; }

  /* Rótulo do menu escondido só faz sentido no ícone: mantém legível. */
  .sidebar-group-label { padding: 12px 16px 4px; }
}

/* Títulos aninhados dentro do cabeçalho herdam o tamanho do cabeçalho:
   um <h1> solto ali ficava com os 2em padrão do navegador e estourava a barra. */
.content-title h1,
.content-title h2,
.content-title h3 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   MENU LATERAL EM ACORDEÃO
   ============================================================ */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 0 18px;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--slate-lt);
  cursor: pointer;
  font-size: var(--fs-md);
  padding: 6px 8px;
  border-radius: 6px;
  display: inline-flex;
  transition: color 0.2s, background 0.2s;
}

.sidebar-collapse-btn:hover { color: var(--blue); background: var(--bg); }

.sidebar-nav {
  padding: 12px 10px;
  gap: 2px;
}

.sidebar-group { display: flex; flex-direction: column; }

/* Cabeçalho clicável do grupo */
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-group-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.sidebar-group-toggle .grp-icon {
  width: 18px;
  text-align: center;
  font-size: var(--fs-md);
  color: var(--green);
  flex-shrink: 0;
}

.sidebar-group-toggle .grp-name { flex: 1; min-width: 0; }

.sidebar-group-toggle .grp-chevron {
  font-size: var(--fs-2xs);
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.sidebar-group.open > .sidebar-group-toggle .grp-chevron { transform: rotate(180deg); }

/* Conteúdo do grupo: recolhido por padrão, expande com transição */
/* O colapso usa max-height, e não o truque grid 0fr->1fr: como
   .sidebar-group-items é um item flex, o min-height automático do flexbox
   segurava a altura no conteúdo e o grid nunca chegava a zero. */
.sidebar-group-items { overflow: hidden; }

.sidebar-group-inner {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Teto folgado: o maior grupo tem 4 itens (~170px). */
.sidebar-group.open .sidebar-group-inner { max-height: 420px; }

/* Os itens do grupo vivem dentro da linha da grade */
.sidebar-group-items {
  padding-left: 15px;
  margin-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-group:not(.open) > .sidebar-group-items { border-left-color: transparent; }

.sidebar-group-items .sidebar-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: 7px;
}

.sidebar-group-items .sidebar-link.active {
  background: var(--green-lt);
  color: var(--green);
  font-weight: 700;
  border-left: none;
  margin-left: 0;
  padding-left: 12px;
  border-radius: 7px;
}

.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0;
}

.sidebar-footer-links a {
  font-size: var(--fs-2xs);
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  font-weight: 600;
}

.sidebar-footer-links a:hover { color: var(--green); }

/* ============================================================
   IDENTIDADE NO CANTO SUPERIOR DIREITO
   ============================================================ */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  margin-left: auto;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-lt);
  color: var(--blue);
  font-size: var(--fs-sm);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-identity {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  max-width: 170px;
}

.topbar-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-role {
  font-size: var(--fs-2xs);
  color: var(--slate);
  font-weight: 600;
}

.topbar-logout {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: var(--fs-md);
  flex-shrink: 0;
  transition: all 0.18s;
}

.topbar-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fee2e2;
}

/* O título deixa de disputar espaço: empurra tudo o mais para a direita. */
.content-title { flex: 1 1 auto; margin-right: auto; }

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
  .topbar-user { padding-left: 10px; gap: 8px; }
}

/* ============================================================
   CARTÃO DE AVISO — texto nunca encostado na borda
   ============================================================ */
.card-note {
  padding: 16px 20px;
  border-left: 5px solid var(--blue);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--slate);
}

.card-note.warn { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.card-note.soft { background: #f8fafc; }

/* Rede de segurança: conteúdo solto dentro de um card sem .card-body
   herda o respiro lateral em vez de colar na borda. */
.card-panel > p,
.card-panel > h2,
.card-panel > h3,
.card-panel > h4,
.card-panel > ul,
.card-panel > ol {
  padding-left: 24px;
  padding-right: 24px;
}

.card-panel > p:first-child { padding-top: 20px; }
.card-panel > p:last-child  { padding-bottom: 20px; }

@media (max-width: 768px) {
  .card-note { padding: 14px 16px; }
  .card-panel > p,
  .card-panel > h2,
  .card-panel > h3,
  .card-panel > h4,
  .card-panel > ul,
  .card-panel > ol { padding-left: 16px; padding-right: 16px; }
}

/* Cabeçalhos de tabela apertados: nunca quebrar o rótulo em duas linhas. */
.data-table th,
.contact-table th { white-space: nowrap; }

/* ============================================================
   TABELAS LARGAS — rolagem com pista visual
   O cartão recorta (overflow:hidden) para manter os cantos
   arredondados, então quem rola é o contêiner interno. Sem a
   sombra, o usuário não percebe que há coluna escondida.
   ============================================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--slate-lt); }

/* A coluna de ações não deve encolher nem quebrar. */
.data-table td:last-child,
.contact-table td:last-child,
.contact-table th:last-child { white-space: nowrap; }

/* Aviso que só aparece quando colunas de tabela são ocultadas por largura. */
@media (max-width: 1400px) {
  .hide-wide { display: inline !important; }
}

/* A identidade no topo é o atalho para a própria conta. */
.topbar-me {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 3px 6px 3px 3px;
  border-radius: 8px;
  min-width: 0;
  transition: background 0.15s;
}

.topbar-me:hover { background: var(--bg); }
.topbar-me:hover .topbar-name { color: var(--blue); }
