/* ============================================================
   Plataforma de Gestão de Eventos e Formação Continuada
   Design system v2 — visual moderno, orientado a cards
   ============================================================ */

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

:root {
  /* Marca Crivo — violeta do símbolo, verde da palavra */
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-soft: #f3eefe;
  --primary-softer: #faf8ff;
  --accent: #149972;

  /* Superfícies */
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-alt: #fafbfe;
  --surface-sunken: #f2f4f9;
  --border: #e8eaf2;
  --border-strong: #d5d9e6;

  /* Texto */
  --text: #14172b;
  --text-muted: #5c6480;
  --text-faint: #8b93ab;

  /* Semânticos */
  --success: #0f7b47;
  --success-bg: #e7f7ee;
  --warning: #a35a06;
  --warning-bg: #fdf2e2;
  --danger: #c4302b;
  --danger-bg: #fdeceb;
  --info: #0b6fa8;
  --info-bg: #e7f3fb;
  --neutral-bg: #eef0f7;

  /* Gradientes por modalidade */
  --grad-presencial: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --grad-assincrono: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #ec4899 100%);
  --grad-aovivo:     linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  --grad-equalizado: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  --grad-brand:      linear-gradient(135deg, #7c3aed 0%, #149972 100%);
  --grad-dark:       linear-gradient(146deg, #17102e 0%, #3b1d7a 46%, #0f6f5c 100%);

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(18, 22, 48, .05);
  --shadow-sm: 0 1px 3px rgba(18, 22, 48, .06), 0 1px 2px rgba(18, 22, 48, .04);
  --shadow-md: 0 6px 18px -6px rgba(18, 22, 48, .12), 0 2px 6px rgba(18, 22, 48, .05);
  --shadow-lg: 0 22px 48px -14px rgba(18, 22, 48, .22), 0 6px 16px rgba(18, 22, 48, .07);
  --shadow-brand: 0 8px 20px -8px rgba(124, 58, 237, .5);

  --sidebar-w: 260px;
  --topbar-h: 68px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.018em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 8px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--primary-soft); }

/* Ícones SVG (injetados por app.js) */
.ic-svg { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic-svg svg { width: 1em; height: 1em; display: block; }

/* Logo Crivo (injetada por app.js via data-logo) */
.crivo-logo { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.crivo-logo .crivo-logo-svg { display: block; height: auto; }
.crivo-logo[data-logo="full"] .crivo-logo-svg,
.crivo-logo[data-logo="full-dark"] .crivo-logo-svg { width: 118px; }
.crivo-logo[data-logo="symbol"] .crivo-logo-svg,
.crivo-logo[data-logo="symbol-dark"] .crivo-logo-svg { width: 42px; }

.radio-inline { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 4px; }
.radio-inline label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.radio-inline input { margin: 0; accent-color: var(--primary); }
.radio-inline + .hint { margin-top: 8px; }

/* ---------------- Layout shell ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #17102e 0%, #100a20 100%);
  color: #c3c9e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }

.sidebar-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand .crivo-logo .crivo-logo-svg { width: 108px; }
.sidebar-brand .sub { font-size: 11px; color: #8a80b8; letter-spacing: .01em; }

.sidebar-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em;
  color: #656e9c; padding: 18px 22px 7px; font-weight: 700;
}
.sidebar-nav { padding: 0 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: #aeb6d6; font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; text-decoration: none; position: relative;
  transition: background .14s ease, color .14s ease;
}
.sidebar-nav a .ic-svg { font-size: 17px; opacity: .82; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.055); color: #fff; }
.sidebar-nav a:hover .ic-svg { opacity: 1; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(147,97,247,.75));
  color: #fff; box-shadow: 0 6px 16px -8px rgba(124,58,237,.9);
}
.sidebar-nav a.active .ic-svg { opacity: 1; }
.sidebar-nav a .count {
  margin-left: auto; background: rgba(255,255,255,0.13); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.sidebar-nav a.active .count { background: rgba(255,255,255,0.26); }

.sidebar-foot {
  margin-top: auto; padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11px; color: #656e9c; line-height: 1.5;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 11.5px; color: var(--text-faint); margin-bottom: 1px; font-weight: 500; }
.topbar .title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.role-pill {
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
/* Seletor de perfil (mockup) */
.role-switch {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 999px; padding: 4px 6px 4px 13px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.role-switch .ic-svg { font-size: 15px; }
.role-switch .rs-label { letter-spacing: .01em; }
.role-switch select {
  width: auto; border: none; background: var(--surface);
  border-radius: 999px; padding: 5px 30px 5px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--primary-dark);
  cursor: pointer; box-shadow: var(--shadow-xs);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236d28d9' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.role-switch select:focus { outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.25); }

/* Atalhos de perfil na tela de login */
.role-cards { display: grid; gap: 10px; }
.role-card {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 11px 14px; background: var(--surface); color: var(--text);
  transition: all .14s ease;
}
.role-card:hover { border-color: var(--primary); background: var(--primary-softer); color: var(--text); }
.role-card .rc-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 16px;
}
.role-card .rc-t { font-size: 13.2px; font-weight: 700; line-height: 1.25; }
.role-card .rc-s { font-size: 11.8px; color: var(--text-faint); }
.role-card .rc-go { margin-left: auto; color: var(--text-faint); font-size: 15px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0; letter-spacing: -.01em;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; border-radius: 24px; }
.avatar.v2 { background: linear-gradient(135deg,#f97316,#ef4444); }
.avatar.v3 { background: linear-gradient(135deg,#7c3aed,#ec4899); }
.avatar.v4 { background: linear-gradient(135deg,#0f766e,#14b8a6); }
.avatar.v5 { background: linear-gradient(135deg,#2563eb,#06b6d4); }
.user-chip .u-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--text-faint); }

.content { padding: 28px; flex: 1; max-width: 1560px; width: 100%; }
.content.narrow { max-width: 900px; }

/* ---------------- Page header ---------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 18px; flex-wrap: wrap;
}
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head .desc { color: var(--text-muted); font-size: 13.5px; max-width: 680px; margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Hero de topo (dashboard / catálogo) */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-dark);
  border-radius: var(--radius-lg); color: #fff;
  padding: 26px 30px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.hero::after {
  content: ''; position: absolute; right: -70px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%);
}
.hero h1 { color: #fff; font-size: 25px; margin-bottom: 6px; }
.hero p { color: rgba(255,255,255,.78); font-size: 13.5px; max-width: 560px; margin: 0; }
.hero .hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn-secondary { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); color: #fff; }
.hero .btn-secondary:hover { background: rgba(255,255,255,.22); }
.hero .btn-primary { background: #fff; color: var(--primary-dark); }
.hero .btn-primary:hover { background: #f1f2ff; color: var(--primary-dark); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .14s ease, box-shadow .14s ease, border-color .14s ease;
  text-decoration: none;
}
.btn .ic-svg { font-size: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--text-faint); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--neutral-bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a52623; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0b6339; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-size: 15px;
  transition: all .14s ease; text-decoration: none;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }

/* ---------------- Cards base / grids ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 15px; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--text-faint); font-weight: 500; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-sidebar { grid-template-columns: 1fr 340px; align-items: start; }

/* Grade fluida de cards */
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.card-grid.sm { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.card-grid.lg { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

/* ---------------- Stat cards (KPI) ---------------- */
.kpi, .stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card { padding-left: 20px; }
.stat-card .stat-top { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.stat-ic {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--primary-soft); color: var(--primary);
}
.stat-ic.green  { background: var(--success-bg); color: var(--success); }
.stat-ic.orange { background: var(--warning-bg); color: var(--warning); }
.stat-ic.blue   { background: var(--info-bg);    color: var(--info); }
.stat-ic.red    { background: var(--danger-bg);  color: var(--danger); }
.stat-ic.purple { background: #f4ecfe;           color: #7c3aed; }

.kpi .label, .stat-card .label {
  font-size: 11.5px; color: var(--text-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: .045em;
}
.kpi .value, .stat-card .value { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.kpi .delta, .stat-card .delta { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.kpi .delta.up, .stat-card .delta.up { color: var(--success); }
.kpi .delta.down, .stat-card .delta.down { color: var(--danger); }
.kpi .bar, .stat-card .bar { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.kpi .bar > span, .stat-card .bar > span { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; }

/* ---------------- Course card ---------------- */
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  text-decoration: none; color: inherit;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d9dcec; color: inherit; }

.course-cover {
  height: 108px; position: relative; flex-shrink: 0;
  display: flex; align-items: flex-end; padding: 12px 14px;
  background: var(--grad-brand); overflow: hidden;
}
.course-cover.presencial { background: var(--grad-presencial); }
.course-cover.assincrono { background: var(--grad-assincrono); }
.course-cover.aovivo     { background: var(--grad-aovivo); }
.course-cover.equalizado { background: var(--grad-equalizado); }
.course-cover.muted      { background: linear-gradient(135deg, #8d94ad 0%, #646c85 100%); }
.course-cover::before {
  content: ''; position: absolute; right: -34px; bottom: -56px;
  width: 168px; height: 168px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.course-cover::after {
  content: ''; position: absolute; right: 26px; top: -50px;
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.course-cover .cover-ic {
  position: absolute; right: 16px; top: 14px;
  font-size: 40px; color: rgba(255,255,255,.5);
}
.course-cover .mod-chip {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
}
.course-cover .mod-chip .ic-svg { font-size: 13px; }
.course-status { position: absolute; top: 12px; left: 14px; z-index: 1; }
.course-status .badge { box-shadow: var(--shadow-xs); }

.course-body { padding: 15px 17px 12px; flex: 1; display: flex; flex-direction: column; }
.course-title {
  font-size: 15px; font-weight: 700; letter-spacing: -.015em; line-height: 1.32;
  margin: 0 0 6px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-audience {
  font-size: 12.3px; color: var(--text-muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.course-audience .ic-svg { font-size: 14px; color: var(--text-faint); }
.course-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-sunken); color: var(--text-muted);
  border-radius: 8px; padding: 4px 9px; font-size: 11.8px; font-weight: 600;
}
.chip .ic-svg { font-size: 13px; color: var(--text-faint); }
.chip.primary { background: var(--primary-soft); color: var(--primary-dark); }
.chip.primary .ic-svg { color: var(--primary); }
.chip.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.02em; }

.course-foot {
  border-top: 1px solid var(--border); padding: 11px 17px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-alt);
}
.course-foot .metric { font-size: 12.3px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.course-foot .metric b { color: var(--text); font-size: 13px; }
.course-foot .metric .ic-svg { font-size: 14px; color: var(--text-faint); }
.course-foot .go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.8px; font-weight: 700; color: var(--primary);
}
.course-card:hover .course-foot .go { gap: 8px; }
.course-foot .go .ic-svg { font-size: 15px; transition: transform .16s ease; }

/* Progresso dentro do card */
.course-progress { margin-top: 12px; }
.course-progress .pr-top { display: flex; justify-content: space-between; font-size: 11.8px; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; }

/* ---------------- Person / entity card ---------------- */
.entity-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 17px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.entity-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dfe2ee; }
.entity-top { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.entity-top .e-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.entity-top .e-sub { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }
.entity-top .e-sub.plain { font-family: var(--font-sans); }
.entity-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.entity-meta { display: flex; flex-direction: column; gap: 8px; font-size: 12.6px; margin-bottom: 14px; }
.entity-meta .row { display: flex; align-items: flex-start; gap: 8px; color: var(--text-muted); }
.entity-meta .row .ic-svg { font-size: 15px; color: var(--text-faint); margin-top: 1px; }
.entity-meta .row b { color: var(--text); font-weight: 600; }
.entity-foot {
  margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.entity-foot .actions { display: flex; gap: 7px; }

/* Cartão de unidade (lotação) com barra de destaque */
.unit-ic {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--primary-soft); color: var(--primary);
}
.unit-ic.central { background: #f4ecfe; color: #7c3aed; }
.unit-ic.off { background: var(--neutral-bg); color: var(--text-faint); }

/* ---------------- Certificate card ---------------- */
.cert-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 17px 18px 15px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.cert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cert-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad-brand);
}
.cert-card.presencial::before { background: var(--grad-presencial); }
.cert-card.assincrono::before { background: var(--grad-assincrono); }
.cert-card.aovivo::before     { background: var(--grad-aovivo); }
.cert-card.equalizado::before { background: var(--grad-equalizado); }
.cert-card.replaced { background: var(--warning-bg); border-color: #f2ddba; }
.cert-card .cert-seal {
  position: absolute; right: 14px; top: 14px;
  font-size: 22px; color: var(--border-strong);
}
.cert-card .cert-course { font-size: 14.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; padding-right: 34px; margin-bottom: 4px; }
.cert-card .cert-person { font-size: 12.6px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.cert-card .cert-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.cert-card .cert-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px dashed var(--border-strong); padding-top: 12px;
}

/* ---------------- Task card (fila de correção) ---------------- */
.task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.task-card.urgent { border-left-color: var(--danger); }
.task-card.warn   { border-left-color: #e0952a; }
.task-card.fresh  { border-left-color: var(--success); }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.task-person { display: flex; align-items: center; gap: 10px; }
.task-person .t-name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.task-person .t-sub { font-size: 11.8px; color: var(--text-faint); }
.task-course { font-size: 13px; color: var(--text-muted); margin-bottom: 11px; display: flex; align-items: flex-start; gap: 7px; }
.task-course .ic-svg { font-size: 15px; color: var(--text-faint); margin-top: 1px; }
.task-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--info-bg); color: var(--info);
  padding: 5px 10px; border-radius: 8px; font-size: 11.8px; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- Rating card ---------------- */
.rating-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.rating-card .r-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rating-card .r-title { font-size: 14.3px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.rating-card .r-score {
  font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  color: var(--text); display: flex; align-items: baseline; gap: 3px;
}
.rating-card .r-score span { font-size: 13px; font-weight: 600; color: var(--text-faint); }
.rating-card .r-bars { margin-top: auto; display: flex; flex-direction: column; gap: 9px; font-size: 12.2px; }
.rating-card .r-bars .rb { display: flex; align-items: center; gap: 10px; }
.rating-card .r-bars .rb span:first-child { color: var(--text-muted); width: 110px; flex-shrink: 0; }
.rating-card .r-bars .rb b { margin-left: auto; }

/* ---------------- Log feed (auditoria) ---------------- */
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 13px;
  box-shadow: var(--shadow-xs); transition: box-shadow .14s ease, border-color .14s ease;
}
.log-item:hover { box-shadow: var(--shadow-sm); border-color: #dfe2ee; }
.log-ic {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--surface-sunken); color: var(--text-muted);
}
.log-ic.green { background: var(--success-bg); color: var(--success); }
.log-ic.blue  { background: var(--info-bg); color: var(--info); }
.log-ic.orange{ background: var(--warning-bg); color: var(--warning); }
.log-ic.red   { background: var(--danger-bg); color: var(--danger); }
.log-ic.purple{ background: #f4ecfe; color: #7c3aed; }
.log-body { flex: 1; min-width: 0; }
.log-action { font-size: 13.4px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 3px; }
.log-target { font-size: 12.4px; color: var(--text-muted); }
.log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.log-time { font-size: 11.6px; color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }

/* ---------------- Data list (listagens densas, colunas alinhadas) ---------------- */
.data-list-wrap { overflow-x: auto; }
.data-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dl-head, .dl-row {
  display: grid;
  grid-template-columns: var(--dl-cols, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}
.dl-head {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 10.8px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  font-weight: 700;
  white-space: nowrap;
}
.dl-row {
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s ease;
}
.dl-row:last-child { border-bottom: none; }
.dl-row:hover { background: var(--surface-alt); color: inherit; }
.dl-row.urgent { box-shadow: inset 3px 0 0 var(--danger); }
.dl-row.warn   { box-shadow: inset 3px 0 0 #e0952a; }
.dl-row.fresh  { box-shadow: inset 3px 0 0 var(--success); }

.dl-cell { min-width: 0; }
.dl-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dl-user > div { min-width: 0; }
.dl-name { font-size: 13.6px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.dl-sub { font-size: 12px; color: var(--text-faint); line-height: 1.35; }
.dl-mono { font-family: var(--font-mono); font-size: 12.2px; color: var(--text-muted); line-height: 1.5; }
.dl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dl-tags .chip { padding: 3px 7px; font-size: 11px; gap: 4px; }
.dl-tags .chip .ic-svg { font-size: 12px; }
.dl-num { text-align: right; font-weight: 600; font-size: 13.4px; }
.dl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.dl-empty { padding: 44px 20px; text-align: center; color: var(--text-faint); }
.dl-foot {
  display: grid; grid-template-columns: var(--dl-cols, 1fr); gap: 12px; align-items: center;
  padding: 13px 16px; background: var(--surface-alt); border-top: 1.5px solid var(--border-strong);
  font-size: 13.2px; font-weight: 700;
}
.dl-foot .dl-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 800; }
.dl-bar { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.dl-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }

@media (max-width: 860px) {
  .data-list-wrap { overflow-x: visible; }
  .data-list { min-width: 0 !important; }
  .dl-head { display: none; }
  .dl-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 15px 16px;
  }
  .dl-cell[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-faint); font-weight: 700; margin-bottom: 4px;
  }
  .dl-cell.dl-primary::before { display: none; }
  .dl-num { text-align: left; }
  .dl-foot { grid-template-columns: 1fr; gap: 8px; }
  .dl-foot > div:empty { display: none; }
  .dl-actions { justify-content: flex-start; }
}

/* ---------------- Data row (lista compacta em card) ---------------- */
.row-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs); transition: border-color .14s ease, box-shadow .14s ease;
}
.row-card:hover { border-color: #dfe2ee; box-shadow: var(--shadow-sm); }
.row-card + .row-card { margin-top: 9px; }
.row-card .rc-main { flex: 1; min-width: 0; }
.row-card .rc-title { font-size: 13.6px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-card .rc-sub { font-size: 12.2px; color: var(--text-faint); }

/* ---------------- Tables (uso restrito a dados densos) ---------------- */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
thead th {
  text-align: left; padding: 12px 16px; background: var(--surface-alt);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 700; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-alt); }
td.num, th.num { text-align: right; }
.table-name { font-weight: 600; letter-spacing: -.01em; }
.table-sub { font-size: 12px; color: var(--text-faint); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------- Badges / pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; letter-spacing: -.005em;
}
.badge .ic-svg { font-size: 12px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger); }
.badge.info    { background: var(--info-bg);    color: var(--info); }
.badge.neutral { background: var(--neutral-bg); color: var(--text-muted); }
.badge.primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge.purple  { background: #f4ecfe; color: #7c3aed; }
.badge.solid   { background: var(--text); color: #fff; }

.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  background: var(--surface-sunken); color: var(--text-muted);
  font-size: 11.8px; font-weight: 600; margin: 2px 5px 2px 0;
}

/* ---------------- Forms ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.8px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.field .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=time], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 13.5px; color: var(--text); font-family: inherit;
  transition: border-color .14s ease, box-shadow .14s ease;
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b93ab' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px var(--primary-soft); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
.form-row { display: flex; gap: 14px; }
.form-row .field { flex: 1; }
.checkline, .radioline { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; margin-bottom: 8px; }
.checkline input, .radioline input { margin-top: 3px; accent-color: var(--primary); }
.select-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.select-chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-muted);
  background: var(--surface); transition: all .14s ease;
}
.select-chip:hover { border-color: var(--primary); color: var(--primary); }
.select-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); padding: 24px;
  text-align: center; color: var(--text-faint); font-size: 12.8px; background: var(--surface-alt);
}

/* ---------------- Tabs / segmented ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 16px; font-size: 13.3px; font-weight: 600; color: var(--text-faint);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .14s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-color: var(--primary); }

/* Variante pílula, mais comercial */
.tabs.pill {
  border-bottom: none; gap: 6px; background: var(--surface);
  padding: 5px; border-radius: 12px; border: 1px solid var(--border);
  display: inline-flex; box-shadow: var(--shadow-xs); max-width: 100%;
}
.tabs.pill .tab-btn {
  border: none; border-radius: 9px; padding: 8px 15px; margin-bottom: 0;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 7px;
}
.tabs.pill .tab-btn:hover { background: var(--surface-sunken); }
.tabs.pill .tab-btn.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.tabs.pill .tab-btn .cnt {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-sunken); color: var(--text-faint);
}
.tabs.pill .tab-btn.active .cnt { background: rgba(255,255,255,.25); color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- Alerts ---------------- */
.alert {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 13px; border: 1px solid transparent;
}
.alert .ic { font-size: 16px; flex-shrink: 0; }
.alert .ic-svg { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert.info    { background: var(--info-bg);    color: #0a5680; border-color: #cbe6f5; }
.alert.warning { background: var(--warning-bg); color: #7f4505; border-color: #f2ddba; }
.alert.success { background: var(--success-bg); color: #0c5f36; border-color: #c5e9d5; }
.alert.danger  { background: var(--danger-bg);  color: #8f1f1f; border-color: #f4cac8; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(14,17,38,0.55);
  backdrop-filter: blur(3px); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
  animation: modalIn .18s ease;
}
.modal.lg { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------------- Misc components ---------------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; transition: width .3s ease; }
.progress.thin { height: 6px; }

.stars { color: #f0b429; font-size: 15px; letter-spacing: 1.5px; }
.stars .off { color: var(--border-strong); }

.stepper { display: flex; align-items: center; margin-bottom: 30px; }
.stepper .step { display: flex; align-items: center; gap: 10px; flex: 1; }
.stepper .num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-sunken); color: var(--text-faint);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.stepper .step.done .num { background: var(--success); color: #fff; }
.stepper .step.active .num { background: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.stepper .label { font-size: 12.5px; font-weight: 600; color: var(--text-faint); }
.stepper .step.active .label, .stepper .step.done .label { color: var(--text); }
.stepper .line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; }
.stepper .step.done + .step .line, .stepper .line.done { background: var(--success); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary); border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.timeline-item .t-time { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.timeline-item .t-title { font-size: 13.2px; font-weight: 600; margin: 2px 0; letter-spacing: -.01em; }
.timeline-item .t-meta { font-size: 12px; color: var(--text-muted); }

.empty-state {
  text-align: center; padding: 56px 20px; color: var(--text-faint);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
}
.empty-state .ic-svg { font-size: 34px; margin-bottom: 12px; color: var(--border-strong); }
.empty-state .ic { font-size: 34px; margin-bottom: 10px; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; font-size: 12.5px; color: var(--text-faint); flex-wrap: wrap; gap: 10px;
}
.pagination.boxed { padding: 13px 16px; }
.pagination .pg-btns { display: flex; gap: 6px; }
.pagination button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); transition: all .14s ease;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.search-input-wrap { position: relative; }
.search-input-wrap .ic, .search-input-wrap .ic-svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 16px; pointer-events: none;
}
.search-input-wrap input { padding-left: 38px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar.boxed {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px; box-shadow: var(--shadow-sm);
}

.list-plain li { padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.3px; }
.list-plain li:last-child { border-bottom: none; }

.video-box {
  background: linear-gradient(140deg, #131735, #0a0d1f); border-radius: var(--radius-md); aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; color: #fff; position: relative; overflow: hidden;
}
.video-box .play-ic {
  width: 68px; height: 68px; border-radius: 50%; background: rgba(255,255,255,0.16);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.video-box .v-label { position: absolute; bottom: 14px; left: 16px; font-size: 12.5px; color: #cdd3ee; }
.video-box .v-badge { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.16); font-size: 11px; padding: 4px 10px; border-radius: 999px; font-weight: 600; }

.qr-box {
  width: 132px; height: 132px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); padding: 8px; gap: 2px;
}
.qr-box i { background: var(--border); border-radius: 1px; }
.qr-box i.on { background: #12162c; }

.chat-panel { display: flex; flex-direction: column; height: 420px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { font-size: 12.8px; }
.chat-msg b { color: var(--primary-dark); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

.q-item {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; gap: 13px; align-items: flex-start; margin-bottom: 10px; background: var(--surface);
}
.upvote { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-faint); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.upvote button { border: 1px solid var(--border); background: var(--surface-alt); border-radius: 7px; width: 28px; height: 26px; cursor: pointer; }
.upvote button:hover { border-color: var(--primary); color: var(--primary); }
.upvote.votado { color: var(--primary); }
.upvote.votado button { background: var(--primary); border-color: var(--primary); color: #fff; }

.divider-label { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin: 20px 0; }
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

code.mono, .mono { font-family: var(--font-mono); }

.uuid-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; font-size: 11.5px; font-family: var(--font-mono); color: var(--text-muted);
}

/* Section header dentro da página */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.section-head h2 .ic-svg { color: var(--primary); font-size: 18px; }
.section-head .sub { font-size: 12.5px; color: var(--text-faint); }

/* ---------------- Entrada de estrelas ---------------- */
.stars-input { display: flex; gap: 4px; }
.star-btn {
  border: none; background: none; cursor: pointer; padding: 0 2px;
  font-size: 26px; line-height: 1; color: var(--border-strong);
  transition: color .12s ease, transform .12s ease;
}
.star-btn:hover { transform: scale(1.08); color: #f0b429; }
.star-btn.on { color: #f0b429; }

/* ---------------- Pop-up de pesquisa (§5.18) ---------------- */
.pesquisa-popup {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 18px 18px 16px; display: flex; gap: 13px;
  opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease;
}
.pesquisa-popup.open { opacity: 1; transform: none; }
.pesquisa-popup .pp-close {
  position: absolute; top: 10px; right: 10px;
  border: none; background: none; cursor: pointer;
  color: var(--text-faint); font-size: 15px; padding: 4px; border-radius: 6px;
  display: inline-flex;
}
.pesquisa-popup .pp-close:hover { background: var(--neutral-bg); color: var(--text); }
.pesquisa-popup .pp-ic {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 18px;
}
.pesquisa-popup .pp-title { font-size: 13.6px; font-weight: 700; line-height: 1.3; padding-right: 18px; }
.pesquisa-popup .pp-sub { font-size: 12.2px; color: var(--text-muted); margin-top: 3px; }

/* ---------------- Módulos do curso (§5.10) ---------------- */
.modulo {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); margin-bottom: 12px; overflow: hidden;
}
.modulo-head {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  background: var(--surface-alt); border-bottom: 1px solid var(--border);
}
.modulo.locked .modulo-head { background: var(--surface); }
.modulo.locked .m-title, .modulo.locked .m-sub { color: var(--text-faint); }
.modulo-num {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  background: var(--surface-sunken); color: var(--text-faint);
}
.modulo.done .modulo-num { background: var(--success-bg); color: var(--success); }
.modulo.current .modulo-num { background: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.modulo .m-title { font-size: 13.8px; font-weight: 700; letter-spacing: -.01em; }
.modulo .m-sub { font-size: 12px; color: var(--text-faint); }
.modulo-body { padding: 6px 16px 12px; }
.item-conteudo {
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.item-conteudo:last-child { border-bottom: none; }
.item-conteudo .ic-svg { font-size: 16px; color: var(--text-faint); }
.item-conteudo.done .ic-svg { color: var(--success); }
.item-conteudo.current { font-weight: 600; color: var(--primary); }
.item-conteudo.current .ic-svg { color: var(--primary); }
.item-conteudo.locked { color: var(--text-faint); }
.item-conteudo .it-meta { margin-left: auto; font-size: 11.8px; color: var(--text-faint); font-weight: 500; }

/* ---------------- Slides (apresentação) ---------------- */
.slide-box {
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-md); aspect-ratio: 16/9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-muted); position: relative;
}
.slide-box .sl-num {
  position: absolute; bottom: 12px; right: 14px; font-size: 11.5px;
  color: var(--text-faint); font-weight: 600;
}

/* ---------------- Auth layout ---------------- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-side {
  flex: 1.05; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #14163a 0%, #312e81 52%, #0e7490 100%);
  color: #fff; padding: 58px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::after {
  content: ''; position: absolute; right: -120px; bottom: -140px; width: 460px; height: 460px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.13), transparent 68%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side .mark { width: 50px; height: 50px; border-radius: 15px; background: rgba(255,255,255,0.16); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; margin-bottom: 22px; }
.auth-side h1 { font-size: 30px; max-width: 420px; line-height: 1.28; }
.auth-side p { color: #c8d0f0; max-width: 400px; font-size: 14px; }
.auth-side .foot { font-size: 12px; color: #94a0d4; }
.auth-side .auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth-side .auth-points div { display: flex; align-items: center; gap: 10px; font-size: 13.2px; color: #d5dcf6; }
.auth-side .auth-points .ic-svg { font-size: 17px; color: #7dd3fc; }
.auth-form-col { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: 100%; max-width: 396px; }
.auth-box .brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.auth-box .brand-row .mark { width: 38px; height: 38px; border-radius: 11px; background: var(--grad-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14.5px; box-shadow: var(--shadow-brand); }
.auth-box .brand-row .name { font-weight: 700; font-size: 13.5px; }
.auth-box .brand-row .sub { font-size: 11px; color: var(--text-faint); }

/* ---------------- Rota pública de validação (§5.20) ---------------- */
.validacao-shell {
  min-height: 100vh; background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 56px 20px;
}
.validacao-box { width: 100%; max-width: 520px; }
.mark-pub {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; box-shadow: var(--shadow-brand); flex-shrink: 0;
}

/* ---------------- Utility ---------------- */
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.sidebar-toggle {
  display: none; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted);
  font-size: 20px; cursor: pointer; border-radius: 9px; flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--neutral-bg); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(12, 16, 38, 0.5); z-index: 39; opacity: 0; transition: opacity .18s ease;
}
.sidebar-overlay.open { display: block; opacity: 1; }

/* ---------------- Responsivo ---------------- */

/* Item de grade tem `min-width: auto` por padrão e não encolhe abaixo da
   largura mínima do seu conteúdo. Basta um nome de arquivo em `mono` ou uma
   tabela dentro dele para a coluna empurrar a página e criar rolagem
   horizontal no celular. Zerar o mínimo devolve o controle ao `1fr`; o que
   precisa transbordar rola dentro do próprio `.data-list-wrap`. */
.grid > * { min-width: 0; }

@media (max-width: 1240px) {
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .validacao-shell { padding: 28px 16px; }
  .sidebar-toggle { display: inline-flex; }
  .app { display: block; }
  .main { width: 100%; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease;
    z-index: 40; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .topbar { padding: 0 14px; }
  .topbar .title { font-size: 15px; }
  .role-pill { display: none; }
  .topbar .crumb { display: none; }
  .topbar-right { gap: 8px; min-width: 0; }
  .topbar-right > * { flex-shrink: 0; }
  .role-switch { padding: 0; background: transparent; min-width: 0; flex-shrink: 1; }
  .role-switch .rs-label, .role-switch > .ic-svg { display: none; }
  .role-switch select {
    max-width: 132px; padding: 6px 26px 6px 10px; font-size: 12px;
    text-overflow: ellipsis; background-position: right 8px center;
  }
  .user-chip { border: none; padding: 0; }
  .user-chip .u-name, .user-chip .u-role { display: none; }

  .content { padding: 16px; }
  .content.narrow { max-width: 100%; }

  .grid-2, .grid-3, .grid-sidebar { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-grid, .card-grid.sm, .card-grid.lg { grid-template-columns: 1fr; }

  /* Stat cards compactos em telas pequenas */
  .stat-card, .kpi { padding: 13px 14px; }
  .stat-card .stat-top { gap: 9px; margin-bottom: 2px; }
  .stat-ic { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .kpi .label, .stat-card .label { font-size: 10px; letter-spacing: .03em; }
  .stat-card .delta, .kpi .delta { font-size: 11px; }

  .hero { padding: 22px; }
  .hero h1 { font-size: 21px; }

  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .page-actions .btn { flex: 1; }

  .form-row { flex-direction: column; gap: 0; }
  .toolbar select, .toolbar input[type=date] { width: 100% !important; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs.pill { display: flex; }
  .tabs::-webkit-scrollbar { display: none; }

  .kpi .value, .stat-card .value { font-size: 20px; }

  .auth-shell { flex-direction: column; min-height: 0; }
  .auth-side { padding: 28px 22px; }
  .auth-side h1 { font-size: 22px; }
  .auth-side .foot, .auth-side .auth-points { display: none; }
  .auth-form-col { padding: 28px 18px; }

  .video-box { aspect-ratio: 4/3; }
}

/* ---------------- Construtor de estrutura de curso (§5.10) ---------------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; }
.preset {
  border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  padding: 15px; cursor: pointer; text-align: left; transition: all .15s ease;
  display: flex; flex-direction: column; gap: 10px; font: inherit; color: inherit;
}
.preset:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.preset.active { border-color: var(--primary); background: var(--primary-softer); box-shadow: var(--shadow-brand); }
.preset .p-top { display: flex; align-items: center; gap: 9px; }
.preset .p-ic {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 16px;
}
.preset.active .p-ic { background: var(--primary); color: #fff; }
.preset .p-t { font-size: 13.4px; font-weight: 700; letter-spacing: -.01em; }
.preset .p-s { font-size: 12.2px; color: var(--text-muted); line-height: 1.5; }
.preset .p-ex { font-size: 11.6px; color: var(--text-faint); }

/* Mini diagrama da trilha */
.blueprint { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.bp-node {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 7px;
  font-size: 10.8px; font-weight: 700; white-space: nowrap;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-muted);
}
.bp-node .ic-svg { font-size: 12px; }
.bp-node.video  { background: #eef2ff; border-color: #dee4ff; color: #4338ca; }
.bp-node.slides { background: #e9fbf4; border-color: #cdf0e1; color: #0f7b47; }
.bp-node.prova  { background: #fdf2e2; border-color: #f7e2c2; color: #a35a06; }
.bp-sep { color: var(--border-strong); font-size: 11px; font-weight: 700; }
.bp-mod {
  display: flex; align-items: center; gap: 5px; padding: 6px 8px 6px 7px;
  border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface);
}
.bp-mod .bp-lbl {
  font-size: 9.6px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 800; padding-right: 2px;
}

/* Módulos editáveis */
.mb-mod { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-xs); }
.mb-mod-head { display: flex; align-items: center; gap: 11px; padding: 11px 14px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.mb-num {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800;
}
.mb-title-input {
  border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 13.6px;
  padding: 6px 8px; border-radius: 8px; width: 100%; color: var(--text); letter-spacing: -.01em;
}
.mb-title-input:hover { border-color: var(--border); background: var(--surface); }
.mb-title-input:focus { border-color: var(--primary); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.mb-mod-actions { display: flex; gap: 3px; flex-shrink: 0; }
.mb-items { padding: 10px 14px 14px; }
.mb-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.mb-item .mi-ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-sunken); color: var(--text-muted);
}
.mb-item.tipo-video  .mi-ic { background: #eef2ff; color: #4338ca; }
.mb-item.tipo-slides .mi-ic { background: #e9fbf4; color: #0f7b47; }
.mb-item.tipo-prova  .mi-ic { background: #fdf2e2; color: #a35a06; }
.mb-item .mi-main { flex: 1; min-width: 0; }
.mb-item .mi-t { font-size: 13.2px; font-weight: 600; letter-spacing: -.01em; }
.mb-item .mi-s { font-size: 11.8px; color: var(--text-faint); margin-top: 1px; }
.mb-item .mi-acts { display: flex; gap: 3px; flex-shrink: 0; }
.mb-item.tipo-prova { border-color: #f2dcbb; background: #fffdf8; }
.mb-empty {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; font-size: 12.4px; color: var(--text-faint); margin-bottom: 9px;
}
.mb-add { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-add {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; font-size: 12.2px; font-weight: 600;
  border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface);
  color: var(--text-muted); cursor: pointer; transition: all .14s ease;
}
.btn-add:hover { border-color: var(--primary); border-style: solid; color: var(--primary); background: var(--primary-softer); }
.btn-add .ic-svg { font-size: 14px; }

/* Regra de aprovação da avaliação de conhecimento (§5.12) */
.rule-strip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.rule-node { text-align: center; padding: 0 10px; min-width: 92px; }
.rule-node .rn-v { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.rule-node .rn-l { font-size: 10.4px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 800; margin-top: 3px; }
.rule-node.hi .rn-v { color: var(--primary); }
.rule-node.ok .rn-v { color: var(--success); }
.rule-arrow { color: var(--border-strong); display: flex; align-items: center; }
.rule-arrow .ic-svg { font-size: 17px; }

.num-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.num-stepper button {
  width: 34px; border: none; background: var(--surface-alt); cursor: pointer;
  font-size: 17px; font-weight: 700; color: var(--text-muted); line-height: 1; transition: all .12s ease;
}
.num-stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.num-stepper input {
  width: 58px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; font-weight: 700; font-size: 15px; padding: 8px 0; border-radius: 0; background: var(--surface);
}
.num-stepper input:focus { outline: none; box-shadow: none; }

/* Editor de questões */
.q-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow-xs); }
.q-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.q-num {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; background: var(--surface-sunken);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800;
}
.q-head .q-en { flex: 1; min-width: 0; font-size: 13.2px; font-weight: 600; letter-spacing: -.01em; }
.q-body { padding: 12px 14px; }
.q-alt {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface);
}
.q-alt:last-child { margin-bottom: 0; }
.q-alt .qa-key {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: var(--surface-sunken);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 10.8px; font-weight: 800;
}
.q-alt.correta { border-color: #bde5cf; background: var(--success-bg); }
.q-alt.correta .qa-key { background: var(--success); color: #fff; }
.q-alt .qa-tag { margin-left: auto; font-size: 10.6px; font-weight: 800; color: var(--success); text-transform: uppercase; letter-spacing: .05em; }

/* Trilha condensada (revisão) */
.review-line { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.review-line:last-child { border-bottom: none; }
.review-line .rl-l { width: 168px; flex-shrink: 0; font-size: 12.2px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.review-line .rl-v { flex: 1; min-width: 0; font-size: 13.4px; }

@media (max-width: 720px) {
  .rule-node { min-width: 74px; padding: 0 4px; }
  .rule-node .rn-v { font-size: 18px; }
  .review-line { flex-direction: column; gap: 3px; }
  .review-line .rl-l { width: auto; }
  .stepper .label { display: none; }
}

/* Navegação do assistente */
.wizard-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 12px; }
.mini-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); padding: 13px 14px; }
.text-xs { font-size: 11px; }

@media (max-width: 620px) {
  .rule-strip { flex-direction: column; align-items: stretch; gap: 0; padding: 2px 14px; }
  .rule-arrow { display: none; }
  .rule-node {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    text-align: left; padding: 11px 0; border-bottom: 1px solid var(--border); min-width: 0;
  }
  .rule-node:last-child { border-bottom: none; }
  .rule-node .rn-l { order: -1; margin-top: 0; flex: 1; min-width: 0; }
  .rule-node .num-stepper { flex-shrink: 0; }
  .rule-node .rn-v { flex-shrink: 0; }
  .preset-grid { grid-template-columns: 1fr; }
}

/* ---------------- Destaque temporário ao navegar até um item ---------------- */
@keyframes fc-flash {
  0%   { box-shadow: 0 0 0 0 var(--primary-soft); border-color: var(--primary); }
  40%  { box-shadow: 0 0 0 6px var(--primary-soft); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.flash { animation: fc-flash 1.4s ease; }

/* Barra de navegação entre os bancos de questões do mesmo evento */
.bank-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.bank-switch .bs-label { font-size: 12.4px; color: var(--text-faint); font-weight: 600; margin-right: 2px; }
.bank-switch a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); font-size: 12.6px; font-weight: 600;
  color: var(--text-muted); text-decoration: none; transition: all .14s ease;
}
.bank-switch a:hover { border-color: var(--primary); color: var(--primary); }
.bank-switch a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bank-switch a .qtd { font-size: 11.4px; opacity: .75; font-weight: 700; }
.bank-switch a.vazio:not(.active) { border-style: dashed; color: var(--danger); border-color: var(--danger); }

/* Linhas clicáveis inteiras (data-ir) */
[data-ir] { cursor: pointer; }
[data-ir]:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
[data-ir]::after {
  content: "›"; margin-left: 2px; color: var(--text-faint); font-size: 18px;
  line-height: 1; opacity: 0; transition: opacity .14s ease, transform .14s ease; transform: translateX(-3px);
}
[data-ir]:hover::after { opacity: 1; transform: translateX(0); }
[data-mock-action].row-card { cursor: pointer; }

/* Opções de resposta da pergunta de múltipla escolha */
.opcao-linha { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opcao-linha .op-key {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px;
  background: var(--surface-sunken); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}
.opcao-linha input { flex: 1; min-width: 0; }

/* ============================================================
   Central de ajuda — índice de categorias e página de categoria
   Cada categoria tem cor própria, injetada em --cat e --cat-soft.
   ============================================================ */

/* ---- Hero leve ---- */
.ajuda-hero {
  position: relative; text-align: center;
  border-radius: var(--radius-lg); padding: 40px 30px 34px; margin-bottom: 30px;
  background:
    radial-gradient(660px 240px at 18% -10%, #eef1ff 0%, rgba(238,241,255,0) 62%),
    radial-gradient(560px 220px at 84% 0%, #e6f7fb 0%, rgba(230,247,251,0) 60%),
    var(--surface);
  border: 1px solid var(--border);
}
.ajuda-hero .ah-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px 5px 9px; font-size: 11.6px; font-weight: 700; color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.ajuda-hero h1 { font-size: 30px; line-height: 1.16; letter-spacing: -.025em; margin-bottom: 10px; }
.ajuda-hero .ah-sub {
  font-size: 14px; line-height: 1.55; color: var(--text-muted);
  max-width: 520px; margin: 0 auto 22px;
}

.ajuda-busca { position: relative; max-width: 540px; margin: 0 auto; text-align: left; }
.ajuda-busca > .ic-svg {
  position: absolute; left: 16px; top: 15px; color: var(--text-faint); pointer-events: none;
}
.ajuda-busca input {
  width: 100%; padding: 14px 16px 14px 45px; font-size: 13.8px;
  border-radius: 13px; box-shadow: var(--shadow-sm);
}
.ajuda-busca input:focus { box-shadow: var(--shadow-brand); }

/* Resultados da busca, sobrepostos ao conteúdo */
.busca-res {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; display: none;
}
.busca-res.open { display: block; }
.busca-res .br-topo {
  padding: 9px 15px; font-size: 11.2px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-faint); background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.busca-res a {
  display: flex; align-items: center; gap: 11px; padding: 11px 15px;
  text-decoration: none; border-bottom: 1px solid var(--border); transition: background .12s ease;
}
.busca-res a:last-child { border-bottom: none; }
.busca-res a:hover { background: var(--surface-alt); }
.busca-res .br-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.busca-res { max-height: 396px; overflow-y: auto; }
.busca-res .br-txt { flex: 1; min-width: 0; }
.busca-res .br-p { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.busca-res .br-c { display: block; font-size: 11.4px; color: var(--text-faint); margin-top: 2px; }
.busca-res a > .ic-svg { color: var(--text-faint); flex-shrink: 0; }
.busca-res .br-vazio { padding: 18px 15px; font-size: 12.8px; color: var(--text-faint); text-align: center; }

/* ---- Atalhos ---- */
.ajuda-atalhos { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 20px; }
.ajuda-atalhos .aa-label {
  font-size: 11.8px; color: var(--text-faint); align-self: center; margin-right: 3px; font-weight: 600;
}
.ajuda-atalhos a {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 999px; padding: 6px 14px; font-size: 12.2px; text-decoration: none;
  transition: all .14s ease; box-shadow: var(--shadow-xs);
}
.ajuda-atalhos a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---- Grade de categorias ---- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 15px;
}
.cat-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 19px 18px 15px; text-decoration: none; box-shadow: var(--shadow-xs);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--cat);
  opacity: .85; transition: height .16s ease;
}
.cat-card::after {
  content: ""; position: absolute; right: -46px; top: -46px; width: 116px; height: 116px;
  border-radius: 50%; background: var(--cat-soft); opacity: .6; transition: transform .3s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--cat); }
.cat-card:hover::before { height: 5px; }
.cat-card:hover::after { transform: scale(1.18); }
.cat-card > * { position: relative; z-index: 1; }

.cat-card .cc-ic {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat-soft); color: var(--cat); font-size: 19px;
}
.cat-card .cc-t {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -.015em; margin-bottom: 5px;
}
.cat-card .cc-d { font-size: 12.6px; line-height: 1.5; color: var(--text-muted); flex: 1; margin-bottom: 15px; }
.cat-card .cc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.cat-card .cc-n { font-size: 11.6px; font-weight: 700; color: var(--text-faint); }
.cat-card .cc-ir {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.2px; font-weight: 700; color: var(--cat);
}
.cat-card .cc-ir .ic-svg { transition: transform .16s ease; font-size: 13px; }
.cat-card:hover .cc-ir .ic-svg { transform: translateX(3px); }

/* ---- Cabeçalho da página de categoria ---- */
.cat-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: 26px 28px; margin-bottom: 24px;
  background: linear-gradient(120deg, var(--cat-soft) 0%, var(--surface) 78%);
  border: 1px solid var(--border);
}
.cat-hero::after {
  content: ""; position: absolute; right: -70px; top: -80px; width: 220px; height: 220px;
  border-radius: 50%; background: var(--cat); opacity: .07;
}
.cat-hero > * { position: relative; z-index: 1; }
.cat-hero .ch-topo { display: flex; align-items: center; gap: 15px; }
.cat-hero .ch-ic {
  width: 50px; height: 50px; border-radius: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat); color: #fff; font-size: 23px; box-shadow: 0 8px 18px -8px var(--cat);
}
.cat-hero h1 { font-size: 23px; letter-spacing: -.022em; margin-bottom: 3px; }
.cat-hero .ch-d { font-size: 13.2px; color: var(--text-muted); line-height: 1.5; }
.cat-hero .ch-n {
  display: inline-block; margin-top: 13px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11.6px; font-weight: 700; color: var(--cat);
}

.migalha { display: flex; align-items: center; gap: 7px; font-size: 12.4px; margin-bottom: 15px; }
.migalha a { color: var(--text-faint); text-decoration: none; font-weight: 600; }
.migalha a:hover { color: var(--primary); }
.migalha .mg-sep { color: var(--border-strong); }
.migalha .mg-atual { color: var(--text); font-weight: 700; }

/* ---- Perguntas ---- */
.qa-lista { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.qa {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-xs); transition: border-color .14s ease, box-shadow .14s ease;
}
.qa:hover { border-color: var(--border-strong); }
.qa.aberta { border-color: var(--cat); box-shadow: var(--shadow-sm); }
.qa-p {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left;
  background: none; border: none; padding: 16px 17px; cursor: pointer; font-family: inherit;
}
.qa-num {
  width: 25px; height: 25px; flex-shrink: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat-soft); color: var(--cat); font-size: 11.4px; font-weight: 800;
  transition: background .14s ease, color .14s ease;
}
.qa.aberta .qa-num { background: var(--cat); color: #fff; }
.qa-t {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: -.012em; line-height: 1.4;
}
.qa-ch { color: var(--text-faint); flex-shrink: 0; transition: transform .18s ease; }
.qa.aberta .qa-ch { color: var(--cat); transform: rotate(180deg); }
.qa-r {
  padding: 0 17px 18px 55px; font-size: 13.4px; line-height: 1.66; color: var(--text-muted);
}
.qa-r p { margin: 0 0 11px; }
.qa-r p:last-child { margin-bottom: 0; }
.qa-r ul, .qa-r ol { margin: 0 0 11px; padding-left: 19px; }
.qa-r li { margin-bottom: 6px; }
.qa-r b { color: var(--text); font-weight: 600; }
.qa-r .destaque {
  display: block; margin: 12px 0; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--cat-soft); border-left: 3px solid var(--cat); color: var(--text);
  font-size: 12.9px; line-height: 1.55;
}

/* ---- Navegação entre categorias ---- */
.cat-outras { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cat-mini {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .14s ease;
}
.cat-mini:hover { border-color: var(--cat); transform: translateX(2px); box-shadow: var(--shadow-xs); }
.cat-mini .cm-ic {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cat-soft); color: var(--cat); font-size: 14px;
}
.cat-mini .cm-t { font-size: 12.8px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cat-mini .cm-n { font-size: 11px; color: var(--text-faint); }

.cat-passos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-passos a {
  flex: 1; min-width: 210px; display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); transition: all .14s ease;
}
.cat-passos a:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.cat-passos .cp-l { font-size: 11.2px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cat-passos .cp-t { font-size: 13px; font-weight: 600; color: var(--text); }
.cat-passos .cp-prox { justify-content: flex-end; text-align: right; }

@media (max-width: 640px) {
  .ajuda-hero { padding: 28px 18px 24px; }
  .ajuda-hero h1 { font-size: 24px; }
  .cat-grid { grid-template-columns: 1fr; }
  .qa-r { padding-left: 17px; }
  .cat-hero { padding: 20px 18px; }
  .cat-hero .ch-topo { flex-direction: column; align-items: flex-start; gap: 11px; }
}
.ic-svg.girar svg { transform: rotate(180deg); }

/* ============================================================
   Evento presencial — grade encontro × turma (§5.14.1)
   ============================================================ */
.gp-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }

.grade-presencial { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; }
.grade-presencial th,
.grade-presencial td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 10px; vertical-align: top; text-align: left; }
.grade-presencial tr:last-child th,
.grade-presencial tr:last-child td { border-bottom: none; }
.grade-presencial th:last-child,
.grade-presencial td:last-child { border-right: none; }

.grade-presencial thead th { background: var(--surface-sunken); font-size: 12px; }
.gp-corner { width: 232px; min-width: 232px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 800; }

.gp-enc { display: flex; align-items: center; gap: 4px; }
.gp-enc-nome { font-weight: 700; font-size: 13px; border: 1px solid transparent; background: transparent; padding: 5px 7px; border-radius: 8px; width: 100%; }
.gp-enc-nome:hover { border-color: var(--border-strong); background: var(--surface); }

.gp-turma { width: 232px; min-width: 232px; background: var(--surface-alt); }
.gp-turma-topo { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.gp-turma-nome { font-weight: 700; font-size: 13.2px; border: 1px solid transparent; background: transparent; padding: 5px 7px; border-radius: 8px; width: 100%; }
.gp-turma-nome:hover { border-color: var(--border-strong); background: var(--surface); }
.gp-turma-acts { display: flex; gap: 2px; flex-shrink: 0; }
.gp-lbl { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 9px 0 4px; }
.gp-turma select,
.gp-turma input { width: 100%; padding: 7px 9px; font-size: 12.5px; }

.grade-presencial td input { width: 100%; padding: 7px 9px; font-size: 12.5px; margin-bottom: 6px; }
.grade-presencial td input:last-child { margin-bottom: 0; }
.grade-presencial td input.gp-override { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }

.gp-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.gp-resumo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gp-kpi { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.gp-kpi b { font-size: 22px; line-height: 1.1; font-weight: 800; }
.gp-kpi span { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.gp-kpi.destaque { border-color: var(--primary); background: var(--primary-soft); }
.gp-kpi.destaque b { color: var(--primary); }
.gp-x { font-size: 17px; font-weight: 700; color: var(--text-faint); }

.gp-intros { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.gp-intros-tit { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

/* Texto introdutório do módulo, no construtor assíncrono (§5.10) */
.mb-intro { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.mb-intro label { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 5px; }
.mb-intro textarea { width: 100%; padding: 8px 10px; font-size: 12.5px; resize: vertical; }

@media (max-width: 760px) {
  .gp-corner, .gp-turma { width: 190px; min-width: 190px; }
}

/* Barra de contexto da sessão no check-in presencial (§5.14.2) */
.sessao-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--primary); border-radius: var(--radius-md);
  background: var(--primary-soft);
}
.sessao-bar .sb-ic { color: var(--primary); display: flex; flex-shrink: 0; }
.sb-campos { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 260px; }
.sb-campos label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.sb-campos select { padding: 7px 10px; font-size: 12.8px; background: var(--surface); min-width: 210px; }
.sb-atual { display: flex; flex-direction: column; text-align: right; flex-shrink: 0; }
.sb-atual b { font-size: 14px; line-height: 1.25; }
.sb-atual span { font-size: 11.8px; color: var(--text-muted); }

@media (max-width: 760px) {
  .sb-atual { text-align: left; }
  .sb-campos select { min-width: 0; width: 100%; }
  .sb-campos label { flex: 1 1 100%; }
}

/* ============================================================
   Matrículas e áreas de atuação (§4.5, §4.6)
   A área é atributo da matrícula: cada matrícula carrega as suas.
   ============================================================ */
.matricula-lista { display: grid; gap: 8px; }
.matricula-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-alt);
}
.matricula-num {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px; font-weight: 700; flex-shrink: 0; min-width: 108px;
}
.matricula-num svg { color: var(--text-faint); }
.matricula-areas { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.matricula-efetiva {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.matricula-efetiva > span:first-child {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint);
}

/* Várias matrículas dentro de uma célula de listagem */
.dl-mats { display: grid; gap: 6px; }
.dl-mat .dl-mono { display: block; }
.dl-mat-areas { font-size: 11px; color: var(--text-faint); line-height: 1.35; }

/* Botão de certificado na lista de cursos concluídos (§5.16) */
.cert-btn { white-space: nowrap; flex-shrink: 0; }
/* O título do curso continua legível: é o botão que quebra, não a linha.
   Só a partir do tablet — no celular o cartão inteiro quebra em linhas. */
@media (min-width: 861px) { .row-card .rc-main { min-width: 190px; } }
@media (max-width: 900px) {
  .cert-btn { white-space: normal; }
  .row-card { flex-wrap: wrap; }
  .row-card .rc-main { flex: 1 1 100%; min-width: 0; }
}
.cert-btn.retido { border-color: var(--warning, #d08700); color: var(--warning, #d08700); }
.cert-btn.retido svg { color: inherit; }
.cert-btn.aguardando { color: var(--text-faint); }
.cert-btn.is-disabled { cursor: default; opacity: .75; pointer-events: none; }

/* Bloco de matrícula no cadastro de usuário (§4.5, §4.6) */
.mat-bloco {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 12px; background: var(--surface-alt);
}
.mat-bloco-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mat-bloco-head b { font-size: 13px; }
.mat-bloco-head .icon-btn { margin-left: auto; }
.mat-bloco .field { margin-bottom: 14px; }

/* Marcador de campo exibido mascarado na ativação (§5.3) */
.dp-mask {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 999px; background: var(--warning-bg); color: var(--warning);
}

/* Turma, agenda de encontros e presença na área do cursista (§5.16, §5.14) */
.presenca-resumo { margin-top: 14px; }
.presenca-resumo .pr-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}
.presenca-resumo .pr-top b { font-size: 14px; color: var(--text); }

.agenda-turma { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.agenda-tit {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint); margin-bottom: 9px;
}
.agenda-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface);
}
.agenda-item + .agenda-item { margin-top: 6px; }
.agenda-item.feito { background: var(--surface-alt); }
.agenda-item .ag-ic { display: flex; flex-shrink: 0; color: var(--text-faint); }
.agenda-item.feito .ag-ic { color: var(--success, #17795e); }
.agenda-item .ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.agenda-item .ag-main b { font-size: 12.6px; font-weight: 600; }
.agenda-item .ag-main span { font-size: 11.6px; color: var(--text-faint); }

@media (max-width: 560px) {
  .agenda-item { flex-wrap: wrap; }
  .agenda-item .ag-main { flex: 1 1 100%; }
}

/* ============================================================
   Documento do certificado — modelo único da rede (§5.20)
   Nome, curso, carga, data, UUID em linha fina e QR de validação.
   Sem matrícula e sem CPF.
   ============================================================ */
.qr-box.sm { width: 92px; height: 92px; padding: 6px; gap: 1.5px; }

.cert-doc {
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-md);
  background: #fff; color: #12162c;
  padding: 30px 34px 22px; text-align: center;
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px var(--border);
}
.cert-doc .cd-brasao { color: var(--primary); display: flex; justify-content: center; margin-bottom: 6px; }
.cert-doc .cd-brasao svg { width: 34px; height: 34px; }
.cert-doc .cd-orgao {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: #5a6076;
}
.cert-doc .cd-titulo {
  font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 18px;
}
.cert-doc .cd-texto { font-size: 12.6px; color: #4c5266; margin: 0 0 6px; }
.cert-doc .cd-nome { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
.cert-doc .cd-curso { font-size: 16px; font-weight: 700; color: var(--primary-dark, var(--primary)); margin: 4px 0 12px; }

.cert-doc .cd-assinatura { margin: 26px auto 0; max-width: 250px; display: grid; gap: 2px; }
.cert-doc .cd-linha { height: 1px; background: #c8ccda; margin-bottom: 7px; }
.cert-doc .cd-assinatura b { font-size: 12.4px; }
.cert-doc .cd-assinatura span { font-size: 11px; color: #6b7186; }

.cert-doc .cd-rodape {
  margin-top: 26px; padding-top: 14px; border-top: 1px solid #e6e8f0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left;
}
.cert-doc .cd-uuid { display: grid; gap: 2px; min-width: 0; }
.cert-doc .cd-uuid > span {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #8a90a4;
}
/* "Linha fina": o UUID é alternativa de digitação, não o destaque do rodapé */
.cert-doc .cd-uuid b { font-size: 11px; font-weight: 500; color: #4c5266; word-break: break-all; }
.cert-doc .cd-uuid em { font-size: 10.5px; font-style: normal; color: #8a90a4; }
.cert-doc .cd-rodape .qr-box { flex-shrink: 0; border-color: #e6e8f0; }

@media (max-width: 560px) {
  .cert-doc { padding: 22px 18px 18px; }
  .cert-doc .cd-rodape { flex-direction: column; align-items: flex-start; }
}

/* Rótulo do modo da pesquisa, visível ao respondente antes de começar (§5.18) */
.modo-pesquisa {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; margin-bottom: 16px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: 13.2px; line-height: 1.4;
}
.modo-pesquisa .ic-svg { flex-shrink: 0; }
.modo-pesquisa.anonima {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark, var(--primary));
}
.modo-pesquisa.identificada {
  background: var(--warning-bg); border-color: var(--warning); color: var(--warning);
}

/* Texto introdutório do módulo e do item de conteúdo (§5.10) */
.intro-box {
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-md); background: var(--surface); padding: 15px 18px;
}
.intro-tag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--primary); margin-bottom: 7px;
}
.intro-box p { font-size: 13.2px; line-height: 1.55; color: var(--text-muted); margin: 0 0 8px; }
.intro-box p:last-child { margin-bottom: 0; }
.intro-box ul { margin: 0; padding-left: 20px; }
.intro-box li { font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.intro-box a { color: var(--primary); }
.intro-box.compacta { border-left-color: var(--border-strong, var(--border)); }
.intro-box.compacta .intro-tag { color: var(--text-faint); }
.intro-nota {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 11.8px; line-height: 1.5; color: var(--text-faint);
}

/* Turma do profissional no card do catálogo presencial (§5.9, §5.14.1) */
.card-turma {
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-alt);
}
.card-turma .ct-tit {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.4px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.card-turma .ct-linha {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.8px; color: var(--text-muted); line-height: 1.6;
}
.card-turma .ct-tit svg, .card-turma .ct-linha svg { width: 13px; height: 13px; color: var(--text-faint); flex-shrink: 0; }
.card-turma .ct-nota {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--text-faint);
}

/* ---------------- Retenção e pedido de exclusão (§5.23) ---------------- */
/* Duas colunas lado a lado porque a regra é uma comparação: o que sai
   contra o que fica. Empilhadas, o contraste se perde. */
.retencao-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.retencao-col {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 15px 17px;
}
.retencao-h {
  display: flex; align-items: center; gap: 7px; margin-bottom: 11px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--danger);
}
.retencao-h.alt { color: var(--text-muted); }
.retencao-h svg { width: 14px; height: 14px; }
.retencao-lista { margin: 0 0 10px; padding-left: 18px; }
.retencao-lista:last-child { margin-bottom: 0; }
.retencao-lista li { font-size: 12.8px; line-height: 1.55; color: var(--text); margin-bottom: 4px; }

@media (max-width: 720px) {
  .retencao-grid { grid-template-columns: 1fr; }
}
