/* ============================================================
   SEEGFY — Design System
   Plataforma SaaS de Gestão de Treinamentos SST
   ============================================================ */

:root {
  --primary: #2456e6;
  --primary-600: #1d46c4;
  --primary-soft: #e8eefc;
  --sidebar-bg: #0d1b2e;
  --sidebar-hover: #16283f;
  --sidebar-active: #1d3453;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e4e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-strong: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --green: #059669;   --green-soft: #d9f2e5;
  --amber: #b45309;   --amber-soft: #fdf0d5;
  --orange: #c2410c;  --orange-soft: #ffe8d9;
  --red: #dc2626;     --red-soft: #fde5e5;
  --blue: #2563eb;    --blue-soft: #e3edfd;
  --purple: #7c3aed;  --purple-soft: #efe9fd;
  --cyan: #0e7490;    --cyan-soft: #d8f3f9;
  --gray: #64748b;    --gray-soft: #eef1f5;
  --gold: #b8860b;    --gold-soft: #fdf3d1;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.16);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Inter", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { color: var(--text-strong); font-weight: 650; }
svg { display: inline-block; vertical-align: middle; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3ccda; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ LAYOUT ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; min-width: 250px;
  background: var(--sidebar-bg);
  color: #cbd8ea;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  transition: margin-left .25s ease;
}
.sidebar.collapsed { margin-left: -250px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #2456e6, #4f8df9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(36,86,230,.4);
}
.brand-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: #7d93b5; letter-spacing: .4px; text-transform: uppercase; }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.side-nav::-webkit-scrollbar-thumb { border-color: var(--sidebar-bg); background: #2c3f5c; }
.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: #5f7594; padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; margin: 1px 0;
  border-radius: 8px; cursor: pointer;
  color: #b9c8dd; font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.nav-item .nav-count {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: rgba(255,255,255,.12); color: #dce6f5;
  border-radius: 20px; padding: 1px 7px;
}
.nav-item .nav-count.hot { background: #dc2626; color: #fff; }

.side-footer {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px; color: #5f7594;
}

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

.topbar {
  height: 60px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.burger {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.burger:hover { background: var(--gray-soft); }

.global-search { position: relative; flex: 1; max-width: 430px; }
.global-search input {
  width: 100%; padding: 8px 12px 8px 36px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); font-family: inherit; font-size: 13px; color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
}
.global-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.global-search .search-ic { position: absolute; left: 11px; top: 8px; color: var(--muted-2); }
.search-results {
  position: absolute; top: 42px; left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; z-index: 60;
}
.search-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted-2); padding: 10px 14px 4px; }
.search-hit { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.search-hit:hover { background: var(--primary-soft); }
.search-hit .hit-sub { color: var(--muted); font-size: 11.5px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sim-clock {
  font-size: 11.5px; color: var(--muted); background: var(--gray-soft);
  padding: 5px 11px; border-radius: 20px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; border: 2px solid #fff;
}

.profile-switch {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 4px 10px 4px 4px; background: #fff; cursor: pointer;
}
.profile-switch:hover { border-color: var(--border-strong); }
.profile-switch select {
  border: none; background: transparent; font-family: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--text-strong); cursor: pointer; outline: none; max-width: 210px;
}
.profile-role { font-size: 10.5px; color: var(--muted); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2456e6, #6d9bf5);
  color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar.tone-green { background: linear-gradient(135deg,#059669,#34d399); }
.avatar.tone-purple { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.avatar.tone-orange { background: linear-gradient(135deg,#c2410c,#fb923c); }
.avatar.tone-cyan { background: linear-gradient(135deg,#0e7490,#22d3ee); }

.content { padding: 24px 26px 60px; max-width: 1560px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; letter-spacing: -.2px; }
.page-head .page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head .page-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ============ COMPONENTES ============ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px 0;
}
.card-head h3 { font-size: 14.5px; }
.card-head .card-sub { font-size: 12px; color: var(--muted); }
.card-head .card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 15px 18px 17px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  cursor: default; transition: transform .12s, box-shadow .12s;
}
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.1); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi-ic {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.kpi-value { font-size: 24px; font-weight: 750; color: var(--text-strong); letter-spacing: -.5px; line-height: 1.1; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.kpi-sub .up { color: var(--green); font-weight: 700; }
.kpi-sub .down { color: var(--red); font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  padding: 2.5px 9px; border-radius: 20px; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.outline { background: #fff; border: 1px solid currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gray-soft); border: 1px solid var(--border);
  color: var(--text); font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 8px; margin: 2px 3px 2px 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .12s, border .12s, transform .06s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(36,86,230,.3); }
.btn.primary:hover { background: var(--primary-600); }
.btn.ghost { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.soft:hover { background: #d9e4fb; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.success { background: var(--green); color: #fff; }
.btn.success:hover { background: #047857; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.xs { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Tabelas */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: #f8fafc; white-space: nowrap;
  position: sticky; top: 0;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: #f6f8fc; }
.tbl tbody tr.row-click { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .cell-main { font-weight: 600; color: var(--text-strong); }
.tbl .cell-sub { font-size: 11.5px; color: var(--muted); }
.tbl td.num, .tbl th.num { text-align: right; }

/* Filtros */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.f-field { display: flex; flex-direction: column; gap: 3px; }
.f-field label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.input, .select, textarea.input {
  padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-family: inherit; font-size: 12.5px; color: var(--text); background: #fff;
  outline: none; min-width: 120px;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.select { cursor: pointer; }

/* Abas */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; border: none; background: none; font-family: inherit;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .tab-n {
  font-size: 10.5px; background: var(--gray-soft); color: var(--muted);
  border-radius: 12px; padding: 0 7px; font-weight: 700;
}
.tab.active .tab-n { background: var(--primary-soft); color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .18s ease; }

/* Progresso */
.progress { height: 8px; background: var(--gray-soft); border-radius: 10px; overflow: hidden; }
.progress .bar { height: 100%; border-radius: 10px; background: var(--primary); transition: width .5s ease; }
.progress.lg { height: 12px; }
.progress .bar.green { background: var(--green); }
.progress .bar.amber { background: #d97706; }
.progress .bar.red { background: var(--red); }
.progress .bar.purple { background: var(--purple); }
.progress .bar.gold { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row .pct { font-size: 12px; font-weight: 700; color: var(--text-strong); min-width: 38px; text-align: right; }

/* Modais */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,27,46,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px; z-index: 100; animation: fadeIn .15s ease;
  backdrop-filter: blur(2px); overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; animation: slideUp .2s ease;
  display: flex; flex-direction: column; max-height: 88vh;
}
.modal.wide { max-width: 860px; }
.modal.xl { max-width: 1060px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 22px 13px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-head .modal-sub { font-size: 12px; color: var(--muted); }
.modal-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.modal-close:hover { background: var(--gray-soft); color: var(--text); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--border); background: #fafbfd;
  border-radius: 0 0 16px 16px;
}

/* Formulários */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 12px; font-weight: 650; color: var(--text-strong); }
.form-field .hint { font-size: 11px; color: var(--muted); }
.form-field .input, .form-field .select { width: 100%; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; }
.check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Toasts */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #0f172a; color: #f1f5f9; border-radius: 11px;
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 400px; animation: toastIn .25s ease;
}
.toast .t-ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.toast.success .t-ic { background: rgba(5,150,105,.25); color: #34d399; }
.toast.error .t-ic { background: rgba(220,38,38,.25); color: #f87171; }
.toast.info .t-ic { background: rgba(59,130,246,.25); color: #93c5fd; }
.toast.warn .t-ic { background: rgba(217,119,6,.25); color: #fbbf24; }
.toast.out { animation: toastOut .3s ease forwards; }

/* Estado vazio */
.empty {
  text-align: center; padding: 44px 24px; color: var(--muted);
}
.empty .empty-ic {
  width: 58px; height: 58px; border-radius: 16px; background: var(--gray-soft);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
  color: var(--muted-2);
}
.empty h4 { font-size: 15px; margin-bottom: 5px; }
.empty p { font-size: 12.5px; max-width: 340px; margin: 0 auto 14px; }

/* Skeleton / loading */
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%);
  background-size: 200% 100%; animation: shimmer 1.1s infinite;
  border-radius: 8px; min-height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Listas */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #f6f8fc; }
.list-row.clickable { cursor: pointer; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; color: var(--text-strong); }
.list-sub { font-size: 11.5px; color: var(--muted); }

/* Calendário */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-size: 17px; font-weight: 700; color: var(--text-strong); min-width: 190px; }
.cal-title::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  min-height: 96px; padding: 6px 7px; font-size: 11px; position: relative;
}
.cal-day.other { background: transparent; border-style: dashed; opacity: .55; }
.cal-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-day .d-num { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-day.today .d-num { color: var(--primary); }
.cal-ev {
  display: block; border-radius: 6px; padding: 2.5px 6px; margin-bottom: 3px;
  font-size: 10.3px; font-weight: 600; cursor: pointer; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid;
}
.cal-ev.blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.cal-ev.green { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.cal-ev.purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple); }
.cal-ev.orange { background: var(--orange-soft); color: var(--orange); border-color: var(--orange); }
.cal-ev.red { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.cal-ev.cyan { background: var(--cyan-soft); color: var(--cyan); border-color: var(--cyan); }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-col { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 300px; padding: 8px; }
.week-col.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.week-col h5 { font-size: 11px; text-transform: capitalize; color: var(--muted); margin-bottom: 8px; text-align: center; }
.week-ev { border-radius: 8px; padding: 7px 9px; margin-bottom: 7px; font-size: 11px; cursor: pointer; border-left: 3px solid; }
.week-ev b { display: block; font-size: 11.5px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 13px; align-items: start; }
.kb-col { background: #eef1f6; border-radius: 12px; padding: 10px; }
.kb-col-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; padding: 3px 6px 9px; color: var(--text-strong); }
.kb-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer; font-size: 12px;
  box-shadow: var(--shadow); transition: transform .1s;
}
.kb-card:hover { transform: translateY(-2px); }

/* Certificado */
.cert-sheet {
  background: linear-gradient(160deg, #fdfefe 0%, #f4f7fb 100%);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  position: relative; padding: 38px 44px; text-align: center;
}
.cert-sheet::before {
  content: ""; position: absolute; inset: 10px; border: 2px solid #d3ddf0; border-radius: 10px; pointer-events: none;
}
.cert-sheet::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: linear-gradient(90deg, #2456e6, #4f8df9, #059669);
}
.cert-org { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cert-title { font-size: 27px; font-weight: 800; letter-spacing: 2px; color: #0d1b2e; margin: 8px 0 2px; font-variant: small-caps; }
.cert-name { font-size: 23px; font-weight: 700; color: var(--primary); margin: 12px 0 2px; }
.cert-line { width: 220px; height: 1px; background: var(--border-strong); margin: 6px auto 12px; }
.cert-text { font-size: 13px; color: var(--text); max-width: 520px; margin: 0 auto 16px; }
.cert-meta { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 18px; }
.cert-meta b { display: block; color: var(--text-strong); font-size: 13px; }
.cert-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 8px; }
.cert-sign { text-align: center; font-size: 11px; color: var(--muted); }
.cert-sign .sig { font-family: "Segoe Script", cursive; font-size: 19px; color: #1e3a8a; margin-bottom: 2px; }
.cert-sign .sig-line { width: 170px; height: 1px; background: var(--border-strong); margin: 2px auto 5px; }
.cert-qr { text-align: center; font-size: 9.5px; color: var(--muted); }

/* EAD / Player */
.player-shell { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.video-frame {
  background: linear-gradient(140deg, #0d1b2e 0%, #16283f 60%, #1d3453 100%);
  border-radius: 14px; aspect-ratio: 16/9; position: relative;
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff;
}
.video-frame .vf-play {
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .15s, background .15s; color: #fff;
}
.video-frame .vf-play:hover { transform: scale(1.08); background: rgba(255,255,255,.24); }
.video-frame .vf-info { position: absolute; left: 18px; bottom: 40px; right: 18px; }
.video-frame .vf-title { font-size: 15px; font-weight: 700; }
.video-frame .vf-sub { font-size: 11.5px; color: #9db4d4; }
.video-frame .vf-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: rgba(0,0,0,.4); display: flex; align-items: center; padding: 0 12px; gap: 10px; font-size: 10.5px; color: #cbd8ea; }
.video-frame .vf-track { flex: 1; height: 5px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.video-frame .vf-track .vf-prog { height: 100%; background: #4f8df9; border-radius: 4px; transition: width .3s linear; }
.video-frame.playing .vf-play { opacity: 0; pointer-events: none; }
.video-frame .vf-badge { position: absolute; top: 14px; left: 14px; }

.module-list { display: flex; flex-direction: column; }
.mod-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-strong); }
.lesson-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; cursor: pointer;
}
.lesson-row:hover { background: #f6f8fc; }
.lesson-row.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.lesson-row.locked { opacity: .5; cursor: not-allowed; }
.lesson-status {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-strong); color: var(--muted-2); font-size: 10px;
}
.lesson-status.done { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-status.current { border-color: var(--primary); color: var(--primary); }

/* Gamificação */
.xp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff;
  border-radius: 20px; padding: 4px 13px; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(245,158,11,.35);
}
.medal {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 6px;
}
.medal.gold { background: linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow: 0 4px 12px rgba(245,158,11,.4); }
.medal.silver { background: linear-gradient(135deg,#e2e8f0,#94a3b8); }
.medal.bronze { background: linear-gradient(135deg,#fdba74,#c2410c); }
.medal.locked { background: var(--gray-soft); filter: grayscale(1); opacity: .5; }
.medal-item { text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 600; width: 84px; }

.rank-row { display: flex; align-items: center; gap: 11px; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: var(--primary-soft); border-radius: 10px; }
.rank-pos { width: 28px; height: 28px; border-radius: 8px; background: var(--gray-soft); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.rank-pos.p1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #fff; }
.rank-pos.p2 { background: linear-gradient(135deg,#e2e8f0,#94a3b8); color: #fff; }
.rank-pos.p3 { background: linear-gradient(135deg,#fdba74,#c2410c); color: #fff; }

.streak-flame { font-size: 30px; }
.mission-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.mission-row:last-child { border: none; }

/* Prova */
.quiz-q { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 17px 19px; margin-bottom: 13px; }
.quiz-q .q-num { font-size: 11px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; display: flex; gap: 8px; align-items: center; }
.quiz-q .q-text { font-size: 13.5px; font-weight: 600; color: var(--text-strong); margin-bottom: 11px; }
.q-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 9px; margin-bottom: 7px;
  cursor: pointer; font-size: 13px; transition: border .12s, background .12s;
}
.q-opt:hover { border-color: var(--primary); background: #fafbfe; }
.q-opt.sel { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.q-opt.correct { border-color: var(--green); background: var(--green-soft); }
.q-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.q-opt .opt-key {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  flex-shrink: 0; color: var(--muted);
}
.q-opt.sel .opt-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-opt.correct .opt-key { background: var(--green); border-color: var(--green); color: #fff; }
.q-opt.wrong .opt-key { background: var(--red); border-color: var(--red); color: #fff; }
.q-img { border-radius: 10px; border: 1px solid var(--border); margin-bottom: 11px; max-width: 420px; width: 100%; }
.q-feedback { border-radius: 9px; padding: 10px 13px; font-size: 12.5px; margin-top: 9px; }
.q-feedback.ok { background: var(--green-soft); color: #065f46; }
.q-feedback.nok { background: var(--red-soft); color: #991b1b; }

.exam-timer {
  font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 800;
  color: var(--text-strong); display: flex; align-items: center; gap: 8px;
}
.exam-timer.low { color: var(--red); animation: pulse 1s infinite; }
.exam-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.exam-nav button {
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border-strong);
  background: #fff; font-weight: 700; font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit;
}
.exam-nav button.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.exam-nav button.current { background: var(--primary); border-color: var(--primary); color: #fff; }

.result-hero { text-align: center; padding: 34px 20px; }
.result-hero .rh-ic { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.result-hero .rh-ic.pass { background: var(--green-soft); color: var(--green); animation: pop .4s ease; }
.result-hero .rh-ic.fail { background: var(--red-soft); color: var(--red); }
.result-hero h2 { font-size: 22px; margin-bottom: 6px; }
.result-hero .rh-score { font-size: 40px; font-weight: 800; letter-spacing: -1px; }

/* Timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; font-size: 12.5px; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--primary);
}
.tl-item.green::before { border-color: var(--green); }
.tl-item.red::before { border-color: var(--red); }
.tl-item.amber::before { border-color: #d97706; }
.tl-item.gray::before { border-color: var(--muted-2); }
.tl-date { font-size: 11px; color: var(--muted); }

/* Etapas (stepper) */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px;
  color: var(--muted); background: #fff; flex-shrink: 0;
}
.step.done .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.step-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.step.current .step-label { color: var(--text-strong); }
.step-line { width: 44px; height: 2px; background: var(--border-strong); margin: 0 10px; }
.step.done + .step-line, .step-line.done { background: var(--green); }

/* Notificações */
.notif-row { display: flex; gap: 13px; padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-row:hover { background: #f6f8fc; }
.notif-row.unread { background: #f4f8ff; }
.notif-row.unread:hover { background: #ecf3fe; }
.notif-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-title { font-weight: 650; font-size: 13px; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.notif-title .unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.notif-text { font-size: 12.5px; color: var(--muted); }
.notif-time { font-size: 11px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }

/* Alertas */
.alert {
  display: flex; gap: 11px; padding: 12px 15px; border-radius: 11px;
  font-size: 12.5px; margin-bottom: 9px; border: 1px solid;
}
.alert.red { background: var(--red-soft); border-color: #f5c2c2; color: #7f1d1d; }
.alert.amber { background: var(--amber-soft); border-color: #f0dcae; color: #713f12; }
.alert.blue { background: var(--blue-soft); border-color: #c3d8f7; color: #1e3a8a; }
.alert.green { background: var(--green-soft); border-color: #b1e3cb; color: #064e3b; }
.alert b { display: block; }

/* Assinatura simulada */
.sig-box {
  border: 1.5px dashed var(--border-strong); border-radius: 9px; height: 40px; min-width: 130px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Segoe Script", cursive; color: #1e3a8a; font-size: 15px; background: #fdfdfe;
}
.sig-box.empty { color: var(--muted-2); font-family: var(--font); font-size: 11px; font-style: italic; }

/* Login / troca de perfil hero */
.profile-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.profile-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 20px; cursor: pointer; transition: border .15s, transform .12s, box-shadow .15s; text-align: left;
  font-family: inherit;
}
.profile-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 26px rgba(36,86,230,.14); }

/* Util */
.flex { display: flex; } .aic { align-items: center; } .jcb { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 22px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 22px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .xs { font-size: 11px; }
.bold { font-weight: 700; } .strong { color: var(--text-strong); font-weight: 650; }
.tar { text-align: right; } .tac { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.link-btn { background: none; border: none; color: var(--primary); font-weight: 600; font-size: inherit; cursor: pointer; font-family: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.ic-tone-blue { background: var(--blue-soft); color: var(--blue); }
.ic-tone-green { background: var(--green-soft); color: var(--green); }
.ic-tone-amber { background: var(--amber-soft); color: #d97706; }
.ic-tone-orange { background: var(--orange-soft); color: var(--orange); }
.ic-tone-red { background: var(--red-soft); color: var(--red); }
.ic-tone-purple { background: var(--purple-soft); color: var(--purple); }
.ic-tone-cyan { background: var(--cyan-soft); color: var(--cyan); }
.ic-tone-gray { background: var(--gray-soft); color: var(--gray); }
.ic-tone-gold { background: var(--gold-soft); color: #d97706; }

/* Animações */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(.5); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes confetti { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(240px) rotate(340deg); opacity: 0; } }
.confetti-piece { position: absolute; width: 9px; height: 9px; border-radius: 2px; animation: confetti 1.6s ease-in forwards; }

.page-enter { animation: fadeIn .2s ease; }

/* Impressão de certificado */
@media print {
  .sidebar, .topbar, .page-actions, .modal-foot, #toast-root { display: none !important; }
}

/* ============ RESPONSIVO ============ */
@media (max-width: 1180px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .player-shell { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; margin-left: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(13,27,46,.4); }
  .sidebar.collapsed { margin-left: 0; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 50px; }
  .sim-clock { display: none; }
  .cal-day { min-height: 70px; }
  .cert-sheet { padding: 26px 18px; }
  .cert-footer { flex-direction: column; align-items: center; }
}

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.login-card form { display: grid; gap: 14px; }
.login-erro { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.login-card .brand-name { color: var(--text-strong); }
.login-card .brand-sub { color: var(--muted); }
.profile-name { font-size: 13px; font-weight: 600; }
