/* Staff Monitoring Shared Styles
   These styles are used by components in ChartHelper.SharedRazor.StaffMonitoring
   and must be included by any host application using this library.
*/

/* ChartHelper Brand Colors */
:root {
    --ch-primary: #2563eb;
    --ch-primary-dark: #1d4ed8;
    --ch-primary-soft: #eff6ff;
    --ch-secondary: #0f766e;
    --ch-accent: #dc2626;
    --ch-warning: #d97706;
    --ch-success: #16a34a;
    --ch-info: #0891b2;
    --ch-surface: #f5f7fb;
    --ch-surface-strong: #ffffff;
    --ch-border: #dbe3ef;
    --ch-border-soft: #e7edf5;
    --ch-text-primary: #172033;
    --ch-text-secondary: #64748b;
    --ch-text-muted: #94a3b8;
    --ch-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ch-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --ch-radius: 8px;
}

.sm-app-content {
    min-height: 100%;
    background: transparent;
    padding: 1rem 1.25rem 2rem !important;
}

/* =====================================================================
   Staff Monitoring page chrome
   ===================================================================== */
.staff-monitoring-page {
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 2.25rem;
    color: #0f172a;
}

.staff-monitoring-page.fill-viewport {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.staff-monitoring-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 4px;
    margin: 0;
    flex-shrink: 0;
}

.staff-monitoring-page-header-main {
    min-width: 0;
}

.staff-monitoring-page-header .sm-breadcrumb {
    padding: 0 0 7px;
}

.staff-monitoring-page-title {
    margin: 0 0 1px;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: 0;
}

.staff-monitoring-page-subtitle {
    margin: 0;
    max-width: 820px;
    font-size: 11px;
    line-height: 1.35;
    color: #8190a8;
}

.staff-monitoring-page-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-top: 18px;
}

.staff-monitoring-filter-panel,
.staff-monitoring-content-section {
    margin-top: 0;
}

@media (max-width: 760px) {
    .sm-app-content {
        padding: 0.75rem 0.875rem 1.5rem !important;
    }

    .staff-monitoring-page {
        gap: 9px;
    }

    .staff-monitoring-page-header {
        flex-direction: column;
        gap: 7px;
    }

    .staff-monitoring-page-header-actions {
        justify-content: flex-start;
        padding-top: 0;
        width: 100%;
    }
}

.sm-page-shell,
.db-page,
.ur-page,
.at-page,
.alert-page,
.pt-page,
.asv-page {
    position: relative;
    min-height: 300px;
    padding: 0;
}

.sm-filter-bar,
.db-filter-bar,
.ur-filter-bar,
.at-filter-bar,
.alert-filter-bar,
.pt-filter-bar,
.asv-filter-bar,
.atc-toolbar {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--ch-border) !important;
    border-radius: var(--ch-radius) !important;
    box-shadow: var(--ch-shadow-sm) !important;
    padding: 0.875rem 1rem !important;
    margin-bottom: 0.1rem !important;
    gap: 0.875rem !important;
}

.sm-filter-label,
.db-filter-label,
.ur-filter-label,
.at-filter-label,
.alert-filter-label,
.pt-filter-label,
.asv-filter-label,
.atc-bucket-label {
    color: var(--ch-text-muted) !important;
    font-size: 0.68rem !important;
    font-weight: 750 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase;
}

.sm-pill,
.db-range-pill,
.ur-range-pill,
.at-range-pill,
.alert-range-pill,
.atc-bucket-pill,
.ur-tab {
    border-radius: 999px !important;
    border-color: var(--ch-border) !important;
    background: #fff !important;
    color: var(--ch-text-secondary) !important;
    font-weight: 650 !important;
}

.sm-pill:hover,
.db-range-pill:hover,
.ur-range-pill:hover,
.at-range-pill:hover,
.alert-range-pill:hover,
.atc-bucket-pill:hover,
.ur-tab:hover {
    color: var(--ch-primary) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    background: var(--ch-primary-soft) !important;
}

.sm-pill.active,
.db-range-pill.active,
.ur-range-pill.active,
.at-range-pill.active,
.alert-range-pill.active,
.atc-bucket-pill.active,
.ur-tab.active {
    background: var(--ch-primary) !important;
    border-color: var(--ch-primary) !important;
    color: #fff !important;
}

.sm-summary-strip,
.db-summary-strip,
.ur-summary-strip,
.alert-summary-strip,
.pt-summary {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    gap: 0.75rem !important;
    overflow: visible !important;
    margin-bottom: 1rem !important;
}

.sm-stat,
.db-stat,
.ur-stat,
.alert-stat,
.pt-summary-card {
    min-width: 0 !important;
    align-items: flex-start !important;
    background: var(--ch-surface-strong) !important;
    border: 1px solid var(--ch-border-soft) !important;
    border-radius: var(--ch-radius) !important;
    box-shadow: var(--ch-shadow-sm) !important;
    padding: 0.875rem 1rem !important;
}

.db-stat,
.ur-stat {
    border-right: 1px solid var(--ch-border-soft) !important;
}

.db-stat-label,
.ur-stat-label,
.pt-summary-label {
    color: var(--ch-text-muted) !important;
    font-size: 0.68rem !important;
    letter-spacing: 0 !important;
}

.db-stat-value,
.ur-stat-value,
.pt-summary-value {
    color: var(--ch-text-primary) !important;
    font-size: 1.55rem !important;
    margin-top: 0.2rem;
}

.clr-success {
    color: var(--ch-success) !important;
}

.clr-info {
    color: var(--ch-info) !important;
}

.clr-warning {
    color: var(--ch-warning) !important;
}

.clr-danger {
    color: var(--ch-accent) !important;
}

.clr-primary {
    color: var(--ch-primary) !important;
}

.clr-dark {
    color: var(--ch-text-primary) !important;
}

.sm-card,
.db-user-card,
.ur-grid-wrap,
.alert-grid-wrap,
.atc-chart-wrap,
.db-breakdown-wrap,
.ur-breakdown-wrap,
.pt-net-card,
.asv-timeline-wrap {
    background: #fff !important;
    border: 1px solid var(--ch-border-soft) !important;
    border-radius: var(--ch-radius) !important;
    box-shadow: var(--ch-shadow-sm) !important;
}

.db-user-card {
    padding: 0.875rem !important;
}

.db-user-card:hover {
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: var(--ch-shadow-md) !important;
}

.sm-empty,
.db-empty,
.ur-empty,
.at-empty,
.atc-empty,
.pt-empty,
.asv-empty {
    background: #fff !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: var(--ch-radius) !important;
    color: var(--ch-text-secondary) !important;
    padding: 2.25rem 1.25rem !important;
    box-shadow: var(--ch-shadow-sm);
}

.sm-grid-wrap .dxbl-grid,
.ur-grid-wrap .dxbl-grid,
.alert-grid-wrap .dxbl-grid,
.pt-grid-wrap .dxbl-grid {
    border-radius: var(--ch-radius);
}

.ur-grid-wrap .dxbl-grid-header-row>th,
.alert-grid-wrap .dxbl-grid-header-row>th,
.pt-grid-wrap .dxbl-grid-header-row>th {
    background: #f8fafc !important;
    color: var(--ch-text-secondary) !important;
    font-size: 0.72rem !important;
    font-weight: 750 !important;
}

.ur-grid-wrap .dxbl-grid-data-row>td,
.alert-grid-wrap .dxbl-grid-data-row>td,
.pt-grid-wrap .dxbl-grid-data-row>td {
    color: var(--ch-text-primary);
    font-size: 0.8rem !important;
}

.severity-critical,
.severity-warning,
.severity-info,
.alert-type-badge,
.sm-status-badge {
    border-radius: 999px !important;
    font-weight: 700 !important;
    padding: 0.2rem 0.6rem !important;
}

.btn-ack {
    border-radius: 6px !important;
    font-weight: 700 !important;
}

.sm-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sm-context-chip,
.at-tz-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px !important;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: var(--ch-primary-soft) !important;
    color: var(--ch-primary) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 0.24rem 0.6rem !important;
}

.alert-stat-sep {
    display: none !important;
}

.alert-stat strong {
    display: block;
    font-size: 1.35rem !important;
    line-height: 1.2;
    color: var(--ch-text-primary);
    margin-top: 0.15rem;
}

.pt-tabs,
.ur-tabs {
    border-bottom: 1px solid var(--ch-border-soft) !important;
    gap: 0.35rem !important;
    flex-wrap: wrap;
}

html[data-bs-theme="dark"] {
    --ch-surface: #0b1220;
    --ch-surface-strong: #111a2e;
    --ch-surface-muted: #152238;
    --ch-border: #26364f;
    --ch-border-soft: #2a3b55;
    --ch-text-primary: #f8fbff;
    --ch-text-secondary: #cbd8ea;
    --ch-text-muted: #9fb1c9;
    --ch-primary: #60a5fa;
    --ch-primary-soft: rgba(59, 130, 246, .16);
}

html[data-bs-theme="dark"] .sm-card,
html[data-bs-theme="dark"] .db-user-card,
html[data-bs-theme="dark"] .ur-grid-wrap,
html[data-bs-theme="dark"] .alert-grid-wrap,
html[data-bs-theme="dark"] .atc-chart-wrap,
html[data-bs-theme="dark"] .db-breakdown-wrap,
html[data-bs-theme="dark"] .ur-breakdown-wrap,
html[data-bs-theme="dark"] .pt-net-card,
html[data-bs-theme="dark"] .asv-timeline-wrap,
html[data-bs-theme="dark"] .sm-empty,
html[data-bs-theme="dark"] .db-empty,
html[data-bs-theme="dark"] .ur-empty,
html[data-bs-theme="dark"] .at-empty,
html[data-bs-theme="dark"] .atc-empty,
html[data-bs-theme="dark"] .pt-empty,
html[data-bs-theme="dark"] .asv-empty {
    background: var(--ch-surface-strong) !important;
    border-color: var(--ch-border) !important;
    color: var(--ch-text-primary) !important;
    box-shadow: none !important;
}

html[data-bs-theme="dark"] .ur-grid-wrap .dxbl-grid,
html[data-bs-theme="dark"] .alert-grid-wrap .dxbl-grid,
html[data-bs-theme="dark"] .pt-grid-wrap .dxbl-grid {
    background: var(--ch-surface-strong) !important;
    border-color: var(--ch-border) !important;
    color: var(--ch-text-primary) !important;
}

html[data-bs-theme="dark"] .ur-grid-wrap .dxbl-grid-header-row>th,
html[data-bs-theme="dark"] .alert-grid-wrap .dxbl-grid-header-row>th,
html[data-bs-theme="dark"] .pt-grid-wrap .dxbl-grid-header-row>th {
    background: #0f1a2d !important;
    border-color: var(--ch-border-soft) !important;
    color: var(--ch-text-secondary) !important;
}

html[data-bs-theme="dark"] .ur-grid-wrap .dxbl-grid-data-row>td,
html[data-bs-theme="dark"] .alert-grid-wrap .dxbl-grid-data-row>td,
html[data-bs-theme="dark"] .pt-grid-wrap .dxbl-grid-data-row>td {
    background: var(--ch-surface-strong) !important;
    border-color: var(--ch-border-soft) !important;
    color: var(--ch-text-primary) !important;
}
