.compliance-dashboard,
.compliance-dashboard * {
    min-width: 0;
}

.compliance-dashboard {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    color: #303244;
    overflow: hidden;
}

.professor-dashboard-toolbar {
    border-radius: 8px;
}

.compliance-dashboard--empty {
    justify-content: center;
    padding: 18px;
}

.compliance-dashboard__metric,
.compliance-dashboard__insight,
.compliance-dashboard__panel {
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(54, 43, 135, 0.05);
}

.compliance-dashboard__selector {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
}

.compliance-dashboard__scroll {
    display: grid;
    align-content: start;
    flex: 1 1 auto;
    gap: 16px;
    width: 100%;
    min-height: 0;
    overflow: auto;
    padding: 0;
}

.compliance-dashboard__selector + .compliance-dashboard__scroll {
    margin-top: 16px;
}

.compliance-dashboard__toolbar {
    flex: 0 0 auto;
    padding-top: 12px;
}

.compliance-dashboard__toolbar ~ .compliance-dashboard__scroll {
    margin-top: 20px;
}

.compliance-dashboard-view-menu {
    max-width: min(420px, 100%);
}

.compliance-dashboard-view-menu .grid-view-menu__current {
    max-width: min(340px, 72vw);
    color: #303244;
    font-size: 14px;
    font-weight: 600;
}

.compliance-dashboard-view-menu .grid-view-menu__item {
    text-decoration: none;
}

.compliance-dashboard-view-menu__popup {
    z-index: 70;
}

.compliance-dashboard-tour-highlight {
    position: relative;
    z-index: 91;
    border-radius: 8px;
    outline: 2px solid rgba(37, 99, 235, 0.72);
    outline-offset: 3px;
}

.compliance-dashboard-tour {
    position: fixed;
    z-index: 92;
    width: min(320px, calc(100vw - 32px));
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 55px -24px rgba(15, 23, 42, 0.45);
    color: #303244;
    padding: 16px;
}

.compliance-dashboard-tour::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-left: 1px solid rgba(203, 213, 225, 0.9);
    border-top: 1px solid rgba(203, 213, 225, 0.9);
    background: #ffffff;
    transform: rotate(45deg);
}

.compliance-dashboard-tour[data-placement="bottom"]::before {
    top: -7px;
    left: var(--tour-arrow-left, 24px);
}

.compliance-dashboard-tour[data-placement="top"]::before {
    bottom: -7px;
    left: var(--tour-arrow-left, 24px);
    transform: rotate(225deg);
}

.compliance-dashboard-tour__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1rem;
    text-transform: uppercase;
}

.compliance-dashboard-tour h2 {
    margin: 0;
    color: #303244;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.compliance-dashboard-tour p {
    margin: 8px 0 0;
    color: #4b5563;
    font-size: 0.88rem;
    line-height: 1.5;
}

.compliance-dashboard-tour__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

.compliance-dashboard-tour__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    padding: 0 12px;
}

.compliance-dashboard-tour__button--primary {
    background: #2563eb;
    color: #ffffff;
}

.compliance-dashboard-tour__button--secondary {
    border-color: rgba(203, 213, 225, 0.9);
    background: #ffffff;
    color: #303244;
}

.compliance-dashboard-tour__button:hover {
    filter: brightness(0.98);
}

.compliance-dashboard-view-menu:not(.is-open) .grid-view-menu__trigger-icon {
    transform: none;
}

.compliance-dashboard-view-menu.is-open .grid-view-menu__trigger-icon {
    transform: rotate(180deg);
}

.compliance-dashboard.is-loading .compliance-dashboard__scroll {
    opacity: 0.58;
    pointer-events: none;
}

.compliance-dashboard.is-loading .compliance-dashboard__selector {
    cursor: progress;
}

.compliance-dashboard.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(248, 250, 252, 0.66);
    pointer-events: auto;
}

.compliance-dashboard.is-loading::after {
    content: "Atualizando dashboard...";
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 21;
    border: 1px solid rgba(2, 132, 199, 0.24);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 18px 45px -30px rgba(15, 23, 42, 0.45);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    padding: 10px 14px;
    animation: compliance-dashboard-loading-pulse 1s ease-in-out infinite;
}

@keyframes compliance-dashboard-loading-pulse {
    0%,
    100% {
        opacity: 0.72;
    }

    50% {
        opacity: 1;
    }
}

.compliance-dashboard__metrics,
.compliance-dashboard__insights,
.compliance-dashboard__panels {
    display: grid;
    gap: 12px;
}

.compliance-dashboard__metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.compliance-dashboard__insights {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.compliance-dashboard__metric,
.compliance-dashboard__insight {
    position: relative;
    display: grid;
    align-content: start;
    min-height: 118px;
    border-left: 4px solid var(--dashboard-accent, #64748b);
    padding: 16px 16px 16px 14px;
}

.compliance-dashboard__metric > span,
.compliance-dashboard__insight > span {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25rem;
    text-transform: none;
}

.compliance-dashboard__metric strong {
    display: block;
    margin-top: 8px;
    color: #303244;
    font-size: 1.48rem;
    font-weight: 600;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.compliance-dashboard__metric p,
.compliance-dashboard__insight p,
.compliance-dashboard__panel header p {
    margin: 7px 0 0;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.compliance-dashboard__metric[data-tone="ocean"],
.compliance-dashboard__insight[data-tone="ocean"] {
    --dashboard-accent: #3473CC;
}

.compliance-dashboard__metric[data-tone="emerald"],
.compliance-dashboard__insight[data-tone="emerald"] {
    --dashboard-accent: #0E872C;
}

.compliance-dashboard__metric[data-tone="amber"],
.compliance-dashboard__insight[data-tone="amber"] {
    --dashboard-accent: #d97706;
}

.compliance-dashboard__metric[data-tone="violet"],
.compliance-dashboard__insight[data-tone="violet"] {
    --dashboard-accent: #9F6CEB;
}

.compliance-dashboard__metric[data-tone="rose"],
.compliance-dashboard__insight[data-tone="rose"] {
    --dashboard-accent: #dc2626;
}

.compliance-dashboard__panels {
    grid-auto-flow: dense;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.compliance-dashboard__panel {
    display: grid;
    grid-column: span var(--dashboard-panel-span, 12) / span var(--dashboard-panel-span, 12);
    grid-template-rows: auto minmax(0, 1fr);
    padding: 16px;
}

.compliance-dashboard__panel header {
    display: grid;
    gap: 5px;
}

.compliance-dashboard__panel h2 {
    margin: 0;
    color: #303244;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.compliance-dashboard__chart {
    min-height: 316px;
    margin-top: 10px;
}

.dashboard-renderer-empty,
.compliance-dashboard__empty {
    display: flex;
    min-height: 278px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
    text-align: center;
}

.compliance-dashboard__table-wrap {
    overflow: auto;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.compliance-dashboard__table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.compliance-dashboard__table th,
.compliance-dashboard__table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 11px 10px;
    text-align: left;
    vertical-align: top;
}

.compliance-dashboard__table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
}

.compliance-dashboard__table td {
    color: #334155;
}

.compliance-dashboard__table td.compliance-dashboard__table-empty,
.dashboard-lab-table td.dashboard-lab-table-empty {
    padding: 24px 12px;
    color: #64748b;
    text-align: center;
}

.compliance-dashboard__table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 1180px) {
    .compliance-dashboard__insights {
        grid-template-columns: 1fr;
    }

    .compliance-dashboard__panel {
        grid-column: span 12 / span 12;
    }
}

@media (max-width: 720px) {
    .compliance-dashboard__selector {
        padding: 12px;
    }

    .compliance-dashboard__selector + .compliance-dashboard__scroll {
        padding-top: 12px;
    }

    .compliance-dashboard__toolbar ~ .compliance-dashboard__scroll {
        margin-top: 16px;
    }

    .compliance-dashboard__metrics {
        grid-template-columns: 1fr;
    }

    .compliance-dashboard__chart {
        min-height: 274px;
    }
}
