/* Operations and finance hub surfaces. */
/* -- Operations hub (Tenant Admin Dashboard) -- */
.ops-hub {
    padding-bottom: 5.5rem;
}

.ops-hub-hero {
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    background:
        var(--admin-hero-glow),
        var(--admin-hero-gradient);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 28px rgba(11, 31, 51, 0.22);
}

.ops-hub-hero__eyebrow {
    color: #99F6E4 !important;
    letter-spacing: 0.14em;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
}

.ops-hub-hero__title {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: clamp(1.75rem, 3vw, 2.125rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 !important;
}

.ops-hub-hero__subtitle {
    color: var(--admin-border-strong) !important;
    max-width: 36rem;
    margin: 0 !important;
}

.ops-hub-hero__meta {
    margin-top: 0.25rem;
}

.ops-hub-hero__chip {
    background: rgba(13, 148, 136, 0.28) !important;
    color: #ECFEFF !important;
    border: 1px solid rgba(45, 212, 191, 0.35);
}

.ops-hub-hero__refreshed {
    color: var(--admin-text-subtle) !important;
}

.ops-hub-hero__actions {
    flex-shrink: 0;
}

.ops-hub-hero__cta-primary.mud-button-filled,
.ops-hub-hero__cta.mud-button-outlined,
.ops-hub-hero__refresh.mud-button-text {
    min-height: 2.5rem;
    padding-inline: 1rem !important;
    border-radius: 0.65rem !important;
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
}

.ops-hub-hero__cta-primary.mud-button-filled {
    background: var(--admin-primary-cta) !important;
    color: #fff !important;
}

.ops-hub-hero__cta-primary.mud-button-filled:hover {
    background: var(--admin-primary-cta-hover) !important;
}

.ops-hub-hero__cta.mud-button-outlined {
    color: var(--admin-border) !important;
    border-color: rgba(226, 232, 240, 0.45) !important;
}

.ops-hub-hero__cta.mud-button-outlined:hover {
    border-color: #99F6E4 !important;
    background: rgba(13, 148, 136, 0.12) !important;
}

.ops-hub-hero__refresh.mud-button-text {
    color: var(--admin-text-subtle) !important;
}

.ops-hub-skeleton {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
}

.ops-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ops-section-heading h2 {
    color: var(--admin-text);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0;
}

.ops-section-heading__status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    color: var(--admin-text-soft);
    text-align: right;
}

.ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

/* Umami-like metric cards: flat white, large value, quiet label. */
.ops-kpi {
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #fff;
    padding: 1rem 1.1rem 1.05rem;
    height: 100%;
    min-height: 112px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ops-kpi::before {
    display: none;
}

.ops-kpi__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.ops-kpi:hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transform: none;
    border-color: color-mix(in srgb, var(--admin-border-strong) 70%, white);
}

.ops-kpi__label {
    color: var(--admin-text) !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em;
    text-transform: none;
    font-size: 0.8125rem !important;
    line-height: 1.25 !important;
}

.ops-kpi__icon {
    color: var(--admin-muted) !important;
    font-size: 1.05rem !important;
    opacity: 0.55;
}

.ops-kpi__value {
    font-weight: 750 !important;
    color: var(--admin-text) !important;
    letter-spacing: -0.03em;
    line-height: 1.05;
    font-size: 1.85rem !important;
    font-variant-numeric: tabular-nums;
    margin-top: 0.15rem !important;
}

.ops-kpi__value--muted {
    color: var(--admin-muted) !important;
}

.ops-kpi__hint {
    color: var(--admin-muted) !important;
    margin-top: 0.45rem !important;
    font-size: 0.75rem !important;
}

.ops-kpi__definition,
.ops-kpi__source {
    display: block;
    margin-top: 0.35rem !important;
    color: var(--admin-muted) !important;
    line-height: 1.35 !important;
    font-size: 0.7rem !important;
}

.ops-kpi__source {
    padding-top: 0.4rem;
    border-top: 1px solid var(--admin-border);
    font-variant-numeric: tabular-nums;
}

/* Optional period-change pill (use only when a real comparison exists). */
.ops-kpi__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.55rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    width: fit-content;
}

.ops-kpi__trend--up {
    color: #15803d;
    background: rgba(34, 197, 94, 0.14);
}

.ops-kpi__trend--down {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.ops-kpi__trend--flat {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.10);
}

.ops-attention-list,
.ops-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.ops-attention,
.ops-activity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: #fff;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ops-attention:hover,
.ops-activity:hover {
    border-color: var(--admin-border-strong);
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
}

.ops-attention__rank {
    display: grid;
    place-items: center;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--admin-surface-subtle);
    color: var(--admin-text);
    font-weight: 750;
}

.ops-attention--critical { border-left: 4px solid var(--admin-danger); }
.ops-attention--warning { border-left: 4px solid var(--admin-warning); }
.ops-attention--info { border-left: 4px solid var(--admin-info); }

.ops-attention__body,
.ops-activity__body {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
    flex: 1 1 auto;
}

.ops-attention__title,
.ops-activity__title {
    color: var(--admin-text);
    font-weight: 700;
}

.ops-attention__detail,
.ops-activity__detail,
.ops-attention__source {
    color: var(--admin-text-soft);
    font-size: 0.8rem;
}

.ops-attention__source {
    color: var(--admin-muted);
}

.ops-attention__arrow {
    color: var(--admin-muted) !important;
}

.ops-activity time {
    flex: 0 0 auto;
    color: var(--admin-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.ops-activity__detail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-activity__severity {
    flex: 0 0 0.65rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--admin-info);
}

.ops-activity__severity--critical { background: var(--admin-danger); }
.ops-activity__severity--warning { background: var(--admin-warning); }
.ops-activity__severity--success { background: var(--admin-success); }

.ops-metric {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
    padding: 1.1rem 1.2rem;
    height: 100%;
    transition: box-shadow 0.2s ease, border-color 0.15s ease;
}

.ops-metric:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    border-color: var(--admin-border-strong);
}

.ops-metric__label {
    color: var(--admin-muted) !important;
    font-weight: 600 !important;
}

.ops-metric__value {
    font-weight: 700 !important;
    color: var(--admin-text) !important;
    letter-spacing: -0.02em;
}

.ops-metric__hint {
    color: var(--admin-muted) !important;
}

.ops-metric__bar {
    border-radius: 999px;
    overflow: hidden;
}

.ops-panel {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
    height: 100%;
    min-height: 148px;
}

.ops-panel__title {
    font-weight: 650 !important;
    color: var(--admin-text) !important;
}

.ops-panel__subtitle {
    color: var(--admin-muted) !important;
}

.ops-panel__pct {
    color: var(--admin-text) !important;
    font-weight: 700 !important;
}

.ops-panel__legend {
    color: var(--admin-muted);
}

.ops-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.ops-dot--success { background: var(--admin-success); }
.ops-dot--muted { background: var(--admin-text-subtle); }

.ops-hub-actions-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
    pointer-events: none;
}

.ops-hub-actions-bar__inner {
    pointer-events: auto;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 0.65rem 1rem;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
}

.ops-hub-actions-bar__buttons {
    justify-content: flex-end;
    max-width: 100%;
}

.ops-hub-actions-bar__label {
    color: var(--admin-muted) !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ops-hub .settings-nav-card {
    height: 100%;
    border-radius: 14px;
    box-shadow: none;
}

.ops-hub .settings-nav-card:hover {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.ops-hub .settings-nav-card__title {
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .ops-hub-hero__row {
        flex-direction: column !important;
    }

    .ops-hub-hero__actions {
        align-items: stretch !important;
        width: 100%;
    }

    .ops-hub-hero__actions .mud-stack {
        justify-content: flex-start !important;
    }

    .ops-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .ops-section-heading__status {
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 600px) {
    .ops-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ops-attention,
    .ops-activity {
        align-items: flex-start;
    }

    .ops-activity time {
        display: none;
    }
}
/* -- Finance hub -- */
.fin-hub-hero {
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    background:
        var(--admin-hero-glow-strong),
        var(--admin-hero-gradient-finance);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 28px rgba(11, 31, 51, 0.2);
}

.fin-hub-hero__eyebrow {
    color: #99F6E4 !important;
    letter-spacing: 0.14em;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
}

.fin-hub-hero__title {
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    margin: 0 !important;
}

.fin-hub-hero__subtitle {
    color: var(--admin-border) !important;
    max-width: 36rem;
    margin: 0 !important;
}

.fin-hub-hero__cta-primary.mud-button-filled,
.fin-hub-hero__cta.mud-button-outlined,
.fin-hub-hero__refresh.mud-button-text {
    min-height: 2.5rem;
    padding-inline: 1rem !important;
    border-radius: 0.65rem !important;
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
}

.fin-hub-hero__cta-primary.mud-button-filled {
    background: var(--admin-primary-cta) !important;
    color: #fff !important;
}

.fin-hub-hero__cta-primary.mud-button-filled:hover {
    background: var(--admin-primary-cta-hover) !important;
}

.fin-hub-hero__cta.mud-button-outlined {
    color: var(--admin-surface-subtle) !important;
    border-color: rgba(248, 250, 252, 0.55) !important;
}

.fin-hub-hero__cta.mud-button-outlined:hover {
    border-color: #99F6E4 !important;
    background: rgba(13, 148, 136, 0.12) !important;
}

.fin-hub-hero__refresh.mud-button-text {
    color: var(--admin-border) !important;
    text-transform: none;
}

.fin-hub-hero__refresh.mud-button-text:hover {
    color: #fff !important;
    background: rgba(248, 250, 252, 0.08) !important;
}

/* Breadcrumbs on dark hero (WCAG AA on var(--admin-navy-950)) */
.fin-hub-hero .mud-breadcrumbs,
.fin-hub-hero .admin-page-breadcrumb {
    color: var(--admin-border) !important;
}

.fin-hub-hero .mud-breadcrumb,
.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-item,
.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-item .mud-button-root,
.fin-hub-hero .mud-breadcrumbs a {
    color: var(--admin-border-strong) !important;
}

.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-item:hover,
.fin-hub-hero .mud-breadcrumbs a:hover {
    color: var(--admin-surface-subtle) !important;
}

.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-item.active,
.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-item[aria-current="page"] {
    color: var(--admin-surface) !important;
    font-weight: 600;
}

.fin-hub-hero .mud-breadcrumbs .mud-breadcrumb-separator {
    color: var(--admin-text-subtle) !important;
}

.fin-hub-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
}

.fin-hub-rail__label {
    font-weight: 700 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--admin-text-subtle) !important;
    margin: 0 !important;
}

.fin-hub-rail__links .mud-chip {
    text-transform: none;
    font-weight: 550;
    border-color: var(--admin-border-strong) !important;
}

.fin-hub-rail__links .mud-chip:hover {
    border-color: var(--admin-primary) !important;
    color: var(--admin-primary-dark) !important;
}

.fin-hub-summary-meta {
    color: var(--admin-text-soft) !important;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 960px) {
    .fin-hub-hero__row {
        flex-direction: column !important;
    }

    .fin-hub-hero__actions {
        align-items: stretch !important;
        width: 100%;
    }

    .fin-hub-hero__actions .mud-stack {
        justify-content: flex-start !important;
    }
}
