/* ============================================================================
   IDENTIDADE VISUAL GLOBAL — "ESQUADRO" (DARK / MARCENARIA)
   Proporção obrigatória 60-30-10:
   - 60% Azul Marinho Profundo (#172D4D) | Base #0F1F38 | Elevado #1E3A63
   - 30% Marfim Suave (#F4F1EA) | Secundário rgba(244, 241, 234, 0.72)
   - 10% Ouro Antigo (#B58A45)
   ============================================================================ */

:root {
  --navy-base: #0F1F38;
  --navy-main: #172D4D;
  --navy-elevated: #1E3A63;
  --ivory: #F4F1EA;
  --ivory-muted: rgba(244, 241, 234, 0.72);
  --ivory-soft: rgba(244, 241, 234, 0.12);
  --gold: #B58A45;
  --gold-bright: #C99D55;
  --gold-dim: rgba(181, 138, 69, 0.25);
  --gold-bg: rgba(181, 138, 69, 0.14);
  --danger: #D96B6B;
  --danger-bg: rgba(217, 107, 107, 0.14);
  --success: #58B88A;
  --success-bg: rgba(88, 184, 138, 0.14);
  --radius-sm: 6px;
  --radius-md: 10px;
  --sidebar-width: 264px;
  --topbar-height: 74px;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html,
body {
  height: 100%;
  background: var(--navy-base);
  color: var(--ivory);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   SCROLLBAR DISCRETA
   ============================================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--navy-base);
}
::-webkit-scrollbar-thumb {
  background: var(--navy-elevated);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============================================================================
   LOGIN
   ============================================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(181, 138, 69, 0.08), transparent 40%),
    radial-gradient(circle at 82% 85%, rgba(30, 58, 99, 0.65), transparent 45%),
    var(--navy-base);
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--navy-main);
  border: 1px solid var(--gold-dim);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.login-brand h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ivory);
  line-height: 1.2;
}

.login-subtitle {
  color: var(--ivory-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--ivory-soft);
  text-align: center;
  font-size: 12px;
  color: var(--ivory-muted);
}

/* ============================================================================
   SHELL PRINCIPAL & SIDEBAR
   ============================================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--navy-base);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--navy-main);
  border-right: 1px solid var(--gold-dim);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.22s ease;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ivory-soft);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sidebar-brand strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ivory);
  letter-spacing: 0.01em;
}
.sidebar-brand span {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  padding: 12px 12px 6px;
  opacity: 0.9;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ivory-muted);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--navy-elevated);
  color: var(--ivory);
}

.nav-item.active {
  background: var(--navy-elevated);
  color: var(--ivory);
  border-color: var(--gold-dim);
  border-left-color: var(--gold);
}

.nav-icon {
  width: 20px;
  text-align: center;
  color: var(--gold);
  font-size: 15px;
}

.sidebar-footer {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--ivory-soft);
  background: rgba(15, 31, 56, 0.45);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--gold-bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.user-meta strong {
  font-size: 13px;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span {
  font-size: 11.5px;
  color: var(--ivory-muted);
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--navy-main);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar-left h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ivory);
  line-height: 1.2;
}
.topbar-left p {
  font-size: 12.5px;
  color: var(--ivory-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-container {
  padding: 24px 28px 40px;
  flex: 1;
  min-width: 0;
}

/* ============================================================================
   BOTÕES, INPUTS E FORMULÁRIOS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-base);
  border-color: var(--gold);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.btn-secondary {
  background: var(--navy-elevated);
  color: var(--ivory);
  border-color: var(--gold-dim);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--gold);
  background: #244575;
}

.btn-ghost {
  background: transparent;
  color: var(--ivory);
  border-color: var(--ivory-soft);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--navy-elevated);
  border-color: var(--gold-dim);
}

.btn-danger {
  background: var(--danger);
  color: var(--navy-base);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: rgba(217, 107, 107, 0.35);
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--ivory-soft);
  color: var(--ivory);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ivory);
  letter-spacing: 0.02em;
}

.form-hint {
  font-size: 11.5px;
  color: var(--ivory-muted);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='search'],
select,
textarea {
  width: 100%;
  background: var(--navy-base);
  color: var(--ivory);
  border: 1px solid var(--ivory-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(181, 138, 69, 0.22);
}

input::placeholder,
textarea::placeholder {
  color: rgba(244, 241, 234, 0.42);
}

input.input-invalid,
select.input-invalid {
  border-color: var(--danger);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 10px;
  background: var(--navy-base);
  border: 1px solid var(--ivory-soft);
  border-radius: var(--radius-sm);
}
.checkbox-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.form-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--ivory);
  font-size: 12.5px;
}

/* ============================================================================
   CARDS, PAINÉIS, KPIs E TABELAS
   ============================================================================ */
.panel {
  background: var(--navy-main);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ivory-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ivory);
}
.panel-body {
  padding: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--navy-main);
  border: 1px solid var(--gold-dim);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ivory-muted);
}
.kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--ivory);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 12px;
  color: var(--gold);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(15, 31, 56, 0.35);
  border-bottom: 1px solid var(--ivory-soft);
  align-items: center;
}
.filters-bar input,
.filters-bar select {
  width: auto;
  min-width: 185px;
  flex: 1 1 190px;
  max-width: 300px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  background: rgba(15, 31, 56, 0.55);
  border-bottom: 1px solid var(--gold-dim);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ivory-soft);
  color: var(--ivory);
  vertical-align: middle;
}

table.data-table tbody tr:hover {
  background: var(--navy-elevated);
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.text-muted {
  color: var(--ivory-muted);
}
.text-gold {
  color: var(--gold);
}
.text-right {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.badge-ivory {
  background: rgba(244, 241, 234, 0.12);
  color: var(--ivory);
  border-color: rgba(244, 241, 234, 0.22);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(88, 184, 138, 0.35);
}

.badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--ivory-muted);
}
.empty-state strong {
  display: block;
  color: var(--ivory);
  font-size: 15px;
  margin-bottom: 6px;
}

/* ============================================================================
   TABS
   ============================================================================ */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  color: var(--ivory-muted);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tab-btn:hover {
  background: var(--navy-elevated);
  color: var(--ivory);
}
.tab-btn.active {
  background: var(--gold);
  color: var(--navy-base);
}

/* ============================================================================
   ORGANOGRAMA VISUAL INTERATIVO (ESTILO ESQUADRO / ORGNOMES.JPG)
   ============================================================================ */
.org-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  background: var(--navy-main);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.org-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.org-viewport {
  position: relative;
  background:
    linear-gradient(rgba(181, 138, 69, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(181, 138, 69, 0.05) 1px, transparent 1px),
    var(--navy-base);
  background-size: 28px 28px;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  min-height: 540px;
  overflow: auto;
  padding: 28px 24px 36px;
  cursor: grab;
}
.org-viewport.panning {
  cursor: grabbing;
  user-select: none;
}

.org-canvas {
  transform-origin: top center;
  transition: transform 0.12s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 100%;
  gap: 0;
}

/* Linha superior dos Superintendentes de Circuito */
.org-sc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}

.org-sc-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 22px;
  background: var(--gold);
  transform: translateX(-50%);
}

/* Árvore ortogonal CSS pura com linhas em Ouro Antigo (#B58A45) */
.org-tree ul {
  padding-top: 22px;
  position: relative;
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 0;
}

.org-tree > ul {
  padding-top: 0;
}

.org-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 22px 10px 0 10px;
}

.org-tree > ul > li {
  padding-top: 0;
}

/* Conectores horizontais e verticais em #B58A45 */
.org-tree li::before,
.org-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid var(--gold);
  width: 50%;
  height: 22px;
}
.org-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--gold);
}
.org-tree li:only-child::after,
.org-tree li:only-child::before {
  display: none;
}
.org-tree li:only-child {
  padding-top: 22px;
}
.org-tree > ul > li:only-child {
  padding-top: 0;
}
.org-tree li:only-child > .org-node-card::before {
  content: '';
  position: absolute;
  top: -22px;
  left: 50%;
  width: 2px;
  height: 22px;
  background: var(--gold);
  transform: translateX(-50%);
}
.org-tree > ul > li:only-child > .org-node-card::before {
  display: none;
}
.org-tree li:first-child::before,
.org-tree li:last-child::after {
  border: 0 none;
}
.org-tree li:last-child::before {
  border-right: 2px solid var(--gold);
  border-radius: 0 4px 0 0;
}
.org-tree li:first-child::after {
  border-radius: 4px 0 0 0;
}
.org-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid var(--gold);
  width: 0;
  height: 22px;
}

/* Card Bipartido do Organograma (Topo #172D4D + Borda #B58A45 / Base #F4F1EA + Texto #172D4D) */
.org-node-card {
  position: relative;
  min-width: 182px;
  max-width: 230px;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.org-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(181, 138, 69, 0.35);
}

.org-node-card.featured {
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(181, 138, 69, 0.25), 0 10px 24px rgba(0, 0, 0, 0.42);
}

.org-node-top {
  background: var(--navy-main);
  color: var(--ivory);
  padding: 9px 12px;
  text-align: center;
  border-bottom: 2px solid var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.org-node-bottom {
  background: var(--ivory);
  color: var(--navy-main);
  padding: 9px 12px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.org-member-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-main);
  line-height: 1.3;
}

.org-member-empty {
  font-size: 11.5px;
  font-style: italic;
  color: rgba(23, 45, 77, 0.55);
}

/* Seções complementares (Pontos de Trabalho & Multiplicadores por Congregação) */
.org-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ============================================================================
   GERADOR DE MENSAGENS WHATSAPP
   ============================================================================ */
.whatsapp-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.whatsapp-preview-surface {
  background: var(--ivory);
  color: var(--navy-main);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px;
}

.whatsapp-preview-surface label {
  color: var(--navy-main);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 8px;
}

.whatsapp-preview-surface textarea {
  background: #ffffff;
  color: var(--navy-main);
  border: 1px solid rgba(23, 45, 77, 0.25);
  min-height: 250px;
  font-size: 13.5px;
  line-height: 1.55;
}

.whatsapp-preview-surface textarea:focus {
  border-color: var(--gold);
}

.recipients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 10px;
}

.recipient-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--navy-base);
  border: 1px solid var(--ivory-soft);
  border-radius: var(--radius-sm);
}

/* ============================================================================
   IMPORTADOR EXCEL
   ============================================================================ */
.dropzone {
  border: 2px dashed var(--gold-dim);
  background: var(--navy-base);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--gold);
  background: var(--navy-elevated);
}

/* ============================================================================
   MODAIS & TOASTS
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 32, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: var(--navy-main);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ivory-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ivory);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--ivory-soft);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: var(--navy-main);
  color: var(--ivory);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 600;
}
.toast.toast-error {
  border-color: var(--danger);
  border-left-color: var(--danger);
}
.toast.toast-success {
  border-color: var(--success);
  border-left-color: var(--success);
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */
.mobile-only {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 32, 0.72);
  z-index: 35;
}

@media (max-width: 960px) {
  .mobile-only {
    display: inline-flex;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .topbar {
    padding: 0 16px;
  }
  .view-container {
    padding: 18px 16px 32px;
  }
  .whatsapp-layout {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   IMPRESSÃO / EXPORTAÇÃO PDF DO ORGANOGRAMA
   ============================================================================ */
@media print {
  body {
    background: #172D4D !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sidebar,
  .topbar,
  .org-toolbar,
  .tabs,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .view-container {
    padding: 0 !important;
  }
  .org-viewport {
    overflow: visible !important;
    border: none !important;
  }
}
