/* Scoped styles for Filament monitoring widgets (Tailwind utilities are not available in panel CSS). */

.uptime-report {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.uptime-report__header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .uptime-report__header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.uptime-report__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
}

.dark .uptime-report__title,
html.dark .uptime-report__title {
    color: #fff;
}

.uptime-report__meta {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.uptime-report__filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.04);
    max-width: 100%;
}

.dark .uptime-report__filters,
html.dark .uptime-report__filters {
    background: rgba(255, 255, 255, 0.06);
}

.uptime-report__filter {
    border: 0;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.dark .uptime-report__filter,
html.dark .uptime-report__filter {
    color: #9ca3af;
}

.uptime-report__filter:hover {
    color: var(--gray-950, #0a0a0a);
}

.dark .uptime-report__filter:hover,
html.dark .uptime-report__filter:hover {
    color: #fff;
}

.uptime-report__filter.is-active {
    background: #fff;
    color: var(--gray-950, #0a0a0a);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.dark .uptime-report__filter.is-active,
html.dark .uptime-report__filter.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: none;
}

.uptime-report__kpis {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
    .uptime-report__kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.uptime-report__kpi {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.85rem 1rem;
}

.dark .uptime-report__kpi,
html.dark .uptime-report__kpi {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.uptime-report__kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
}

.uptime-report__kpi-value {
    margin-top: 0.35rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.uptime-report__kpi-value--xl {
    font-size: 1.875rem;
    line-height: 1;
}

.uptime-report__kpi-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.uptime-report__tone-up { color: #10b981; }
.uptime-report__tone-warn { color: #f59e0b; }
.uptime-report__tone-down { color: #ef4444; }

.uptime-report__strip {
    display: flex;
    width: 100%;
    height: 2.5rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.08);
}

.dark .uptime-report__strip,
html.dark .uptime-report__strip {
    background: rgba(255, 255, 255, 0.12);
}

.uptime-report__bucket {
    flex: 1 1 0;
    min-width: 3px;
}

.uptime-report__bucket--up { background: #10b981; }
.uptime-report__bucket--warn { background: #f59e0b; }
.uptime-report__bucket--down { background: #ef4444; }
.uptime-report__bucket--empty { background: #9ca3af; }

.dark .uptime-report__bucket--empty,
html.dark .uptime-report__bucket--empty {
    background: #4b5563;
}

.uptime-report__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.uptime-report__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.uptime-report__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.uptime-report__swatch {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 0.15rem;
}

.uptime-report__swatch--up { background: #10b981; }
.uptime-report__swatch--warn { background: #f59e0b; }
.uptime-report__swatch--down { background: #ef4444; }
.uptime-report__swatch--empty { background: #9ca3af; }

.uptime-report__empty {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
}

/* Dashboard overview list */
.uptime-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.uptime-overview__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

@media (min-width: 640px) {
    .uptime-overview__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.uptime-overview__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
}

.dark .uptime-overview__title,
html.dark .uptime-overview__title {
    color: #fff;
}

.uptime-overview__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.uptime-overview__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.uptime-overview__row {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.75rem;
}

.uptime-overview__row--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.uptime-overview__row--link:hover {
    border-color: rgba(0, 0, 0, 0.16);
    background: rgba(0, 0, 0, 0.05);
}

.dark .uptime-overview__row--link:hover,
html.dark .uptime-overview__row--link:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.dark .uptime-overview__row,
html.dark .uptime-overview__row {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.uptime-overview__row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.uptime-overview__host {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.uptime-overview__pct {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.uptime-overview__strip {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.08);
}

.dark .uptime-overview__strip,
html.dark .uptime-overview__strip {
    background: rgba(255, 255, 255, 0.12);
}

/* Lighthouse trend */
.lh-trend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lh-trend__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.lh-trend__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
}

.dark .lh-trend__title,
html.dark .lh-trend__title {
    color: #fff;
}

.lh-trend__meta {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.lh-trend__rows {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

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

.lh-trend__row {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.75rem;
}

.dark .lh-trend__row,
html.dark .lh-trend__row {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.lh-trend__row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.lh-trend__label {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}

.dark .lh-trend__label,
html.dark .lh-trend__label {
    color: #9ca3af;
}

.lh-trend__values {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.lh-trend__latest {
    font-size: 1rem;
    font-weight: 600;
}

.lh-trend__delta {
    font-size: 0.75rem;
    font-weight: 600;
}

.lh-trend__spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 44px;
}

.lh-trend__bar {
    flex: 1 1 0;
    min-width: 4px;
    max-width: 18px;
    border-radius: 3px 3px 1px 1px;
    background: #10b981;
}

.lh-trend__bar--empty {
    background: #9ca3af;
    opacity: 0.45;
}

.dark .lh-trend__bar--empty,
html.dark .lh-trend__bar--empty {
    background: #4b5563;
    opacity: 0.7;
}

.latency-strip {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.latency-strip__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
}

.latency-strip__bars {
    height: 1.25rem;
}

.incident-metrics {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .incident-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.incident-metrics__item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.75rem 1rem;
}

.dark .incident-metrics__item,
html.dark .incident-metrics__item {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.incident-metrics__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
}

.incident-metrics__value {
    margin-top: 0.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.incident-table-wrap {
    overflow-x: auto;
}

.incident-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.incident-table th,
.incident-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.incident-table th {
    text-align: left;
    font-weight: 500;
    color: var(--gray-500, #6b7280);
}

.incident-table th:last-child,
.incident-table td:last-child {
    text-align: right;
}

.incident-table tbody tr {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dark .incident-table tbody tr,
html.dark .incident-table tbody tr {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Site hero (command center) */
.site-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-hero__main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.site-hero__preview {
    width: 64px;
    height: 64px;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.06);
}

.site-hero__host {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
    word-break: break-all;
}

.dark .site-hero__host,
html.dark .site-hero__host {
    color: #fff;
}

.site-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.site-hero__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.site-hero__badge--up { background: rgba(16, 185, 129, 0.15); color: #059669; }
.site-hero__badge--warn { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.site-hero__badge--down { background: rgba(239, 68, 68, 0.15); color: #dc2626; }

.dark .site-hero__badge--up,
html.dark .site-hero__badge--up { color: #34d399; }
.dark .site-hero__badge--warn,
html.dark .site-hero__badge--warn { color: #fbbf24; }
.dark .site-hero__badge--down,
html.dark .site-hero__badge--down { color: #f87171; }

.site-hero__grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
    .site-hero__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.site-hero__metric {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.75rem 1rem;
}

.dark .site-hero__metric,
html.dark .site-hero__metric {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.site-hero__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500, #6b7280);
}

.site-hero__value {
    margin-top: 0.3rem;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.site-hero__value--sm {
    font-size: 0.95rem;
}

.site-hero__hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}
