.wells-v2-page {
    width: 100%;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: inherit;
}

.hero-panel,
.kpi-card,
.command-panel,
.panel-v2,
.state-card {
    background: var(--panel-bg);
    border: 1px solid var(--card-border);
    color: inherit;
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.hero-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 18px;
}

.eyebrow {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: .14em;
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.hero-left h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 950;
    letter-spacing: -.03em;
}

.hero-left p {
    margin: 8px 0 0;
    color: var(--muted-text);
    font-weight: 700;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-meta {
    min-width: 160px;
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

    .refresh-meta span {
        display: block;
        color: var(--muted-text);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .refresh-meta b {
        display: block;
        margin-top: 4px;
        color: inherit;
        font-size: 13px;
    }

.primary-btn,
.ghost-btn,
.view-btn,
.pager-btn {
    border: 1px solid rgba(214, 173, 58, .28);
    background: rgba(214, 173, 58, .12);
    color: var(--gold);
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

.primary-btn {
    height: 46px;
    padding: 0 18px;
}

    .primary-btn:hover,
    .ghost-btn:hover,
    .view-btn:hover,
    .pager-btn:hover:not(:disabled) {
        background: rgba(214, 173, 58, .20);
        transform: translateY(-1px);
    }

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

.kpi-card {
    min-height: 136px;
    border-radius: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 14px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

    .kpi-card::after {
        content: "";
        position: absolute;
        inset: auto 18px 12px 18px;
        height: 2px;
        border-radius: 999px;
        background: var(--gold);
        opacity: .22;
    }

    .kpi-card:hover {
        transform: translateY(-2px);
        transition: .18s ease;
    }

.kpi-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background: rgba(214, 173, 58, .10);
    color: var(--gold);
}

.kpi-card span {
    display: block;
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.kpi-card b {
    display: block;
    margin-top: 4px;
    font-size: 38px;
    line-height: 1;
    font-weight: 950;
    color: inherit;
}

.kpi-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted-text);
    font-weight: 700;
}

.gold-card,
.green-card,
.red-card,
.blue-card,
.purple-card {
    color: inherit;
    border-color: var(--card-border);
}

.command-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 220px 220px auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
}

.search-wrap {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--card-border);
    border-radius: 13px;
    background: rgba(255,255,255,.025);
}

    .search-wrap span {
        color: var(--gold);
        font-weight: 900;
    }

    .search-wrap input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        color: inherit;
        font-weight: 800;
    }

        .search-wrap input::placeholder {
            color: var(--muted-text);
            opacity: .75;
        }

.filter-select {
    height: 44px;
    border-radius: 13px;
    border: 1px solid var(--card-border);
    background: var(--panel-bg);
    color: inherit;
    padding: 0 12px;
    font-weight: 800;
    outline: none;
}

.ghost-btn {
    height: 44px;
    padding: 0 16px;
}

.main-analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr);
    gap: 14px;
    align-items: stretch;
}

.panel-v2 {
    border-radius: 18px;
    overflow: hidden;
}

.panel-head-v2 {
    min-height: 70px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

    .panel-head-v2 h3 {
        margin: 0;
        font-size: 17px;
        font-weight: 950;
    }

    .panel-head-v2 p {
        margin: 4px 0 0;
        color: var(--muted-text);
        font-size: 12px;
        font-weight: 700;
    }

    .panel-head-v2.compact {
        min-height: 56px;
    }

        .panel-head-v2.compact span {
            color: var(--gold);
            font-weight: 950;
        }

.legend-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 800;
}

    .legend-row span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.green-dot {
    background: #22c55e;
}

.red-dot {
    background: #ef4444;
}

.gold-dot {
    background: var(--gold);
}

.leaflet-host {
    height: 555px;
    background: var(--panel-bg);
}

.leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.leaflet-container {
    background: var(--panel-bg);
    font-family: Arial, sans-serif;
}

.leaflet-control-attribution {
    font-size: 10px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--panel-bg);
    color: inherit;
    border: 1px solid var(--card-border);
    box-shadow: 0 14px 38px rgba(0,0,0,.22);
}

.map-popup-title {
    color: var(--gold);
    font-weight: 950;
    font-size: 15px;
    margin-bottom: 6px;
}

.map-popup-line {
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 800;
    margin: 4px 0;
}

.custom-well-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.95);
    box-shadow: 0 0 0 5px rgba(255,255,255,.10), 0 10px 24px rgba(0,0,0,.35);
}

    .custom-well-marker.visited-map {
        background: #22c55e;
    }

    .custom-well-marker.notvisited-map {
        background: #ef4444;
    }

    .custom-well-marker.selected-map {
        width: 24px;
        height: 24px;
        background: var(--gold);
        box-shadow: 0 0 0 8px rgba(214,173,58,.18), 0 0 30px rgba(214,173,58,.45);
    }

.analytics-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.chart-panel {
    min-height: 190px;
}

.chart-host {
    padding: 12px 18px 18px;
}

.doughnut-host {
    height: 210px;
}

.trend-host {
    height: 190px;
}

.chart-host canvas {
    width: 100% !important;
    height: 100% !important;
}

.selected-panel {
    flex: 1;
}

.empty-selection {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted-text);
}

    .empty-selection b {
        color: inherit;
    }

.selected-well-card {
    padding: 18px;
}

.selected-title {
    font-size: 28px;
    color: var(--gold);
    font-weight: 950;
    margin-bottom: 14px;
}

.selected-lines {
    display: grid;
    gap: 10px;
}

    .selected-lines div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid var(--card-border);
        border-radius: 12px;
        background: rgba(255,255,255,.025);
    }

    .selected-lines span {
        color: var(--muted-text);
        font-size: 12px;
        font-weight: 800;
    }

    .selected-lines b {
        color: inherit;
        font-size: 13px;
        text-align: right;
    }

.table-layout {
    display: grid;
    grid-template-columns: 1fr;
}

.table-card {
    padding: 0;
}

.table-head .ghost-btn {
    min-width: 128px;
}

.table-wrap-v2 {
    width: 100%;
    overflow-x: auto;
}

.wells-table-v2 {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .wells-table-v2 th,
    .wells-table-v2 td {
        padding: 14px 18px;
        border-bottom: 1px solid var(--card-border);
        text-align: left;
        white-space: nowrap;
    }

    .wells-table-v2 th {
        color: var(--gold);
        font-size: 12px;
        text-transform: uppercase;
        background: rgba(255,255,255,.025);
    }

    .wells-table-v2 td {
        color: inherit;
    }

    .wells-table-v2 tr:hover,
    .selected-row {
        background: rgba(214,173,58,.075);
    }

.well-no-cell {
    color: var(--gold) !important;
    font-weight: 950;
}

.status-pill {
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 950;
    display: inline-flex;
    align-items: center;
}

.status-visited {
    color: #22c55e;
    background: rgba(34,197,94,.12);
}

.status-notvisited {
    color: #ef4444;
    background: rgba(239,68,68,.12);
}

.view-btn {
    height: 34px;
    padding: 0 14px;
}

.empty-cell {
    text-align: center !important;
    color: var(--muted-text) !important;
    padding: 30px !important;
}

.pager-row {
    min-height: 58px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted-text);
    font-weight: 800;
    border-top: 1px solid var(--card-border);
}

    .pager-row div {
        display: flex;
        gap: 8px;
    }

.pager-btn {
    height: 36px;
    padding: 0 13px;
}

    .pager-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.state-card {
    padding: 22px;
    border-radius: 18px;
    display: flex;
    gap: 16px;
    align-items: center;
}

    .state-card b {
        display: block;
        color: inherit;
        margin-bottom: 5px;
    }

    .state-card span {
        color: var(--muted-text);
        font-weight: 700;
    }

.error-state {
    border-color: rgba(239,68,68,.35);
    background: rgba(239,68,68,.08);
}

.loading-state {
    border-color: rgba(214,173,58,.25);
}

.state-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(214,173,58,.20);
    border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-side {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {
    .hero-panel,
    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .command-panel {
        grid-template-columns: 1fr;
    }

    .kpi-grid,
    .analytics-side {
        grid-template-columns: 1fr;
    }

    .leaflet-host {
        height: 430px;
    }
}

@media (max-width: 680px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .panel-head-v2 {
        flex-direction: column;
        align-items: flex-start;
    }

    .leaflet-host {
        height: 360px;
    }

    .pager-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
