/* ══════════════════════════════════════
   Painel v2 — IABS
   Layout: sidebar fixa + main scrollável
   ══════════════════════════════════════ */

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

:root {
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --navy: #1a2e4a;
  --navy-hover: #243d5f;
  --navy-active: #2d5a8e;
  --blue: #2d5a8e;
  --blue-light: #4a90d9;
  --blue-pale: #e8f0f8;
  --text: #2c3e50;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --white: #ffffff;
  --red: #e74c3c;
  --red-bg: #fef2f2;
  --green: #27ae60;
  --green-bg: #f0fdf4;
  --orange: #f39c12;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══ LOGIN ══ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #2d5a8e 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-cross {
  font-size: 40px;
  color: var(--blue);
  margin-bottom: 12px;
  display: block;
}

.login-logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ══ FORM FIELDS ══ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-size: 16px; /* 16px evita zoom automático no iOS */
}
@media (min-width: 600px) {
  .field input,
  .field select,
  .field textarea { font-size: 14px; }
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Alias classes para campos gerados dinamicamente (secretaria, perfil) ── */
.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
@media (min-width: 600px) {
  .form-input, .form-select { font-size: 14px; }
}
.form-input:focus, .form-select:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  resize: vertical;
  min-height: 80px;
}
@media (min-width: 600px) {
  .form-textarea { font-size: 14px; }
}
.form-textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-active); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) { background: #c0392b; }

.btn-success {
  background: var(--green);
  color: var(--white);
}
.btn-success:hover:not(:disabled) { background: #219a52; }

.btn-ghost {
  background: transparent;
  color: var(--blue);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--blue-pale); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

/* ══ ALERTS ══ */
.alert-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.alert-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.form-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ══ MODAL ══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-start;   /* permite scroll quando modal > viewport */
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;           /* overlay rola quando modal é alto */
  -webkit-overflow-scrolling: touch;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
  position: relative;
  margin: auto; /* auto em flex-child distribui espaço: centraliza quando curto, 0 quando longo */
}

.modal-header {
  margin-bottom: 24px;
  padding-right: 32px;        /* espaço para o botão ✕ */
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.modal-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  z-index: 1;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ══ APP LAYOUT ══ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease;
  z-index: 200;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.brand-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background .15s;
}
.brand-home-link:hover { background: rgba(255,255,255,.08); }

.brand-cross {
  font-size: 22px;
  color: #7eb8f7;
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #e8f0f8;
  letter-spacing: .5px;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.sidebar-close-btn:hover { color: var(--white); background: rgba(255,255,255,.1); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #a8bfd8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  border-radius: 0;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
}
.nav-item.active {
  background: var(--blue);
  color: var(--white);
}

.nav-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.nav-label { flex: 1; }

/* ── Sidebar Bottom ── */
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-profile-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: #a8bfd8;
  transition: all .15s;
  min-width: 0;
}
.sidebar-profile-btn:hover { background: rgba(255,255,255,.08); color: var(--white); }

.s-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.s-avatar img { width: 100%; height: 100%; object-fit: cover; }

.s-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#sidebar-nome {
  font-size: 13px;
  font-weight: 600;
  color: #e8f0f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s-sub {
  font-size: 11px;
  color: #6b8ab0;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b8ab0;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { background: rgba(231,76,60,.15); color: var(--red); }

/* ── Overlay mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
}

/* ── Main Wrapper ── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

.topbar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
  transition: all .15s;
}
.topbar-toggle svg { width: 20px; height: 20px; }
.topbar-toggle:hover { background: var(--bg); color: var(--text); }

.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

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

.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all .15s;
}
.topbar-user-chip:hover { background: var(--blue-pale); border-color: var(--blue-light); }

.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── View Content ── */
.view-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
}

/* ══ LOADING ══ */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ VIEW COMPONENTS ══ */

/* Page header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Card */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 20px;
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-name { font-size: 14px; font-weight: 600; color: var(--text); }

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-admin { background: #fef3c7; color: #92400e; }
.badge-editor { background: #dbeafe; color: #1e40af; }
.badge-leitura { background: #dcfce7; color: #166534; }
.badge-sem_acesso { background: #f1f5f9; color: var(--text-muted); }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: var(--red-bg); color: var(--red); }

/* Avatar small */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Actions */
.actions { display: flex; gap: 4px; }

/* Search / toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ══ PERMISSÕES GRID ══ */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.perm-modulo {
  flex: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perm-select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  cursor: pointer;
  outline: none;
}
.perm-select:focus { border-color: var(--blue-light); }

/* ══ PERFIL ══ */
.perfil-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
}

.foto-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.foto-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid var(--border);
}
.foto-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ══ MODULE CARD (acervo/estudos/etc) ══ */
.module-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--white);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.module-banner-icon { font-size: 48px; }
.module-banner-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.module-banner-info p { opacity: .8; font-size: 14px; }

.module-action-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.module-action-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* ══ MODULE BANNER — mobile ══ */
@media (max-width: 600px) {
  .module-banner {
    flex-direction: column;
    padding: 20px;
    gap: 12px;
    text-align: center;
  }
  .module-banner-icon { font-size: 36px; }
  .module-banner-info h2 { font-size: 18px; }
  .module-banner-info p  { font-size: 13px; }
}

/* ══ WELCOME BANNER — mobile ══ */
@media (max-width: 600px) {
  .welcome-banner { padding: 20px 22px; }
  .welcome-banner h1 { font-size: 18px; }
}

/* ══ TOAST ══ */
.v2-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  max-width: 320px;
}
.v2-toast.show { opacity: 1; transform: translateY(0); }
.v2-toast.v2-toast-error { background: var(--red); }
.v2-toast.v2-toast-success { background: var(--green); }

/* ══ PLACEHOLDER ══ */
.view-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}
.view-placeholder .placeholder-icon { font-size: 48px; }
.view-placeholder h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.view-placeholder p { font-size: 14px; max-width: 360px; }

/* ══ RESPONSIVE ══ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar-overlay.show { display: block; }
  .sidebar-close-btn { display: flex !important; }

  .topbar-toggle { display: flex; }

  .view-content { padding: 16px; }

  .perfil-layout { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Modal: overlay com menos padding, modal ocupa mais tela */
  .modal-overlay { padding: 12px; }
  .modal         { padding: 24px 20px; border-radius: 10px; }
  .modal-lg      { max-width: none; }

  /* Secretaria: tabs roláveis horizontalmente */
  .tabs-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 0;
  }
  .tabs-header::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 10px 14px; }

  /* Filtros: empilhar verticalmente */
  .filtros-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .form-select-sm, .form-input-sm { width: 100%; font-size: 15px; padding: 10px 12px; }

  /* Formulários: grade 2 colunas → 1 coluna */
  .form-grid-2          { grid-template-columns: 1fr; }
  .form-grid-2 .field-full { grid-column: 1; }
  .form-row             { grid-template-columns: 1fr; }

  /* Config grid: coluna única */
  .config-grid { grid-template-columns: 1fr; }
  .rel-grid    { grid-template-columns: 1fr; }

  /* Stats cards: esticar */
  .stats-cards { flex-direction: column; }

  /* Campo builder: empilhar */
  .campo-builder-fields { flex-direction: column; align-items: stretch; }
  .campo-builder-fields input,
  .campo-builder-fields select { width: 100%; font-size: 15px; }
  .cb-del { align-self: flex-end; }

  /* View detalhe: label acima do valor */
  .view-row   { flex-direction: column; gap: 2px; }
  .view-label { min-width: unset; }

  /* Footer dos modais: botões em largura total */
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Tabela: scroll horizontal + fonte menor */
  .table-wrap { border-radius: 0; border-left: none; border-right: none; }
  tbody td    { font-size: 13px; padding: 10px 12px; }
  thead th    { font-size: 11px; padding: 10px 12px; }

  /* Botões maiores para touch */
  .btn-icon { min-width: 40px; min-height: 40px; font-size: 16px; }

  /* ── Membros: modal foto+nome empilha verticalmente ── */
  .membro-foto-header {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: center;
  }
  .membro-foto-header > div:last-child { width: 100%; }
  .membro-foto-header .form-grid-2 { grid-template-columns: 1fr 1fr; }

  /* ── Membros: familia-add-row empilha ── */
  .familia-add-row {
    flex-direction: column;
  }
  .familia-add-row .ss-wrap,
  .familia-add-row select,
  .familia-add-row .btn { width: 100%; }

  /* ── Membros: tabela oculta colunas secundárias ── */
  #tabela-membros .col-tipo,
  #tabela-membros thead th:nth-child(3),
  #tabela-membros thead th:nth-child(4),
  #tabela-membros tbody td:nth-child(3),
  #tabela-membros tbody td:nth-child(4) { display: none; }

  /* ── Topbar: oculta nome do usuário em telas pequenas ── */
  #chip-nome { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal      { padding: 20px 16px; }
  .view-content { padding: 12px; }

  /* card header row empilha em mobile pequeno */
  .card-header-row { flex-wrap: wrap; }

  /* ── Membros: foto+nome em coluna no modal ── */
  .membro-foto-header .form-grid-2 { grid-template-columns: 1fr; }

  /* ── Setor tags: fonte menor, padding menor ── */
  .setor-tag { font-size: 12px; padding: 4px 10px; }

  /* ── Searchable select: dropdown não extrapola viewport ── */
  .ss-dropdown { max-width: calc(100vw - 48px); }

  /* ── Filtros da lista de membros em coluna ── */
  .filtros-row > * { width: 100%; }

  /* ── Familia chips no modal compactam ── */
  .familia-chip { font-size: 12px; padding: 4px 8px 4px 4px; }
}

/* ══ FORM ROWS ══ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ══ SECTION SEPARATOR ══ */
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ══ INFO LIST ══ */
.info-list { display: flex; flex-direction: column; gap: 4px; }
.info-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}
.info-key { color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.info-val { color: var(--text); font-weight: 500; }

/* ══ ABAS ══ */
.tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

.tab-content { display: block; }
.tab-content.hidden { display: none !important; }

/* ══ CONFIG GRID ══ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

/* welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #2d5a8e 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: var(--white);
  margin-bottom: 24px;
}
.welcome-banner h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.welcome-banner p { opacity: .8; font-size: 14px; }

/* ══ EDITOR OVERLAY (Quill tela cheia) ══ */
.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  background: var(--white);
}
.editor-overlay.hidden { display: none; }

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--navy);
  color: var(--white);
  flex-shrink: 0;
}
.editor-topbar h3 {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-topbar .btn { flex-shrink: 0; }
.btn-editor-save {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-editor-save:hover { opacity: .88; }
.btn-editor-cancel {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-editor-cancel:hover { background: rgba(255,255,255,.25); }

.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-body .ql-toolbar {
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.editor-body .ql-container {
  border: none;
  flex: 1;
  overflow-y: auto;
  font-size: 16px;
  font-family: inherit;
}
.editor-body .ql-editor {
  min-height: 100%;
  padding: 24px 40px;
  max-width: 860px;
  margin: 0 auto;
  line-height: 1.7;
}
.editor-body .ql-editor p,
.editor-body .ql-editor li { margin-bottom: 6px; }
.editor-body .ql-editor blockquote {
  border-left: 4px solid var(--blue-light);
  padding-left: 16px;
  color: var(--text-muted);
  font-style: italic;
  margin: 12px 0;
}

/* Leitura pública — aplica estilo Quill ao conteúdo renderizado */
.ql-content { line-height: 1.7; color: var(--text, #2c3e50); }
.ql-content p { margin-bottom: .75em; }
.ql-content h1, .ql-content h2, .ql-content h3 { margin: 1.2em 0 .4em; font-weight: 700; }
.ql-content blockquote {
  border-left: 4px solid #4a90d9;
  padding-left: 16px;
  color: #6b7280;
  font-style: italic;
  margin: 12px 0;
}
.ql-content ul, .ql-content ol { padding-left: 1.6em; margin-bottom: .75em; }
.ql-content a { color: #2d5a8e; text-decoration: underline; }

/* ══ SECRETARIA / ATIVIDADES ══ */

/* Wrapper e layout de tabs */
.secretaria-wrap { display: flex; flex-direction: column; gap: 16px; }

.tabs-header {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
}
.tab-pane { display: block; }
.tab-pane.hidden { display: none !important; }

/* Cabeçalho de card com título + botão */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-header-row h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

/* Linha de filtros */
.filtros-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.form-select-sm,
.form-input-sm {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; /* 16px evita zoom iOS; override no desktop abaixo */
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-height: 38px;
}
.form-select-sm:focus,
.form-input-sm:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}
@media (min-width: 600px) {
  .form-select-sm, .form-input-sm { font-size: 13px; }
}

/* Grade de formulário de 2 colunas */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-grid-2 .field-full {
  grid-column: 1 / -1;
}
@media (max-width: 580px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* Campo inline (checkbox) */
.field-inline { margin-bottom: 16px; }
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Color input */
.form-color {
  padding: 4px 6px;
  height: 40px;
  cursor: pointer;
}

/* Separador de seção dentro de modal */
.section-divider {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin: 20px 0 12px;
}

/* Badges de status para atividades */
.badge-ok   { background: var(--green-bg); color: var(--green); }
.badge-warn { background: #fff7ed; color: #c2410c; }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }
.data-table tbody tr.row-inativo { opacity: 0.65; background: #f9f9f9; }

/* Botão ícone de perigo */
.btn-danger-icon { color: var(--red); }
.btn-danger-icon:hover { background: var(--red-bg); }

/* Coluna de ações na tabela */
.td-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  white-space: nowrap;
}
.text-center { text-align: center; }

/* Loading inline */
.loading-inline {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Modal largo */
.modal-lg { max-width: 680px; }

/* Cards de estatísticas (relatório) */
.stats-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stats-cards .stat-card {
  flex: 1;
  min-width: 140px;
}

/* Grade do relatório (por setor + por tipo) */
.rel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.rel-grid h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .rel-grid { grid-template-columns: 1fr; }
}

/* Config cards (setores e tipos) */
.config-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;       /* grid child: não extrapola a coluna */
  overflow: hidden;   /* clip table overflow dentro do card */
}

/* Tabelas dentro dos config-cards: padding compacto */
.config-card table thead th,
.config-card table tbody td {
  padding: 10px 10px;
}

/* Coluna de ações: padding compacto (width controlado por cada classe de tabela) */
.config-card table td.td-actions,
.config-card table th:last-child {
  padding-left: 4px;
  padding-right: 8px;
  white-space: nowrap;
}

/* ── Tabela de Setores (1 botão de ação) ── */
.table-setores {
  table-layout: fixed;
  width: 100%;
}
.table-setores th:nth-child(1),
.table-setores td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-setores th:nth-child(2),
.table-setores td:nth-child(2) { width: 76px; }
.table-setores th:nth-child(3),
.table-setores td:nth-child(3) { width: 48px; }

/* ── Tabela config com 2 botões de ação (edit + delete) ── */
.table-config-2btn {
  table-layout: fixed;
  width: 100%;
}
.table-config-2btn th:nth-child(1),
.table-config-2btn td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-config-2btn th:nth-child(2),
.table-config-2btn td:nth-child(2) { width: 76px; }
.table-config-2btn th:nth-child(3),
.table-config-2btn td:nth-child(3) { width: 88px; }

/* ── Tabela de Tipos ── */
.table-tipos {
  table-layout: fixed;
  width: 100%;
}
.table-tipos th:nth-child(1),
.table-tipos td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-tipos th:nth-child(2),
.table-tipos td:nth-child(2) { width: 68px; text-align: center; }
.table-tipos th:nth-child(3),
.table-tipos td:nth-child(3) { width: 76px; }
.table-tipos th:nth-child(4),
.table-tipos td:nth-child(4) { width: 48px; }

/* Builder de campos extras (modal tipo) */
.campos-builder-wrap {
  margin: 12px 0;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.campos-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.campos-builder-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.campo-builder-row { margin-bottom: 8px; }
.campo-builder-fields {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.campo-builder-fields .form-input,
.campo-builder-fields input[type="text"] {
  flex: 1;
  min-width: 100px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
}
.campo-builder-fields .form-select,
.campo-builder-fields select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
}

/* Drag handle para reordenação */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.drag-handle:hover {
  color: var(--navy);
  transform: scale(1.25);
}
.drag-handle:active { cursor: grabbing; }

/* Item sendo arrastado: slot vazio tracejado mostra onde ele estava/irá cair */
.campo-builder-row.dragging,
.cb-opcao-item.dragging {
  opacity: 0.18;
  background: rgba(26, 46, 74, 0.05);
  border: 2px dashed var(--navy);
  border-radius: var(--radius-sm);
  box-shadow: none !important;
}

/* Sub-área de opções de campo tipo lista (builder) */
.cb-opcoes-wrap {
  margin: 4px 0 4px 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cb-opcoes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cb-opcao-item {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cb-opcao-item .form-input {
  flex: 1;
  font-size: 13px;
  padding: 5px 8px;
}

/* Detalhe de atividade (modal visualizar) */
.view-detalhe { padding: 4px 0; }
.view-section  { margin-bottom: 16px; }
.view-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.view-row:last-child { border-bottom: none; }
.view-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  min-width: 140px;
  flex-shrink: 0;
}
.view-value {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

/* Texto auxiliar */
.helper-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.ql-content img { max-width: 100%; border-radius: 6px; margin: 8px 0; }

/* ══ TABELA DE MEMBROS — botões de ação ══ */
#tabela-membros td.td-actions {
  padding-left: 4px;
  padding-right: 8px;
  white-space: nowrap;
}

/* ══ FAMÍLIA ══ */
.familia-add-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.familia-add-row .ss-wrap {
  flex: 1;
  min-width: 180px;
}

.familia-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  font-size: 13px;
}
.familia-item-foto { flex-shrink: 0; }
.familia-grau-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--blue);
  background: var(--blue-pale);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.familia-parente-nome {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.familia-parente-link {
  cursor: pointer;
  color: var(--blue);
}
.familia-parente-link:hover { color: var(--blue-light); }

/* ══ SETOR TAGS (multi-select pills) ══ */
.setor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.setor-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
  white-space: nowrap;
}
.setor-tag:hover {
  border-color: var(--blue-light);
  color: var(--blue);
}
.setor-tag input[type="checkbox"] { display: none; }
.setor-tag:has(input:checked) {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  font-weight: 500;
}

/* ══ CEP ROW (input + botão na mesma linha) ══ */
.cep-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.cep-row input { flex: 1; }
.cep-row .btn  { flex-shrink: 0; min-height: 44px; }

/* ══ FOTO PERFIL ROW (foto ao lado das ações) ══ */
.foto-perfil-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 20px !important;
}
@media (max-width: 500px) {
  .foto-perfil-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

/* ══ SEARCHABLE SELECT (cônjuge) ══ */
.ss-wrap {
  position: relative;
}
.ss-input-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ss-input-row:focus-within {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74,144,217,.15);
}
.ss-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 10px 12px;
  font-size: 14px;
  background: transparent;
}
.ss-clear {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 10px;
  font-size: 14px;
  line-height: 1;
}
.ss-clear:hover { color: var(--red); }
.ss-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 2px;
}
.ss-option {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.ss-option:last-child { border-bottom: none; }
.ss-option:hover { background: var(--blue-pale); color: var(--blue); }
.ss-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.ss-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 7px;
  flex-shrink: 0;
}
.ss-dot-green { background: var(--green); }
.ss-dot-red   { background: var(--red); }

/* ══ EXTRA RESPONSIVE ══
   Melhorias gerais de UX mobile aplicadas sobre o layout existente
   ═══════════════════════════════════════════════════════════════ */

/* ── Touch targets mínimos em mobile (Apple HIG: 44px) ── */
@media (max-width: 768px) {
  .field input,
  .field select,
  .form-input,
  .form-select,
  .form-textarea,
  .ss-input-row,
  .search-input,
  .form-input-sm,
  .form-select-sm {
    min-height: 44px;
  }

  /* Membro foto-header: garante que o hint "Salve primeiro" fique centralizado */
  #membro-foto-hint {
    text-align: center;
  }

  /* View title menor em mobile */
  .view-title { font-size: 18px; }

  /* View header empilha quando título + botão não cabem */
  .view-header > div:first-child { flex: 1; min-width: 0; }

  /* Card header row envolve em mobile */
  .card-header-row { flex-wrap: wrap; }

  /* Topbar title truncado */
  .topbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  /* Membro: botões de ação na tabela — área de toque maior */
  #tabela-membros .btn-icon {
    min-width: 40px;
    min-height: 40px;
  }

  /* Secretaria: filtros de data — evitar overflow */
  #f-de, #f-ate, #r-de, #r-ate {
    min-width: 130px;
  }
}

/* ── Ajustes 480px (telas muito pequenas) ── */
@media (max-width: 480px) {

  /* Toast ocupa largura total */
  .v2-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    text-align: center;
  }

  /* info-row empilha label e valor */
  .info-row {
    flex-direction: column;
    gap: 1px;
  }
  .info-key { min-width: unset; }

  /* Stat card menor */
  .stat-value { font-size: 22px; }

  /* Modal: título menor */
  .modal-header h2 { font-size: 16px; }

  /* Membro detalhe: foto + dados empilha */
  #modal-detalhe-body > div:first-child {
    flex-direction: column !important;
    align-items: center !important;
  }
  #modal-detalhe-body .view-detalhe {
    min-width: unset !important;
    width: 100%;
  }

  /* Perfil: botão salvar full-width */
  #form-perfil .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ── Editor Quill mobile ── */
@media (max-width: 600px) {
  .editor-body .ql-editor {
    padding: 16px;
  }
  .editor-topbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .editor-topbar h3 { font-size: 14px; }
}

/* ── Searchable select: z-index maior que sidebar em mobile ── */
@media (max-width: 768px) {
  .ss-dropdown { z-index: 300; }
}

/* ── Modal grande: scroll suave no iOS ── */
.modal-overlay {
  -webkit-overflow-scrolling: touch;
}
.modal { -webkit-overflow-scrolling: touch; }
