/* OnNoc — Visão geral (SaaS dashboard) */

.dash-health-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
}

.dash-health-strip.hidden { display: none; }

.dash-health-strip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
}

.dash-health-strip__text {
    flex: 1;
    min-width: 200px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dash-health-strip__meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dash-health-strip--ok {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
}
.dash-health-strip--ok .dash-health-strip__icon {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
}

.dash-health-strip--warn {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
}
.dash-health-strip--warn .dash-health-strip__icon {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
}

.dash-health-strip--danger {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.08);
}
.dash-health-strip--danger .dash-health-strip__icon {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.12);
}

.dash-section {
    margin-bottom: 22px;
}

.dash-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-section__title {
    margin: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.dash-section__desc {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.85;
}

.dash-kpi-tile {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-kpi-tile__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.dash-kpi-tile__icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    opacity: 0.75;
    flex-shrink: 0;
}

.dash-kpi-tile .icarus-kpi-card__label {
    margin: 0;
}

.dash-kpi-tile .icarus-kpi-card__value {
    font-size: 1.55rem !important;
}

.dash-kpi-tile__hint {
    margin-top: auto;
    padding-top: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-secondary);
}

a.dash-kpi-tile--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

a.dash-kpi-tile--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    border-color: rgba(79, 124, 255, 0.35);
}

a.dash-kpi-tile--link:focus-visible {
    outline: 2px solid rgba(79, 124, 255, 0.55);
    outline-offset: 2px;
}

button.dash-kpi-tile--click {
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

button.dash-kpi-tile--click:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    border-color: rgba(79, 124, 255, 0.35);
}

button.dash-kpi-tile--click:focus-visible {
    outline: 2px solid rgba(79, 124, 255, 0.55);
    outline-offset: 2px;
}

html[data-theme="light"] button.dash-kpi-tile--click:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] a.dash-kpi-tile--link:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.dash-bento-panel {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    box-shadow: var(--shadow, none);
    padding: 1.15rem 1.2rem;
}

html[data-theme="dark"] .dash-bento-panel {
    background: color-mix(in srgb, var(--bg-card) 88%, #4f7cff 4%);
    border-color: rgba(148, 163, 184, 0.12);
}

.dash-bento-panel .chart-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.dash-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-panel-head h3 {
    margin: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.dash-panel-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.dash-panel-link {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
}

.dash-panel-link:hover { color: #93c5fd; }

html[data-theme="light"] .dash-panel-link { color: var(--blue); }

.dash-chart-wrap {
    height: 16rem;
    position: relative;
}

.dash-chart-empty {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.dash-chart-empty.is-visible { display: flex; }

.dash-alerts-list {
    flex: 1;
    overflow-y: auto;
    max-height: 17.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.dash-alerts-list.is-loading { min-height: 10rem; }

.dash-alert-row {
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    cursor: pointer;
    transition: background 160ms ease;
    font: inherit;
    color: inherit;
}

.dash-alert-row:last-child { border-bottom: 0; }

.dash-alert-row:hover {
    background: color-mix(in srgb, var(--bg-hover) 70%, transparent);
}

.dash-count-badge {
    font-size: 10px;
    font-weight: 600;
    font-family: ui-monospace, monospace;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.dash-count-badge.is-zero {
    background: color-mix(in srgb, var(--bg-hover) 80%, transparent);
    color: var(--text-secondary);
    border-color: var(--border);
}

.dash-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 480px) {
    .dash-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dash-shortcut-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-hover) 50%, transparent);
    text-decoration: none;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dash-shortcut-tile:hover {
    border-color: rgba(79, 124, 255, 0.35);
    background: rgba(79, 124, 255, 0.08);
    transform: translateY(-1px);
}

.dash-shortcut-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(79, 124, 255, 0.12);
    color: var(--blue);
    flex-shrink: 0;
}

.dash-traffic-bars { display: flex; flex-direction: column; gap: 12px; }

.dash-traffic-row-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.dash-traffic-row-meta strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-traffic-row-meta span {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
}

.dash-traffic-bar {
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 90%, transparent);
    overflow: hidden;
}

.dash-traffic-bar > i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f7cff, #22d3ee);
    min-width: 4%;
}

.dash-panel-empty {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 12px;
}

.preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(110,121,255, 0.28);
    background: rgba(110,121,255, 0.1);
    color: var(--blue);
}

html[data-theme="light"] .preview-badge {
    color: var(--blue);
    background: rgba(110,121,255, 0.08);
}

#btnReload.is-loading { opacity: 0.65; pointer-events: none; }

#btnReload.is-loading::after {
    content: '';
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    margin-left: 0.45rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: dashSpin 0.7s linear infinite;
    vertical-align: -0.15em;
}

@keyframes dashSpin { to { transform: rotate(360deg); } }

.dash-panel-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dash-panel-head__actions .text-xs {
    align-self: center;
}

.dash-sla-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .dash-sla-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .dash-sla-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dash-sla-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    min-width: 0;
}

.dash-sla-tile__main { min-width: 0; flex: 1; }

.dash-sla-tile__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-sla-tile__meta {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-secondary);
}

.dash-sla-tile__pct {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.dash-sla-tile--ok .dash-sla-tile__pct { color: #34d399; }
.dash-sla-tile--warn .dash-sla-tile__pct { color: #fbbf24; }
.dash-sla-tile--danger .dash-sla-tile__pct { color: #fb7185; }

.dash-sla-tile--ok {
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.06);
}

.dash-sla-tile--warn {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}

.dash-sla-tile--danger {
    border-color: rgba(244, 63, 94, 0.25);
    background: rgba(244, 63, 94, 0.06);
}

#dashEmbedSection .dash-empty-state {
    margin-top: 4px;
}

#dashWidgetChartOuter {
    margin-top: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 75%, transparent);
    padding: 12px;
}

.bento-grid .bento-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}
