/* Unidade de Ensino — hardening responsivo/PWA 2026-08-21 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
body.dashboard-open {
  padding-top: 0;
}
.dashboard,
.workspace,
.workspace-content,
.panel,
.panel-grid,
.page-title,
.course-card,
.course-body,
.p-shell {
  min-width: 0;
}
.dashboard {
  width: 100%;
  max-width: 100vw;
}
.workspace {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.workspace-content {
  width: 100%;
  max-width: 1500px;
  overflow: visible;
}
.workspace-content > * {
  min-width: 0;
  max-width: 100%;
}
.panel {
  max-width: 100%;
  overflow: hidden;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.course-card {
  height: 100%;
}
.course-image {
  aspect-ratio: 3/2;
  height: auto !important;
  min-height: 170px;
}
.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e7efec;
}
.course-card h3,
.course-card p,
.course-application {
  overflow-wrap: anywhere;
}
.course-application {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 4px 0 10px;
}
.course-footer {
  align-items: flex-end;
}
.course-footer .action-row {
  justify-content: flex-end;
}
.catalog-warning {
  display: grid;
  gap: 5px;
  background: #fff7e4;
  border: 1px solid #ead39a;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0;
  color: #6d5523;
}
.catalog-warning small {
  display: block;
}
.dashboard-open .float.whatsapp,
.dashboard-open .ai-float,
.dashboard-open .pwa-install-banner {
  display: none !important;
}
.dashboard-open #publicApp,
.dashboard-open #publicHeader,
.dashboard-open #publicFooter {
  display: none !important;
}
@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .workspace {
    grid-column: 1;
  }
  .workspace-header {
    width: 100%;
  }
  .kpi-grid,
  .master-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-courses,
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    align-items: flex-start;
  }
  .page-title > .action-row,
  .page-title > div:last-child {
    max-width: 100%;
  }
}
@media (max-width: 760px) {
  .workspace-header {
    min-height: 68px;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .workspace-header > div {
    min-width: 0;
  }
  .workspace-header #breadcrumb {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 38vw;
  }
  .workspace-actions {
    margin-left: auto;
    gap: 5px !important;
  }
  .workspace-content {
    padding: 14px 12px 108px;
  }
  .page-title {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }
  .page-title h1 {
    font-size: 26px;
  }
  .page-title > div:last-child,
  .page-title > .action-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }
  .page-title .btn {
    flex: 1 1 150px;
  }
  .kpi-grid,
  .master-kpis,
  .dashboard-courses,
  .course-grid,
  .settings-grid,
  .agent-grid,
  .assessment-cards,
  .phase8-cards,
  .scenario-grid,
  .answer-grid,
  .intelligence-kpis,
  .master-banner-grid {
    grid-template-columns: 1fr !important;
  }
  .panel {
    padding: 16px;
    border-radius: 17px;
  }
  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .filter-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .filter-row .input {
    max-width: none !important;
    width: 100%;
  }
  .course-image {
    min-height: 190px;
  }
  .course-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .course-footer .action-row {
    justify-content: flex-start;
  }
  .course-footer .action-row .btn {
    flex: 1 1 auto;
  }
  .modal {
    padding: 10px;
  }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
    padding: 22px 16px;
    overflow: auto;
  }
  .modal-card.crm-modal,
  .modal-card.course-modal,
  .modal-card.ai-drawer {
    width: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .pwa-dock {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: calc(100% - 16px) !important;
  }
  .pwa-dock-brand {
    display: none !important;
  }
  .pwa-dock-btn {
    min-width: 0;
  }
  .pwa-sheet-card {
    max-height: 82dvh;
    overflow: auto;
  }
  .pwa-sheet-grid {
    grid-template-columns: 1fr;
  }
  .pwa-sheet-link.primary,
  .pwa-sheet-link.gold {
    grid-column: auto;
  }
}
@media (max-width: 420px) {
  .kpi-grid,
  .master-kpis {
    grid-template-columns: 1fr !important;
  }
  .workspace-header #breadcrumb {
    max-width: 30vw;
  }
  .workspace-logout-btn {
    font-size: 0 !important;
    width: 40px;
    height: 40px;
    padding: 0 !important;
  }
  .workspace-logout-btn:before {
    content: '↪';
    font-size: 17px;
  }
  .course-image {
    min-height: 175px;
  }
}
@media (display-mode: standalone) {
  html,
  body {
    min-height: 100dvh;
  }
  .dashboard {
    min-height: 100dvh;
  }
  .dashboard-open {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
  .dashboard-open .workspace {
    min-height: calc(100dvh - 92px);
  }
}
.course-hours {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0;
}
.course-hours > small {
  width: 100%;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hour-choice {
  border: 1px solid #b7d2ca;
  background: #f3faf7;
  color: var(--deep);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 850;
  font-size: 11px;
  cursor: pointer;
}
.hour-choice:hover,
.hour-choice.active {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}
.course-duration-box {
  margin: 12px 0 16px;
}
.course-duration-box > small {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}
.course-detail aside .course-hours {
  margin-bottom: 16px;
}

/* Sidebar identity + compact mobile header — 2026-08-21 */
.user-mini-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-mini-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}
.user-mini-meta small {
  margin: 0 !important;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-mini-logout {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-radius: 9px;
  padding: 5px 9px;
  font: 700 11px/1.1 inherit;
  cursor: pointer;
}
.user-mini-logout:hover,
.user-mini-logout:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}
@media (max-width: 760px) {
  .workspace-header {
    min-height: 60px !important;
    height: auto !important;
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .workspace-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    gap: 7px !important;
  }
  .workspace-header #breadcrumb {
    font-size: 12px !important;
    line-height: 1.1 !important;
    max-width: 28vw !important;
  }
  .workspace-actions {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
  .workspace-actions .btn.small {
    font-size: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
  }
  .workspace-site-btn:before {
    content: '←' !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }
  .workspace-logout-btn:before {
    content: '↪' !important;
    font-size: 17px !important;
    line-height: 1 !important;
  }
  .workspace-actions .icon-btn,
  .workspace-actions .avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }
}
@media (max-width: 390px) {
  .workspace-header #breadcrumb {
    max-width: 24vw !important;
  }
  .workspace-actions {
    gap: 3px !important;
  }
  .workspace-actions .btn.small,
  .workspace-actions .icon-btn,
  .workspace-actions .avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
}
