:root {
  --ink: #171044;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --blue: #078ed2;
  --company-primary: #078ed2;
  --company-primary-dark: #056ba0;
  --company-secondary: #ffffff;
  --cyan: #16b4d8;
  --green: #23b26d;
  --yellow: #f5bd3d;
  --red: #ef5b5b;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
 
  font-size: 12px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--soft);
  font-family: "Inter", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.is-hidden {
  display: none !important;
}

body:not([data-page="login"]) .main-nav:not([data-nav-ready="1"]) {
  visibility: hidden;
}

body.is-client-portal .client-filter,
body.is-client-portal #employeeClient,
body.is-client-portal #roleClient,
body.is-client-portal #turnoClient,
body.is-client-portal #certificateClient,
body.is-client-portal #asoClient,
body.is-client-portal #historyClient,
body.is-client-portal #classClient,
body.is-client-portal label:has(#employeeClient),
body.is-client-portal label:has(#roleClient),
body.is-client-portal label:has(#certificateClient),
body.is-client-portal label:has(#asoClient),
body.is-client-portal label:has(#historyClient),
body.is-client-portal label:has(#classClient) {
  display: none !important;
}

body.is-client-portal .class-form-grid label.client-readonly-field select:disabled {
  border-color: #e1e7ef;
  background: #f3f6fa;
  color: #475467;
  cursor: not-allowed;
  opacity: 1;
}

body.is-client-portal .class-form-grid .field-hint {
  display: none;
}

body.is-client-portal .class-form-grid .readonly-field-value {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  background: #f3f6fa;
  color: #475467;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

body.is-client-portal .class-form-grid label.client-readonly-field select.is-hidden {
  display: none;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 13px 18px;
  font-weight: 800;
  box-shadow: none;
}

.secondary-button:hover {
  background: #f8fafc;
  border-color: #cfd8e3;
}

.modal-form-actions .primary-button,
.modal-form-actions .secondary-button {
  min-width: 132px;
}

@media (max-width: 520px) {
  .modal-form-actions .primary-button,
    .modal-form-actions .secondary-button {
      width: 100%;
      min-width: 0;
    }
}

body:not([data-page="login"]):not(.is-app-ready) .app-shell {
  visibility: hidden;
}

body[data-page="dashboard"]:not([data-dashboard-ready="1"]) .metric-grid,
body[data-page="dashboard"]:not([data-dashboard-ready="1"]) .dashboard-grid {
  visibility: hidden;
}

body.is-app-ready .app-shell {
  visibility: visible;
}

.login-screen {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  background: var(--paper);
  overflow: hidden;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 42px;
  padding: clamp(32px, 6vw, 76px);
  border-right: 1px solid var(--line);
  background: #c7d7ea;
}

.login-brand {
  width: 100%;
}

.login-brand img,
.sidebar-brand img {
  width: 138px;
  height: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-brand span,
.eyebrow {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 520px;
  color: var(--ink);
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.92;
}

.password-form .primary-button {
  justify-self: start;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #f2f4f7;
  color: var(--blue);
  outline: none;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle svg.icon-eye-closed {
  stroke-width: 1.6;
}

.password-toggle .icon-eye-closed {
  display: none;
}

.password-toggle.is-visible .icon-eye-open {
  display: none;
}

.password-toggle.is-visible .icon-eye-closed {
  display: block;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(7, 142, 210, 0.12);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.app-shell.is-menu-collapsed {
  grid-template-columns: 84px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 900;
}

.app-shell.is-menu-collapsed .sidebar {
  align-items: center;
  padding-inline: 12px;
}

.app-shell.is-menu-collapsed .sidebar-brand img {
  width: 46px;
}

.app-shell.is-menu-collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
}

.app-shell.is-menu-collapsed .nav-item,
.app-shell.is-menu-collapsed .nav-group-label {
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  padding: 12px;
  color: transparent;
  font-size: 0;
  gap: 0;
}

.app-shell.is-menu-collapsed .nav-item span,
.app-shell.is-menu-collapsed .nav-group-label span {
  color: var(--blue);
  font-size: 0.88rem;
}

.app-shell.is-menu-collapsed .nav-item.is-active span {
  color: #fff;
}

.app-shell.is-menu-collapsed .nav-group-label::after {
  display: none;
}

.app-shell.is-menu-collapsed .sub-nav,
.app-shell.is-menu-collapsed .sidebar-footer {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  padding: 12px;
  text-align: left;
  font-weight: 800;
}

.nav-item span,
.nav-group-label span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef6fb;
  color: var(--blue);
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  color: #475467;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.nav-group-label::after {
  content: "\25BE";
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-group.is-open .nav-group-label::after {
  content: "\25B4";
}

.nav-group.is-active .nav-group-label {
  background: #eef6fb;
  color: var(--blue);
}

.sub-nav {
  display: grid;
  gap: 4px;
  padding-left: 47px;
}

.nav-group:not(.is-open) .sub-nav {
  display: none;
}

.sub-nav-item {
  border-radius: 8px;
  color: #667085;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 800;
}

.sub-nav-item.is-active {
  background: var(--blue);
  color: #fff;
}

.nav-sub-group {
  display: grid;
  gap: 4px;
}

.nav-sub-group-label {
  border-radius: 8px;
  color: #344054;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-sub-group-label::after {
  content: "\25BE";
  color: #98a2b3;
  font-size: 0.75rem;
}

.nav-sub-group.is-open .nav-sub-group-label::after {
  content: "\25B4";
}

.nav-sub-group.is-active .nav-sub-group-label {
  color: var(--blue);
}

.nav-sub-group:not(.is-open) .sub-nav-nested {
  display: none;
}

.nav-item.is-active {
  background: var(--blue);
  color: #fff;
}

.nav-item.is-active span {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.sidebar-footer span,
.module-header p,
.metric-card span,
.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

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

.module-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.profile-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 800;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px 12px 8px 8px;
  color: var(--ink);
  font-weight: 800;
}

.user-chip-link {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-chip-link:hover,
.user-chip-link:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 127, 252, 0.12);
  outline: none;
}

.user-chip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #eef6fb;
  color: var(--blue);
  font-size: 0.78rem;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.metric-card,
.panel,
.class-details,
.calendar-panel,
.attendance-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.metric-card strong {
  font-size: 2.1rem;
}

.metric-card.danger strong {
  color: var(--red);
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .chart-panel {
  grid-column: span 2;
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .operational-panel {
  grid-column: span 3;
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .legend-scroll {
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .donut {
  width: 140px;
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .donut-center strong {
  font-size: 1.55rem;
}

.panel {
  padding: 20px;
}

.panel-heading,
.module-header,
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel h3,
.module-header h3 {
  font-size: 1.15rem;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

body.is-client-portal[data-page="dashboard"] .dashboard-grid .operational-panel-wide {
  grid-column: span 6;
}

.ok { background: var(--green); }

.warn { background: var(--yellow); }

.late { background: var(--red); }

.expiry-card.is-expired {
  border-left-color: var(--red);
}

.module-header {
  margin-bottom: 18px;
  align-items: flex-end;
}

.page-heading {
  width: 100%;
  margin-bottom: 18px;
}

.page-controls {
  width: 100%;
  margin-bottom: 18px;
}

.aso-page-heading + .page-controls {
  margin-top: 0;
}

.class-page-heading,
.attendance-page-heading,
.contractor-page-heading,
.role-page-heading,
.user-page-heading {
  width: 100%;
}

.secondary-button.is-active {
  border-color: var(--blue, #078ed2);
  background: rgba(7, 142, 210, 0.1);
  color: var(--blue, #078ed2);
}

.employee-card-heading .badge {
  justify-self: start;
}

.module-header > div:first-child:not(.module-title-row) {
  display: grid;
  gap: 6px;
}

.module-title-row,
.module-header > .module-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: none;
  flex-direction: row;
}

.table-action,
.matricula-remove-btn {
  display: inline-flex;
  justify-content: center;
  min-width: 76px;
  border: 1px solid #c9e7f4;
  border-radius: 8px;
  color: var(--blue);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  background: #fff;
  cursor: pointer;
}

.access-level-form .table-wrap {
  grid-column: 1 / -1;
}

.history-filters {
  width: min(1100px, 100%);
}

.history-filters label {
  min-width: 190px;
  flex: 1;
}

.rating-stars {
  color: var(--yellow);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.print-certificate-button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
  font-size: 0.84rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.muted-action {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.certificate-page-heading + .page-controls {
  margin-bottom: 12px;
}

.page-controls .certificate-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}

.page-controls .certificate-filters label,
.page-controls .attendance-filters label {
  min-width: 150px;
  flex: 1 1 150px;
}

.attendance-controls .attendance-filters {
  width: 100%;
  max-width: 720px;
}

.attendance-controls .attendance-filters label {
  width: 100%;
}

.certificate-filters .select2-container,
.history-filters .select2-container,
.attendance-filters .select2-container {
  width: 100% !important;
}

.certificate-filters .select2-container .select2-selection--single,
.history-filters .select2-container .select2-selection--single,
.attendance-filters .select2-container .select2-selection--single {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.certificate-filters .select2-container--default .select2-selection--single .select2-selection__rendered,
.history-filters .select2-container--default .select2-selection--single .select2-selection__rendered,
.attendance-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
  padding-left: 12px;
  padding-right: 28px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.certificate-filters .select2-container--default .select2-selection--single .select2-selection__arrow,
.history-filters .select2-container--default .select2-selection--single .select2-selection__arrow,
.attendance-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
  right: 8px;
}

.certificate-filters .select2-container--default.select2-container--focus .select2-selection--single,
.certificate-filters .select2-container--default.select2-container--open .select2-selection--single,
.history-filters .select2-container--default.select2-container--focus .select2-selection--single,
.history-filters .select2-container--default.select2-container--open .select2-selection--single,
.attendance-filters .select2-container--default.select2-container--focus .select2-selection--single,
.attendance-filters .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.certificate-filters .select2-dropdown,
.history-filters .select2-dropdown,
.attendance-filters .select2-dropdown {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.certificate-filters .select2-container--default .select2-results__option--highlighted[aria-selected],
.history-filters .select2-container--default .select2-results__option--highlighted[aria-selected],
.attendance-filters .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--blue);
}

.certificate-filters .select2-search--dropdown .select2-search__field,
.history-filters .select2-search--dropdown .select2-search__field,
.attendance-filters .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.certificate-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.registration-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.compact-form .primary-button {
  margin-top: 4px;
}

.chip.chip-tipo-formacao {
  border-color: #86efac;
  background: #ecfdf3;
  color: #15803d;
}

.chip.chip-tipo-reciclagem {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.employee-photo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  background: #eef6fb;
}

.employee-photo.large {
  width: 82px;
  height: 82px;
  flex-basis: 82px;
}

.employee-photo.pass-photo {
  width: 82px;
  height: 82px;
  margin: 18px auto 10px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.employee-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.employee-identity .employee-photo {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.employee-identity span {
  min-width: 0;
}

.chip {
  border: 1px solid #c9e7f4;
  border-radius: 999px;
  background: #f1fbff;
  color: #126f9d;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.chip.is-expired {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.video-lesson-page .detail-actions {
  margin-bottom: 18px;
}

.employee-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(140px, 180px));
  gap: 14px;
  margin-bottom: 18px;
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 10px;
  font-weight: 900;
  white-space: nowrap;
}

.tab-button.is-active {
  border-bottom-color: var(--blue);
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 18px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.form-section-autor {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-row-inline {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  align-items: start;
}

.form-row-inline.form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row-inline.form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row-inline.form-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid > .field-hint {
  grid-column: 1 / -1;
}

.employee-schedule-day {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: end;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.employee-schedule-day:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.employee-schedule-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-height: 46px !important;
  margin-bottom: 0;
}

.employee-schedule-day-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.employee-schedule-day .employee-schedule-times.form-row-inline {
  margin: 0;
  grid-column: auto;
}

@media (max-width: 900px) {
  .employee-schedule-day {
      grid-template-columns: 1fr;
      align-items: start;
    }

  .employee-schedule-day-toggle {
      min-height: auto !important;
    }

  .employee-schedule-times.form-row-4 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.employee-schedule-readonly .employee-schedule-day-toggle {
  cursor: default;
}

.history-filters .select2-search--dropdown .select2-search__field,
.attendance-filters .select2-search--dropdown .select2-search__field {
  min-height: 38px;
}

.dashboard-page-controls {
  margin-bottom: 18px;
}

.dashboard-filters .secondary-button,
.dashboard-filters .link-button {
  min-height: 46px;
}

.form-grid label,
.form-row-inline label {
  min-width: 0;
}

.form-grid input,
.form-grid select,
.form-row-inline input,
.form-row-inline select {
  min-height: 46px;
}

.form-grid input[type="date"],
.form-grid input[type="time"],
.form-row-inline input[type="date"],
.form-row-inline input[type="time"] {
  min-height: 46px;
}

.company-form-shell {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.04);
  overflow: hidden;
}

.company-form-shell .form-grid {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.integration-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.04);
}

.integration-toolbar-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
  gap: 14px;
  flex: 1 1 420px;
}

.integration-toolbar-fields label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}

.integration-status-badge.is-active {
  background: #dcfce7;
  color: #166534;
}

input[type="file"] {
  padding: 10px;
}

.badge-card-layout {
  --credit-card-width: 53.98mm;
  --credit-card-height: 85.6mm;
  display: grid;
  grid-template-columns: var(--credit-card-width) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.id-card-shell {
  width: var(--credit-card-width);
  height: var(--credit-card-height);
  perspective: 1200px;
}

.id-card-shell-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.id-card-shell.is-flipped .id-card-shell-inner {
  transform: rotateY(180deg);
}

.id-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  border-radius: 3.18mm;
  color: #fff;
  padding: 2.4mm 3mm 2mm;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.id-card-front {
  background: linear-gradient(135deg, var(--company-primary, #078ed2), var(--company-primary-dark, #056ba0));
}

.id-card-back {
  transform: rotateY(180deg);
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, var(--company-primary-dark, #056ba0), color-mix(in srgb, var(--company-primary-dark, #056ba0) 72%, #000000));
}

@supports not (color: color-mix(in srgb, white 50%, black)) {
  .id-card-front,
    .id-card-back {
      background: var(--company-primary, var(--blue, #078ed2));
    }
}

.id-card-client-logo-wrap {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-height: 7mm;
  margin-bottom: 1.2mm;
  padding: 0.8mm 1.6mm;
  border-radius: 1.2mm;
  background: rgba(255, 255, 255, 0.95);
}

.id-card-client-logo {
  display: block;
  max-width: 100%;
  max-height: 5.5mm;
  width: auto;
  height: auto;
  object-fit: contain;
}

.id-card-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6mm;
  margin-bottom: 2mm;
  flex-shrink: 0;
  text-align: center;
}

.id-card-photo {
  width: 14mm;
  height: 14mm;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.18);
}

.id-card-identity {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.id-card-identity strong {
  margin-bottom: 0.6mm;
  font-size: 6.8pt;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.id-card-identity span {
  display: block;
  font-size: 4.8pt;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.id-card-certifications {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.id-card-certifications h4 {
  margin: 0 0 0.8mm;
  font-size: 5.4pt;
  font-weight: 800;
  flex-shrink: 0;
  text-align: center;
}

.id-card-certs-list {
  display: grid;
  gap: 0.6mm;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}

.id-card-certs-list::-webkit-scrollbar {
  width: 3px;
}

.id-card-certs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.id-card-cert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2mm;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.id-card-cert-head span:last-child,
.id-card-cert-date {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.id-card-cert-date.is-expired,
.id-card-cert-row.is-expired .id-card-cert-name {
  color: #fecaca;
}

.id-card-cert-head {
  padding-bottom: 0.6mm;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 4.4pt;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.9;
}

.id-card-cert-name {
  min-width: 0;
  font-size: 4.6pt;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.id-card-cert-date {
  display: grid;
  justify-items: end;
  gap: 0.4mm;
  font-size: 4.6pt;
  font-weight: 700;
  line-height: 1.2;
}

.id-card-cert-expired-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  padding: 0.2mm 1.2mm;
  font-size: 4pt;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.id-card-certs-empty {
  margin: 0;
  font-size: 4.8pt;
  font-weight: 600;
  opacity: 0.9;
  text-align: center;
}

.id-card-footer {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
}

.id-card-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  margin: 1.2mm 0 0.8mm;
}

.id-card-dates {
  display: grid;
  gap: 0.4mm;
  font-size: 4.8pt;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.id-card-dates span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.id-card-flip-trigger {
  display: block;
  width: 100%;
  margin-top: 0.8mm;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 4.5pt;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.id-card-flip-trigger:hover {
  color: #fff;
}

.id-card-qr {
  width: 32mm;
  height: 32mm;
  margin: 2mm auto 1.6mm;
  padding: 1mm;
  border-radius: 1.2mm;
  background: #fff;
  flex-shrink: 0;
}

.id-card-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.id-card-back-name {
  display: block;
  margin-bottom: 0.6mm;
  font-size: 6pt;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.id-card-back-cpf,
.id-card-back-aso {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  font-size: 4.8pt;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.id-card-back-aso {
  margin-top: 0.4mm;
}

.id-card-qr-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 4.8pt;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.72);
  text-align: center;
}

.qr-code {
  width: 86px;
  height: 86px;
  margin: 20px auto 0;
  border: 8px solid #fff;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #111 50%, transparent 50%) 0 0 / 18px 18px,
    linear-gradient(#111 50%, transparent 50%) 0 0 / 18px 18px,
    #fff;
}

.training-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.class-form-grid {
  margin-bottom: 18px;
}

.import-overview-card,
.import-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.import-overview-card {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.import-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.training-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
}

th {
  background: #f8fbfd;
  color: #475467;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.calendar-panel,
.class-details,
.attendance-panel {
  padding: 18px;
}

.today .day-number {
  background: var(--blue);
  color: #fff;
}

.class-days-heading .form-section-title {
  margin: 0;
}

.class-details {
  align-self: start;
  display: grid;
  gap: 14px;
}

.employee-toggle.is-aso-blocked .badge {
  flex-shrink: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 38, 0.46);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.class-details .chip + h3 {
  margin-top: 12px;
}

.attendance-panel {
  display: grid;
  gap: 12px;
}

@media print {
  .sidebar,
    .page-heading,
    .page-controls {
      display: none !important;
    }

  .app-shell {
      display: block;
    }

  .workspace {
      padding: 0;
    }

  body {
      background: #fff;
    }
}

@media (max-width: 1100px) {
  .login-screen,
    .app-shell,
    .calendar-layout {
      grid-template-columns: 1fr;
    }

  .app-shell.is-menu-collapsed {
      grid-template-columns: 1fr;
    }

  .login-screen {
      height: auto;
      min-height: 100vh;
      overflow: visible;
    }

  .login-panel {
      min-height: 460px;
    }

  .sidebar {
      position: static;
      height: auto;
    }

  .app-shell.is-menu-collapsed .sidebar {
      align-items: stretch;
    }

  .employee-detail-hero,
    .form-grid,
    .form-row-inline,
    .badge-card-layout,
    .training-detail-hero,
    .training-detail-grid,
    .registration-layout {
      grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
  .workspace,
    .login-panel {
      padding: 20px;
    }

  .sub-nav {
      padding-left: 35px;
    }

  .module-header,
    .topbar,
    .panel-heading {
      align-items: flex-start;
      flex-direction: column;
    }

  .integration-toolbar-fields {
      grid-template-columns: 1fr;
    }

  .module-title-row {
      align-items: flex-start;
      flex-direction: row;
      flex-wrap: wrap;
    }
}

.prova-question-card .form-grid {
  margin-top: 12px;
}

.app-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid #86efac;
  border-left: 4px solid #22c55e;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf3 100%);
  color: #14532d;
  box-shadow: 0 16px 34px rgba(22, 101, 52, 0.18);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  max-width: min(380px, calc(100vw - 40px));
  animation: app-toast-in 0.24s ease;
  cursor: pointer;
}

.app-toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.app-toast-text {
  flex: 1 1 auto;
  padding-top: 1px;
}

.app-toast.is-update {
  border-color: #93c5fd;
  border-left-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.16);
}

.app-toast.is-update .app-toast-icon {
  background: #2563eb;
}

.app-toast.is-delete,
.app-toast.is-removed {
  border-color: #fca5a5;
  border-left-color: #ef4444;
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.16);
}

.app-toast.is-delete .app-toast-icon,
.app-toast.is-removed .app-toast-icon {
  background: #ef4444;
}

.app-toast.is-leaving {
  animation: app-toast-out 0.2s ease forwards;
}

@keyframes app-toast-in {
  from {
      opacity: 0;
      transform: translateY(12px);
    }

  to {
      opacity: 1;
      transform: translateY(0);
    }
}

@keyframes app-toast-out {
  from {
      opacity: 1;
      transform: translateY(0);
    }

  to {
      opacity: 0;
      transform: translateY(8px);
    }
}
