/* Zone Web — Global Styles */

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    height: 100%;
    overflow: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ---- Nav Menu ---- */
.zone-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    height: 36px;
    overflow: visible;
}

.zone-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.zone-brand {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    color: white;
}

.zone-menu-bar {
    display: flex;
}

.zone-menu-item {
    position: relative;
    padding: 6px 12px;
    cursor: pointer;
    color: white;
    font-size: 13px;
    user-select: none;
    z-index: 1001;
}

.zone-menu-item:hover {
    background: rgba(255,255,255,0.15);
}

.zone-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #c0c0c0;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 1000;
    padding: 4px 0;
}

.zone-dropdown a {
    display: block;
    padding: 6px 20px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.zone-dropdown a:hover {
    background: #29588c;
    color: white;
}

.zone-dropdown-item {
    display: block;
    padding: 6px 20px;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.zone-dropdown-item:hover:not(.disabled) {
    background: #29588c;
    color: white;
}

.zone-dropdown-item.disabled {
    color: #aaa;
    cursor: default;
}

.zone-menu-sep {
    height: 1px;
    background: #d0d0d0;
    margin: 4px 8px;
}

/* Invisible overlay to close menus when clicking outside */
.zone-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

.zone-menu-disabled {
    color: #aaa !important;
    cursor: default !important;
    pointer-events: none;
}

.zone-menu-sub {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.zone-menu-arrow {
    font-size: 10px;
    color: #999;
}

.zone-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

.zone-project-name {
    color: #ffdd66;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.zone-nav-sep {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}

.zone-license-info {
    color: #88cc88;
    font-size: 12px;
}

.zone-version {
    color: #7ed957;
    font-size: 12px;
    font-weight: 600;
}

/* ---- Toolbar ---- */
.zone-toolbar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px;
}

.zone-toolbar-row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
}

.zone-toolbar-btn {
    background: white;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.zone-toolbar-btn:hover {
    background: #e0e0e0;
    border-color: #808080;
}

/* Icon-only toolbar buttons matching WPF */
.zone-toolbar-icon {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
}

.zone-toolbar-icon:hover {
    background: #e0e8f0;
    border-color: #90b0d0;
}

.zone-toolbar-icon img {
    height: 22px;
    width: auto;
}

.zone-toolbar-label {
    font-size: 12px;
    padding: 0 4px;
    color: #333;
}

.zone-toolbar-sep {
    width: 1px;
    height: 20px;
    background: #c0c0c0;
    margin: 0 4px;
}

.zone-case-dropdown {
    width: 300px;
    height: 24px;
    font-size: 12px;
    padding: 2px 4px;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
}

/* ---- ESP Layout ---- */
.esp-design-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.esp-left-panel {
    width: 160px;
    min-width: 160px;
    background: #29588c;
    border-right: 1px solid #1a3a5c;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 4px;
}

.esp-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---- Action Panel ---- */
.esp-action-header {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 4px;
}

.esp-action-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.esp-action-spacer {
    flex: 1;
}

.esp-action-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.esp-action-btn {
    display: block;
    width: 100%;
    padding: 5px 8px;
    background: #e8e6e0;
    border: 1px outset #e8e6e0;
    border-radius: 0;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 25px;
    color: black;
}

.esp-action-btn:hover {
    background: #cce8ff;
    border-color: #99d1ff;
}

.esp-action-btn.active {
    background: #0078D4;
    color: white;
    border-color: #0078D4;
}

/* Button with embedded checkbox (Quick Design / Water Well Design) */
.esp-action-btn-checkbox {
    display: flex;
    align-items: center;
    height: 25px;
    background: #e8e6e0;
    border: 1px outset #e8e6e0;
}

.esp-action-btn-checkbox input[type="checkbox"] {
    margin: 0 0 0 4px;
    flex-shrink: 0;
}

.esp-action-btn-inner {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding: 0 8px;
    cursor: pointer;
    color: black;
}

.esp-action-btn-inner:hover {
    background: #cce8ff;
}

.esp-action-sep {
    height: 6px;
    background: rgba(255,255,255,0.2);
    margin: 4px 0;
}

.esp-action-label {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    padding: 4px 4px 2px 4px;
    text-transform: uppercase;
}

/* ---- Tab Control ---- */
.zone-tabs {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.zone-tab-header {
    display: flex;
    background: #f0f0f0;
    border-bottom: 2px solid #29588c;
    flex-shrink: 0;
}

.zone-tab {
    padding: 6px 16px;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 2px;
    background: transparent;
    color: #555;
}

.zone-tab:hover {
    background: #e0e0e0;
}

.zone-tab.active {
    background: white;
    border-color: #29588c #c0c0c0 transparent #c0c0c0;
    color: #333;
    font-weight: 600;
    margin-bottom: -2px;
    padding-bottom: 8px;
}

.zone-tab-content {
    flex: 1;
    overflow: auto;
    padding: 8px;
}

/* ---- Results Summary ---- */
.results-summary {
    display: flex;
    gap: 0;
    height: 100%;
}

.results-container {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    border: 1px solid #c0c0c0;
    overflow: hidden;
}

.results-header {
    font-weight: bold;
    font-size: 13px;
    color: #29588c;
    padding: 4px 8px;
    border-bottom: 1px solid #c0c0c0;
    text-align: center;
    flex-shrink: 0;
}

.results-text {
    flex: 1;
    overflow: auto;
    padding: 0;
    background: white;
}

.results-pre {
    margin: 0;
    padding: 4px 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.35;
    white-space: pre;
    color: black;
}

.results-diagram {
    flex: 1;
    overflow: auto;
    border: 1px solid #c0c0c0;
    border-left: none;
}

/* ---- Equipment Diagram ---- */
.equip-diagram-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equip-diagram-header {
    font-weight: bold;
    font-size: 13px;
    color: #29588c;
    padding: 4px 8px;
    border-bottom: 1px solid #c0c0c0;
    text-align: center;
    flex-shrink: 0;
}

.equip-diagram-body {
    flex: 1;
    overflow: auto;
    padding: 4px;
}

.equip-diagram-stack {
    display: grid;
    grid-template-columns: 96px 1fr;
    border-top: 1px solid #999;
}

/* Left column: images stacked flush with no gaps */
.equip-img-column,
.equip-info-column {
    display: contents;
}

/* Equipment image with MLE cable overlay */
.equip-img-wrap {
    position: relative;
    font-size: 0;
    line-height: 0;
    border-bottom: 1px solid #999;
    border-right: 1px solid #999;
    border-left: 1px solid #999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.equip-img-wrap img.equip-base {
    width: 92px;
    display: block;
}

/* Solid blue cylinder block for upper separator (no intake screen) */
.equip-solid-blue {
    width: 92px;
    background: linear-gradient(to right, #14305a, #1a3d6e 15%, #1e4578 50%, #1a3d6e 85%, #14305a);
    border-left: 2px solid #0d1f3d;
    border-right: 2px solid #0d1f3d;
}

.equip-img-wrap img.equip-mle {
    position: absolute;
    top: 0;
    left: 0;
    width: 92px;
    display: block;
    pointer-events: none;
}

/* Right column: text labels aligned to components */
.equip-info-row {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #333;
    border-bottom: 1px solid #999;
    border-right: 1px solid #999;
}

.equip-info-title {
    font-weight: bold;
    color: #000;
}

.equip-info-spacer {
    /* empty row to align with image that has no text */
}

.equip-total-spacer {
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    border-left: 1px solid #999;
}

.equip-total-row {
    padding: 4px 8px 0 8px;
    font-weight: bold;
}

/* ---- Errors/Warnings ---- */
.errors-warnings {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.ew-section {
    flex: 1;
    overflow: auto;
}

.ew-section-header {
    font-weight: bold;
    font-size: 13px;
    padding: 4px 8px;
    border-bottom: 1px solid #c0c0c0;
}

.ew-section-header.errors {
    color: #c62828;
    background: #ffebee;
}

.ew-section-header.warnings {
    color: #e65100;
    background: #fff3e0;
}

.ew-item {
    padding: 4px 16px;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ew-empty {
    padding: 8px 16px;
    color: #999;
    font-style: italic;
}

/* Errors/Warnings tab color states */
.zone-tab.ew-tab-red {
    background: #c62828;
    color: white;
    font-weight: bold;
}

.zone-tab.ew-tab-red.active {
    background: #c62828;
    color: white;
    border-color: #c62828 #c62828 transparent #c62828;
}

.zone-tab.ew-tab-yellow {
    background: #f9a825;
    color: black;
    font-weight: bold;
}

.zone-tab.ew-tab-yellow.active {
    background: #f9a825;
    color: black;
    border-color: #f9a825 #f9a825 transparent #f9a825;
}

.zone-tab.ew-tab-green {
    background: #2e7d32;
    color: white;
    font-weight: bold;
}

.zone-tab.ew-tab-green.active {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32 #2e7d32 transparent #2e7d32;
}

/* ---- Landing Page ---- */
.zone-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #29588c 0%, #1a3a5c 100%);
    color: white;
}

.zone-landing-title {
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.zone-landing-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 48px;
}

.zone-mode-selector {
    display: flex;
    gap: 32px;
}

.zone-mode-card {
    width: 364px;
    padding: 32px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: white;
    display: block;
}

.zone-mode-card:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
    transform: translateY(-4px);
}

.zone-mode-card h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
}

.zone-mode-card p {
    margin: 0;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.zone-mode-icon {
    margin-bottom: 16px;
}

.zone-mode-detail-light {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ---- Authentication: login, download, sign-out ---- */
.zone-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #fff;
    background: linear-gradient(135deg, #29588c 0%, #1a3a5c 100%);
    font-size: 18px;
}

.zone-login-page,
.zone-download-page {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #29588c 0%, #1a3a5c 100%);
    overflow: auto;
}

/* Desktop Download button, upper-right corner of the login page */
.zone-desktop-download {
    position: absolute;
    top: 22px;
    right: 26px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 22px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.08);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.zone-desktop-download:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.6);
}

.zone-login-card,
.zone-download-card {
    width: 100%;
    max-width: 420px;
    margin: 24px;
    padding: 40px 36px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.zone-download-card { max-width: 540px; }

.zone-login-brand {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #14305a;
    text-align: center;
}
.zone-login-brand sup { font-size: 18px; }

.zone-login-subtitle {
    text-align: center;
    color: #6b7785;
    font-size: 15px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 26px;
}

.zone-login-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #b02a37;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 18px;
}

.zone-login-form { display: flex; flex-direction: column; gap: 16px; }

.zone-login-field { display: flex; flex-direction: column; gap: 6px; }
.zone-login-field span { font-size: 13px; font-weight: 600; color: #44505d; }
.zone-login-field input {
    padding: 11px 12px;
    border: 1px solid #c7ced6;
    border-radius: 6px;
    font-size: 15px;
}
.zone-login-field input:focus {
    outline: none;
    border-color: #29588c;
    box-shadow: 0 0 0 3px rgba(41,88,140,0.15);
}

/* Forgot-password link under the login form, and the reset-info page */
.zone-login-help { margin-top: 16px; text-align: center; }
.zone-login-help a { color: #29588c; font-size: 13px; text-decoration: none; }
.zone-login-help a:hover { text-decoration: underline; }
.zone-forgot-title { margin: 4px 0 12px; color: #14305a; font-size: 20px; text-align: center; }
.zone-forgot-text { color: #44505d; font-size: 14px; line-height: 1.5; margin-bottom: 22px; }
.zone-forgot-back { display: block; text-align: center; text-decoration: none; }

/* ---- Password show/hide eyeball ---- */
.zone-pwd-wrap { position: relative; display: block; }
.zone-pwd-toggle {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: none; border: none; padding: 2px; margin: 0; cursor: pointer;
    color: #8a96a3; display: inline-flex; align-items: center;
}
.zone-pwd-toggle:hover { color: #44505d; }
.zone-pwd-toggle.zone-pwd-shown { color: #29588c; }
/* Input must fill the wrapper (it's no longer a direct flex child), so the eyeball sits INSIDE it. */
.zone-pwd-wrap input { width: 100%; box-sizing: border-box; }
.zone-login-field .zone-pwd-wrap input { padding-right: 40px; }

.zone-login-button {
    margin-top: 8px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #29588c;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.zone-login-button:hover { background: #1e4578; }
.zone-login-button:disabled { background: #9fb0c4; cursor: not-allowed; }
.zone-login-button:disabled:hover { background: #9fb0c4; }

/* "Web coming soon" state — shown while Site:ComingSoon is on (web UI held closed during the
   desktop-API test window). Ported from the interim static landing page so the message matches. */
.zone-soon-note {
    background: #eef4fb; border: 1px solid #cfe0f2; color: #29588c;
    padding: 10px 14px; border-radius: 6px; font-size: 13.5px; margin-bottom: 18px; text-align: center;
}

/* Download page */
.zone-download-back {
    position: absolute;
    top: 22px;
    left: 26px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
}
.zone-download-back:hover { color: #fff; text-decoration: underline; }

.zone-download-title { text-align: center; color: #14305a; font-size: 24px; margin: 6px 0 0; }
.zone-download-tagline { text-align: center; color: #6b7785; font-size: 15px; margin: 8px 0 22px; }

.zone-download-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f4f6f9;
    border: 1px solid #e2e7ee;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    color: #2f3a45;
    margin-bottom: 20px;
}
.zone-download-meta span {
    display: inline-block;
    width: 110px;
    font-weight: 700;
    color: #14305a;
}

.zone-download-eula { font-size: 14px; color: #44505d; margin-bottom: 22px; }
.zone-download-accept {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    cursor: pointer;
    font-weight: 600;
    color: #2f3a45;
}
.zone-download-accept input { margin-top: 3px; }

.zone-download-button {
    display: block;
    text-align: center;
    padding: 13px;
    border-radius: 26px;
    background: #E9C226;
    color: #14305a;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.zone-download-button:hover { background: #d8b31d; }
.zone-download-button.is-disabled {
    background: #d7dbe0;
    color: #9aa3ad;
    pointer-events: none;
    cursor: not-allowed;
}

/* Sign-out area in the authenticated app header */
.zone-user-area {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-right: 14px;
}
.zone-user-name { color: #fff; font-size: 13px; font-weight: 600; opacity: 0.9; }
.zone-user-link { color: #cfe0f2; font-size: 12px; text-decoration: none; }
.zone-user-link:hover { color: #fff; text-decoration: underline; }
.zone-logout-form { margin: 0; }

/* Profile dropdown anchored on the username in the top bar */
.zone-user-menu { display: flex; align-items: center; gap: 5px; }
.zone-user-caret { color: #cfe0f2; font-size: 10px; }
.zone-dropdown-right { left: auto; right: 0; }
.zone-user-head { padding: 8px 20px 6px; }
.zone-user-head-name { color: #1e3f5f; font-weight: 700; font-size: 13px; }
.zone-user-head-email { color: #6a7682; font-size: 12px; }
.zone-logout-item { width: 100%; box-sizing: border-box; text-align: left; background: none; border: none; font: inherit; cursor: pointer; }
.zone-logout-button {
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 16px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.zone-logout-button:hover { background: rgba(255,255,255,0.15); }

/* ---- Well Architecture Form ---- */
.well-tab-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
    height: 100%;
}

.well-gradient-header {
    background: PaleTurquoise;
    border: 2px solid #000;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.well-gradient-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.well-gradient-row label {
    font-weight: bold;
    font-size: 12px;
    min-width: 160px;
}

.well-label-inline {
    min-width: auto !important;
    margin-left: 16px;
}

.well-select {
    font-size: 11px;
    padding: 3px 6px;
    min-width: 200px;
}

.well-input-sm {
    width: 80px;
    font-size: 11px;
    padding: 3px 6px;
}

.well-add-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.well-add-row {
    display: flex;
    gap: 6px;
}

.well-btn {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    background: LightGray;
    border: 1px solid #999;
    cursor: pointer;
    min-width: 120px;
}

.well-btn:hover {
    background: #ddd;
}

.well-btn-sm {
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    background: LightGray;
    border: 1px solid #999;
    cursor: pointer;
}

.well-btn-sm:hover {
    background: #ddd;
}

.well-btn-delete {
    background: transparent;
    border: none;
    color: #c00;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
}

.well-btn-delete:hover {
    color: #f00;
}

.well-grid-container {
    max-height: 300px;
    overflow: auto;
    border: 1px solid #999;
}

.well-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.well-grid th {
    background: #29588c;
    color: white;
    padding: 4px 6px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}

.well-grid td {
    padding: 2px 4px;
    border-bottom: 1px solid #ddd;
}

.well-grid tr:hover td {
    background: #f0f8ff;
}

.well-grid tr.selected td {
    background: #d4e8f7;
}

.well-cell-type {
    color: blue;
    background: WhiteSmoke;
    font-weight: bold;
    white-space: nowrap;
}

.well-cell-input {
    width: 80px;
    font-size: 11px;
    padding: 1px 4px;
    border: 1px solid #ccc;
}

.well-error-bar {
    background: #fff3f3;
    border: 1px solid #c00;
    padding: 6px 10px;
    font-size: 12px;
    white-space: pre-line;
}

.well-error-text {
    color: #c00;
    font-weight: bold;
}

.well-validation-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Well Data tab */
.well-data-section {
    border: 2px solid #000;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.well-data-gold {
    background: PaleGoldenrod;
}

.well-data-cyan {
    background: PaleTurquoise;
}

.well-data-divider {
    height: 3px;
    background: #000;
    margin: 4px 0;
}

.well-data-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.well-data-section-title {
    font-weight: bold;
    font-size: 13px;
}

.well-data-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.well-data-row label {
    font-weight: bold;
    font-size: 12px;
    min-width: 200px;
}

.well-input {
    width: 120px;
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #999;
}

.well-unit {
    font-size: 11px;
    color: #666;
}

/* ---- Equipment Table ---- */
.equip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.equip-table th {
    background: #29588c;
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
}

.equip-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.equip-table tr:hover td {
    background: #f0f8ff;
}

/* ---- HPS Layout ---- */
.hps-design-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Left panel + content sit side by side and grow to fill, pushing the footer to the bottom. */
.hps-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hps-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.hps-panel-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
}

.hps-button-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 45px;
    padding: 0 12px;
    background: #f0f0f0;
    border-top: 1px solid #c0c0c0;
    flex-shrink: 0;
    width: 100%;
}

.esp-action-btn.active {
    background: #29588c;
    color: white;
    border-color: #29588c;
}

.hps-btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.hps-btn {
    background: white;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    padding: 4px 16px;
    font-size: 12px;
    cursor: pointer;
    height: 32px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    color: #333;
}

.hps-btn:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #808080;
}

.hps-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hps-btn.primary {
    background: #29588c;
    color: white;
    border-color: #1a3a5c;
}

.hps-btn.primary:hover:not(:disabled) {
    background: #1a3a5c;
}

.hps-save-status {
    margin-left: 12px;
    font-size: 12px;
    color: #1a3a5c;
    align-self: center;
}

/* ---- HPS Open/Save dialogs ---- */
.hps-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hps-modal {
    background: white;
    border: 1px solid #1a3a5c;
    border-radius: 4px;
    min-width: 460px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.hps-modal-header {
    background: #29588c;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 4px 4px 0 0;
}

.hps-modal-body {
    padding: 16px;
    overflow: auto;
}

.hps-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.hps-open-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.hps-open-table th,
.hps-open-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.hps-open-table th {
    background: #f0f4f8;
    color: #1a3a5c;
}

.hps-saveas-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    margin-top: 4px;
}

/* ---- HPS Order Input (four-section layout, mirrors desktop v4.8.2) ---- */
.hps-oi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 12px;
    align-items: start;
}

.hps-oi-section {
    border: 1px solid #b0b0b0;
    background: #fafafa;
    border-radius: 3px;
    padding-bottom: 8px;
}

.hps-oi-section-header {
    background: #e8eef4;
    color: #1a3a5c;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    padding: 6px;
    border-bottom: 1px solid #d0d8e0;
    margin-bottom: 8px;
}

.hps-oi-row {
    display: grid;
    grid-template-columns: 175px 1fr;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
}

.hps-oi-row label {
    font-size: 12px;
    color: #333;
}

.hps-oi-row select,
.hps-oi-row input {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    width: 100%;
}

.hps-oi-notes {
    display: flex;
    flex-direction: column;
}

.hps-oi-textarea {
    flex: 1;
    min-height: 230px;
    margin: 0 12px 8px;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #b0b0b0;
    border-radius: 2px;
    resize: vertical;
}

/* Blank space between the HPS nav buttons and the project/action buttons (mirrors desktop spacer). */
.hps-action-gap {
    height: 70px;
    flex-shrink: 0;
}

.esp-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- HPS Form Grid ---- */
.hps-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    max-width: 800px;
    padding: 8px 0;
}

.hps-form-group {
    display: flex;
    flex-direction: column;
}

.hps-form-group label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
}

.hps-form-group input,
.hps-form-group select {
    width: 100%;
    height: 28px;
    border: 1px solid #c0c0c0;
    border-radius: 2px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: inherit;
}

.hps-form-group input:focus,
.hps-form-group select:focus {
    outline: none;
    border-color: #29588c;
    box-shadow: 0 0 0 1px rgba(41,88,140,0.25);
}

.hps-form-group input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.hps-section-header {
    font-weight: bold;
    font-size: 13px;
    color: #29588c;
    padding: 8px 0 4px 0;
    border-bottom: 1px solid #c0c0c0;
    margin-bottom: 8px;
}

/* ---- HPS Pricing Summary ---- */
.hps-pricing-summary {
    max-width: 500px;
    font-size: 12px;
}

.hps-pricing-header {
    display: grid;
    grid-template-columns: 140px 120px 120px;
    font-weight: 600;
    color: #29588c;
    padding: 4px 8px;
    border-bottom: 1px solid #c0c0c0;
}

.hps-pricing-row {
    display: grid;
    grid-template-columns: 140px 120px 120px;
    padding: 3px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.hps-pricing-row:nth-child(even) {
    background: #fafafa;
}

.hps-pricing-total {
    display: grid;
    grid-template-columns: 140px 120px 120px;
    padding: 6px 8px;
    font-weight: bold;
    font-size: 13px;
    border-top: 2px solid #29588c;
    background: #f0f5fa;
}

.hps-pricing-lead {
    padding: 8px 8px 0 8px;
    color: #666;
    font-style: italic;
}

/* ---- Table row selection ---- */
.equip-table tr.selected td {
    background: #d4e8f7;
}

.equip-table tbody tr {
    cursor: pointer;
}

/* ---- ESP Form Shared Styles (matching WPF) ---- */

.esp-form-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: white;
}

.esp-form-title {
    font-size: 14px;
    font-weight: bold;
    color: white;
    background: #29588c;
    padding: 6px 12px;
    flex-shrink: 0;
}

.esp-form-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
    background: white;
}

/* Pump Select Pump(s) tab rows */
.esp-pump-select-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
}
.esp-pump-select-label {
    font-size: 11px;
    font-weight: bold;
    width: 30px;
    flex-shrink: 0;
}
.esp-pump-select-key {
    font-size: 11px;
    flex: 1;
    min-width: 150px;
}
.esp-pump-select-limits {
    flex: 1;
    min-width: 100px;
}

.esp-form-button-bar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    height: 35px;
    padding: 3px 10px;
    border-top: 1px solid #c0c0c0;
    background: #f0f0f0;
    flex-shrink: 0;
    align-items: center;
}

.esp-form-btn {
    background: LightGray;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #999;
    padding: 3px 12px;
    min-width: 80px;
    height: 26px;
    cursor: pointer;
    text-align: center;
}

.esp-form-btn:hover:not(:disabled) {
    background: #d0d0d0;
    border-color: #666;
}

.esp-form-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* GroupBox equivalent */
.esp-groupbox {
    border: 2px solid black;
    padding: 12px 8px 8px 8px;
    margin: 4px 0;
    position: relative;
}

.esp-groupbox-header {
    font-weight: bold;
    font-size: 12px;
    position: absolute;
    top: -10px;
    left: 10px;
    background: white;
    padding: 0 6px;
    color: #333;
}

/* Colored form sections matching WPF Borders */
.esp-form-section-gold {
    background: PaleGoldenrod;
    border: 2px solid black;
    padding: 8px;
    margin: 4px 0;
}

.esp-form-section-blue {
    background: PaleTurquoise;
    border: 2px solid black;
    padding: 8px;
    margin: 4px 0;
}

.esp-form-section-green {
    background: Honeydew;
    border: 2px solid black;
    padding: 8px;
    margin: 4px 0;
}

.esp-form-section-alice {
    background: AliceBlue;
    border: 2px solid black;
    padding: 8px;
    margin: 4px 0;
}

/* Form field rows (label + input, matching WPF 25px rows) */
.esp-form-row {
    display: flex;
    align-items: center;
    height: 25px;
    margin-bottom: 1px;
}

.esp-form-label {
    width: 170px;
    min-width: 170px;
    font-size: 11px;
    padding: 0 5px;
    color: #333;
}

.esp-form-input {
    width: 100px;
    height: 20px;
    font-size: 11px;
    border: 1px solid #c0c0c0;
    padding: 1px 4px;
    font-family: inherit;
}

.esp-form-input:focus {
    outline: none;
    border-color: #29588c;
}

.esp-form-input:disabled,
.esp-form-input[readonly] {
    background: #f0f0f0;
    color: #666;
}

.esp-form-select {
    width: 220px;
    height: 22px;
    font-size: 11px;
    border: 1px solid #c0c0c0;
    padding: 1px 4px;
    font-family: inherit;
}

.esp-form-select:focus {
    outline: none;
    border-color: #29588c;
}

.esp-form-unit {
    font-size: 10px;
    color: #666;
    margin-left: 4px;
}

.esp-form-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 25px;
    font-size: 11px;
}

.esp-form-checkbox input[type="checkbox"] {
    margin: 0;
}

.esp-form-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 25px;
    font-size: 11px;
}

.esp-form-radio input[type="radio"] {
    margin: 0;
}

/* Results panel (read-only text box) */
.esp-form-results {
    border: 2px solid black;
    padding: 8px;
    margin: 4px 0;
    position: relative;
    min-height: 200px;
    overflow: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: white;
}

/* Two-column form layout */
.esp-form-2col {
    display: flex;
    gap: 12px;
}

.esp-form-2col > .esp-form-left {
    flex: 1;
    min-width: 0;
}

.esp-form-2col > .esp-form-right {
    flex: 1;
    min-width: 0;
}

/* Three-column form layout */
.esp-form-3col {
    display: flex;
    gap: 12px;
}

.esp-form-3col > * {
    flex: 1;
    min-width: 0;
}

/* Inner tabs (nested within forms) */
.esp-inner-tabs {
    display: flex;
    background: #f0f0f0;
    border-bottom: 2px solid #29588c;
    margin-bottom: 8px;
}

.esp-inner-tab {
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 2px;
    background: transparent;
    color: #555;
}

.esp-inner-tab:hover {
    background: #e0e0e0;
}

.esp-inner-tab.active {
    background: white;
    border-color: #29588c #c0c0c0 transparent #c0c0c0;
    color: #333;
    font-weight: 600;
    margin-bottom: -2px;
    padding-bottom: 6px;
}

/* DataGrid equivalent */
.esp-datagrid {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.esp-datagrid th {
    background: #29588c;
    color: white;
    padding: 4px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
}

.esp-datagrid td {
    padding: 3px 6px;
    border-bottom: 1px solid #e0e0e0;
}

.esp-datagrid tr:hover td {
    background: #f0f8ff;
}

/* Required field indicator */
.esp-required {
    color: red;
    font-weight: bold;
    margin-left: 2px;
}

/* KVA-style highlight banner */
.esp-highlight-bar {
    background: #5B9BD5;
    border: 2px solid #1F4E79;
    padding: 6px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* ListBox equivalent */
.esp-listbox {
    border: 1px solid #c0c0c0;
    height: 100%;
    overflow-y: auto;
    font-size: 12px;
}

.esp-listbox-header {
    font-weight: bold;
    font-size: 12px;
    padding: 4px 8px;
    background: #f0f0f0;
    border-bottom: 1px solid #c0c0c0;
}

.esp-listbox-item {
    padding: 4px 8px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.esp-listbox-item:hover {
    background: #e8f0fe;
}

.esp-listbox-item.selected {
    background: #29588c;
    color: white;
}

/* Blue divider (Shafts form) */
.esp-divider-blue {
    width: 5px;
    background: LightBlue;
    border: 2px solid black;
    margin: 0 8px;
}

/* ---- Blazor infrastructure ---- */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
