/* ==========================================================================
   PBWriter Studio & CCDR-N — Plataforma Editorial NORTE 2030
   Estética Editorial Bookazine, Elegante, Funcional e Colaborativa
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

:root {
  --navy: #0f2b48;
  --navy-light: #1a426d;
  --navy-dark: #091b2e;
  --burgundy: #7a1f3d;
  --burgundy-light: #9e2a4f;
  --emerald: #17533c;
  --emerald-light: #247556;
  --gold: #c29b38;
  --gold-light: #dfb64e;
  
  --creme-bg: #f5f2eb;
  --creme-surface: #ffffff;
  --creme-subtle: #fcfbf9;
  --creme-border: #e3ded6;
  --creme-border-light: #ece8e1;

  --text-main: #20242a;
  --text-muted: #5e6672;
  --text-light: #8792a2;

  --status-proposto: #d97706;
  --status-redacao: #2563eb;
  --status-revisao: #7c3aed;
  --status-aprovado: #15803d;

  --shadow-sm: 0 1px 3px rgba(15, 43, 72, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 43, 72, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 43, 72, 0.12);
  --shadow-drawer: -6px 0 25px rgba(15, 43, 72, 0.18);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--creme-bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── TIPOGRAFIA EDITORIAL ────────────────────────────────────────────────── */

h1, h2, h3, h4, .serif-font {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mono-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── BARRA SUPERIOR (HEADER) ─────────────────────────────────────────────── */

.top-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-pb {
  font-family: 'EB Garamond', serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.logo-pb-img {
  height: 42px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

.logo-pb span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--burgundy);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: #fff;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
}

.client-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.client-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-light);
  box-shadow: 0 0 6px var(--emerald-light);
}

/* Seletor de Revistas na Barra */
.edition-selector-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.5rem;
  gap: 0.5rem;
}

.edition-select {
  background: transparent;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0.3rem 0.5rem;
}

.edition-select option {
  background: var(--navy-dark);
  color: #ffffff;
}

/* ── BARRA DE ABAS PRINCIPAIS ────────────────────────────────────────────── */

.nav-tabs-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--creme-border);
  box-shadow: var(--shadow-sm);
}

.nav-tabs-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.main-tab {
  padding: 0.9rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.main-tab:hover {
  color: var(--navy);
  background: rgba(15, 43, 72, 0.03);
}

.main-tab.active {
  color: var(--navy);
  border-bottom-color: var(--burgundy);
  background: #ffffff;
}

.main-tab .tab-count {
  background: var(--creme-border-light);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

.main-tab.active .tab-count {
  background: var(--burgundy);
  color: #ffffff;
}

/* ── CONTENTOR PRINCIPAL ─────────────────────────────────────────────────── */

.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem 1.5rem;
}

/* ── BOTÕES & CONTROLOS ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--burgundy);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(122, 31, 61, 0.25);
}

.btn-primary:hover {
  background: var(--burgundy-light);
  transform: translateY(-1px);
}

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

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

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--creme-border);
}

.btn-secondary:hover {
  background: var(--creme-subtle);
  border-color: #c9c3b8;
}

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

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

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

/* ── BADGES & FORMATOS EDITORIAIS ────────────────────────────────────────── */

.badge-format {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.format-grande-reportagem {
  background: #fdf2f4;
  color: var(--burgundy);
  border: 1px solid #f9ccd6;
}

.format-pequena-reportagem {
  background: #eef5fc;
  color: var(--navy);
  border: 1px solid #c7ddf4;
}

.format-entrevista {
  background: #eef7f2;
  color: var(--emerald);
  border: 1px solid #c2e5d1;
}

.format-breve {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.format-custom {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Distintivos de Origem da Matéria (NORTE 2030 vs Matéria Livre) */
.badge-origin {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-origin-n2030 {
  background: #eef6ff;
  color: #0369a1;
  border: 1px solid #bfdbfe;
}

.badge-origin-custom {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Linha Temporal de Auditoria / Histórico */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: var(--creme-border);
}

.audit-item {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
}

.audit-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--burgundy);
  border: 2px solid #ffffff;
}

.audit-item .audit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.audit-item .audit-user {
  font-weight: 700;
  color: var(--navy);
}

.audit-item .audit-time {
  color: var(--text-light);
}

.audit-item .audit-action {
  color: var(--text-main);
  line-height: 1.4;
}

/* Badges de Estado */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-proposto {
  background: #fef3c7;
  color: #92400e;
}
.status-proposto .dot { background: #d97706; }

.status-redacao {
  background: #dbeafe;
  color: #1e40af;
}
.status-redacao .dot { background: #2563eb; }

.status-revisao {
  background: #ede9fe;
  color: #5b21b6;
}
.status-revisao .dot { background: #7c3aed; }

.status-aprovado {
  background: #dcfce7;
  color: #166534;
}
.status-aprovado .dot { background: #16a34a; }

/* ── CARTÃO DA OPERAÇÃO JÁ ALOCADA (DESTAQUE VISUAL) ─────────────────────── */

.operation-card.is-assigned {
  background: #faf7ff !important;
  border: 2px solid #7c3aed !important;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.12) !important;
}

.badge-assigned-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
  letter-spacing: 0.02em;
}

/* ── VISTA 1: ESPAÇO DE TRABALHO DA REVISTA (LANDING PRINCIPAL) ──────────── */

.magazine-hero {
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.magazine-hero-left h1 {
  font-size: 2.1rem;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.magazine-hero-left p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.magazine-stats-grid {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--creme-subtle);
  border: 1px solid var(--creme-border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 100px;
}

.stat-pill .num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-pill .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Filtros da Revista */
.stories-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--creme-border);
}

.pill-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--creme-subtle);
  border: 1px solid var(--creme-border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: #ffffff;
  color: var(--navy);
}

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

/* Grelha de Histórias Selecionadas */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 1.5rem;
}

.story-card {
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

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

.story-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.story-title {
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.story-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  background: var(--creme-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--navy);
}

.story-meta-row strong {
  color: var(--text-main);
}

.story-angle-box {
  background: #fff8f5;
  border-left: 3px solid var(--burgundy);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #3b3f46;
  margin-bottom: 1.1rem;
  max-height: 140px;
  overflow-y: auto;
}

.story-angle-box strong {
  color: var(--burgundy);
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.story-images-preview {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.story-thumb-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--creme-border);
}

.story-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--creme-border-light);
  gap: 0.5rem;
}

/* Estado Vazio */
.empty-state {
  background: #ffffff;
  border: 2px dashed var(--creme-border);
  border-radius: var(--radius-lg);
  padding: 4.5rem 2rem;
  text-align: center;
  max-width: 720px;
  margin: 2rem auto;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.empty-state h3 {
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── VISTA 2: BANCO DE OPERAÇÕES NORTE 2030 (1.330) ──────────────────────── */

.ops-search-panel {
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 1fr;
  gap: 1rem;
  align-items: flex-end;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(15, 43, 72, 0.1);
}

.ops-results-count {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.operation-card {
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.operation-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.op-header {
  margin-bottom: 0.65rem;
}

.op-beneficiary {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--burgundy);
  margin-bottom: 0.25rem;
}

.op-title {
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.op-territory-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.op-purpose-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.op-financials {
  display: flex;
  justify-content: space-between;
  background: var(--creme-subtle);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.op-financials .feder-val {
  font-weight: 700;
  color: var(--emerald);
}

.op-actions {
  display: flex;
  gap: 0.5rem;
}

/* Paginação */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* ── MODAIS & ESPAÇO DE TRABALHO DA PEÇA (DRAWER) ────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 27, 46, 0.65);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--creme-border);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--creme-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--creme-subtle);
}

.modal-header h3 {
  font-size: 1.4rem;
  color: var(--navy);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--creme-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--creme-subtle);
}

/* Espaço de Trabalho / Drawer Fullscreen ou Amplo para a Peça */
.story-workspace-modal {
  max-width: 1100px;
}

.subtabs-bar {
  display: flex;
  border-bottom: 1px solid var(--creme-border);
  background: var(--creme-subtle);
  padding: 0 1.5rem;
  gap: 0.5rem;
}

.subtab-btn {
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.subtab-btn:hover {
  color: var(--navy);
}

.subtab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--burgundy);
  background: #ffffff;
}

.subtab-panel {
  display: none;
  padding: 1.75rem;
}

.subtab-panel.active {
  display: block;
}

/* Galeria de Upload de Imagens */
.upload-dropzone {
  border: 2px dashed #b8c4d2;
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.5rem;
}

.upload-dropzone:hover {
  border-color: var(--navy);
  background: #f1f5f9;
}

.images-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.image-card {
  background: #ffffff;
  border: 1px solid var(--creme-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.image-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.image-card-meta {
  padding: 0.85rem;
  font-size: 0.8rem;
}

.image-card-meta input {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border: 1px solid var(--creme-border);
  border-radius: 3px;
}

/* Notificações / Toast */
.toast-msg {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--navy);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2000;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .stories-grid {
    grid-template-columns: 1fr;
  }
  .magazine-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── ECRÃ DE LOGIN OBRIGATÓRIO (norte.pbwriter.pt) ────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #1a426d 0%, #0f2b48 50%, #091b2e 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 390px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(223, 182, 78, 0.4);
  padding: 2.25rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
}

.login-header-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.35rem;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.login-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(15, 43, 72, 0.2);
}

.login-btn:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.login-quick-select {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--creme-border);
  text-align: left;
}

.login-quick-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  display: block;
}

.login-quick-pills {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-quick-pill {
  background: var(--creme-subtle);
  border: 1px solid var(--creme-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--navy);
  cursor: pointer;
.login-error-msg {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  text-align: left;
}

/* ── CONTROLO DE ACESSO (RBAC) ────────────────────────────────────────────── */
.admin-only {
  /* Visibilidade gerida dinamicamente via JavaScript com base no perfil autenticado */
}
