/* ==========================================================================
   SUSTENTARE PASSO FUNDO | PLATAFORMA CAMPO CIRCULAR 2026 - INTRANET & ADMIN
   ========================================================================== */

:root {
  --primary: #0d3b5c;
  --primary-hover: #082840;
  --primary-dark: #061c2e;
  --gold: #2e8b22;
  --gold-light: #eef8eb;
  --gold-border: #86efac;
  --accent: #2e8b22;
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #2e8b22;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(7, 30, 61, 0.14);
}

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

body.intra {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TELA DE LOGIN CENTRALIZADA E MODERNA
   ========================================================================== */

body.auth-page {
  background: radial-gradient(circle at top center, #1b3b6f 0%, #071e3d 60%, #031024 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px 16px;
}

body.auth-page .intra-main {
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: fadeInDown 0.35s ease-out;
}

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

.auth-card-head {
  background: #ffffff;
  padding: 36px 28px 20px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}

.auth-logo {
  max-width: 230px;
  height: auto;
  display: inline-block;
  transition: transform 0.2s ease;
}

.auth-logo:hover {
  transform: scale(1.02);
}

.auth-card-body {
  padding: 28px 32px 36px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.auth-header .sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form label,
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #fff;
  font-size: 14px;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.auth-form input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

.turnstile-wrap {
  margin: 20px 0 16px;
  display: flex;
  justify-content: center;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(180deg, #004aad 0%, #003366 100%);
  color: #ffffff;
  border: 0;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.25);
  transition: all 0.18s ease;
  margin-top: 6px;
}

.btn-submit:hover {
  background: linear-gradient(180deg, #0056b3 0%, #002244 100%);
  box-shadow: 0 6px 16px rgba(0, 51, 102, 0.35);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.auth-footer-links {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer-links a:hover {
  text-decoration: underline;
}

.auth-footer-links .sep {
  margin: 0 8px;
  color: var(--text-light);
}

/* ==========================================================================
   TOPO DA INTRANET (HEADER)
   ========================================================================== */

.intra-top {
  display: flex;
  align-items: center;
  background: var(--primary-dark);
  border-bottom: 3px solid var(--gold);
  color: #fff;
  padding: 10px 24px;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.intra-brand {
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s;
}

.intra-brand:hover {
  opacity: 0.95;
}

.intra-logo {
  height: 34px;
  width: auto;
  display: block;
}

.intra-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.intra-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.intra-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.intra-nav a.active {
  color: #ffffff;
  background: rgba(200, 157, 60, 0.22);
  border: 1px solid rgba(200, 157, 60, 0.4);
}

.intra-nav a.nav-ext {
  color: #93c5fd;
  font-weight: 500;
}

.intra-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.intra-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.user-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #ffffff;
}

.user-role {
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: #b00020;
  border-color: #b00020;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (MAIN)
   ========================================================================== */

.intra-main {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px 60px;
  width: 100%;
}

/* Barra de Ferramentas / Título */
.intra-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.count-badge {
  display: inline-block;
  background: #e2e8f0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.intra-search {
  display: flex;
  gap: 6px;
}

.intra-search input {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13.5px;
  min-width: 240px;
}

.intra-search button {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.intra-search button:hover {
  background: var(--primary-hover);
}

/* Abas de Seções de Menus */
.section-tabs-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  border-color: #cbd5e1;
  color: var(--text-main);
  background: #f8fafc;
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.tab-count {
  font-size: 11px;
  background: #e2e8f0;
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
}

/* ==========================================================================
   TABELAS DE DADOS
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.intra-table th {
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
}

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

.intra-table tbody tr:last-child td {
  border-bottom: 0;
}

.intra-table tbody tr:hover {
  background: #fafcff;
}

.row-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--primary-dark);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 2px;
}

.row-title:hover {
  color: var(--accent);
}

.row-meta {
  font-size: 12px;
  color: var(--text-light);
}

.row-slug {
  font-family: monospace;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-publish {
  background: #dcfce7;
  color: #166534;
}

.badge-draft {
  background: #fef3c7;
  color: #92400e;
}

.section-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: #e0e7ff;
  color: #3730a3;
  white-space: nowrap;
}

.section-institucional { background: #e0f2fe; color: #0369a1; }
.section-organizacao { background: #fef3c7; color: #92400e; }
.section-juridico { background: #fce7f3; color: #9d174d; }
.section-publicacoes { background: #ede9fe; color: #5b21b6; }
.section-convenios { background: #dcfce7; color: #166534; }
.section-associese { background: #ffedd5; color: #9a3412; }
.section-contato { background: #f1f5f9; color: #475569; }

/* Ações na Tabela */
.intra-table th.th-actions,
.intra-table td.td-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
  padding-left: 12px;
  padding-right: 16px;
}

.intra-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  flex-wrap: nowrap;
  vertical-align: middle;
}

.form-action-inline {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
}

.btn-action,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  box-sizing: border-box;
  vertical-align: middle;
  transition: all 0.15s ease-in-out;
}

.btn-view {
  color: var(--accent);
  background: #f0f6ff;
  border: 1px solid #bfdbfe;
}

.btn-view:hover {
  background: #dbeafe;
  color: var(--primary-dark);
}

.btn-edit {
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
}

.btn-edit:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-protected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  padding: 0 8px;
  border-radius: 4px;
  text-transform: uppercase;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
  font-style: italic;
}

/* Paginação no Painel Intra */
.intra-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.intra-pagination-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

.intra-pagination-info strong {
  color: var(--text-main);
}

.intra-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.intra-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
}

.intra-page-link:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
}

.intra-page-link.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  pointer-events: none;
  cursor: default;
}

.intra-page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
  background: #f8fafc;
}

.intra-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

/* Botões Genéricos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: all 0.15s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--primary-dark);
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--primary-dark);
}

.btn-block {
  width: 100%;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 8px;
}

.btn-back:hover {
  color: var(--accent);
}

/* ==========================================================================
   TELA DE EDIÇÃO DE PÁGINAS E NOTÍCIAS
   ========================================================================== */

.edit-header {
  margin-bottom: 20px;
}

.edit-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.edit-title-group h1,
.edit-header h1 {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
}

.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.edit-main {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.edit-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.side-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}

.slug-preview {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  overflow: hidden;
}

.slug-prefix {
  padding: 10px 10px 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  background: #f1f5f9;
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
}

.slug-preview input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.slug-warning {
  display: block;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 6px;
  border: 1px solid #fef3c7;
}

.page-content-area {
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.6;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.menu-info-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.chk input {
  width: auto;
  margin: 0;
}

.featured-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.featured-status {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}

#featured-file {
  margin: 8px 0;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* Formulário de Admin */
.admin-form {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-top: 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.admin-form h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

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

/* Notificações */
.notice-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
}

.notice-box.err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.notice-box.ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #071e3d;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

.intra-nav a.active .nav-badge {
  background: #ffffff;
  color: #071e3d;
}

/* ==========================================================================
   MINI EDITOR WYSIWYG (NOTÍCIAS E PÁGINAS)
   ========================================================================== */

.rich-editor-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rich-editor-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
}

.rich-editor-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow: visible;
}

.tb-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.tb-group-right {
  margin-left: auto;
}

.tb-divider {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
  margin: 0 2px;
  flex-shrink: 0;
}

.tb-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: all 0.15s ease;
  user-select: none;
  vertical-align: middle;
  font-family: inherit;
  line-height: 0;
  overflow: hidden;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.tb-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.tb-btn:active {
  background: #e2e8f0;
  transform: translateY(1px);
}

.tb-btn svg {
  display: block;
  pointer-events: none;
  flex-shrink: 0;
  margin: 0;
}

.tb-btn-b,
.tb-btn-i,
.tb-btn-u,
.tb-btn-s {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  color: #0f172a;
}

.tb-btn-b {
  font-weight: 800;
  font-size: 13.5px;
}

.tb-btn-i {
  font-style: italic;
  font-weight: 600;
  font-family: 'Georgia', serif;
  font-size: 14.5px;
}

.tb-btn-u {
  text-decoration: underline;
  font-weight: 700;
  font-size: 13px;
}

.tb-btn-s {
  text-decoration: line-through;
  font-weight: 700;
  font-size: 13px;
}

.form-group select.tb-select,
.rich-editor-toolbar select.tb-select,
.tb-select {
  width: auto !important;
  height: 30px !important;
  line-height: 28px !important;
  padding: 0 8px !important;
  font-size: 12.5px !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius-sm) !important;
  background-color: #ffffff !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  outline: none !important;
  display: inline-block !important;
}

.form-group select.tb-select:hover,
.rich-editor-toolbar select.tb-select:hover {
  border-color: #94a3b8 !important;
}

.form-group select.tb-select:focus,
.rich-editor-toolbar select.tb-select:focus {
  border-color: var(--border-focus) !important;
}

.tb-color-picker {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s;
  vertical-align: middle;
  line-height: 0;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 0;
}

.tb-color-picker:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #0f172a;
}

.tb-color-picker input[type="color"] {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.tb-color-picker svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  margin: 0;
}

.tb-mode-btn {
  width: auto;
  padding: 0 10px;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  box-sizing: border-box;
}

.tb-mode-btn:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.rich-editor-content {
  min-height: 380px;
  max-height: 720px;
  overflow-y: auto;
  padding: 24px 28px;
  font-size: 16px;
  line-height: 1.75;
  color: #1e293b;
  outline: none;
  background: #ffffff;
}

.rich-editor-content:empty::before {
  content: attr(placeholder);
  color: #94a3b8;
  font-style: italic;
  pointer-events: none;
}

.rich-editor-content h2 {
  font-size: 23px;
  margin: 22px 0 12px;
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.3;
}

.rich-editor-content h3 {
  font-size: 19px;
  margin: 18px 0 10px;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.35;
}

.rich-editor-content h4 {
  font-size: 16px;
  margin: 14px 0 8px;
  color: #334155;
  font-weight: 600;
}

.rich-editor-content p {
  margin: 0 0 16px;
}

.rich-editor-content a {
  color: var(--accent);
  text-decoration: underline;
}

.rich-editor-content blockquote {
  border-left: 4px solid var(--gold);
  margin: 18px 0;
  padding: 10px 18px;
  background: var(--gold-light);
  color: #334155;
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.rich-editor-content ul,
.rich-editor-content ol {
  margin: 0 0 16px;
  padding-left: 26px;
}

.rich-editor-content li {
  margin-bottom: 6px;
}

.rich-editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 14px 0;
}

.rich-editor-raw {
  width: 100%;
  min-height: 380px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 20px;
  border: 0;
  background: #0f172a;
  color: #f8fafc;
  outline: none;
  resize: vertical;
}

/* ==========================================================================
   MODERAÇÃO DE COMENTÁRIOS
   ========================================================================== */

.comment-author-name {
  font-size: 13.5px;
  color: #0f172a;
  margin-bottom: 2px;
}

.comment-email {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 3px;
  word-break: break-all;
}

.comment-email a {
  color: inherit;
  text-decoration: none;
}

.comment-email a:hover {
  text-decoration: underline;
}

.comment-ip {
  font-size: 11.5px;
  color: #64748b;
}

.comment-ip code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: #475569;
  font-family: inherit;
}

.comment-body-text {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
}

.comment-post-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  line-height: 1.35;
}

.comment-post-link:hover {
  text-decoration: underline;
  color: var(--primary);
}

.empty-state {
  text-align: center;
  color: #94a3b8;
  padding: 36px 16px !important;
  font-style: italic;
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLETS)
   ========================================================================== */

@media (max-width: 840px) {
  /* Centralização total no header da intranet em mobile */
  .intra-top {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 16px 14px !important;
    gap: 14px !important;
  }

  .intra-brand {
    margin: 0 auto !important;
    display: inline-flex !important;
    justify-content: center !important;
  }

  .intra-nav {
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .intra-nav a {
    text-align: center;
    padding: 7px 12px;
    font-size: 13px;
  }

  .intra-user {
    width: 100% !important;
    justify-content: center !important;
    margin: 4px auto 0 !important;
    gap: 12px !important;
  }

  .intra-user-info {
    align-items: center !important;
    text-align: center !important;
  }

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

  .intra-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: space-between;
  }

  .intra-search {
    width: 100%;
  }

  .intra-search input {
    min-width: 0;
    flex: 1;
  }

  .rich-editor-toolbar {
    justify-content: flex-start;
  }

  .tb-group-right {
    margin-left: 0;
  }

  .tb-divider {
    display: none;
  }

  .rich-editor-content {
    padding: 16px;
    font-size: 15px;
  }
}

.wa-support {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  line-height: 1;
}

.wa-support:hover {
  background: #1ebe5d;
  color: #fff;
}

.wa-support svg {
  display: block;
  flex-shrink: 0;
}

/* ==========================================================================
   MODAL DE ALTERAÇÃO DE SENHA (ADMINS)
   ========================================================================== */
dialog.admin-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 25px 50px -12px rgba(7, 30, 61, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  margin: auto;
}

dialog.admin-modal::backdrop {
  background: rgba(7, 30, 61, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog.admin-modal[open] {
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-dialog-content {
  padding: 24px 26px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h3 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-target-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.user-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.modal-target-user .target-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-target-user .target-user {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: monospace;
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper input {
  width: 100%;
  padding-right: 42px !important;
}

.btn-pwd-eye {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.btn-pwd-eye:hover {
  color: var(--text-main);
}

.modal-form-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

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

/* ==========================================================================
   BIBLIOTECA DE MÍDIAS & SELETOR DE ARQUIVOS
   ========================================================================== */

.media-dropzone {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 24px;
}

.media-dropzone:hover,
.media-dropzone.dragover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.dropzone-icon {
  color: var(--primary);
  margin-bottom: 12px;
}

.dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.media-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.media-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.media-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.media-card:hover .media-card-thumb img {
  transform: scale(1.04);
}

.media-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.media-card-thumb .video-badge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease;
}

.media-card:hover .video-badge-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.play-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 51, 102, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.media-doc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 8px;
}

.media-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.media-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.media-type-tag {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.media-type-tag.type-video {
  background: #fef3c7;
  color: #92400e;
}

.media-type-tag.type-image {
  background: #e0f2fe;
  color: #0369a1;
}

.media-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.media-btn-action {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.media-btn-action:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.media-btn-delete {
  color: #ef4444;
  border-color: #fee2e2;
  background: #fef2f2;
}

.media-btn-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Linha com botão "Abrir Mídias" ao lado do input */
.media-input-action-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}

.media-input-action-row input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0 !important;
}

.btn-open-media {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-open-media:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.file-upload-row {
  margin-bottom: 10px;
}

.file-upload-row input[type="file"] {
  font-size: 12px;
  width: 100%;
}

.media-preview-box,
.video-preview-box {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #071e3d;
  border: 1px solid var(--border-color);
  margin-top: 10px;
}

.media-preview-box img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.video-preview-box video,
.video-preview-box iframe {
  display: block;
  width: 100%;
  max-height: 240px;
  border: 0;
}

.btn-clear-media {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 2;
}

.btn-clear-media:hover {
  background: #ef4444;
}

.sub-label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  margin-bottom: 4px !important;
}

/* ==========================================================================
   MODAL SELETOR DE MÍDIAS (POPUP)
   ========================================================================== */

dialog.media-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  z-index: 999999 !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  padding: 0 !important;
  width: 92vw !important;
  max-width: 920px !important;
  height: 85vh !important;
  max-height: 720px !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden !important;
}

dialog.media-modal:not([open]) {
  display: none !important;
}

dialog.media-modal[open] {
  display: flex !important;
  flex-direction: column !important;
}

dialog.media-modal::backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(7, 30, 61, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 999998 !important;
}

.media-modal-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-modal-head {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.media-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.media-modal-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.media-modal-nav-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
}

.modal-nav-btn {
  border: none;
  background: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-nav-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.media-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.media-modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.media-modal-toolbar {
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-filter-pills {
  display: flex;
  gap: 6px;
}

.modal-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.modal-pill.active,
.modal-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.modal-search-box {
  position: relative;
  min-width: 220px;
}

.modal-search-box input {
  width: 100%;
  padding: 6px 12px 6px 30px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: #ffffff;
}

.modal-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.media-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  position: relative;
}

.modal-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.picker-item {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.picker-item:hover {
  border-color: #93c5fd;
}

.picker-item.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.2);
}

.picker-item.is-selected::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.picker-thumb {
  aspect-ratio: 1;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.picker-name {
  font-size: 11.5px;
  padding: 6px 8px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
}

.media-modal-footer {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-selection-info {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-footer-actions {
  display: flex;
  gap: 10px;
}

.upload-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
}



/* ==========================================================================
   PLATAFORMA CAMPO CIRCULAR FERTILIZANTES — SISTEMA VISUAL (.cc-*)
   ========================================================================== */

.cc-demo-switcher {
  background: linear-gradient(90deg, #0d3b5c 0%, #14532d 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(13, 59, 92, 0.18);
}

.cc-demo-switcher-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.cc-demo-tag {
  background: #3fa535;
  color: #ffffff;
  font-weight: 800;
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cc-demo-switcher-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-demo-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cc-demo-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.cc-demo-btn.is-current {
  background: #ffffff;
  color: #0d3b5c;
  border-color: #ffffff;
  font-weight: 800;
}

.cc-hero-banner {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 6px solid #2e8b22;
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.cc-hero-Logos {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.cc-hero-logo-sust {
  height: 68px !important;
  max-height: 68px !important;
  width: auto;
}

.cc-hero-logo-cc {
  height: 48px !important;
  max-height: 48px !important;
  width: auto;
}

.cc-hero-divider {
  width: 1px;
  height: 32px;
  background: #cbd5e1;
}

.cc-hero-banner h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #0d3b5c;
}

.cc-hero-banner p {
  margin: 0;
  font-size: 13.5px;
  color: #475569;
  max-width: 720px;
}

.cc-hero-actions,
.cc-header-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.cc-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cc-page-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: #0d3b5c;
}

.cc-page-header p {
  margin: 0;
  font-size: 13.5px;
  color: #475569;
}

/* Botões Campo Circular */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cc-btn-primary {
  background: #2e8b22;
  color: #ffffff !important;
  border-color: #2e8b22;
}

.cc-btn-primary:hover {
  background: #236e19;
}

.cc-btn-secondary {
  background: #0d3b5c;
  color: #ffffff !important;
  border-color: #0d3b5c;
}

.cc-btn-secondary:hover {
  background: #082840;
}

.cc-btn-outline {
  background: #ffffff;
  color: #0d3b5c !important;
  border-color: #cbd5e1;
}

.cc-btn-outline:hover {
  background: #f8fafc;
  border-color: #0d3b5c;
}

.cc-btn-danger-soft {
  background: #fef2f2;
  color: #b91c1c !important;
  border-color: #fecaca;
}

.cc-btn-danger-soft:hover {
  background: #fee2e2;
}

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

.cc-btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}

.cc-btn-lg {
  padding: 12px 22px;
  font-size: 14px;
}

/* Alert Banners */
.cc-alert-banner {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.cc-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  color: #92400e;
}

.cc-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 5px solid #dc2626;
  color: #991b1b;
}

/* KPI Grid */
.cc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.cc-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 4px solid #0d3b5c;
}

.cc-kpi-green { border-top-color: #2e8b22; }
.cc-kpi-teal { border-top-color: #0d9488; }
.cc-kpi-blue { border-top-color: #0d3b5c; }
.cc-kpi-slate { border-top-color: #475569; }
.cc-kpi-danger { border-top-color: #dc2626; background: #fffafa; }

.cc-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.cc-kpi-value {
  font-size: 27px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.cc-kpi-sub {
  font-size: 12px;
  color: #475569;
}

/* Cards de seção */
.cc-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cc-section-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  color: #0d3b5c;
}

.cc-section-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: #0d3b5c;
}

.cc-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.cc-section-head p {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
}

.cc-link-more {
  font-size: 13px;
  font-weight: 700;
  color: #2e8b22;
  text-decoration: none;
  white-space: nowrap;
}

/* Pipeline 7 etapas */
.cc-steps-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.cc-step-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.18s ease;
}

.cc-step-card.has-items {
  background: #ffffff;
  border-color: #93c5fd;
  border-top: 3px solid #2e8b22;
}

.cc-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #2e8b22;
}

.cc-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cc-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0d3b5c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cc-step-icon {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2e8b22;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 6px;
  border-radius: 4px;
}

.cc-step-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0d3b5c;
  margin-bottom: 4px;
  line-height: 1.25;
}

.cc-step-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  margin-bottom: 10px;
}

.cc-step-metrics {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.cc-step-metrics strong {
  color: #2e8b22;
}

/* Colunas */
.cc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cc-three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Barras de progresso */
.cc-bar-row {
  margin-bottom: 12px;
}

.cc-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.cc-bar-track {
  height: 9px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.cc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2e8b22, #4ade80);
  border-radius: 99px;
}

.cc-bar-fill-blue {
  background: linear-gradient(90deg, #0d3b5c, #0284c7);
}

/* Tabelas */
.cc-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cc-table th {
  background: #f8fafc;
  color: #0d3b5c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.cc-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.cc-table tr:hover td {
  background: #f8fafc;
}

.cc-td-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.cc-code-pill {
  display: inline-block;
  background: #0d3b5c;
  color: #ffffff !important;
  font-family: monospace;
  font-weight: 800;
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 6px;
  text-decoration: none;
}

.cc-code-pill:hover {
  background: #2e8b22;
}

.cc-stage-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
}

.cc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.cc-badge-success { background: #dcfce7; color: #166534; }
.cc-badge-teal { background: #ccfbf1; color: #115e59; }
.cc-badge-blue { background: #dbeafe; color: #1e40af; }
.cc-badge-indigo { background: #e0e7ff; color: #3730a3; }
.cc-badge-amber { background: #fef3c7; color: #92400e; }
.cc-badge-danger { background: #fee2e2; color: #991b1b; }
.cc-badge-muted { background: #f1f5f9; color: #475569; }

.cc-doc-counter {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.cc-doc-counter.is-complete {
  background: #dcfce7;
  color: #166534;
}

.cc-row-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.cc-chain-mini {
  font-size: 11.5px;
  line-height: 1.45;
  color: #334155;
}

.cc-chain-mini span {
  font-weight: 700;
  color: #64748b;
}

/* Barra de filtros */
.cc-filter-bar {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.cc-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cc-filter-wide {
  grid-column: span 2;
}

.cc-filter-item label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.cc-filter-item input,
.cc-filter-item select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  background: #ffffff;
}

.cc-filter-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-filter-summary {
  margin-left: auto;
  font-size: 12.5px;
  color: #475569;
}

/* Formulários de Lote e Eventos */
.cc-form-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.cc-form-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.cc-form-section h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  color: #0d3b5c;
}

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

.cc-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cc-field {
  margin-bottom: 8px;
}

.cc-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.cc-field input,
.cc-field select,
.cc-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
}

.cc-form-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Detalhe do Lote */
.cc-lote-top-bar {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 6px solid #0d3b5c;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cc-lote-big-code {
  font-family: monospace;
  font-size: 24px;
  font-weight: 800;
  color: #0d3b5c;
}

/* Stepper 7 Etapas */
.cc-stepper-wrap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.cc-stepper-node {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-stepper-node.is-done {
  background: #f0fdf4;
  border-color: #86efac;
}

.cc-stepper-node.is-current {
  background: #eff6ff;
  border: 2px solid #0d3b5c;
}

.cc-stepper-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #0f172a;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-stepper-node.is-done .cc-stepper-circle {
  background: #2e8b22;
  color: #ffffff;
}

.cc-stepper-node.is-current .cc-stepper-circle {
  background: #0d3b5c;
  color: #ffffff;
}

.cc-stepper-label strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
}

.cc-stepper-label span {
  font-size: 11px;
  color: #64748b;
}

/* Balanço de Massa & Checklist */
.cc-mass-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-mass-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 7px;
  font-size: 12.5px;
}

.cc-mass-highlight {
  background: #dcfce7;
  color: #166534;
}

.cc-checklist-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
}

.cc-check-item.is-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cc-check-item.is-missing {
  background: #fffbeb;
  border-color: #fde68a;
}

.cc-check-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-hash-badge {
  font-family: monospace;
  font-size: 10.5px;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.cc-doc-badge {
  display: inline-block;
  background: #0d3b5c;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Timeline */
.cc-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.cc-timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.cc-timeline-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0d3b5c;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cc-timeline-content {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
}

.cc-timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cc-timeline-date {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
}

.cc-timeline-obs {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1e293b;
}

.cc-timeline-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
}

@media (max-width: 1100px) {
  .cc-kpi-grid,
  .cc-steps-grid,
  .cc-stepper-wrap,
  .cc-three-col,
  .cc-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cc-two-col,
  .cc-form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cc-kpi-grid,
  .cc-steps-grid,
  .cc-stepper-wrap,
  .cc-three-col,
  .cc-filter-grid,
  .cc-form-grid-2 {
    grid-template-columns: 1fr;
  }
  .cc-filter-wide {
    grid-column: span 1;
  }
}
