/* ==========================================================================
   SIGA — DESIGN SYSTEM INSTITUTIONAL DRIVE (ESTRUTURA VISUAL UNIFICADA)
   Diocese de São José dos Campos
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Tipografia Oficial */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-serif: 'Cinzel', Georgia, serif;
  
  /* Dimensões e Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-drawer: -4px 0 20px rgba(0, 0, 0, 0.08);

  /* Paleta Oficial Institutional Drive */
  --id-sidebar-bg: #0b1a30;
  --id-sidebar-active: #162a4a;
  --id-sidebar-hover: #13243d;
  --id-sidebar-text: #e2e8f0;
  --id-sidebar-muted: #94a3b8;
  
  --id-primary: #1e3a8a;
  --id-primary-dark: #172554;
  --id-accent: #2563eb;
  --id-accent-gold: #c5a880;
  --id-border: #e2e8f0;
  --id-border-light: #f1f5f9;
  --id-card: #ffffff;
  --id-bg: #f8fafc;
  --id-text: #0f172a;
  --id-text-muted: #64748b;

  /* Status */
  --status-ok-bg: #ecfdf5;
  --status-ok-text: #065f46;
  --status-ok-border: #a7f3d0;
  
  --status-wait-bg: #fffbeb;
  --status-wait-text: #92400e;
  --status-wait-border: #fde68a;

  /* Badges de Formato */
  --badge-pdf: #dc2626;
  --badge-doc: #2563eb;
  --badge-jpg: #059669;
  --badge-txt: #4b5563;

  /* Compatibilidade RDC legada */
  --blue: var(--id-primary);
  --blue-d: var(--id-primary-dark);
  --navy: var(--id-sidebar-bg);
  --ink: var(--id-text);
  --muted: var(--id-text-muted);
  --line: var(--id-border);
  --paper: var(--id-bg);
  --card: var(--id-card);
  --gold: #8d6a32;
  --gold-soft: #f4ead8;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--id-bg);
  color: var(--id-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--id-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TOP GLOBAL SUPER-BAR (COMPARTILHADA ENTRE TODOS OS MÓDULOS)
   ========================================================================== */
#global-super-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #081220;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  flex-shrink: 0;
  height: 48px;
  min-width: 0;
}

.super-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.super-bar-crest {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(197, 168, 128, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  flex-shrink: 0;
}

.siga-badge-brand {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
}

.demo-tag {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.super-bar-center {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn-link {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  text-decoration: none;
}

.nav-btn-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

.nav-btn-link.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 600;
}

.super-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.session-badge-pill {
  background: #059669;
  color: #ffffff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   ESTRUTURA PRINCIPAL (APP LAYOUT & SIDEBAR)
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 48px);
  overflow: hidden;
  position: relative;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

/* Menu Lateral Permanente Institucional */
.id-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--id-sidebar-bg);
  color: var(--id-sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e293b;
  z-index: 20;
  height: 100%;
}

.id-brand-box {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.id-crest {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(197, 168, 128, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.id-crest-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.id-brand-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.id-brand-sub {
  font-size: 10px;
  color: var(--id-accent-gold);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}

/* Card da Instituição Ativa no Menu */
.id-institution-card {
  margin: 12px 14px 6px 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.id-inst-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--id-accent-gold);
  font-weight: 700;
}

.id-inst-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-inst-meta {
  font-size: 11px;
  color: var(--id-sidebar-muted);
  margin-top: 2px;
}

/* Seção de Navegação por Módulos */
.id-nav-section {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.id-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--id-sidebar-muted);
  padding: 0 8px 6px 8px;
  font-weight: 700;
}

.id-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--id-sidebar-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.id-nav-link:hover {
  background: var(--id-sidebar-hover);
  color: #ffffff;
  text-decoration: none;
}

.id-nav-link.active {
  background: var(--id-sidebar-active);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid #38bdf8;
}

.id-nav-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.id-future-tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.sidebar-badge-counter {
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

/* Pastas e Árvore na Sidebar */
.id-folder-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Usuário no Rodapé da Sidebar */
.id-user-footer {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.id-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.id-user-info {
  flex: 1;
  min-width: 0;
}

.id-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-user-role {
  font-size: 11px;
  color: var(--id-sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-logout:hover {
  color: #ef4444;
}

/* ==========================================================================
   COLUNA DA ÁRVORE DO RDC (TREE PANE)
   ========================================================================== */
.tree-pane {
  width: var(--tree-width, 300px);
  min-width: 240px;
  max-width: 500px;
  background: #ffffff;
  border-right: 1px solid var(--id-border);
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
  height: 100%;
}

.tree-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--id-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.tree-head strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.tree-head button {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
}

.tree-head button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tree-find {
  padding: 8px 12px;
  border-bottom: 1px solid var(--id-border-light);
  background: #ffffff;
}

.tree-find label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.tree-find input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}

.tree-find input:focus {
  border-color: var(--id-accent);
}

.tree-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.tree-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
}

.tree-resize:hover {
  background: #3b82f6;
}

.node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #334155;
  margin-bottom: 1px;
  padding-left: calc(8px + var(--depth, 0) * 16px);
  cursor: pointer;
  transition: all 0.15s;
}

.node:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.node[aria-current="true"] {
  background: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}

.node a {
  flex: 1;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.node em {
  font-style: normal;
  font-size: 11px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 10px;
}

.chev {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 11px;
  padding: 0;
}

.chev[aria-expanded="true"]::before {
  content: "▾";
}

.chev[aria-expanded="false"]::before {
  content: "▸";
}

.chev.leaf {
  visibility: hidden;
}

/* ==========================================================================
   ÁREA PRINCIPAL DE CONTEÚDO (ID-MAIN)
   ========================================================================== */
.id-main, .doc-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-y: auto;
  min-width: 0;
  height: 100%;
}

.pane-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 20px 24px;
  container-type: inline-size;
}

/* Barra Superior com Breadcrumbs, Busca e Ações */
.id-header, .pane-head {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pane-head h1 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
}

.pane-head p {
  font-size: 12.5px;
  color: var(--id-text-muted);
  margin-top: 3px;
}

.pane-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Breadcrumbs Padronizados */
.id-breadcrumbs, .crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--id-text-muted);
  margin-bottom: 12px;
  padding: 0 4px;
}

.crumbs a {
  color: #475569;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--id-accent);
  text-decoration: underline;
}

.crumbs strong {
  color: #0f172a;
  font-weight: 600;
}

.crumbs span {
  color: #cbd5e1;
}

/* Barra de Busca com Cantos Arredondados */
.id-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  width: 260px;
  transition: all 0.2s;
}

.id-search-box:focus-within {
  background: #ffffff;
  border-color: var(--id-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.id-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  width: 100%;
}

/* Alternador Grade / Lista */
.id-view-toggle {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 2px;
}

.id-toggle-btn {
  background: transparent;
  border: none;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
}

.id-toggle-btn.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}

/* Botões Padrão */
.btn, .btn-id-primary {
  background: #1e3a8a;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover, .btn-id-primary:hover {
  background: #172554;
  color: #ffffff;
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.btn.ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.text-link {
  font-size: 12px;
  color: var(--id-accent);
  text-decoration: none;
  padding: 6px 8px;
}

.text-link:hover {
  text-decoration: underline;
}

/* Banner da MITRA */
.id-mitra-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #1e40af;
}

/* Grade de Paróquias (Visão da Mitra) */
.mitra-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.mitra-card-institution {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.mitra-card-institution:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mitra-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mitra-card-crest-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.mitra-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.mitra-card-info {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mitra-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
  font-size: 12px;
}

/* Pastas Mensais */
.id-folders-section {
  margin-bottom: 24px;
}

.id-subheading {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--id-text-muted);
  margin-bottom: 10px;
}

.id-folders-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.id-folder-card {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.id-folder-card:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.id-folder-card.active {
  border-color: var(--id-accent);
  background: #f0f7ff;
}

.id-folder-card-icon {
  font-size: 22px;
}

.id-folder-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.id-folder-card-count {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* MODO GRADE DE DOCUMENTOS */
.id-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.id-doc-card {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.id-doc-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.id-doc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.id-badge-format {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.id-badge-format.pdf { background: #fee2e2; color: #991b1b; }
.id-badge-format.doc { background: #dbeafe; color: #1e40af; }
.id-badge-format.jpg { background: #dcfce7; color: #166534; }
.id-badge-format.txt { background: #f1f5f9; color: #475569; }

.id-doc-date {
  font-size: 11.5px;
  color: #64748b;
}

.id-doc-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  min-height: 38px;
}

.id-doc-card-name a {
  color: inherit;
  text-decoration: none;
}

.id-doc-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
}

.id-dept-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
}

.id-doc-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}

/* MODO LISTA / TABELA */
.file-table, .id-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
  margin-top: 10px;
}

.file-table th, .id-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--id-border);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-table td, .id-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--id-border-light);
  color: #334155;
  vertical-align: middle;
}

.file-table tr:hover td, .id-table tr:hover td {
  background: #f8fafc;
}

.file-link {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}

.file-link:hover {
  color: var(--id-accent);
  text-decoration: underline;
}

.file-table .sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Status Badges */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.mark.done {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border: 1px solid var(--status-ok-border);
}

.mark.wait {
  background: var(--status-wait-bg);
  color: var(--status-wait-text);
  border: 1px solid var(--status-wait-border);
}

/* Painel de Detalhes e Histórico */
.detail-pane, .card.pad {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

dl.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 18px 0;
}

dl.meta dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

dl.meta dd {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

.history-block h2 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--id-border);
  margin-top: 8px;
}

.timeline li {
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--id-accent);
  border: 2px solid #ffffff;
}

.timeline .op {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.timeline .op.inc { background: #ecfdf5; color: #065f46; }
.timeline .op.alt { background: #eff6ff; color: #1e40af; }

.timeline .when {
  font-size: 11.5px;
  color: #64748b;
}

.hist-grid {
  display: flex;
  gap: 20px;
  font-size: 12px;
  margin-top: 4px;
  color: #334155;
}

/* Formulários de Inclusão e Alteração */
.include-box {
  background: #ffffff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.include-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="file"],
.field select,
.field textarea {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--id-accent);
}

.siga-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.siga-tabs .btn-sm.is-active {
  background: #0f172a;
  color: #fff;
  text-decoration: none;
}

.demand-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

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

.demand-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin-top: 16px;
}

.demand-more {
  margin: 8px 0 16px;
}

.demand-more summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}

#d-urg-wrap[hidden] {
  display: none !important;
}

.is-late-row td { background: #fef2f2; }
.is-pending-row td { background: #fffbeb; }
.id-future-tag.is-late { background: #fecaca; color: #7f1d1d; }

.parish-inbox {
  max-width: 1080px;
}

.parish-inbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.parish-inbox-head h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--id-text);
}

.parish-inbox-head p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--id-text-muted);
}

.parish-inbox-stats,
.siga-home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
}

.siga-home-stats {
  margin-bottom: 24px;
}

@container (min-width: 760px) {
  .parish-inbox-stats,
  .siga-home-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container (max-width: 379px) {
  .parish-inbox-stats,
  .siga-home-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.parish-inbox-stat {
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.parish-inbox-stat.is-on {
  border-color: var(--id-accent);
  box-shadow: 0 0 0 1px var(--id-accent);
}

.parish-inbox-stat-n {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--id-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.parish-inbox-stat.is-late .parish-inbox-stat-n { color: #b91c1c; }
.parish-inbox-stat.is-done .parish-inbox-stat-n { color: #047857; }

.parish-inbox-stat span:last-child {
  font-size: 12.5px;
  color: var(--id-text-muted);
}

.parish-inbox-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

.parish-inbox-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

.parish-inbox-tabs a.is-on {
  background: var(--id-primary);
  color: #fff;
}

.parish-inbox-count {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
}

.parish-inbox-tabs a.is-on .parish-inbox-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.parish-demand-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parish-demand-card {
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.parish-demand-body {
  flex: 1;
  min-width: 0;
}

.parish-demand-card h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  margin-bottom: 6px;
}

.parish-demand-meta {
  color: var(--id-text-muted);
  font-size: 13px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.parish-demand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.parish-demand-badge.is-wait {
  background: var(--status-wait-bg);
  color: var(--status-wait-text);
  border: 1px solid var(--status-wait-border);
}

.parish-demand-badge.is-late {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.parish-demand-badge.is-done {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border: 1px solid var(--status-ok-border);
}

.parish-demand-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: #475569;
}

.parish-demand-due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #0f172a;
}

.parish-demand-due.is-late { color: #b91c1c; }

.parish-demand-card .btn {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 2px;
}

.parish-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.parish-inbox-status {
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  color: var(--id-text-muted);
  font-size: 14px;
}

.parish-inbox-error p + p {
  margin: 8px 0 16px;
  color: #991b1b;
}

.siga-inbox-filters-wrap {
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  margin-bottom: 16px;
}

.siga-inbox-filters-wrap summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--id-text-muted);
  list-style: none;
}

.siga-inbox-filters-wrap summary::-webkit-details-marker {
  display: none;
}

.siga-inbox-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px 14px;
  align-items: end;
  margin-top: 14px;
}

.siga-inbox-filters .field {
  margin: 0;
}

.siga-inbox-filters .btn-sm {
  height: 38px;
  padding: 0 14px;
}

.siga-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: var(--id-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
}

.siga-nav-toggle,
.id-sidebar-mobile-head,
.siga-nav-backdrop {
  display: none;
}

.siga-nav-toggle,
.siga-nav-close,
.siga-bell-btn {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  min-width: 36px;
  height: 32px;
  cursor: pointer;
}

.siga-page-context {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(240px, 36vw);
}

.siga-bell-btn .id-badge-unread {
  position: absolute;
  top: -6px;
  right: -6px;
}

.session-badge-pill,
.siga-inst-chip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.siga-inst-chip {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.siga-bell {
  position: relative;
}

.siga-bell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.siga-bell-panel {
  position: fixed;
  right: 12px;
  top: 52px;
  width: min(340px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  overflow: auto;
  background: #fff;
  color: var(--id-text);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  padding: 10px;
  z-index: 4000;
}

.siga-bell-panel[hidden] {
  display: none !important;
}

.siga-bell-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--id-text);
  font-size: 13px;
}

.siga-bell-panel a:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.siga-section-label {
  font-size: 13px;
  color: var(--id-text-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.siga-detail {
  max-width: 800px;
  background: #fff;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}

.siga-detail-head h2 {
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  margin: 8px 0 6px;
}

.siga-detail-body,
.siga-detail-files,
.siga-timeline {
  margin-top: 20px;
}

.siga-detail-body p {
  white-space: pre-wrap;
  line-height: 1.5;
}

.siga-attach-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--id-border-light);
}

.siga-timeline ol {
  list-style: none;
  border-left: 2px solid #e2e8f0;
  margin: 8px 0 0 8px;
  padding: 0 0 0 16px;
}

.siga-timeline li {
  position: relative;
  margin-bottom: 14px;
}

.siga-time-dot {
  position: absolute;
  left: -21px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--id-accent);
}

.siga-ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
  border: 1px solid var(--status-ok-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.siga-due-fields {
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0 0 16px;
  background: #fff;
}

.siga-due-fields legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

.siga-due-civil,
.siga-due-time {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.siga-due-civil {
  grid-template-columns: 5.5rem minmax(0, 1fr) 6.5rem;
}

.siga-due-time {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1100px) {
  .parish-inbox-stats,
  .siga-home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .parish-inbox-stats,
  .siga-home-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .siga-due-civil,
  .siga-due-time {
    grid-template-columns: minmax(0, 1fr);
  }

  .siga-bell-panel {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

.siga-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.siga-filter-chips a {
  font-size: 12.5px;
}

@media (max-width: 760px) {
  .parish-inbox-stats {
    grid-template-columns: 1fr;
  }
  .parish-inbox-tabs {
    width: 100%;
  }
  .parish-demand-card {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }
  .parish-demand-card .btn {
    width: 100%;
    text-align: center;
  }
  .siga-inbox-filters {
    grid-template-columns: 1fr;
  }
  .siga-inbox-filters .btn-sm {
    width: 100%;
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .siga-inbox-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .demand-form-grid {
    grid-template-columns: 1fr;
  }
  .include-grid {
    grid-template-columns: 1fr;
  }
}

.drop {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
}

.drop:hover {
  border-color: var(--id-accent);
  background: #f0f7ff;
}

.drop input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Avisos e Notificações */
.notice {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
}

.error {
  color: #dc2626;
  font-size: 12px;
  margin-bottom: 8px;
}

.empty {
  padding: 32px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* ==========================================================================
   MODAIS E DIÁLOGOS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.dialog-back {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card, .dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
}

.modal-header, .dialog h2 {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.modal-body, .dialog ul {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

.modal-footer, .dialog-actions {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #f8fafc;
}

/* Toast */
#toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--id-accent);
  z-index: 3000;
  display: none;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   ALERTAS INSTITUCIONAIS E BADGES DE MENSAGENS NÃO LIDAS
   ========================================================================== */
.id-badge-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  margin-left: auto;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
  animation: pulseBadge 2.2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 2px 8px rgba(220, 38, 38, 0.6); }
  100% { transform: scale(1); }
}

.siga-alert-banner {
  background: linear-gradient(90deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 24px 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  animation: slideDownAlert 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.siga-alert-banner.solicitacao {
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
  border-left-color: #d97706;
}

@keyframes slideDownAlert {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.siga-alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.siga-alert-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.siga-alert-content strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
}

.siga-alert-banner.solicitacao .siga-alert-content strong {
  color: #92400e;
}

.siga-alert-content span {
  font-size: 12px;
  color: #475569;
}

.siga-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.siga-alert-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.siga-alert-btn.primary {
  background: #1e3a8a;
  color: #ffffff;
  border: 1px solid #1e3a8a;
}

.siga-alert-btn.primary:hover {
  background: #172554;
}

.siga-alert-btn.solicitacao {
  background: #d97706;
  color: #ffffff;
  border: 1px solid #d97706;
}

.siga-alert-btn.solicitacao:hover {
  background: #b45309;
}

.siga-alert-btn.ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.siga-alert-btn.ghost:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Notificação flutuante em tempo real */
.siga-realtime-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  border: 1px solid #e2e8f0;
  border-left: 6px solid #2563eb;
  z-index: 9999;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Botão de visualização rápida no card de documento */
.id-doc-quick-view {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.id-doc-quick-view:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

/* Modal amplo de visualização de documentos */
.modal-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-preview-box {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid #cbd5e1;
  overflow: hidden;
}

.modal-preview-header {
  padding: 14px 20px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-preview-body {
  padding: 0;
  background: #f8fafc;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
}

/* ==========================================================================
   RESPONSIVIDADE E NAVEGAÇÃO EM TELAS PEQUENAS (Item 7)
   ========================================================================== */
@media (max-width: 900px) {
  .siga-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }

  .siga-page-context,
  .super-bar-crest,
  .session-badge-pill,
  .siga-inst-chip {
    display: none;
  }

  .siga-inbox-filters {
    grid-template-columns: 1fr;
  }

  .id-sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .id-sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 2000;
    height: 100%;
    width: min(300px, 88vw);
    max-width: 100%;
  }

  body.is-nav-open .id-sidebar {
    display: flex !important;
  }

  body.is-nav-open .siga-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1990;
  }

  .app-layout {
    flex-direction: column !important;
    height: calc(100vh - 48px) !important;
    overflow-x: hidden !important;
  }

  /* Adaptação das colunas da árvore e visualizador */
  .tree-pane {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 40vh !important;
    border-right: none !important;
    border-bottom: 1px solid var(--id-border) !important;
  }

  .tree-splitter {
    display: none !important;
  }

  .pane {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    padding: 16px !important;
  }

  table.data {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  .siga-alert-banner {
    flex-wrap: wrap;
    margin: 8px 12px;
  }

  .siga-alert-actions {
    width: 100%;
    justify-content: flex-end;
  }

  form.stack,
  form[data-ob-action],
  form[data-demand-action],
  form[data-com-action] {
    max-width: 100% !important;
  }

  .super-bar-center {
    display: none !important;
  }

  .super-bar {
    padding: 0 12px !important;
  }

  .pane-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

#obrigacoes-root .ob-stats {
  gap: 8px;
  margin-bottom: 16px;
}

#obrigacoes-root .ob-stats .parish-inbox-stat {
  padding: 12px 14px;
}

#obrigacoes-root .ob-stats .parish-inbox-stat-n {
  font-size: 22px;
}

#obrigacoes-root .ob-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 14px;
  align-items: end;
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

#obrigacoes-root .ob-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#obrigacoes-root .ob-count {
  font-size: 13px;
  color: var(--id-text-muted);
  margin: 0 0 12px;
}

#obrigacoes-root .ob-table-wrap {
  overflow: auto;
  background: var(--id-card);
  border: 1px solid var(--id-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

#obrigacoes-root .ob-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

#obrigacoes-root .ob-table th,
#obrigacoes-root .ob-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--id-border);
}

#obrigacoes-root .ob-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--id-text-muted);
  font-weight: 700;
  background: #f8fafc;
}

#obrigacoes-root .ob-table tr:last-child td {
  border-bottom: 0;
}

#obrigacoes-root .ob-cards {
  display: none;
}

#obrigacoes-root .ob-cards.is-only {
  display: flex;
}

#obrigacoes-root .ob-card {
  padding: 14px 16px;
  gap: 12px;
  align-items: center;
}

#obrigacoes-root .ob-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

#obrigacoes-root .ob-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#obrigacoes-root .ob-form {
  max-width: 860px;
}

#obrigacoes-root .ob-section {
  margin: 0 0 28px;
}

#obrigacoes-root .ob-section h3 {
  font-size: 15px;
  margin: 0 0 12px;
}

#obrigacoes-root .ob-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}

#obrigacoes-root .ob-due-summary {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--id-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

#obrigacoes-root .ob-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

#obrigacoes-root .ob-pick {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #fff;
}

#obrigacoes-root .ob-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px;
}

#obrigacoes-root .ob-check input {
  margin-top: 3px;
  accent-color: var(--id-accent);
}

#obrigacoes-root .ob-items {
  margin: 0;
  padding-left: 18px;
}

#obrigacoes-root .ob-form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

#obrigacoes-root .ob-row-actions {
  white-space: nowrap;
}

@media (max-width: 900px) {
  #obrigacoes-root .ob-table-wrap {
    display: none;
  }

  #obrigacoes-root .ob-cards {
    display: flex;
    flex-direction: column;
  }

  #obrigacoes-root .ob-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #obrigacoes-root .ob-filters,
  #obrigacoes-root .ob-grid,
  #obrigacoes-root .ob-pick-toolbar,
  #obrigacoes-root .ob-form-foot {
    grid-template-columns: 1fr;
  }
}

.siga-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #081220 0%, #0f1d33 48%, #1e3a8a 100%);
}
.siga-login-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 24px;
  box-shadow: 0 22px 40px rgba(8, 18, 32, 0.35);
  border: 1px solid rgba(197, 168, 128, 0.35);
}
.siga-login-brand { text-align: center; margin-bottom: 22px; }
.siga-login-crest { width: 56px; height: 56px; margin: 0 auto 12px; border: 1px solid rgba(197, 168, 128, 0.7); }
.siga-login-brand h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin: 0;
  color: #0b1a30;
}
.siga-login-kicker {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #c5a880;
}
.siga-login-place { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.siga-login-form .field { margin-bottom: 14px; }
.siga-login-form label { display: block; font-size: 12px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.siga-login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}
.siga-login-pass { display: flex; gap: 8px; }
.siga-login-pass input { flex: 1; }
.siga-login-eye {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  color: #1e3a8a;
}
.siga-login-submit { width: 100%; padding: 11px; font-weight: 600; }
.siga-login-submit:disabled { opacity: 0.7; cursor: wait; }
.siga-login-forgot { text-align: center; margin: 14px 0 0; font-size: 13px; }
.siga-login-forgot a { color: #1e3a8a; }
.siga-login-lead { font-size: 13px; color: #475569; line-height: 1.45; margin: 0 0 14px; }
.siga-login-error {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 12px;
}
.siga-login-env, .siga-login-support {
  margin: 16px 0 0;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.4;
}
.siga-login-support { margin-top: 4px; }
@media (max-width: 480px) {
  .siga-login { padding: 12px; }
  .siga-login-card { padding: 24px 18px 18px; }
}
