/* ============================================================
   DS Inova — Painel do participante
   Tema: claro (CPS/Fatec) — fundo branco + vermelho institucional
   ============================================================ */
:root {
  --sky-950: #ffffff;
  --sky-900: #fdf4f3;
  --sky-800: #f7e4e2;
  --sky-700: #f0d3d0;

  --brand-500: #b12025;
  --brand-400: #c9464a;
  --brand-600: #8a1a1e;

  --crimson-500: #e07a1c;
  --crimson-600: #c2650f;
  --crimson-bg: rgba(224, 122, 28, .16);

  --success-500: #1f9d68;
  --success-bg: rgba(31, 157, 104, .14);

  --glass-bg: rgba(40, 20, 20, .035);
  --glass-bg-strong: rgba(40, 20, 20, .07);
  --glass-border: rgba(40, 20, 20, .12);
  --glass-border-strong: rgba(40, 20, 20, .22);

  --text-1: #241417;
  --text-2: #6b4d4f;
  --text-3: #8a6d6f;

  --font-body: "Poppins", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--sky-950);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0; color: var(--brand-600); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
svg { display: block; flex-shrink: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--crimson-600); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
  font-weight: 500;
}
.skip-link:focus { left: 0; }

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 6px;
}

/* ============================================================
   Cena de fundo — céu noturno, estrelas e montanhas
   ============================================================ */
.bg-scene {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 55% at 50% 100%, rgba(177, 32, 37, .05), transparent 62%),
    linear-gradient(180deg, var(--sky-950) 0%, var(--sky-900) 38%, var(--sky-800) 68%, var(--sky-700) 100%);
}
/* Estrelas brancas não aparecem sobre fundo claro — desligadas no tema CPS. */
.bg-scene__stars { display: none; }
.bg-scene__glow {
  position: absolute; left: 50%; bottom: -10%; width: 60vw; height: 40vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(177, 32, 37, .08), transparent 75%);
  filter: blur(10px);
}
.bg-scene__mountains { position: absolute; left: 0; bottom: 0; width: 100%; height: 32vh; min-height: 220px; }

/* ============================================================
   Shell / layout
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; align-items: flex-start; }

/* ============================================================
   Sidebar — painel de vidro flutuante
   ============================================================ */
.sidebar {
  position: sticky; top: 18px; flex-shrink: 0;
  width: var(--sidebar-w); height: calc(100vh - 36px);
  margin: 18px 0 18px 18px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 24px 60px -30px rgba(80, 30, 30, .18);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  z-index: 20;
  transition: width .32s var(--ease);
}
.sidebar.is-collapsed { width: 84px; }

.sidebar__toggle {
  position: absolute; top: 30px; right: -13px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-500); border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(177, 32, 37, .75);
  z-index: 25;
}
.sidebar__toggle svg { width: 12px; height: 12px; transition: transform .32s var(--ease); }
.sidebar.is-collapsed .sidebar__toggle svg { transform: rotate(180deg); }

.sidebar__top { display: flex; align-items: center; gap: 11px; padding: 4px 6px 20px; }
.sidebar.is-collapsed .sidebar__top { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar__mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-600));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(177, 32, 37, .7);
}
.sidebar__mark svg { width: 18px; height: 18px; color: #fff; }
.sidebar__mark--logo { background: #fff; padding: 3px; box-shadow: none; }
.sidebar__mark--logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.sidebar__brand-name { font-weight: 600; font-size: 14.5px; color: var(--text-1); white-space: nowrap; }
.sidebar.is-collapsed .sidebar__brand-name { display: none; }

.sidebar__nav {
  display: flex; flex-direction: column; gap: 3px; flex: 1;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar { display: none; }
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--text-3); font-size: 13.5px; font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.sidebar__link svg { width: 18px; height: 18px; }
.sidebar__link:hover { background: var(--glass-bg); color: var(--text-1); }
.sidebar__link.is-active {
  color: #fff;
  background: var(--brand-500);
  box-shadow: 0 10px 22px -10px rgba(177, 32, 37, .55);
}
.sidebar.is-collapsed .sidebar__link { justify-content: center; padding: 12px; }
.sidebar.is-collapsed .sidebar__link span:not(.sidebar__badge) { display: none; }

.sidebar__badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--crimson-500); color: #fff; font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.sidebar.is-collapsed .sidebar__badge {
  position: absolute; top: 6px; right: 6px; margin-left: 0; min-width: 8px; height: 8px; padding: 0;
}
.sidebar.is-collapsed .sidebar__badge-num { display: none; }

.sidebar__bottom { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--glass-border); }

/* ============================================================
   Main
   ============================================================ */
.main { flex: 1; min-width: 0; padding: 30px 34px 64px 26px; }

.breadcrumb { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.breadcrumb a, .breadcrumb span.is-current {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-3);
}
.breadcrumb a:hover { color: var(--text-1); }
.breadcrumb svg { width: 13px; height: 13px; }
.breadcrumb__sep { color: var(--text-3); opacity: .5; font-size: 12px; }
.breadcrumb span.is-current { color: var(--text-2); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 34px; flex-wrap: wrap;
}

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

.avatar-stack { display: flex; align-items: center; }
.avatar-stack__item {
  width: 32px; height: 32px; border-radius: 50%; margin-left: -9px;
  border: 2px solid rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600; color: #fff;
}
.avatar-stack__item:first-child { margin-left: 0; }
.avatar-stack__add {
  width: 32px; height: 32px; border-radius: 50%; margin-left: -9px;
  border: 1.5px dashed var(--glass-border-strong); background: var(--glass-bg);
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
  transition: border-color .18s, color .18s;
}
.avatar-stack__add:hover { border-color: var(--brand-400); color: var(--text-1); }
.avatar-stack__add svg { width: 14px; height: 14px; }

.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: border-color .18s, color .18s, background .18s;
}
.icon-btn:hover { color: var(--text-1); border-color: var(--glass-border-strong); background: var(--glass-bg-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn__dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--crimson-500); box-shadow: 0 0 0 2px var(--sky-950);
}
.icon-btn__dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--crimson-500);
  animation: radarPing 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes radarPing { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.4); opacity: 0; } }

.topbar__user { display: flex; align-items: center; gap: 10px; padding-left: 2px; }
.topbar__user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; border: 1.5px solid var(--glass-border-strong);
  overflow: hidden;
}
.topbar__user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar__user-name { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.topbar__user-role { font-size: 11.5px; color: var(--text-3); line-height: 1.3; }

/* ============================================================
   Hero
   ============================================================ */
.hero { max-width: 640px; margin-bottom: 34px; }
.hero__eyebrow {
  font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-400); margin-bottom: 14px;
}
.hero h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; margin-bottom: 14px; }
.mask-line { display: block; overflow: hidden; }
.mask-line__inner {
  display: block;
  animation: lineReveal .9s cubic-bezier(.16, 1, .3, 1) both;
}
.mask-line + .mask-line .mask-line__inner { animation-delay: .12s; }
@keyframes lineReveal { from { transform: translateY(115%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.hero h1 .hero__accent {
  background: linear-gradient(100deg, var(--brand-600), var(--brand-400) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: 15px; color: var(--text-2); max-width: 48ch; margin-bottom: 20px; }

.hero__badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 999px; padding: 9px 16px 9px 12px; font-size: 12.5px; color: var(--text-2);
  backdrop-filter: blur(10px);
}
.hero__badge-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--success-500); box-shadow: 0 0 0 3px rgba(31, 157, 104,.18); flex-shrink: 0; }
.hero__badge-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--success-500);
  animation: radarPing 2.2s cubic-bezier(0, 0, .2, 1) infinite;
}
.hero__badge strong { color: var(--text-1); font-weight: 600; }

/* ============================================================
   Layout de conteúdo: coluna principal + trilho lateral
   ============================================================ */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.layout__main { min-width: 0; }

/* ============================================================
   Toolbar (filtros + ação primária)
   ============================================================ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 10px; transition: border-color .18s, color .18s, background .18s;
}
.filter-chip:hover { color: var(--text-1); border-color: var(--glass-border-strong); background: var(--glass-bg-strong); }
.filter-chip svg { width: 13px; height: 13px; opacity: .7; }

.btn {
  position: relative; z-index: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1.5px solid transparent; transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn--primary {
  color: #fff; box-shadow: 0 10px 24px -10px rgba(177, 32, 37, .65);
  background:
    linear-gradient(var(--brand-500), var(--brand-500)) padding-box,
    conic-gradient(from var(--beam-angle, 0deg), transparent, transparent) border-box;
}
.btn--primary:hover {
  background:
    linear-gradient(var(--brand-600), var(--brand-600)) padding-box,
    conic-gradient(from var(--beam-angle, 0deg), transparent 0%, rgba(255, 255, 255, .95) 10%, transparent 26%) border-box;
  animation: beamSpin 1.8s linear infinite;
}
@property --beam-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes beamSpin { to { --beam-angle: 360deg; } }
.btn--ghost { border-color: var(--glass-border-strong); color: var(--text-1); background: var(--glass-bg); }
.btn--ghost:hover { border-color: var(--brand-400); background: var(--glass-bg-strong); }
.btn--ghost.is-active { border-color: var(--brand-500); color: #fff; background: var(--brand-500); }
.btn--done { border-color: var(--success-bg); background: var(--success-bg); color: var(--success-500); cursor: default; }
.btn--block { width: 100%; }
.btn svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ============================================================
   Sections &amp; glass cards
   ============================================================ */
.section { margin-bottom: 30px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section__head h3 { font-size: 17px; }
.section__head-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.section__link { font-size: 12.5px; font-weight: 500; color: var(--brand-400); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.section__link:hover { color: var(--text-1); }
.section__link svg { width: 13px; height: 13px; }

.glass-card {
  position: relative; z-index: 0;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s, background .22s;
}
.glass-card:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); background: var(--glass-bg-strong); box-shadow: 0 26px 50px -30px rgba(80, 30, 30, .12); }
.glass-card::before {
  content: '';
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .1), transparent 62%);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.glass-card:hover::before { opacity: 1; }

.chip {
  display: inline-flex; align-items: center; font-family: var(--font-body); font-size: 10.5px;
  font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap;
}
.chip--outline { border: 1px solid var(--glass-border-strong); color: var(--text-2); }
.chip--blue { background: rgba(177, 32, 37, .16); color: var(--brand-400); }
.chip--urgent { background: var(--crimson-bg); color: var(--crimson-500); }
.chip--success { background: var(--success-bg); color: var(--success-500); }

/* ============================================================
   Eventos
   ============================================================ */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.event-card { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.event-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-card__title { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text-1); }
.event-card__row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.event-card__row svg { width: 15px; height: 15px; color: var(--text-3); }
.event-card__row .mono { font-family: var(--font-body); font-size: 12px; color: var(--text-1); }

.event-card__vagas { display: flex; flex-direction: column; gap: 6px; }
.event-card__vagas-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.event-card__vagas-fill { height: 100%; border-radius: 999px; background: var(--brand-500); }
.event-card__vagas-fill.is-urgent { background: var(--crimson-500); }
.event-card__vagas-label { font-family: var(--font-body); font-size: 11px; color: var(--text-3); }
.event-card__foot { margin-top: auto; padding-top: 4px; }

/* ============================================================
   Trabalhos / Projetos
   ============================================================ */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.work-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.work-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.work-card__title { font-size: 15px; font-weight: 600; line-height: 1.35; max-width: 30ch; color: var(--text-1); }
.work-card__meta { font-size: 12.5px; color: var(--text-2); }
.work-card__protocol { font-family: var(--font-body); font-size: 10.5px; color: var(--text-3); letter-spacing: .03em; }

.work-card__body { display: flex; gap: 16px; align-items: center; }
.work-card__note { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex-shrink: 0; }
.seal {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--crimson-500); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 16.5px; color: var(--crimson-500);
  background: var(--crimson-bg);
}
.seal::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed rgba(224, 122, 28, .45); }
.work-card__note-label { font-family: var(--font-body); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

.review {
  background: rgba(0, 0, 0, .03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 13px 14px; flex: 1; min-width: 0;
}
.review__quote { font-size: 12.5px; font-style: italic; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }
.review__author { display: flex; align-items: center; gap: 9px; }
.review__avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-500); color: #fff; font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.review__name { font-size: 12px; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.review__role { font-size: 11px; color: var(--text-3); line-height: 1.3; }

.work-card__status-block {
  background: rgba(0, 0, 0, .03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 10px; align-items: flex-start;
}
.work-card__status-block svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--brand-400); }
.work-card__status-block strong { color: var(--text-1); font-weight: 600; }

/* ============================================================
   Novo trabalho — formulário
   ============================================================ */
.work-form { padding: 26px 28px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--text-1); }

/* Cabeçalho dos formulários "novo X": título + botão de fechar, sempre visível
   no topo do formulário, sem precisar rolar até o fim pra recolher. */
.form-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-header h4 { margin: 0; }
.form-close-btn {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); border: 1px solid var(--glass-border); background: var(--glass-bg);
  transition: background .18s, color .18s, border-color .18s;
}
.form-close-btn:hover { background: var(--glass-bg-strong); color: var(--text-1); border-color: var(--glass-border-strong); }
.form-close-btn svg { width: 14px; height: 14px; }

.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body); font-size: 13.5px; color: var(--text-1);
  background: rgba(0, 0, 0, .03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 11px 13px; width: 100%; resize: vertical;
  transition: border-color .18s, background .18s;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--text-3); }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--glass-border-strong); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; background: #fff; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(177, 32, 37, .15);
}
.form-field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%236b4d4f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.form-field select option { background: var(--sky-900); color: var(--text-1); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 28px 20px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--glass-border-strong); background: rgba(0, 0, 0, .02); color: var(--text-2);
  transition: border-color .18s, background .18s;
}
.dropzone svg { width: 25px; height: 25px; color: var(--brand-400); }
.dropzone p { font-size: 13.5px; color: var(--text-1); }
.dropzone__hint { font-family: var(--font-body); font-size: 11px; color: var(--text-3); }

.file-input { display: flex; align-items: center; gap: 10px; }
.file-input__native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.file-input__btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-2);
  cursor: pointer; transition: background .18s, color .18s, border-color .18s;
}
.file-input__btn svg { width: 15px; height: 15px; }
.file-input__btn:hover { background: var(--glass-bg-strong); color: var(--text-1); border-color: var(--glass-border-strong); }
.file-input__native:focus-visible + .file-input__btn { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.file-input__nome {
  font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0;
}

.checkbox-list {
  display: flex; flex-wrap: wrap; gap: 8px 10px; max-height: 180px; overflow-y: auto;
  background: rgba(0, 0, 0, .03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 12px 13px;
}
.checkbox-list__empty { font-size: 12.5px; color: var(--text-3); }
.checkbox-list__item {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; user-select: none;
}
.checkbox-list__item input {
  width: auto; height: auto; padding: 0; margin: 0; background: none; border: none;
  accent-color: var(--brand-500); cursor: pointer; flex-shrink: 0;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand-400); background: rgba(0, 0, 0, .05); }

.work-form__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--glass-border); flex-wrap: wrap;
}
.work-form__note { font-size: 12.5px; color: var(--text-3); }
.work-form__note a { color: var(--brand-400); font-weight: 500; }
.work-form__note a:hover { color: var(--text-1); }

/* ============================================================
   Certificados
   ============================================================ */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cert-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.cert-badge {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--crimson-bg); color: var(--crimson-500);
}
.cert-badge svg { width: 21px; height: 21px; }
.cert-badge--locked { background: rgba(255,255,255,.08); color: var(--text-3); }

.cert-card__body { display: flex; flex-direction: column; gap: 5px; }
.cert-card__title { font-size: 15px; font-weight: 600; margin-top: 4px; color: var(--text-1); }
.cert-card__meta { font-size: 12.5px; color: var(--text-2); }
.cert-card__code { font-family: var(--font-body); font-size: 10.5px; color: var(--text-3); letter-spacing: .02em; margin-top: 5px; }
.cert-card__action { margin-top: auto; }
.cert-card--locked { background: rgba(255,255,255,.03); }

/* ============================================================
   Trilho lateral — widgets
   ============================================================ */
.layout__rail {
  display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px;
  max-height: calc(100vh - 36px); overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none; padding-bottom: 2px;
}
.layout__rail::-webkit-scrollbar { display: none; }
.rail-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.rail-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail-card__head h4 { font-size: 14px; }
.rail-card__head-icon {
  width: 30px; height: 30px; border-radius: 50%; background: var(--glass-bg); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.rail-card__head-icon svg { width: 14px; height: 14px; }

/* -- Aviso -- */
.rail-note__text { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.rail-note__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rail-note__time { font-family: var(--font-body); font-size: 10.5px; color: var(--text-3); }
.rail-note__actions { display: flex; align-items: center; gap: 8px; }
.pill-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--success-bg); color: var(--success-500); border: 1px solid transparent;
  font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 10px;
}
.pill-toggle svg { width: 13px; height: 13px; }
.pill-toggle.is-popping { animation: pillPop .35s ease; }
@keyframes pillPop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm svg { width: 13px; height: 13px; }

/* -- Certificados (mini) -- */
.rail-files__icons { display: flex; gap: 8px; }
.rail-files__icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-body); font-size: 9.5px; font-weight: 600;
}
.rail-files__text { font-size: 12.5px; color: var(--text-2); }
.rail-files__text strong { color: var(--text-1); }

/* -- Melhor apresentação -- */
.rail-rank { display: flex; flex-direction: column; gap: 6px; }
.rail-rank__item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent; }
.rail-rank__item--self { background: rgba(177, 32, 37, .12); border-color: rgba(177, 32, 37, .3); }
.rail-rank__pos {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #1c1c1c;
}
.rail-rank__pos--gold { background: linear-gradient(140deg, #ffe08a, #d4a72c); }
.rail-rank__pos--silver { background: linear-gradient(140deg, #eef1f7, #a9b3c2); }
.rail-rank__pos--bronze { background: linear-gradient(140deg, #e8b48a, #b97a45); }
.rail-rank__info { min-width: 0; flex: 1; }
.rail-rank__title { font-size: 12.5px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-rank__meta { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-rank__score { font-size: 13px; font-weight: 700; color: var(--crimson-500); flex-shrink: 0; }

/* -- Notas / desempenho -- */
.rail-activity__stat { display: flex; align-items: baseline; gap: 8px; }
.rail-activity__stat-num { font-size: 30px; font-weight: 700; color: var(--text-1); font-family: var(--font-body); }
.rail-activity__stat-label { font-size: 12px; color: var(--text-3); }
.rail-activity__bars { display: flex; flex-direction: column; gap: 9px; }
.rail-activity__bar-row { display: flex; align-items: center; gap: 10px; }
.rail-activity__bar-label { font-family: var(--font-body); font-size: 10.5px; color: var(--text-3); width: 78px; flex-shrink: 0; }
.rail-activity__bar-track { flex: 1; height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .06); overflow: hidden; }
.rail-activity__bar-label { width: auto; min-width: 78px; }
.rail-activity__bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.rail-activity__bar-value { font-family: var(--font-body); font-size: 10.5px; color: var(--text-1); width: 28px; text-align: right; flex-shrink: 0; }

/* -- Resumo / próximos prazos (painel Início) -- */
.rail-resumo { display: flex; flex-direction: column; gap: 14px; }
.rail-prazo-item { display: flex; flex-direction: column; gap: 2px; }
.rail-prazo-item + .rail-prazo-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.rail-prazo-item__meta { font-size: 11px; color: var(--text-3); }

/* ============================================================
   Estatísticas (página Minhas notas)
   ============================================================ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.stat-card__num { font-size: 34px; font-weight: 700; color: var(--text-1); }
.stat-card__num .unit { font-size: 16px; color: var(--text-3); font-weight: 500; }
.stat-card__label { font-size: 12.5px; color: var(--text-2); }

/* ============================================================
   Selo de favorito
   ============================================================ */
.fav-star {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(245, 184, 61, .16); border: 1px solid rgba(245, 184, 61, .35);
  color: #f5b83d; display: flex; align-items: center; justify-content: center;
}
.fav-star svg { width: 15px; height: 15px; }
.reason-tag { font-size: 11.5px; color: var(--text-3); margin-top: -4px; }
.reason-tag strong { color: var(--text-2); font-weight: 500; }

/* ============================================================
   Calendário — grade de mês
   ============================================================ */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.cal-weekday {
  text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); padding-bottom: 4px;
}
.cal-day {
  height: 96px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass-bg);
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 7px 6px 8px; text-align: left; overflow: hidden;
  font-family: var(--font-body); font-size: 13px; color: var(--text-1);
  transition: background .15s, border-color .15s;
}
.cal-day:hover { background: var(--glass-bg-strong); border-color: var(--glass-border-strong); }
.cal-day.is-outside { color: var(--text-3); opacity: .45; }
.cal-day.is-today { border-color: var(--brand-400); font-weight: 700; }
.cal-day.is-selected {
  background: rgba(177, 32, 37, .1); border-color: var(--brand-500);
  box-shadow: inset 0 0 0 1.5px var(--brand-500); color: var(--brand-600); font-weight: 700;
}
.cal-day__num { align-self: flex-start; font-size: 12.5px; }
.cal-day__events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day__pill {
  display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-body); font-size: 9.5px; font-weight: 600; line-height: 1.4;
  padding: 2px 5px; border-radius: 5px; background: var(--glass-bg-strong); color: var(--text-1);
}
.cal-day__pill--inicio { border-left: 3px solid var(--success-500); }
.cal-day__pill--prazo { border-left: 3px solid var(--brand-500); }
.cal-day__more { font-size: 9.5px; color: var(--text-3); padding-left: 4px; }
.cal-day__dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-day__dot--inicio { background: var(--success-500); }
.cal-day__dot--prazo { background: var(--brand-500); }

.cal-popover {
  width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto; padding: 30px;
  text-align: left; background: #fff; border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  transform: translateY(10px) scale(.97); opacity: 0;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.modal-overlay.is-open .cal-popover { transform: translateY(0) scale(1); opacity: 1; }
.cal-popover__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cal-popover__head h4 { margin: 0; font-size: 19px; }

/* ============================================================
   Modal de confirmação (ex.: sair da conta)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 9, 20, .65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal-card {
  width: 100%; max-width: 360px; text-align: center;
  padding: 30px 26px 26px;
  background: #fff; border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  transform: translateY(10px) scale(.97); opacity: 0;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); opacity: 1; }

.modal-card__icon {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--crimson-bg); color: var(--crimson-500);
  display: flex; align-items: center; justify-content: center;
}
.modal-card__icon svg { width: 22px; height: 22px; }
.modal-card h3 { font-size: 17px; margin-bottom: 8px; }
.modal-card p { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.modal-card__actions { display: flex; gap: 10px; }
.modal-card__actions .btn { flex: 1; }
.btn--danger { border-color: var(--crimson-bg); color: var(--crimson-500); background: var(--crimson-bg); }
.btn--danger:hover { background: rgba(224, 122, 28, .24); border-color: rgba(224, 122, 28, .4); }

/* ============================================================
   Reveal on load
   ============================================================ */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible { animation: revealUp .6s var(--ease) forwards; }
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 1180px) {
  .main { padding: 26px 24px 56px 20px; }
  .layout { grid-template-columns: 1fr 270px; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .layout__rail { position: static; max-height: none; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .rail-card { min-width: 240px; }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 18px 10px; }
  .sidebar__brand-name { display: none; }
  .sidebar__link { justify-content: center; padding: 12px; }
  .sidebar__link span:not(.sidebar__badge) { display: none; }
  .sidebar__badge { position: absolute; top: 6px; right: 6px; margin-left: 0; min-width: 8px; height: 8px; padding: 0; }
  .sidebar__badge-num { display: none; }
  .sidebar__toggle { display: none; }
  .avatar-stack, .breadcrumb a:not(:last-child) span:not(.breadcrumb__sep) { display: none; }
}

@media (max-width: 620px) {
  .main { padding: 20px 14px 48px 14px; }
  .topbar { margin-bottom: 24px; }
  .hero h1 { font-size: 26px; }
  .events-grid, .works-grid, .cert-grid { grid-template-columns: 1fr; }
  .work-card__body { flex-direction: column; align-items: stretch; }
  .work-card__note { flex-direction: row; }
  .form-grid { grid-template-columns: 1fr; }
  .work-form { padding: 22px 18px 20px; }
  .work-form__foot { flex-direction: column; align-items: stretch; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .layout__rail { flex-direction: column; }
  .rail-card { min-width: 0; }
}
