/*
 * Pentagon Command Center Theme
 * Scoped to monitoring pages only via body[data-monitoring-page="true"] or .pent-shell
 * Dark navy + neon green/amber + monospace for tactical look
 */

.pent-shell {
    --pent-bg-deep: #06101c;
    --pent-bg-mid: #0c1a2d;
    --pent-bg-card: #0f2440;
    --pent-bg-card-2: #122c4d;
    --pent-border: rgba(94, 234, 212, 0.18);
    --pent-border-strong: rgba(94, 234, 212, 0.45);
    --pent-grid: rgba(94, 234, 212, 0.06);
    --pent-neon-green: #5eead4;
    --pent-neon-green-bright: #2dd4bf;
    --pent-neon-amber: #fbbf24;
    --pent-neon-red: #ef4444;
    --pent-neon-blue: #38bdf8;
    --pent-text: #d1e5f3;
    --pent-text-dim: #7a96b0;
    --pent-text-bright: #f1f9ff;
    --pent-mono: 'Consolas', 'Cascadia Code', 'Courier New', monospace;

    /* Override Jafam tokens for monitoring scope */
    --jf-text: var(--pent-text);
    --jf-text-soft: var(--pent-text-dim);
    --jf-border: var(--pent-border);
    --jf-surface-glass: var(--pent-bg-card);
    --jf-shadow-rest: 0 0 0 1px var(--pent-border), 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    --jf-bg: var(--pent-bg-deep);

    background:
        radial-gradient(ellipse at top, rgba(94, 234, 212, 0.05), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.04), transparent 50%),
        linear-gradient(135deg, var(--pent-bg-deep) 0%, var(--pent-bg-mid) 100%);
    color: var(--pent-text);
    font-family: var(--pent-mono);
    position: relative;
    min-height: 100vh;
}

/* Tactical grid background overlay */
.pent-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--pent-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--pent-grid) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.pent-shell > * {
    position: relative;
    z-index: 1;
}

/* Classification banner */
.pent-classify {
    background: var(--pent-neon-green);
    color: #000;
    text-align: center;
    font-family: var(--pent-mono);
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    padding: 3px 10px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--pent-border-strong);
    box-shadow: 0 1px 0 rgba(94, 234, 212, 0.3);
}

.pent-classify--bottom {
    border-bottom: none;
    border-top: 1px solid var(--pent-border-strong);
    box-shadow: 0 -1px 0 rgba(94, 234, 212, 0.3);
    margin-top: 12px;
}

.pent-classify--warning {
    background: var(--pent-neon-amber);
}

.pent-classify--critical {
    background: var(--pent-neon-red);
    color: #fff;
}

/* Section titles */
.pent-shell .jf-zbx__section-title {
    color: var(--pent-neon-green);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: var(--pent-mono);
    font-weight: 700;
    border-bottom: 1px solid var(--pent-border);
    padding-bottom: 6px;
    margin-top: 10px;
}

.pent-shell .jf-zbx__section-title::before {
    content: "▸";
    color: var(--pent-neon-green-bright);
    margin-left: 4px;
    text-shadow: 0 0 8px var(--pent-neon-green-bright);
}

/* Card panels */
.pent-shell .jf-zbx__gauge-card,
.pent-shell .jf-zbx__chart-card,
.pent-shell .jf-zbx__alerts-card,
.pent-shell .jf-zbx__alerts,
.pent-shell .jf-zbx__panel,
.pent-shell .jf-zbx__toolbar,
.pent-shell .jf-thr__panel,
.pent-shell .jf-mdt__panel,
.pent-shell .jf-mdt__big {
    background: linear-gradient(180deg, var(--pent-bg-card) 0%, var(--pent-bg-card-2) 100%);
    border: 1px solid var(--pent-border);
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(94, 234, 212, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--pent-text);
    position: relative;
}

/* Corner brackets — tactical HUD feel */
.pent-shell .jf-zbx__gauge-card::before,
.pent-shell .jf-zbx__chart-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 12px; height: 12px;
    border-top: 1px solid var(--pent-neon-green-bright);
    border-left: 1px solid var(--pent-neon-green-bright);
    box-shadow: -1px -1px 4px rgba(45, 212, 191, 0.3);
}

.pent-shell .jf-zbx__gauge-card::after,
.pent-shell .jf-zbx__chart-card::after {
    content: "";
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    border-bottom: 1px solid var(--pent-neon-green-bright);
    border-right: 1px solid var(--pent-neon-green-bright);
    box-shadow: 1px 1px 4px rgba(45, 212, 191, 0.3);
}

.pent-shell .jf-zbx__chart-title,
.pent-shell .jf-zbx__gauge-title {
    color: var(--pent-neon-green);
    text-transform: uppercase;
    font-family: var(--pent-mono);
    letter-spacing: 0.08em;
    font-weight: 700;
    font-size: 0.78rem;
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--pent-border);
}

/* Gauge customization */
.pent-shell .jf-zbx__gauge-value {
    color: var(--pent-text-bright);
    font-family: var(--pent-mono);
    text-shadow: 0 0 8px rgba(94, 234, 212, 0.6);
}

.pent-shell .jf-zbx-gauge-arc-track {
    stroke: rgba(94, 234, 212, 0.15);
}

.pent-shell .jf-zbx-gauge-arc-fill-ok {
    stroke: var(--pent-neon-green-bright);
    filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.6));
}

.pent-shell .jf-zbx-gauge-arc-fill-warn {
    stroke: var(--pent-neon-amber);
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.pent-shell .jf-zbx-gauge-arc-fill-crit {
    stroke: var(--pent-neon-red);
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.7));
}

.pent-shell .jf-zbx-gauge-needle {
    stroke: var(--pent-text-bright);
    filter: drop-shadow(0 0 2px rgba(241, 249, 255, 0.8));
}

/* Sparkline */
.pent-shell .jf-zbx__sparkline span {
    background: linear-gradient(180deg, var(--pent-neon-green-bright), var(--pent-neon-blue));
    box-shadow: 0 0 3px rgba(45, 212, 191, 0.4);
}

/* Meta tables (chart bottom) */
.pent-shell .jf-zbx__chart-meta {
    border-top: 1px solid var(--pent-border);
    color: var(--pent-text-dim);
    font-family: var(--pent-mono);
    font-size: 0.7rem;
}

.pent-shell .jf-zbx__chart-meta-header {
    color: var(--pent-neon-green);
    text-shadow: 0 0 4px rgba(94, 234, 212, 0.4);
}

/* Tables (alerts, thresholds) */
.pent-shell .jf-zbx__alerts table,
.pent-shell .jf-thr__table {
    color: var(--pent-text);
    font-family: var(--pent-mono);
    font-size: 0.78rem;
}

.pent-shell .jf-zbx__alerts th,
.pent-shell .jf-thr__table th {
    background: rgba(94, 234, 212, 0.08);
    color: var(--pent-neon-green);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    border-bottom: 1px solid var(--pent-border-strong);
}

.pent-shell .jf-zbx__alerts td,
.pent-shell .jf-thr__table td {
    border-bottom: 1px solid var(--pent-border);
}

.pent-shell .jf-zbx__sev-critical {
    color: var(--pent-neon-red);
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    text-transform: uppercase;
}

.pent-shell .jf-zbx__sev-warning {
    color: var(--pent-neon-amber);
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
    text-transform: uppercase;
}

/* Metric pill (threshold metric chips) */
.pent-shell .jf-thr__metric-pill {
    background: rgba(94, 234, 212, 0.1);
    color: var(--pent-neon-green-bright);
    border: 1px solid var(--pent-border);
    font-family: var(--pent-mono);
    text-shadow: 0 0 4px rgba(94, 234, 212, 0.3);
}

.pent-shell .jf-thr__disabled-row {
    opacity: 0.4;
    text-decoration: line-through;
}

/* Detail page big metric boxes */
.pent-shell .jf-mdt__big-label {
    color: var(--pent-neon-green);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--pent-mono);
    font-size: 0.7rem;
}

.pent-shell .jf-mdt__big-value {
    color: var(--pent-text-bright);
    font-family: var(--pent-mono);
    text-shadow: 0 0 10px rgba(94, 234, 212, 0.4);
    font-weight: 800;
}

.pent-shell .jf-mdt__big-sub {
    color: var(--pent-text-dim);
    font-family: var(--pent-mono);
}

/* MudBlazor button overrides inside pent-shell */
.pent-shell .mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--pent-neon-green-bright), #14b8a6);
    color: #04121f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--pent-mono);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.4);
    border-radius: 4px;
}

.pent-shell .mud-button-outlined.mud-button-outlined-primary {
    border-color: var(--pent-neon-green);
    color: var(--pent-neon-green);
    background: rgba(94, 234, 212, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--pent-mono);
    font-weight: 700;
    border-radius: 4px;
}

.pent-shell .mud-button-outlined.mud-button-outlined-primary:hover {
    background: rgba(94, 234, 212, 0.12);
    box-shadow: 0 0 8px rgba(94, 234, 212, 0.3);
}

.pent-shell .mud-button-text {
    color: var(--pent-text);
    font-family: var(--pent-mono);
}

/* Switch + Select labels */
.pent-shell .mud-input-label,
.pent-shell .mud-switch-label,
.pent-shell label {
    color: var(--pent-text);
    font-family: var(--pent-mono);
}

.pent-shell .mud-switch-track {
    background: rgba(94, 234, 212, 0.2) !important;
}

.pent-shell .mud-switch-thumb.mud-checked {
    color: var(--pent-neon-green-bright) !important;
}

/* Select dropdown */
.pent-shell .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--pent-border);
}

.pent-shell .mud-input-slot {
    color: var(--pent-text);
    font-family: var(--pent-mono);
}

/* Chip */
.pent-shell .mud-chip {
    font-family: var(--pent-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
}

.pent-shell .mud-chip-color-success {
    background: rgba(94, 234, 212, 0.15);
    color: var(--pent-neon-green-bright);
    border: 1px solid var(--pent-border-strong);
}

.pent-shell .mud-chip-color-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--pent-neon-amber);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.pent-shell .mud-chip-color-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--pent-neon-red);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Page header */
.pent-shell .jf-page-header {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.04), rgba(56, 189, 248, 0.03)), var(--pent-bg-card);
    border: 1px solid var(--pent-border);
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.pent-shell .jf-page-header__title {
    color: var(--pent-text-bright);
    font-family: var(--pent-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 12px rgba(94, 234, 212, 0.4);
}

.pent-shell .jf-page-header__subtitle {
    color: var(--pent-text-dim);
    font-family: var(--pent-mono);
}

.pent-shell .jf-page-header__eyebrow {
    color: var(--pent-neon-green);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: var(--pent-mono);
    font-size: 0.68rem;
}

.pent-shell .jf-page-header__icon {
    background: rgba(94, 234, 212, 0.1) !important;
    color: var(--pent-neon-green-bright) !important;
    border: 1px solid var(--pent-border-strong) !important;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.3);
}

/* MudChart canvas (force dark background) */
.pent-shell .mud-chart {
    background: transparent;
}

.pent-shell .mud-chart text,
.pent-shell .mud-chart .mud-chart-legend-item {
    fill: var(--pent-text-dim) !important;
    color: var(--pent-text-dim) !important;
    font-family: var(--pent-mono) !important;
}

/* All numbers use mono font */
.pent-shell bdi {
    font-family: var(--pent-mono);
    color: var(--pent-text-bright);
}

/* Service card name link */
.pent-shell a {
    color: var(--pent-neon-green);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pent-shell a:hover {
    color: var(--pent-neon-green-bright);
    text-shadow: 0 0 6px rgba(45, 212, 191, 0.5);
}

/* Toolbar refresh info */
.pent-shell .jf-zbx__refresh-info {
    color: var(--pent-text-dim);
    font-family: var(--pent-mono);
    font-size: 0.78rem;
}

/* Status banner override */
.pent-shell .pent-banner {
    background: linear-gradient(90deg,
        rgba(94, 234, 212, 0.08) 0%,
        var(--pent-bg-card) 60%) !important;
    border: 1px solid var(--pent-border-strong) !important;
}

.pent-shell .pent-banner-score {
    font-family: var(--pent-mono);
    text-shadow: 0 0 12px currentColor;
    border: 2px solid currentColor !important;
}

.pent-shell .pent-reason-card {
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 4px;
    font-family: var(--pent-mono);
}

.pent-shell .pent-reason-title {
    font-family: var(--pent-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Dep chips */
.pent-shell .jf-mon__dep-chip {
    font-family: var(--pent-mono);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
}

/* Force RTL containers to keep numbers LTR */
.pent-shell [dir="rtl"] bdi,
.pent-shell bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Hide system noise from background grid on print */
@media print {
    .pent-shell::before {
        display: none;
    }
}
