/*
 * WellCore customer portal theme.
 * Uses the same scheme as the public site (/static/site/wellcore.css):
 * dark steel, droplet logo, amber actions, brand blue data accents, Inter.
 */
@import url("/static/site/wellcore.css");

.wellcore-customer-portal,
.customer-shell,
.rv-shell,
.login-shell,
.wc-portal {
    --wc-bg: #0d1015;
    --wc-panel: #121821;
    --wc-panel-2: #18222f;
    --wc-header: #08090b;
    --wc-border: #2a394c;
    --wc-text: #f4f7fb;
    --wc-muted: #d7deea;
    --wc-subtle: #aeb9c8;
    --wc-green: #2bd17f;
    --wc-blue: #4da3ff;
    --wc-blue-brand: #1484ff;
    --wc-amber: #f0a72d;
    --wc-amber-deep: #c48822;
    --wc-red: #ff5a52;
    --wc-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    --wc-glow: 0 0 26px rgba(20, 132, 255, 0.16);
    background: var(--wc-bg);
    color: var(--wc-text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body:has(.customer-shell),
body:has(.rv-shell),
body:has(.login-shell) {
    background: #08090b;
}

.customer-header,
.rv-header {
    background: var(--wc-header);
    color: var(--wc-text);
    border-bottom: 1px solid rgba(240, 167, 45, 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(20, 132, 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(20, 132, 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(43, 209, 127, 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(20, 132, 255, 0.32);
    border-radius: 999px;
    background: rgba(20, 132, 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(20, 132, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 132, 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(20, 132, 255, 0.12);
    stroke-width: 1;
}

.trend-area {
    fill: rgba(43, 209, 127, 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(20, 132, 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(20, 132, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 132, 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(20, 132, 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(43, 209, 127, 0.35);
    background: rgba(43, 209, 127, 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: linear-gradient(135deg, var(--wc-amber), var(--wc-amber-deep));
    border: 1px solid rgba(255, 211, 124, 0.55);
    color: #08090b;
    font-weight: 800;
}

.btn.btn-light:hover,
.login-button:hover {
    filter: brightness(1.06);
    color: #08090b;
}

.btn.btn-outline-light {
    border-color: var(--wc-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--wc-text);
}

.btn.btn-outline-light:hover {
    border-color: var(--wc-amber);
    background: rgba(255, 255, 255, 0.08);
    color: var(--wc-text);
}

.report-link,
.rv-shell .candidate-table a {
    color: var(--wc-blue);
}

.login-shell {
    background:
        linear-gradient(180deg, rgba(20, 132, 255, 0.08), transparent 360px),
        radial-gradient(circle at 80% 8%, rgba(196, 136, 34, 0.13), transparent 270px),
        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;
}


/* ---------- Residential (customer-shell) dashboard on the WellCore scheme ---------- */

.customer-shell .customer-header { border-bottom: 1px solid rgba(240, 167, 45, 0.45); }
.customer-shell .dashboard-subtitle { color: var(--wc-subtle); }

.customer-shell .focus-summary-panel,
.customer-shell .focus-chart-panel,
.customer-shell .technical-details,
.customer-shell .health-card,
.customer-shell .metric-card,
.customer-shell .well-panel,
.customer-shell .service-panel,
.customer-shell .report-panel,
.customer-shell .history-panel,
.customer-shell .assessment-card,
.customer-shell .assessment-table,
.customer-shell .comment-item,
.customer-shell .reading-table {
    background: var(--wc-panel);
    border-color: var(--wc-border);
    color: var(--wc-text);
}

.customer-shell .focus-readout,
.customer-shell .focus-chart-stat,
.customer-shell .service-item,
.customer-shell .report-field,
.customer-shell .standard-chip {
    background: var(--wc-panel-2);
    border-color: var(--wc-border);
}

.customer-shell .report-grid,
.customer-shell .assessment-grid {
    background: var(--wc-border);
}

.customer-shell .focus-title,
.customer-shell .focus-readout-value,
.customer-shell .focus-chart-heading .panel-title,
.customer-shell .focus-chart-stat strong,
.customer-shell .technical-details > summary,
.customer-shell .health-value,
.customer-shell .panel-title,
.customer-shell .report-value,
.customer-shell .assessment-table th,
.customer-shell .assessment-table td,
.customer-shell .comment-text,
.customer-shell .evidence-list,
.customer-shell .service-value,
.customer-shell .reading-table td {
    color: var(--wc-text);
}

.customer-shell .focus-readout-label,
.customer-shell .focus-readout-note,
.customer-shell .focus-chart-heading .panel-kicker,
.customer-shell .focus-chart-stat span,
.customer-shell .health-label,
.customer-shell .health-detail,
.customer-shell .metric-label,
.customer-shell .metric-unit,
.customer-shell .panel-kicker,
.customer-shell .report-label,
.customer-shell .comment-meta,
.customer-shell .service-label,
.customer-shell .refresh-note,
.customer-shell .assessment-card ul {
    color: var(--wc-subtle);
}

.customer-shell .reading-table th,
.customer-shell .assessment-table th {
    background: var(--wc-panel-2);
    color: var(--wc-subtle);
    border-color: var(--wc-border);
}

.customer-shell .reading-table th,
.customer-shell .reading-table td,
.customer-shell .assessment-table td,
.customer-shell .panel-heading {
    border-color: var(--wc-border);
}

.customer-shell .focus-insight,
.customer-shell .focus-chart-callout {
    background: rgba(20, 132, 255, 0.08);
    border-left-color: var(--wc-blue-brand);
    color: var(--wc-muted);
}

.customer-shell .assessment-status,
.customer-shell .service-icon {
    background: rgba(20, 132, 255, 0.12);
    color: var(--wc-blue);
}

.customer-shell .chart-button {
    background: var(--wc-panel-2);
    border-color: var(--wc-border);
    color: var(--wc-muted);
}

.customer-shell .chart-button.active {
    background: rgba(240, 167, 45, 0.12);
    border-color: var(--wc-amber);
    color: var(--wc-amber);
}

.customer-shell .focus-chart {
    border-color: var(--wc-border);
    background:
        linear-gradient(rgba(20, 132, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 132, 255, 0.05) 1px, transparent 1px),
        #0e141c;
    background-size: 100% 25%, 36px 100%, auto;
}

.customer-shell .technical-details > summary::after {
    border-color: var(--wc-border);
    color: var(--wc-amber);
}

.customer-shell .review-note,
.customer-shell .dashboard-notice {
    background: rgba(240, 167, 45, 0.12);
    border-color: rgba(240, 167, 45, 0.42);
    color: #ffd58a;
}

.customer-shell .comment-form {
    background: var(--wc-panel-2);
    border-color: var(--wc-border);
}

.customer-shell .comment-form label {
    color: var(--wc-subtle);
}

.customer-shell .comment-form select,
.customer-shell .comment-form textarea {
    background: var(--wc-bg);
    border-color: var(--wc-border);
    color: var(--wc-text);
}

.customer-shell .comment-form button {
    background: linear-gradient(135deg, var(--wc-amber), var(--wc-amber-deep));
    border: 1px solid rgba(255, 211, 124, 0.55);
    color: #08090b;
    font-weight: 800;
}

.customer-shell .empty-state {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--wc-border);
    color: var(--wc-subtle);
}

.customer-shell .report-link {
    color: var(--wc-blue);
}

/* ---------- Portal navigation (shared by all signed-in pages) ---------- */

.wc-portal-nav {
    background: #0b0e13;
    border-bottom: 1px solid var(--wc-border, #2a394c);
}

.wc-portal-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
}

.wc-portal-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-bottom: 2px solid transparent;
    color: #aeb9c8;
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.wc-portal-nav a:hover {
    color: #f4f7fb;
}

.wc-portal-nav a[aria-current="page"] {
    color: #f0a72d;
    border-bottom-color: #f0a72d;
}

.wc-portal-nav a.wc-portal-nav-cta {
    margin-left: auto;
}

@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;
    }
}
