@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --mud-default-borderradius: 10px !important;
    --mud-palette-surface: #11161E !important;
}

html, body {
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2Lj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"An error has occurred."
}

.blur-background {
    backdrop-filter: blur(10px);
}

.timeline-date {
    font-size: 10px;
}

.hidden {
    display: none;
}

.mud-tabs-toolbar {
    position: relative;
    background-color: transparent;
    /* background-color: var(--mud-palette-surface); */
}

/* Mega admin — app bar + fixed nav rail, scrollable page content only */
.mega-admin-layout.mud-layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.mega-admin-appbar.mud-appbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 0 0 auto;
    min-height: 64px;
    z-index: 1200;
}

.mega-admin-main-content.mud-main-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
}

.mega-admin-main-content--shell.mud-main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mega-admin-frame {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.mega-admin-nav-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 62px;
    min-width: 62px;
    flex-shrink: 0;
    align-self: stretch;
    padding: 8px 4px;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.15);
}

.mega-admin-nav-rail__divider {
    width: 32px;
    height: 1px;
    margin: 8px 0 4px;
    background: rgba(255, 255, 255, 0.1);
}

.mega-admin-nav-rail__label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 9px !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.45;
    margin: 4px 0 8px;
    user-select: none;
}

.mega-admin-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mega-admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--mud-palette-text-primary);
}

.mega-admin-nav-link.active {
    background: rgba(104, 162, 209, 0.2);
    color: var(--mud-palette-primary);
}

.mega-admin-nav-link__icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-admin-nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--mud-palette-surface);
}

.mega-admin-nav-badge--error { background-color: var(--mud-palette-error); }
.mega-admin-nav-badge--warning { background-color: var(--mud-palette-warning); }
.mega-admin-nav-badge--success { background-color: var(--mud-palette-success); }
.mega-admin-nav-badge--default { background-color: var(--mud-palette-info); }

.mega-admin-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.mega-admin-main:has(.admin-page--fill) {
    overflow: hidden;
}

.admin-page {
    width: 100%;
}

.admin-page--fill {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.mud-breadcrumbs {
    font-size: 11px;
}

.mud-table-cell {
    padding: 7px;
}

.mud-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mud-table-cell .mud-link {
    color: var(--mud-palette-text-primary) !important;
    text-decoration: underline;
    font-size: 14px;
    text-underline-offset: 3px;
}

input:-internal-autofill-selected,
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    appearance: menulist-button;
    background-image: none !important;
    background-color: transparent !important;
    color: fieldtext !important;
}

@media (max-width: 850px) {
    .full-sm {
        width: 100% !important;
    }
}

.environment-stamp {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 4px;
    margin-top: 14px;
}

.environment-stamp.tier-dev {
    background: rgba(41, 182, 246, 0.12);
    color: #b3e5fc;
}

.environment-stamp.tier-staging {
    background: rgba(255, 179, 0, 0.14);
    color: #ffe082;
}

.environment-stamp.tier-prod {
    background: rgba(255, 23, 68, 0.16);
    color: #ff8a80;
}

/* Dashboard widget shell (same gradient treatment as former .control-room-node) */
.mega-widget-card {
    position: relative;
    border-radius: 14px !important;
    border: 1px solid rgba(0, 229, 255, 0.15);
    background: linear-gradient(165deg, rgba(18, 24, 32, 0.95), rgba(10, 14, 20, 0.92)) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.45);
}

.mega-widget-card .mud-card-header,
.mega-widget-card .mud-card-content,
.mega-widget-card .mud-card-actions {
    background-color: transparent !important;
}

/* Server host widget: drop card-content padding so loading/offline overlays span the full mega-widget surface */
.mega-widget-card > .mud-card-content:has(.control-room-card-shell) {
    padding: 0 !important;
}

.dashboard-panel-inner > .mud-paper {
    background: transparent;
    box-shadow: none;
}

/* Single-widget dashboards that should fill the tab panel height (fleet map) */
.dashboard-panel-inner.dashboard-panel-inner--fill {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    width: 100%;
}

.dashboard-panel-inner.dashboard-panel-inner--fill > .mud-paper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
}

.dashboard-panel-inner.dashboard-panel-inner--fill .mega-widget-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-panel-inner.dashboard-panel-inner--fill .mega-widget-card > .mud-card-header {
    flex-shrink: 0;
}

.dashboard-panel-inner.dashboard-panel-inner--fill .mega-widget-card > .mud-card-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mega-widget-card:has(.fleet-world-map) > .mud-card-content {
    padding: 10px 12px 12px !important;
}

.mega-widget-card:has(.fleet-world-map) > .mud-card-header {
    flex-shrink: 0;
}

/* Fleet pulse — rollup expansion panels (no outer MudPaper) */
.rollup-panels.mud-expansion-panels {
    background: transparent;
}

.rollup-panel.mud-expansion-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.rollup-panel.health-healthy {
    border-left: 4px solid #00c853;
}

.rollup-panel.health-degraded {
    border-left: 4px solid #ffc107;
}

.rollup-panel.health-offline {
    border-left: 4px solid #ff5252;
}

.sparkline-wrap {
    position: relative;
    height: 72px;
    border-radius: 8px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 12px),
    linear-gradient(180deg, rgba(0, 229, 255, 0.04), transparent);
    border: 1px solid rgba(0, 229, 255, 0.12);
}

.sparkline-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.spark-legend {
    position: absolute;
    right: 8px;
    top: 6px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
}

.spark-legend .lg-cpu {
    color: #00e5ff;
    margin-right: 10px;
}

.spark-legend .lg-pl {
    color: #ff00aa;
}

.health-dot.health-healthy {
    border: 1px solid #00c853;
}

.health-dot.health-degraded {
    border: 1px solid #ffc107;
}

.health-dot.health-offline {
    border: 1px solid #ff5252;
}

/* Fleet world map — MapLibre GL; grows with dashboard when tab uses StretchContent */
.fleet-world-map {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.fleet-world-map__surface {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 200px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.12);
    box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.25);
}

.fleet-world-map__map-host {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.fleet-world-map__map-host .maplibregl-canvas {
    outline: none;
}

.fleet-world-map__map-host .maplibregl-ctrl-top-right {
    margin-top: 6px;
    margin-right: 6px;
}

.maplibregl-popup-content {
    border-radius: 10px !important;
    padding: 12px 14px !important;
    background: rgba(14, 20, 30, 0.96) !important;
    border: 1px solid rgba(0, 229, 255, 0.18);
    color: #e8eaed;
}

.maplibregl-popup-tip {
    border-top-color: rgba(14, 20, 30, 0.96) !important;
}

.fma-popup-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.fma-popup-meta {
    font-size: 12px;
    opacity: 0.78;
    margin-top: 2px;
}

.fma-popup-status {
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.fma-popup-status--healthy {
    color: #69f0ae;
}

.fma-popup-status--degraded {
    color: #ffd54f;
}

.fma-popup-status--offline {
    color: #ff8a80;
}

.fma-popup-err {
    font-size: 12px;
    color: #ff8a80;
    margin-top: 8px;
    line-height: 1.35;
}

.fma-popup-actions {
    margin: 10px 0 0;
}

.fma-popup-actions a {
    color: #80deea;
    font-weight: 500;
}

.control-room-card-shell {
    position: relative;
    min-height: 320px;
}

.card-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 14px;
    pointer-events: auto;
}

.card-overlay-loading {
    background: rgba(6, 10, 18, 0.82);
    backdrop-filter: blur(3px);
}

.card-overlay-offline {
    background: rgba(28, 8, 12, 0.88);
    backdrop-filter: blur(3px);
}


.mud-tabs-tabbar {
    background-color: transparent !important;
}

.mud-tab-slider.mud-tab-slider-vertical {
    display: none;
}

.mud-appbar{
    background-color: rgba(0,0,0,0.25);
}

.mud-layout {
    background-color: #0F141B;
}

.mud-tabs-tabbar.mud-tabs-border-left {
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* Content Management page */
.content-page-shell {
    width: 100%;
}

.story-layouts-editor {
    width: 100%;
    --story-layouts-preview-chrome: 18rem;
}

.story-layouts-editor .mud-paper {
    background-color: var(--mud-palette-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--mud-default-borderradius);
}

.story-layouts-select,
.story-layouts-input {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--mud-default-borderradius);
    padding: 0.4rem 0.65rem;
    font-size: 0.875rem;
    min-height: 40px;
}

.story-layouts-select:focus,
.story-layouts-input:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
}

.story-layouts-editor .story-title-input.story-layouts-input {
    height: 40px;
    font-size: 0.875rem;
    line-height: 1.25;
    padding-block: 0.25rem;
    font-weight: 700;
}

.story-layouts-editor .story-title-display {
    border-radius: var(--mud-default-borderradius);
    padding: 0.25rem 0.75rem;
}

.story-layouts-editor .layout-page-text-input.form-control,
.story-layouts-editor .layout-page-text-input {
    background-color: rgba(0, 0, 0, 0.35);
    color: var(--mud-palette-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.story-layouts-page-nav {
    display: inline-flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--mud-default-borderradius);
    overflow: hidden;
}

.story-layouts-nav-btn {
    background: transparent;
    color: var(--mud-palette-text-primary);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.story-layouts-nav-btn:last-child {
    border-right: none;
}

.story-layouts-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

.story-layouts-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Knowledge browser */
.knowledge-browser {
    width: 100%;
}

.knowledge-browser .mud-paper {
    background-color: var(--mud-palette-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--mud-default-borderradius);
}

.knowledge-browser__surface {
    width: 100%;
}

.knowledge-browser__sync-strip {
    display: block;
    width: 100%;
    margin: -0.5rem 0 1rem;
}

.knowledge-browser__sync-strip .mud-progress-linear {
    width: 100%;
    margin-bottom: 0.5rem;
}

.knowledge-browser__search {
    max-width: 420px;
}

.knowledge-browser__table code {
    font-size: 0.8125rem;
    color: #9ec5e8;
}

.knowledge-browser__field-name {
    width: 28%;
    white-space: nowrap;
    vertical-align: top;
    font-weight: 500;
}

.knowledge-browser__field-value {
    white-space: pre-wrap;
    word-break: break-word;
}

.knowledge-browser__issues-card {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--mud-default-borderradius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.knowledge-browser__issues-card--warning {
    border-left: 4px solid var(--mud-palette-warning);
    background-color: rgba(255, 193, 7, 0.08);
}

.knowledge-browser__issues-card--error {
    border-left: 4px solid var(--mud-palette-error);
    background-color: rgba(244, 67, 54, 0.08);
}

.knowledge-browser__issues-heading {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

.knowledge-browser__issues-panel {
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
}

.knowledge-browser__warnings {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
}

.knowledge-browser__warnings li {
    word-break: break-word;
}

.knowledge-browser__warnings li + li {
    margin-top: 0.25rem;
}