:root {
  --brand: #682567;
  --brand-light: #8E3B8C;
  --brand-pale: #F6EEF6;
  --brand-dark: #3D1540;   /* roxo OFCV (ofcv.cv usa #682567) — escurecido para fundos */
  --sand: #F5F0E8;
  --ink: #1F1A20;
  --ink-60: #6E6070;
  --ink-30: #C7BAC6;
  --white: #FCFAFC;
  --accent: #E8732A;
  --accent-soft: #FDF0E8;
  --success: #2A9D6A;
  --warning: #E8A82A;
  --sidebar-w: 260px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--ink);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0 0 24px;
}

.sidebar-logo {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}

.logo-badge {
  width: 40px; height: 40px;
  background: var(--brand-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: white;
  margin-bottom: 12px;
}

.logo-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: white;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.logo-sub {
  font-size: 11px;
  color: var(--ink-30);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-30);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active {
  background: var(--brand);
  color: white;
  font-weight: 500;
}

.nav-icon {
  width: 18px; height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 16px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-card:hover { background: rgba(255,255,255,0.06); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--ink-30); margin-top: 1px; }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid #ECE4EC;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.btn-notif {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #E6DCE6;
  background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}

.btn-notif:hover { border-color: var(--brand-light); }

.notif-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 7px; right: 7px;
  border: 1.5px solid white;
}

.btn-primary {
  padding: 8px 16px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex; align-items: center; gap: 6px;
}

.btn-primary:hover { background: var(--brand-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-logout {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #E6DCE6;
  background: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-60);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-logout:hover { border-color: #E8732A; color: #E8732A; background: #FDF0E8; }

/* input com erro */
.input-error {
  border-color: #E8732A !important;
  background: #FDF0E8 !important;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ── CONTENT ── */
.content { padding: 32px; flex: 1; }

/* ── WELCOME BANNER ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(142,59,140,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 120px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(232,115,42,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-text { position: relative; z-index: 1; }
.welcome-greeting { font-size: 13px; color: var(--ink-30); margin-bottom: 6px; }

.welcome-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: white;
  margin-bottom: 6px;
}

.welcome-name span { color: #F2D6F1; }

.welcome-meta { font-size: 13px; color: rgba(255,255,255,0.72); display: flex; align-items: center; gap: 16px; }
.welcome-meta-item { display: flex; align-items: center; gap: 5px; }

.cedula-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.05em;
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border: 1px solid #ECE4EC;
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.stat-card:hover {
  border-color: var(--brand-light);
  box-shadow: 0 4px 20px rgba(104,37,103,0.08);
}

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

.stat-label { font-size: 12px; color: var(--ink-60); font-weight: 500; }

.stat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--ink-60); }

.stat-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
}

.pill-green { background: #E8F8F0; color: var(--success); }
.pill-orange { background: var(--accent-soft); color: var(--accent); }
.pill-brand { background: var(--brand-pale); color: var(--brand); }
.pill-warn { background: #FFF8E8; color: var(--warning); }

/* ── TWO COLUMN ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.three-col { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 20px; margin-bottom: 28px; }

/* ── CARD ── */
.card {
  background: white;
  border: 1px solid #ECE4EC;
  border-radius: 14px;
  padding: 22px;
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.card-action {
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}

.card-action:hover { color: var(--brand-light); }

/* ── CEDULA SECTION ── */
.cedula-card {
  background: linear-gradient(135deg, var(--brand) 0%, #3D1540 100%);
  border-radius: 14px;
  padding: 22px;
  color: white;
  position: relative;
  overflow: hidden;
}

.cedula-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.cedula-card::after {
  content: '';
  position: absolute;
  bottom: -50px; left: 30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.cedula-num {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 10px 0 6px;
  position: relative; z-index: 1;
}

.cedula-name {
  font-size: 14px;
  opacity: 0.8;
  position: relative; z-index: 1;
}

.cedula-status {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(42,157,106,0.25);
  border: 1px solid rgba(42,157,106,0.4);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #7EFFC0;
  margin-top: 14px;
  position: relative; z-index: 1;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #7EFFC0; }

/* ── QUOTAS ── */
.quota-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F4EFF4;
}

.quota-row:last-child { border-bottom: none; }

.quota-period { font-size: 13px; color: var(--ink); font-weight: 500; }
.quota-date { font-size: 12px; color: var(--ink-60); margin-top: 2px; }

.quota-amount {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-paid { background: #E8F8F0; color: var(--success); }
.badge-pending { background: var(--accent-soft); color: var(--accent); }
.badge-late { background: #FFF0F0; color: #D94040; }

/* ── FORMAÇÕES ── */
.formacao-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #F4EFF4;
  cursor: pointer;
  transition: background 0.1s;
}

.formacao-item:last-child { border-bottom: none; }
.formacao-item:hover { margin: 0 -22px; padding: 14px 22px; background: var(--brand-pale); }

.formacao-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.formacao-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; line-height: 1.3; }
.formacao-meta { font-size: 12px; color: var(--ink-60); display: flex; gap: 10px; align-items: center; }

.cpd-bar-wrap {
  background: #F4EFF4;
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.cpd-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
  border-radius: 20px;
  transition: width 1s ease;
}

/* ── EMPREGOS ── */
.emprego-item {
  padding: 14px 0;
  border-bottom: 1px solid #F4EFF4;
  cursor: pointer;
  transition: background 0.1s;
}

.emprego-item:last-child { border-bottom: none; }
.emprego-item:hover { margin: 0 -22px; padding: 14px 22px; background: var(--brand-pale); }

.emprego-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.emprego-org { font-size: 12px; color: var(--brand); font-weight: 500; margin-bottom: 6px; }
.emprego-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px; font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  background: #F4EFF4;
  color: var(--ink-60);
}

.tag-hot { background: var(--accent-soft); color: var(--accent); }

/* ── NOTICIAS ── */
.noticia-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F4EFF4;
  cursor: pointer;
}

.noticia-item:last-child { border-bottom: none; }

.noticia-date {
  font-size: 10px; font-weight: 700;
  color: var(--ink-30);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  padding-top: 2px;
  line-height: 1.4;
}

.noticia-text { font-size: 13px; color: var(--ink); line-height: 1.5; }

/* ── CPD TRACKER ── */
.cpd-ring-wrap {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 0;
}

.cpd-ring {
  width: 80px; height: 80px;
  position: relative;
  flex-shrink: 0;
}

.cpd-ring svg { transform: rotate(-90deg); }

.cpd-ring-center {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.cpd-pct {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  line-height: 1;
}

.cpd-pct-lbl { font-size: 10px; color: var(--ink-60); }

.cpd-detail-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.cpd-detail-sub { font-size: 12px; color: var(--ink-60); line-height: 1.5; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate { animation: fadeUp 0.4s ease both; }
.a1 { animation-delay: 0.05s; }
.a2 { animation-delay: 0.10s; }
.a3 { animation-delay: 0.15s; }
.a4 { animation-delay: 0.20s; }
.a5 { animation-delay: 0.25s; }
.a6 { animation-delay: 0.30s; }

/* ── PROGRESS ── */
.progress-wrap { margin-top: 6px; }
.progress-bg { background: #F4EFF4; border-radius: 20px; height: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--brand-light), var(--brand)); }

/* ── RESPONSIVE TABS ── */
.tabs {
  display: flex; gap: 4px;
  background: #F4EFF4;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}

.tab {
  flex: 1; text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  color: var(--ink-60);
  transition: background 0.15s, color 0.15s;
}

.tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* section pages */
.page { display: none; }
.page.active { display: block; }

/* Nav active switching */
.nav-item[data-page] { cursor: pointer; }

/* ── LOGIN PAGE ── */
.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0;
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(142,59,140,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(232,115,42,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.login-branding {
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-logo {
  width: 80px; height: 80px;
  background: var(--brand-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: white;
  margin: 0 auto 24px;
}

.login-brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 42px;
  color: white;
  margin-bottom: 12px;
  letter-spacing: 0;
}

.login-brand-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--white);
}

.login-form-wrap {
  width: 100%;
  max-width: 420px;
}

.login-form-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-form-sub {
  font-size: 14px;
  color: var(--ink-60);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #ECE4EC;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-light);
}

.form-input::placeholder {
  color: var(--ink-30);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check label {
  font-size: 13px;
  color: var(--ink-60);
  cursor: pointer;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

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

.btn-login:active {
  transform: scale(0.98);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-60);
}

.login-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  color: var(--brand-light);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVIDADE MÓVEL
   ══════════════════════════════════════════════════════ */

/* ── Agrupador esquerdo da topbar ── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Botão hamburger (escondido em desktop) ── */
.btn-hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid #E6DCE6;
  background: white;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-60);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.btn-hamburger:hover { border-color: var(--brand-light); color: var(--brand); }

/* ── Overlay do sidebar ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,26,32,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeOverlay 0.2s ease;
}
.sidebar-overlay.active { display: block; }
@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Botão fechar sidebar (mobile) ── */
.sidebar-close {
  display: none;
  position: absolute;
  top: 18px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  align-items: center; justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}
.sidebar-close:hover { background: rgba(255,255,255,0.18); }

/* ══ PÁGINA NOTÍCIA ═══════════════════════════════════ */
.noticia-detalhe {
  max-width: 760px;
}
.noticia-conteudo {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.85;
}
.noticia-relacionadas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ══ TABLET ≤ 1024px ══════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col  { grid-template-columns: 1fr 1fr; }
  .content    { padding: 24px; }
  .topbar     { padding: 14px 24px; }
  .welcome-banner { padding: 22px 24px; }
}

/* ══ MOBILE ≤ 768px ═══════════════════════════════════ */
@media (max-width: 768px) {

  /* Sidebar desliza para fora do ecrã */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-logo  { padding-right: 50px; }

  /* Main ocupa largura total */
  .main { margin-left: 0; }

  /* Topbar compacta */
  .topbar          { padding: 10px 16px; }
  .topbar-title    { font-size: 16px; }
  .btn-hamburger   { display: flex; }
  .btn-primary-text { display: none; }
  .topbar-actions  { gap: 8px; }

  /* Área de conteúdo */
  .content { padding: 16px; }

  /* Grelhas */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .two-col    { grid-template-columns: 1fr; }
  .three-col  { grid-template-columns: 1fr; }

  /* Valores de stats */
  .stat-card  { padding: 16px; }
  .stat-value { font-size: 22px; }

  /* Banner de boas-vindas */
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 16px;
  }
  .welcome-name { font-size: 20px; }
  .welcome-meta { flex-wrap: wrap; gap: 10px; font-size: 11px; }

  /* Cards internos */
  .card { padding: 16px; }

  /* Quotas */
  .quota-row { flex-wrap: wrap; gap: 8px; }
  .quota-amount { width: 100%; }

  /* Tabs */
  .tab { font-size: 12px; padding: 7px 8px; }

  /* Página de login */
  .login-wrapper  { flex-direction: column; }
  .login-left     { flex: none; padding: 24px 24px 20px; min-height: unset; }
  .login-left::before, .login-left::after { display: none; }
  .login-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
  }
  .login-logo {
    width: 46px; height: 46px;
    font-size: 18px;
    border-radius: 12px;
    margin: 0;
    flex-shrink: 0;
  }
  .login-brand-name { font-size: 22px; margin-bottom: 2px; }
  .login-brand-sub  { font-size: 12px; }
  .login-right      { padding: 32px 24px 48px; flex: 1; }
  .login-form-title { font-size: 26px; }
  .login-form-sub   { margin-bottom: 24px; }
}

/* ══ PEQUENOS ECRÃS ≤ 420px ══════════════════════════ */
@media (max-width: 420px) {
  .stats-grid     { gap: 8px; }
  .stat-card      { padding: 12px; }
  .stat-value     { font-size: 20px; }
  .content        { padding: 12px; }
  .login-right    { padding: 24px 18px 40px; }
  .emprego-tags   { gap: 4px; }
  .formacao-meta  { flex-wrap: wrap; gap: 6px; }
  .welcome-name   { font-size: 18px; }
}

/* ══ NOVAS FUNCIONALIDADES (MODO DEMO) ═══════════════ */
.sidebar { overflow-y: auto; }
.btn-notif { text-decoration: none; }

.demo-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid #F5C9A8; border-radius: 6px; padding: 2px 7px;
}

.flash {
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px;
  font-size: 13px; font-weight: 500; border: 1.5px solid;
}
.flash-success { background: #E8F8F0; border-color: var(--success); color: #1A6645; }
.flash-error   { background: #FFF0F0; border-color: #D94040; color: #9D2020; }
.flash-notice  { background: var(--accent-soft); border-color: var(--accent); color: #9D3A10; }

.badge-info { background: var(--brand-pale); color: var(--brand); }

.muted { color: var(--ink-60); font-size: 13px; }
.small { font-size: 12px; }
.mt-16 { margin-top: 16px; }
.mb-20 { margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.empty {
  padding: 18px; background: #F8F5F8; border-radius: 10px;
  font-size: 13px; color: var(--ink-60); text-align: center;
}

.btn-secondary, .btn-danger, .btn-ghost {
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  font-family: 'Inter', sans-serif; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary { background: white; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-pale); }
.btn-danger { background: white; color: #D94040; border-color: #F0B8B8; }
.btn-danger:hover { background: #FFF0F0; }
.btn-ghost { background: transparent; color: var(--ink-60); border-color: #E6DCE6; }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-30); }
a.btn-primary { text-decoration: none; display: inline-flex; }
button:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hub de funcionalidades */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 28px; }
.feature-card {
  background: white; border: 1px solid #ECE4EC; border-radius: 14px; padding: 18px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.feature-card:hover { border-color: var(--brand-light); transform: translateY(-2px); }
.feature-code {
  font-family: 'Outfit', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--brand); background: var(--brand-pale); border-radius: 6px; padding: 2px 8px; align-self: flex-start;
}
.feature-title { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 15px; }
.feature-desc { font-size: 13px; color: var(--ink-60); line-height: 1.5; }

.steps { counter-reset: step; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; font-size: 13px; line-height: 1.5; }
.steps li::before {
  content: counter(step); flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: white; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* Formulários */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group .form-input { padding: 10px 14px; }
select.form-input { background: white; }
textarea.form-input { resize: vertical; min-height: 70px; }
.form-hint { font-size: 12px; color: var(--ink-60); margin-top: 6px; }
.check-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid #ECE4EC; border-radius: 10px; cursor: pointer; font-size: 13px;
}
.check-option:has(input:checked) { border-color: var(--brand); background: var(--brand-pale); }
.check-option input { width: 17px; height: 17px; accent-color: var(--brand); }
.check-option.disabled { opacity: 0.55; cursor: not-allowed; }

/* Lista de requisitos */
.req-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.req-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #F8F5F8; font-size: 13px; }
.req-icon { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; }
.req-ok .req-icon { background: var(--success); }
.req-ko .req-icon { background: #D94040; }
.req-title { font-weight: 600; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-60); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid #ECE4EC; }
.table td { padding: 12px 10px; border-bottom: 1px solid #F4EFF4; vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

/* Pedido / linha de tempo */
.pedido-item { border: 1px solid #ECE4EC; border-radius: 12px; padding: 14px 16px; }
.pedido-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.pedido-tipo { font-weight: 600; font-size: 14px; }
.pedido-meta { font-size: 12px; color: var(--ink-60); margin-top: 3px; }
.pedido-nota { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #FFF0F0; color: #9D2020; font-size: 12px; }
.pedido-nota.ok { background: #E8F8F0; color: #1A6645; }
.decisao-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.decisao-form .form-input { flex: 1; min-width: 200px; padding: 8px 12px; font-size: 13px; }

/* Notificações */
.notif-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #F4EFF4; text-decoration: none; color: inherit; }
.notif-item:last-child { border-bottom: none; }
.notif-bullet { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--ink-30); }
.notif-item.unread .notif-bullet { background: var(--accent); }
.notif-item.unread .notif-title { font-weight: 700; }
.notif-title { font-size: 14px; font-weight: 500; }
.notif-text { font-size: 13px; color: var(--ink-60); margin-top: 2px; }
.notif-date { font-size: 11px; color: var(--ink-30); margin-top: 4px; }

/* Cédula digital */
.cedula-digital { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.qr-box { background: white; border-radius: 12px; padding: 10px; width: 150px; height: 150px; position: relative; z-index: 1; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-fallback { font-size: 9px; color: var(--ink); word-break: break-all; overflow: hidden; }
.cedula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dado-label { font-size: 11px; color: var(--ink-60); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.dado-valor { font-size: 14px; font-weight: 600; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; background: #F4EFF4; padding: 2px 7px; border-radius: 6px; }

.stats-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-mini { background: white; border: 1px solid #ECE4EC; border-radius: 12px; padding: 14px; }
.stat-mini-value { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 700; }
.stat-mini-label { font-size: 12px; color: var(--ink-60); }

.tab { border: none; background: transparent; font-family: inherit; }

/* ══ PÁGINAS PÚBLICAS ═══════════════════════════════ */
body.public { display: block; background: #F8F5F8; }
.public-top { background: var(--brand-dark); color: white; }
.public-top-inner { max-width: 960px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.public-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.public-brand .logo-badge { margin: 0; }
.public-brand-name { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 17px; }
.public-brand-sub { font-size: 11px; opacity: 0.6; }
.public-nav { display: flex; gap: 6px; }
.public-nav a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px; padding: 7px 12px; border-radius: 8px; }
.public-nav a:hover, .public-nav a.active { background: rgba(255,255,255,0.1); color: white; }
.public-main { max-width: 960px; margin: 0 auto; padding: 32px 20px 60px; }
.public-title { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.public-lead { font-size: 14px; color: var(--ink-60); margin-bottom: 24px; max-width: 640px; line-height: 1.6; }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.search-bar .form-input { flex: 1; min-width: 200px; }
.search-bar select.form-input { flex: 0 0 180px; min-width: 0; }
.public-foot { text-align: center; font-size: 12px; color: var(--ink-60); padding: 20px; }

.verify-result { border-radius: 14px; padding: 22px; border: 2px solid; display: flex; gap: 16px; align-items: flex-start; }
.verify-result.valid { border-color: var(--success); background: #F2FBF6; }
.verify-result.invalid { border-color: #D94040; background: #FFF5F5; }
.verify-result.warn { border-color: var(--warning); background: #FFFBEF; }
.verify-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: white; flex-shrink: 0; }
.valid .verify-icon { background: var(--success); }
.invalid .verify-icon { background: #D94040; }
.warn .verify-icon { background: var(--warning); }
.verify-title { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }

/* ══ DOCUMENTOS IMPRIMÍVEIS (declaração, recibo) ═════ */
body.doc { display: block; background: #EEE8EE; }
.doc-toolbar { max-width: 210mm; margin: 20px auto 0; display: flex; gap: 10px; justify-content: flex-end; }
.doc-page {
  background: white; width: 210mm; min-height: 297mm; margin: 16px auto 40px;
  padding: 22mm 20mm; box-shadow: 0 4px 24px rgba(0,0,0,0.08); position: relative;
  font-size: 14px; line-height: 1.7; color: var(--ink);
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 34px; }
.doc-org { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 16px; color: var(--brand); }
.doc-org-sub { font-size: 11px; color: var(--ink-60); line-height: 1.5; }
.doc-title { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 700; text-align: center; letter-spacing: 0.04em; margin-bottom: 30px; text-transform: uppercase; }
.doc-body p { margin-bottom: 14px; text-align: justify; }
.doc-sign { margin-top: 50px; text-align: center; font-size: 13px; }
.doc-sign-line { width: 220px; border-top: 1px solid var(--ink); margin: 40px auto 6px; }
.doc-validate { position: absolute; left: 20mm; right: 20mm; bottom: 18mm; display: flex; gap: 16px; align-items: center; border-top: 1px solid #E6DCE6; padding-top: 12px; font-size: 11px; color: var(--ink-60); line-height: 1.5; }
.doc-validate .qr-box { width: 90px; height: 90px; padding: 0; }
.doc-table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid #E3D9E3; padding: 6px 10px; text-align: left; }
.doc-table th { background: #F6F1F6; }
.doc-void { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: 'Outfit', sans-serif; font-size: 110px; font-weight: 800; color: rgba(217,64,64,0.15); transform: rotate(-30deg); }

@media print {
  body.doc { background: white; }
  .doc-toolbar { display: none; }
  .doc-page { box-shadow: none; margin: 0; width: auto; min-height: 0; height: 297mm; }
  @page { size: A4; margin: 0; }
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .cedula-digital { grid-template-columns: 1fr; justify-items: start; }
  .cedula-grid { grid-template-columns: 1fr; }
  .doc-page { width: auto; min-height: 0; padding: 24px 18px 160px; margin: 10px; }
  .doc-toolbar { padding: 0 10px; }
}

/* Logótipo oficial (images/logo-ofcv.png, retirado de ofcv.cv) */
.logo-img { display: block; border-radius: 50%; background: white; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.logo-img-sm { width: 44px; height: 44px; }
.logo-img-md { width: 56px; height: 56px; }
.logo-img-lg { width: 96px; height: 96px; margin: 0 auto 18px; box-shadow: 0 0 0 4px rgba(255,255,255,0.2); }
.flash a { color: inherit; font-weight: 600; }

/* ── Ícones SVG (php/icons.php): monocromáticos, herdam a cor do texto ── */
.icon { flex-shrink: 0; vertical-align: -2px; }
a .icon, button .icon, .badge .icon { vertical-align: -2px; }
.stat-icon { background: var(--brand-pale) !important; color: var(--brand); display: flex; align-items: center; justify-content: center; }
.formacao-thumb { background: var(--brand-pale); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.thumb-icon { color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.thumb-box { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-pale); flex-shrink: 0; }
.verify-icon .icon, .req-icon .icon { vertical-align: 0; }
