.wellcore-customer-portal,
.customer-shell,
.rv-shell,
.login-shell {
    --wc-bg: #0b1118;
    --wc-panel: #141a23;
    --wc-panel-2: #1e2835;
    --wc-header: #071320;
    --wc-border: #31455c;
    --wc-text: #f5f7fa;
    --wc-muted: #dce7f2;
    --wc-subtle: #8aa4bf;
    --wc-green: #2fe6a6;
    --wc-blue: #80d8ff;
    --wc-amber: #ffb03a;
    --wc-red: #ff5c5c;
    --wc-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --wc-glow: 0 0 26px rgba(128, 216, 255, 0.14);
    background: var(--wc-bg);
    color: var(--wc-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.customer-header,
.rv-header {
    background: var(--wc-header);
    border-bottom: 1px solid rgba(128, 216, 255, 0.45);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.customer-header-inner,
.customer-main,
.rv-header-inner,
.rv-main {
    width: min(1280px, calc(100% - 36px));
}

.customer-logo,
.rv-logo {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
}

.dashboard-title,
.rv-title,
.login-title {
    color: var(--wc-text);
    font-weight: 700;
}

.dashboard-subtitle,
.rv-subtitle,
.panel-kicker,
.metric-unit,
.refresh-note,
.rv-shell .well-role,
.rv-shell .site-meter,
.rv-shell .info-label,
.customer-shell .report-label {
    color: var(--wc-subtle);
}

.customer-main,
.rv-main {
    background: var(--wc-bg);
}

.metric-card,
.well-panel,
.service-panel,
.report-panel,
.history-panel,
.scada-panel,
.rv-shell .panel,
.login-panel {
    background: var(--wc-panel);
    border: 1px solid var(--wc-border);
    border-radius: 6px;
    box-shadow: var(--wc-shadow);
}

.metric-card {
    min-height: 126px;
    border-top: 2px solid rgba(128, 216, 255, 0.34);
}

.summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.metric-label,
.rv-shell .metric-label {
    color: var(--wc-muted);
}

.metric-label i,
.service-icon i {
    color: var(--wc-green);
}

.metric-value,
.rv-shell .metric-value,
.reading-table td,
.service-value,
.report-value,
.rv-shell .well-name,
.rv-shell .site-number,
.rv-shell .info-value,
.rv-shell .candidate-table td,
.login-field input {
    color: var(--wc-text);
}

.metric-value {
    color: var(--wc-blue);
    text-shadow: 0 0 16px rgba(128, 216, 255, 0.14);
}

.metric-value.metric-status {
    color: var(--wc-blue);
}

.panel-heading {
    background: var(--wc-panel);
    border-bottom: 1px solid var(--wc-border);
}

.panel-title {
    color: var(--wc-text);
}

.reading-table,
.reading-table tbody,
.rv-shell .candidate-table {
    background: var(--wc-panel);
}

.reading-table th,
.rv-shell .candidate-table th {
    background: var(--wc-panel-2);
    color: var(--wc-muted);
    border-color: var(--wc-border);
}

.reading-table td,
.rv-shell .candidate-table td {
    background: var(--wc-panel);
    border-color: var(--wc-border);
}

.service-item,
.report-field,
.rv-shell .well-card,
.rv-shell .site-tile,
.rv-shell .info-row,
.rv-shell .boundary-point {
    background: var(--wc-panel-2);
    border-color: var(--wc-border);
}

.customer-shell .evidence-card {
    min-height: 148px;
}

.customer-shell .evidence-card-confirmed {
    border-left: 3px solid var(--wc-green);
    background: rgba(47, 230, 166, 0.08);
}

.customer-shell .evidence-card-missing {
    border-left: 3px solid var(--wc-amber);
    background: rgba(245, 166, 35, 0.08);
}

.customer-shell .evidence-list {
    color: var(--wc-muted);
    font-weight: 600;
}

.customer-shell .evidence-card-confirmed .evidence-list li::marker {
    color: var(--wc-green);
}

.customer-shell .evidence-card-missing .evidence-list li::marker {
    color: var(--wc-amber);
}

.scada-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.scada-panel {
    min-height: 230px;
    overflow: hidden;
}

.scada-panel-wide {
    grid-column: span 1;
}

.scada-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-height: 78px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(49, 69, 92, 0.9);
}

.scada-scale,
.status-chip,
.event-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(128, 216, 255, 0.32);
    border-radius: 999px;
    background: rgba(128, 216, 255, 0.08);
    color: var(--wc-blue);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.sparkline {
    display: block;
    height: 136px;
    margin: 14px 18px 18px;
    padding: 0;
    border: 1px solid rgba(49, 69, 92, 0.55);
    border-radius: 4px;
    background:
        linear-gradient(rgba(128, 216, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 216, 255, 0.05) 1px, transparent 1px),
        #0e141c;
    background-size: 100% 25%, 36px 100%, auto;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.24);
}

.trend-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-axis,
.chart-grid-major {
    vector-effect: non-scaling-stroke;
}

.chart-axis {
    stroke: rgba(220, 231, 242, 0.3);
    stroke-width: 1.2;
}

.chart-grid-major {
    stroke: rgba(128, 216, 255, 0.12);
    stroke-width: 1;
}

.trend-area {
    fill: rgba(47, 230, 166, 0.08);
}

.trend-line {
    fill: none;
    stroke: var(--wc-blue);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
    filter: drop-shadow(0 0 7px rgba(128, 216, 255, 0.22));
    vector-effect: non-scaling-stroke;
}

.trend-latest-dot {
    fill: var(--wc-green);
    stroke: #0e141c;
    stroke-width: 2;
}

.chart-label {
    fill: var(--wc-subtle);
    font-size: 11px;
    font-weight: 700;
}

.chart-y-label {
    text-anchor: start;
}

.chart-x-end {
    text-anchor: end;
}

.chart-latest {
    fill: var(--wc-muted);
    font-size: 12px;
    font-weight: 800;
}

.sparkline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--wc-subtle);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.status-strip {
    display: grid;
    grid-template-rows: 1fr 1fr 18px;
    position: relative;
    height: 136px;
    margin: 14px 18px 18px;
    padding: 14px 12px 10px 48px;
    border: 1px solid rgba(49, 69, 92, 0.55);
    border-radius: 4px;
    background:
        linear-gradient(rgba(128, 216, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 216, 255, 0.05) 1px, transparent 1px),
        #0e141c;
    background-size: 100% 50%, 36px 100%, auto;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.24);
}

.status-lane {
    position: relative;
    border-bottom: 1px solid rgba(128, 216, 255, 0.1);
}

.status-lane span {
    position: absolute;
    left: -36px;
    top: 50%;
    color: var(--wc-subtle);
    font-size: 10px;
    font-weight: 800;
    transform: translateY(-50%);
}

.status-segments {
    display: flex;
    align-items: stretch;
    gap: 2px;
    grid-row: 1 / 3;
    grid-column: 1;
    min-width: 0;
}

.status-segment {
    flex: 1 1 5px;
    min-width: 4px;
    border-radius: 2px;
    background: rgba(138, 164, 191, 0.35);
}

.status-segment-on {
    align-self: start;
    height: 45%;
    background: var(--wc-green);
    box-shadow: var(--wc-glow);
}

.status-segment-off {
    align-self: end;
    height: 45%;
    background: rgba(138, 164, 191, 0.42);
}

.status-segment-unknown {
    align-self: stretch;
    background: rgba(255, 176, 58, 0.55);
}

.status-time-labels {
    display: flex;
    justify-content: space-between;
    grid-row: 3;
    grid-column: 1;
    color: var(--wc-subtle);
    font-size: 10px;
    font-weight: 700;
}

.event-table-wrap {
    max-height: 150px;
    margin: 12px 14px 16px;
    overflow: auto;
    border: 1px solid rgba(49, 69, 92, 0.72);
    border-radius: 4px;
}

.event-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--wc-text);
    font-size: 12px;
}

.event-table th,
.event-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(49, 69, 92, 0.72);
    text-align: left;
    white-space: nowrap;
}

.event-table th {
    position: sticky;
    top: 0;
    background: #0e141c;
    color: var(--wc-amber);
    font-size: 11px;
    text-transform: uppercase;
}

.event-pump_on {
    border-color: rgba(47, 230, 166, 0.35);
    background: rgba(47, 230, 166, 0.12);
    color: var(--wc-green);
}

.event-pump_off {
    border-color: rgba(138, 164, 191, 0.35);
    background: rgba(138, 164, 191, 0.1);
    color: var(--wc-muted);
}

.rv-shell .well-card.phase-1 {
    background: rgba(79, 140, 201, 0.16);
    border-color: rgba(79, 140, 201, 0.55);
}

.service-icon,
.rv-shell .signal-chip,
.rv-shell .badge-live-ready {
    background: rgba(123, 200, 164, 0.14);
    color: var(--wc-green);
}

.report-grid {
    background: var(--wc-border);
}

.dashboard-notice,
.review-note,
.phase-note,
.login-warning {
    background: rgba(245, 166, 35, 0.14);
    border-color: rgba(245, 166, 35, 0.42);
    color: #ffd58a;
}

.status-pill,
.rv-shell .badge-plan {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(220, 231, 242, 0.24);
    color: var(--wc-text);
}

.status-live .status-dot,
.status-calibrated .status-dot,
.status-OK .status-dot,
.status-ok .status-dot {
    background: var(--wc-green);
    box-shadow: 0 0 0 5px rgba(123, 200, 164, 0.16);
}

.status-stale .status-dot,
.status-uncalibrated .status-dot,
.status-stale_config .status-dot,
.status-held_dropout .status-dot {
    background: var(--wc-amber);
    box-shadow: 0 0 0 5px rgba(245, 166, 35, 0.16);
}

.status-fault .status-dot,
.status-loop_fault .status-dot,
.status-adc_saturated .status-dot,
.status-out_of_range .status-dot {
    background: var(--wc-red);
    box-shadow: 0 0 0 5px rgba(224, 93, 93, 0.16);
}

.badge.text-bg-secondary,
.badge.text-bg-warning,
.badge.text-bg-success {
    border: 1px solid rgba(220, 231, 242, 0.22);
}

.badge.text-bg-secondary {
    background: rgba(169, 183, 198, 0.18) !important;
    color: var(--wc-muted) !important;
}

.badge.text-bg-warning {
    background: rgba(245, 166, 35, 0.18) !important;
    color: #ffd58a !important;
}

.badge.text-bg-success {
    background: rgba(123, 200, 164, 0.18) !important;
    color: var(--wc-green) !important;
}

.btn.btn-light,
.login-button {
    background: var(--wc-text);
    border-color: var(--wc-text);
    color: #07111f;
    font-weight: 700;
}

.btn.btn-outline-light {
    border-color: rgba(245, 247, 250, 0.78);
    color: var(--wc-text);
}

.report-link,
.rv-shell .candidate-table a {
    color: #8fc2ff;
}

.login-shell {
    background: var(--wc-header);
}

.login-panel {
    color: var(--wc-text);
}

.login-subtitle,
.login-field label {
    color: var(--wc-subtle);
}

.login-field input {
    background: var(--wc-panel-2);
    border-color: var(--wc-border);
}

.login-error {
    background: rgba(224, 93, 93, 0.16);
    border-color: rgba(224, 93, 93, 0.45);
    color: #ffb4b4;
}

@media (max-width: 1180px) {
    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .summary-grid,
    .scada-board {
        grid-template-columns: 1fr;
    }

    .sparkline,
    .status-strip {
        height: 112px;
    }
}
