:root {
  --navy: #16233f;
  --navy-2: #253554;
  --orange: #ef6c2f;
  --orange-dark: #b8430f;
  --green: #18794e;
  --red: #b42318;
  --blue: #245f9e;
  --ink: #182033;
  --muted: #667085;
  --line: #e3e7ee;
  --soft: #f5f7fa;
  --paper: #ffffff;
  --shadow: 0 14px 35px rgba(22, 35, 63, 0.1);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(239, 108, 47, 0.07), transparent 26rem),
    var(--soft);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 18px clamp(20px, 4vw, 60px);
  color: #fff;
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
}

.brand { display: flex; align-items: center; gap: 20px; }
.brand img {
  width: 154px;
  max-height: 56px;
  object-fit: contain;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
}
.brand p, .brand h1 { margin: 0; }
.brand p { margin-bottom: 3px; color: #ccd5e5; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.brand h1 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 700; }

.header-actions { display: flex; gap: 10px; }
.header-actions .button-ghost { color: #fff; border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.08); }
.file-button input { display: none; }
.profile-badge { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 8px 12px; color: #ccd5e5; font-size: .82rem; }
.profile-badge strong { margin-left: 5px; color: #fff; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  padding: 10px clamp(20px, 4vw, 60px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
}
.settings-menu { position: relative; margin-left: auto; }
.settings-items { position: absolute; right: 0; top: 100%; z-index: 25; min-width: 225px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.settings-items .tab { display: block; width: 100%; text-align: left; }
.advanced-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.instructor-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.instructor-team-grid label { min-width: 0; }
#replaceInstructorDialog .check-label { padding-top: 0; }

.tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 17px;
  color: #475467;
  background: transparent;
  font-weight: 650;
}
.tab:hover { background: #f1f4f8; color: var(--navy); }
.tab.is-active { color: var(--navy); background: #e9edf4; }
.tab-primary { margin-left: auto; color: #fff; background: var(--orange); }
.tab-primary:hover, .tab-primary.is-active { color: #fff; background: var(--orange-dark); }

main { width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 60px) 72px; }
.view { display: none; }
.view.is-active { display: block; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-heading h2 { margin: 3px 0 5px; font-size: clamp(1.6rem, 2.4vw, 2.25rem); letter-spacing: -0.03em; }
.page-heading p { margin: 0; color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
  text-decoration: none;
  transition: 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--orange); box-shadow: 0 8px 18px rgba(239, 108, 47, 0.22); }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { color: var(--navy); border-color: #cbd2dc; background: #fff; }
.button-ghost { color: #344054; border-color: #d0d5dd; background: transparent; }
.full-width { width: 100%; }
.text-button { border: 0; padding: 0; color: var(--blue); background: transparent; font-weight: 700; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #475467; background: #f2f4f7; font-size: 1.5rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 6px 20px rgba(22,35,63,0.045); }
.stat-card p { margin: 0 0 7px; color: var(--muted); font-size: 0.88rem; }
.stat-card strong { display: block; color: var(--navy); font-size: 1.8rem; letter-spacing: -0.03em; }
.stat-card small { color: var(--muted); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.compact-panel { padding: 20px; overflow: visible; }
.toolbar { display: flex; align-items: end; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.toolbar .search-field { flex: 1; }

label { display: grid; gap: 7px; color: #344054; font-size: 0.86rem; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd5df;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: #6a8fba; box-shadow: 0 0 0 3px rgba(36,95,158,0.12); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 18px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.data-table th { color: #667085; background: #fff; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.data-table td { font-size: 0.91rem; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.actions-column { width: 330px; text-align: right !important; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mini-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d6dbe3; border-radius: 8px; padding: 7px 10px; color: #344054; background: #fff; font-size: 0.81rem; font-weight: 700; text-decoration: none; }
.mini-button.primary { color: #fff; border-color: var(--orange); background: var(--orange); }
.mini-button.danger { color: var(--red); }

.primary-cell strong { display: block; color: var(--navy); }
.primary-cell small { display: block; max-width: 580px; margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-cell strong, .date-cell small { display: block; white-space: nowrap; }
.date-cell small { margin-top: 3px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 4px 10px; font-size: 0.76rem; font-weight: 750; }
.badge-upcoming, .badge-active { color: #075e40; background: #dcfae6; }
.badge-today { color: #92400e; background: #fef3c7; }
.badge-past, .badge-inactive { color: #475467; background: #eef1f5; }
.badge-complete { color: #10643f; background: #dff4e9; }
.badge-cancelled { color: #8b2525; background: #fde9e7; }
.cancel-reason { max-width: 260px; overflow-wrap: anywhere; color: #667085; }
.team-pill { display: inline-grid; place-items: center; min-width: 44px; min-height: 30px; border-radius: 8px; color: var(--navy); background: #e9edf4; font-weight: 800; }

.empty-state { padding: 56px 24px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }

.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; padding: 20px; }
.topic-card { display: grid; grid-template-rows: auto auto 1fr auto auto; min-height: 240px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, #fff, #fbfcfd); }
.topic-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topic-card .topic-discipline { color: var(--orange-dark); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.topic-card h3 { margin: 9px 0 10px; color: var(--navy); font-size: 1rem; line-height: 1.4; white-space: pre-line; }
.topic-card p { margin: 0; color: #5a6577; font-size: 0.86rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.topic-card footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.topic-card footer span { color: var(--muted); font-size: 0.8rem; }
.topic-team-progress { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.topic-team-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d8e0eb; border-radius: 999px; padding: 5px 9px; background: #f7f9fc; }
.topic-team-item strong { color: var(--navy); font-size: .76rem; }
.topic-team-item small { color: var(--muted); font-size: .68rem; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.pagination-buttons { display: flex; gap: 8px; }
.pagination button:disabled { cursor: not-allowed; opacity: 0.45; }

.generator-layout { display: grid; grid-template-columns: minmax(310px, 390px) minmax(700px, 1fr); align-items: start; gap: 24px; }
.generator-controls { display: grid; gap: 18px; position: sticky; top: 76px; }
.generator-controls .panel { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 42px; padding-top: 24px; }
.check-label input { width: 18px; height: 18px; }
.participant-panel { min-height: 300px; }
.section-title-row { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.section-title-row h3, .section-title-row p { margin: 0; }
.section-title-row p { margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.participant-search { margin-top: 14px; }
.participant-list { display: grid; gap: 4px; max-height: 330px; margin: 12px 0 16px; overflow: auto; }
.participant-item { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 9px 8px; border-radius: 8px; }
.participant-item:hover { background: #f6f8fb; }
.participant-item input { width: 17px; height: 17px; margin-top: 2px; }
.participant-item strong { display: block; color: #26334c; font-size: 0.86rem; }
.participant-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.76rem; }

.print-preview { display: grid; gap: 24px; min-width: 0; }
.attendance-page {
  width: 100%;
  aspect-ratio: 210 / 297;
  padding: 7mm;
  color: #000;
  background: #fff;
  border: 1px solid #d3d8e0;
  box-shadow: 0 18px 50px rgba(22,35,63,0.16);
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(7px, 0.68vw, 10px);
}
.form-header { display: grid; grid-template-columns: 25% 50% 25%; min-height: 54px; border: 1px solid #000; }
.form-header > div { display: grid; place-items: center; padding: 5px 8px; text-align: center; }
.form-header > div + div { border-left: 1px solid #000; }
.form-logo img { width: 150px; max-width: 88%; }
.form-title strong { display: block; font-size: 1.32em; }
.form-title span { display: block; margin-top: 5px; font-size: 1.05em; font-weight: 700; }
.form-code { align-content: center; justify-items: start !important; text-align: left !important; line-height: 1.45; }
.form-grid-table { display: grid; border-left: 1px solid #000; border-right: 1px solid #000; }
.form-row { display: grid; min-height: 24px; border-bottom: 1px solid #000; }
.form-row > div { padding: 4px 6px; border-right: 1px solid #000; }
.form-row > div:last-child { border-right: 0; }
.title-row { grid-template-columns: 68% 32%; min-height: 38px; }
.frequency-row { grid-template-columns: 30% 22% 23% 25%; }
.legend-row { grid-template-columns: 58% 17% 25%; font-size: 0.86em; }
.details-row { grid-template-columns: 25% 14% 16% 13% 32%; }
.consent-row { display: block; min-height: 20px; padding: 4px 6px; border: 1px solid #000; border-top: 0; text-align: center; font-size: 0.85em; font-weight: 700; }
.form-label { display: block; margin-bottom: 3px; font-size: 0.78em; font-weight: 700; text-transform: uppercase; }
.form-value { font-weight: 700; white-space: pre-line; }
.programmed-box { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; }
.check-mark { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 4px; border: 1px solid #000; font-size: 11px; }

.attendance-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.attendance-table th, .attendance-table td { border: 1px solid #000; padding: 2px 4px; height: 18px; }
.attendance-table th { background: #f1f1f1; font-size: 0.87em; line-height: 1.15; text-align: center; }
.attendance-table td { font-size: 0.9em; }
.attendance-table .number { width: 4.5%; text-align: center; }
.attendance-table .participant-name { width: 36%; }
.attendance-table .participant-team { width: 8%; text-align: center; }
.attendance-table .participant-role { width: 24%; }
.attendance-table .signature { width: 18%; }
.attendance-table .wellbeing { width: 9.5%; text-align: center; }
.wellbeing-header { display: flex; justify-content: center; align-items: center; gap: 4px; }
.wellbeing-header img { width: 15px; height: 15px; object-fit: contain; }
.content-box { height: 70px; padding: 5px 7px; border: 1px solid #000; border-top: 0; font-size: 0.8em; line-height: 1.22; white-space: pre-line; overflow: hidden; }
.content-box strong { display: block; margin-bottom: 3px; }
.form-footer { display: flex; justify-content: space-between; margin-top: 3px; font-size: 0.72em; }
.program-content-page { display: flex; flex-direction: column; }
.program-summary { display: grid; grid-template-columns: 2fr 1fr 1fr; border: 1px solid #000; border-top: 0; }
.program-summary > div { min-height: 44px; padding: 6px 8px; border-right: 1px solid #000; }
.program-summary > div:last-child { border-right: 0; }
.program-full-content { flex: 1; padding: 12px 14px; border: 1px solid #000; border-top: 0; line-height: 1.48; white-space: pre-line; }
.program-full-content > strong { display: block; margin-bottom: 10px; font-size: 1.05em; }
.program-full-content > div { font-size: 1.02em; }

.modal { width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 40px); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 28px 80px rgba(14,25,46,0.28); }
.modal::backdrop { background: rgba(16, 24, 40, 0.55); backdrop-filter: blur(3px); }
.modal form { display: grid; gap: 17px; padding: 24px; overflow-y: auto; }
.small-modal { width: min(570px, calc(100vw - 30px)); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.modal-header h2 { margin: 2px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 18px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.server-status { align-self: center; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: #fff; font-size: .82rem; font-weight: 700; }
.server-status.online { color: var(--green); border-color: #b9decf; background: #eefaf5; }
.server-status.offline { color: var(--red); border-color: #efc4c0; background: #fff4f3; }
.live-layout { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: 22px; align-items: start; }
.live-control-panel { display: grid; gap: 16px; position: sticky; top: 76px; padding: 20px; min-width: 0; }
.live-actions { display: grid; gap: 9px; }
.reset-demo-button { width: 100%; margin-top: 4px; }
.live-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.live-stage { min-height: 420px; min-width: 0; padding: 20px; }
.live-empty { display: grid; place-items: center; min-height: 360px; text-align: center; color: var(--muted); }
.live-empty h3, .live-empty p { margin: 0; }
.live-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.live-heading > div:first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.live-heading h3 { margin: 10px 0 5px; font-size: 1.25rem; }
.live-heading p { margin: 0; color: var(--muted); }
.execution-id { display: inline-block; margin-top: 9px; color: #536176; font-size: .74rem; }
.live-status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; background: #eef1f5; }
.status-aberta { color: var(--green); background: #eaf8f1; }
.status-encerrada { color: var(--red); background: #fff0ee; }
.status-cancelada { color: #8b2525; background: #fde9e7; }
.live-count { display: grid; min-width: 105px; text-align: right; }
.live-count strong { color: var(--navy); font-size: 2.3rem; line-height: 1; }
.live-count span { color: var(--muted); font-size: .8rem; }
.live-summary { display: grid; grid-template-columns: repeat(2, minmax(115px, 1fr)); gap: 10px; min-width: 250px; }
.live-metric { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 76px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; text-align: center; background: #f8fafc; }
.live-metric strong { color: var(--navy); font-size: 1.7rem; line-height: 1; }
.live-metric span { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.live-metric.pending strong { color: var(--orange-dark); }
.qr-zone { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; padding: 24px 0; }
.qr-card { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 18px; padding: 10px; background: #fff; }
.qr-card img { display: block; width: 240px; height: 240px; }
.qr-instructions h4, .demo-credentials h4, .live-participants h4 { margin: 0 0 8px; }
.qr-instructions p { color: var(--muted); line-height: 1.5; }
.url-copy { display: flex; gap: 8px; margin: 15px 0 10px; }
.url-copy input { min-width: 0; flex: 1; }
.preview-link { display: inline-flex; }
.live-link-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.closed-session { margin: 22px 0; border: 1px dashed #c9d1dd; border-radius: 13px; padding: 18px; color: var(--muted); background: #fafbfc; }
.closed-session-actions, .report-pdf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.live-material-action { margin-top: 12px; }
.demo-credentials { padding: 20px 0; border-top: 1px solid var(--line); }
.credential-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.credential-grid article { display: grid; gap: 5px; min-width: 0; border: 1px solid #f1cdbb; border-radius: 13px; padding: 12px; background: #fff7f2; }
.credential-grid span { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.credential-grid strong { font-size: .82rem; }
.credential-grid code { color: var(--orange-dark); font-size: 1rem; font-weight: 900; }
.live-participants { padding-top: 20px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--green); font-weight: 800; }
.participant-rows { display: grid; gap: 8px; margin-top: 13px; }
.participant-rows > div { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-radius: 10px; padding: 10px; background: var(--soft); }
.participant-rows strong { min-width: 0; overflow-wrap: anywhere; }
.participant-rows small, .muted { color: var(--muted); }
.confirmed-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--green); font-size: .75rem; font-weight: 900; }
.pending-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--orange); font-size: .75rem; font-weight: 900; }
.live-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--line); }
.live-columns .live-participants { border-top: 0; }
.pending-list .section-title span { background: var(--orange); }
.feeling { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 7px; font-size: .68rem; font-style: normal; font-weight: 900; }
.feeling img { width: 18px; height: 18px; object-fit: contain; }
.feeling-bem { color: #10643f; background: #dff4e9; }
.feeling-mau { color: #9b2c25; background: #fde7e5; }
.report-panel { display: grid; gap: 18px; padding: 22px; min-width: 0; }
.credential-panel { padding: 22px; }
.report-search { max-width: 620px; }
.report-export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.report-stats { margin: 0; }
.dashboard-kpis .stat-card { border-top: 4px solid var(--orange); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: #fbfcfe; }
.dashboard-card h4 { margin: 0 0 4px; color: var(--navy); font-size: 1.02rem; }
.dashboard-card p { margin: 0 0 18px; color: var(--muted); font-size: .82rem; }
.dash-row + .dash-row { margin-top: 14px; }
.dash-row-label { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; }
.dash-row-label span { color: var(--muted); }
.dash-track { height: 11px; margin-top: 7px; border-radius: 99px; background: #e5eaf1; overflow: hidden; }
.dash-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ef6c2f, #f9a16e); }
.dash-months { display: flex; align-items: end; gap: 12px; min-height: 180px; }
.dash-month { display: flex; flex: 1; min-width: 0; height: 180px; flex-direction: column; align-items: center; justify-content: end; gap: 4px; color: var(--navy); }
.dash-month-track { display: flex; align-items: end; width: min(44px, 100%); height: 125px; background: #eef2f7; border-radius: 8px 8px 0 0; overflow: hidden; }
.dash-month-track > span { width: 100%; background: #345d92; border-radius: 8px 8px 0 0; }
.dash-month small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.dash-feelings { display: flex; align-items: center; gap: 24px; }
.dash-donut { display: flex; width: 155px; height: 155px; flex: none; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle closest-side, #fbfcfe 66%, transparent 67%), conic-gradient(#16835d 0 var(--well-angle), #dc655d var(--well-angle) 360deg); }
.dash-donut.empty { background: radial-gradient(circle closest-side, #fbfcfe 66%, transparent 67%), conic-gradient(#d5dce6 0 360deg); }
.dash-donut strong { font-size: 1.8rem; line-height: 1; }
.dash-donut span { color: var(--muted); font-size: .75rem; }
.dash-legend { display: grid; gap: 12px; min-width: 110px; }
.dash-legend span { display: flex; align-items: center; gap: 8px; }
.dash-legend strong { margin-left: auto; }
.dash-legend i { width: 11px; height: 11px; border-radius: 50%; }
.dash-legend .well { background: #16835d; }
.dash-legend .unwell { background: #dc655d; }
.report-panel h3 { margin: 8px 0 0; }
.report-subtitle { padding-top: 10px; border-top: 1px solid var(--line); }
.employee-history-panel { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.employee-history-panel h3, .employee-history-panel p { margin: 0; }
.employee-history-panel p { margin-top: 5px; color: var(--muted); }
.employee-history-search { display: flex; align-items: end; gap: 10px; max-width: 680px; }
.employee-history-search input { flex: 1; }
.employee-history-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; }
.employee-history-card + .employee-history-card { margin-top: 12px; }
.employee-history-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.employee-history-heading h4, .employee-history-heading p { margin: 0; }
.hash-code { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; font-size: .72rem; }
.block { display: block; margin-top: 4px; color: var(--muted); }
.login-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(9,20,38,.78); backdrop-filter: blur(8px); }
.login-overlay[hidden] { display: none; }
.login-card { display: grid; gap: 16px; width: min(440px, 100%); border-radius: 22px; padding: 30px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.login-card h2, .login-card p { margin: 0; }
.login-message { color: var(--muted); font-size: .82rem; text-align: center; }
.login-message.error { color: var(--red); }
.login-message.success { color: var(--green); }
.forgot-button { align-self: flex-start; margin-top: -4px; }

.team-selector { border: 1px solid #d5deea; border-radius: 14px; padding: 12px 14px; margin: 0; }
.team-selector legend { font-weight: 800; color: #17233c; padding: 0 6px; }
.team-selector > div { display: flex; flex-wrap: wrap; gap: 8px; }
.team-selector label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid #d5deea; border-radius: 10px; background: #f7f9fc; cursor: pointer; }
.team-selector input { width: auto; margin: 0; }
.team-selector p { margin: 8px 0 0; color: #63708a; font-size: .82rem; }
.inline-reset-form { display: flex; align-items: end; gap: 12px; max-width: 620px; }
.inline-reset-form label { flex: 1; }
.credential-result { margin-top: 16px; border: 1px solid #99d8bd; background: #ecfbf4; border-radius: 14px; padding: 16px; }
.credential-result code { display: block; width: fit-content; margin: 10px 0; padding: 9px 14px; border-radius: 8px; background: #14213d; color: #fff; font-size: 1.25rem; letter-spacing: .08em; }
.credential-result p { margin: 0; color: #41506a; }
.credential-result .credential-hide { margin-top: 12px; }
.credential-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.evidence-hash { display: block; margin-top: 12px; max-width: 620px; overflow-wrap: anywhere; color: #5a667d; }

@media (max-width: 1100px) {
  .live-layout { grid-template-columns: 1fr; }
  .live-control-panel { position: static; }
  .generator-layout { grid-template-columns: 1fr; }
  .generator-controls { position: static; grid-template-columns: 1fr 1fr; }
  .print-preview { min-width: 850px; transform-origin: top left; }
  .generator-view { overflow-x: auto; }
  .live-heading { flex-direction: column; }
  .live-summary { width: 100%; min-width: 0; }
}

@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .instructor-team-grid { grid-template-columns: 1fr; }
  .qr-zone { grid-template-columns: 1fr; }
  .credential-grid { grid-template-columns: 1fr; }
  .app-header, .page-heading { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .tab-primary { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topic-grid, .generator-controls { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .three-columns { grid-template-columns: 1fr; }
  .check-label { padding-top: 0; }
  .live-columns { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .live-stage, .live-control-panel, .report-panel, .credential-panel { padding: 16px; }
  .live-heading { flex-direction: column; }
  .live-summary { width: 100%; }
  .dash-feelings { flex-wrap: wrap; }
  .brand { align-items: flex-start; flex-direction: column; }
  .brand img { width: 130px; }
  .header-actions { flex-direction: column; }
  .stats-grid, .two-columns { grid-template-columns: 1fr; }
  main { padding-inline: 14px; }
  .topic-grid { padding: 12px; }
  .row-actions { flex-direction: column; }
}

@page { size: A4 portrait; margin: 6mm; }

/* V14: agenda visual, comparações e entrada externa. */
.kanban-grid { display:grid; grid-template-columns:repeat(5,minmax(230px,1fr)); gap:14px; overflow-x:auto; padding:16px; }
.kanban-column { background:#f1f4f8; border-radius:12px; padding:12px; min-height:250px; }
.kanban-column h3 { margin-top:0; font-size:16px; }
.schedule-card { border:1px solid #d6deea; border-radius:10px; padding:12px; margin:10px 0; background:#fff; box-shadow:0 3px 8px #16233f08; overflow-wrap:anywhere; }
.schedule-card h4 { margin:10px 0 6px; font-size:14px; }
.schedule-card p,.schedule-card small { font-size:12px; }
.schedule-card small { display:block; margin-top:6px; }
.schedule-card .row-actions { display:flex; flex-wrap:wrap; gap:5px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(145px,1fr)); overflow-x:auto; border:1px solid #d0d5dd; }
.calendar-day { border:1px solid #e0e5ed; padding:8px; min-height:140px; }
.calendar-day.is-today { background:#e9f4ff; box-shadow:inset 0 0 0 2px #245f9e; }
.calendar-weekday { padding:10px; text-align:center; background:#16233f; color:#fff; }
.calendar-day .schedule-card { padding:8px; }
.calendar-day .mini-button { font-size:11px; padding:5px; }
#scheduleVisual { padding:12px; }
.request-panel { margin-top:24px; padding:20px; }
.request-card { padding:16px; margin:12px 0; border:1px solid #d0d5dd; border-radius:10px; }
.access-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; gap:12px; border-bottom:1px solid #e0e5ed; }
#userPermissionBody tr { cursor:pointer; }
#userPermissionBody tr:hover { background:#eef4ff; }
.chart-button { border:0; background:none; width:100%; text-align:left; color:inherit; padding:10px 0; cursor:pointer; font:inherit; }
.chart-button > span:first-child { display:flex; justify-content:space-between; gap:12px; margin-bottom:7px; }
.chart-button:hover { background:#f1f5fa; }
.chart-button .dash-track { display:block; height:12px; }
.chart-button .dash-track > span { display:block; height:100%; background:#245f9e; border-radius:12px; }
.detail-panel { margin:20px 0; padding:20px; }
.detail-panel details { padding:12px; border-bottom:1px solid #d0d5dd; }
.external-main { display:flex; justify-content:center; padding:30px 16px; }
.external-main .login-card { width:min(100%,520px); }
.external-main h1 { font-size:27px; }
.dashboard-kpis { grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
.attendance-page { max-width:210mm; min-height:297mm; margin:0 auto 20px; overflow:visible; font-size:9px; }
@media (max-width:700px) { .kanban-grid { grid-template-columns:repeat(5,230px); } .dashboard-controls { grid-template-columns:1fr 1fr; } .external-main { padding:15px 8px; } }
@media print { .attendance-page { min-height:280mm; max-width:none; overflow:visible; } .form-grid-table { overflow-wrap:anywhere; } .form-header,.attendance-table tr { break-inside:avoid; } }

@media print {
  :root, body { background: #fff; }
  body { margin: 0; }
  .no-print, body > header, body > nav, .view:not(#view-generator), .generator-controls { display: none !important; }
  main { width: auto; margin: 0; padding: 0; }
  #view-generator { display: block !important; }
  .generator-layout { display: block; }
  .print-preview { display: block; min-width: 0; width: 100%; transform: none; }
  .attendance-page .form-row > div { min-width: 0; overflow-wrap: anywhere; }
  .attendance-table { width: 100%; min-width: 0; table-layout: fixed; }
  .attendance-page { width: 100%; min-height: 280mm; height: auto; aspect-ratio: auto; margin: 0; padding: 0; border: 0; box-shadow: none; break-after: page; page-break-after: always; font-size: 10px; }
  .attendance-page .content-box { height: auto; min-height: 70px; overflow: visible; }
  .attendance-table td { overflow-wrap: anywhere; }
  .attendance-page:last-child { break-after: auto; page-break-after: auto; }
}
.dashboard-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0 12px;
}
.dashboard-controls label { min-width: 0; }
.dashboard-controls input, .dashboard-controls select { width: 100%; min-width: 0; }
.dashboard-controls .check-label { align-self: center; }
.signature-slot { margin-top: 6px; font-size: .85rem; } .signature-slot ul { margin: 4px 0; padding-left: 18px; }

.check-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }


.bar { height: 8px; border-radius: 4px; background: #e6ebf0; overflow: hidden; } .bar i { display: block; height: 100%; background: #176d8e; }
.report-person { break-inside: avoid; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.report-person h4 { margin: 0 0 4px; } .report-person ul { margin: 4px 0 8px; padding-left: 18px; }
@media print { #trainingIndicators, .no-print { display: none !important; } .report-person { box-shadow: none; } }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.modal .check-label { display: flex; align-items: center; gap: 10px; }
.modal .check-label input { width: auto; flex: 0 0 auto; }

body[data-central] #newEmployeeButton, body[data-central] [data-import="employees"], body[data-central] #newJobRoleHeading, body[data-central] #employeeTableBody [data-edit] { display: none; }

/* Treinamentos: mesmo vocabulário visual dos relatórios e da apresentação ao vivo do DDS */
#view-trainings-reports .report-section, #view-trainings-run .report-section { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#view-trainings-reports .stats-grid { gap: 10px; margin-bottom: 12px; }
#view-trainings-reports .stat-card { padding: 12px 14px; border-radius: 12px; box-shadow: none; }
#view-trainings-reports .stat-card p { margin: 0 0 4px; font-size: 12px; }
#view-trainings-reports .stat-card strong { font-size: 1.35rem; }
#view-trainings-reports .stat-card small { font-size: 11px; }
#view-trainings-reports .dashboard-kpis .stat-card { border-top-width: 3px; }
.stat-card.is-alert strong { color: var(--red); }
#view-trainings-run .live-stage { margin-bottom: 16px; }
#view-trainings-run .live-stage > .live-link-actions { padding-top: 16px; border-top: 1px solid var(--line); }
.empty-state h3 { font-size: 1rem; }

#view-trainings .data-table small.block { display: block; margin-top: 2px; color: var(--muted); }
#view-trainings .data-table td { vertical-align: top; }

.live-status.status-avaliacao { color: #93400b; background: #fff1e5; }
.mini-button.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }

.modal .check-label input:not([type=checkbox]):not([type=radio]) { flex: 1 1 auto; width: 100%; min-width: 0; }
