/* MapTrax v2.7.0.0 — Wells / Permits / Production styling
   Covers: sidebar toggles, post-import summary modal, drawer tabs. */

/* -----------------------------------------------------------
   Sidebar entity toggle group
   ----------------------------------------------------------- */

.entity-toggle-group .checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin: 4px 0;
    cursor: pointer;
    user-select: none;
}

.entity-toggle-group .checkbox-row input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.entity-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.entity-count-badge {
    margin-left: auto;
    font-size: 10px;
    color: #888;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
}

/* v2.13.2.11: per-entity trashcan that clears Wells/Permits/Production
 * without touching Tracts or Assets. Hidden via the `hidden` attribute
 * (toggled by entityActions.refreshEntityChrome) when the store is
 * empty so the row stays visually clean. */
.entity-clear-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #b96c28;
    font-size: 13px;
    line-height: 1;
    padding: 2px 5px;
    margin-left: 4px;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.12s, background 0.12s, border-color 0.12s, color 0.12s;
}

.entity-clear-btn:hover {
    opacity: 1;
    background: #fbe8d8;
    border-color: #d47e2f;
    color: #8a3c0e;
}

/* -----------------------------------------------------------
   Post-import summary modal
   ----------------------------------------------------------- */

.import-summary-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.import-summary-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.import-summary-header h3 {
    margin: 0;
    font-size: 18px;
    color: #222;
}

.import-summary-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.import-summary-counts {
    background: #f0f8f0;
    border-left: 3px solid #22C55E;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #1a4a1a;
}

.import-summary-counts .muted {
    color: #777;
    font-weight: normal;
}

.import-summary-clean {
    color: #1a4a1a;
    font-size: 13px;
}

.import-summary-issue {
    border: 1px solid #f5e0a3;
    background: #fffbe8;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.import-summary-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.import-summary-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.import-summary-text {
    flex: 1;
    font-size: 13px;
    color: #4d3a08;
}

.import-summary-text .muted {
    color: #888;
    font-size: 12px;
}

.import-summary-issue .link-btn {
    background: none;
    border: none;
    color: #2b6cb0;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    padding: 0;
    flex-shrink: 0;
}

.import-summary-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5e0a3;
}

.import-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.import-summary-table th,
.import-summary-table td {
    border: 1px solid #e5d8a0;
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}

.import-summary-table th {
    background: #fff3c4;
    font-weight: 600;
    color: #4d3a08;
}

.import-summary-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.import-summary-footer button {
    padding: 7px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.import-summary-footer button.primary {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: white;
}

.import-summary-footer button.primary:hover {
    background: #1f4d80;
}

#import-summary-backdrop.wizard-backdrop {
    z-index: 9100;  /* above the wizard so it appears after wizard closes */
}

/* -----------------------------------------------------------
   Attribute drawer tabs (Tracts / Wells / Permits / Production)
   ----------------------------------------------------------- */

.drawer-tab-strip {
    display: flex;
    gap: 4px;
    padding: 6px 8px 0;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.drawer-tab {
    padding: 6px 14px 6px 12px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.drawer-tab:hover {
    background: var(--ink-200);
}

.drawer-tab.active {
    background: var(--bg-surface);
    border-color: var(--border-primary);
    border-bottom: 1px solid var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 0 var(--gold);
}

.drawer-tab .drawer-tab-count {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 8px;
}

.drawer-tab.active .drawer-tab-count {
    background: #f0f8f0;
    color: #1a8c44;
}

.drawer-tab.empty {
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.drawer-tab.empty .drawer-tab-count {
    color: var(--ink-400);
}

/* v2.13.14.6: eyeball toggle button placed inside each primary drawer
   tab on MMS hosts. Sits inline to the right of the tab count, separate
   from the X (entity delete) button in style and behavior. Clicking it
   toggles map-layer visibility for the tab's category/entity type
   independently of which tab is currently active. */
/* v2.14.3.24 — strip the pill background + border per user. Eyeball
   is now just the SVG icon in a dark color (off = red), no box. */
.drawer-tab .drawer-tab-eye {
    margin-left: 0;
    padding: 1px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    line-height: 0;
    cursor: pointer;
    transition: color 0.12s, transform 0.08s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.drawer-tab .drawer-tab-eye svg { display: block; }
.drawer-tab .drawer-tab-eye:hover { color: var(--gold-text); }
.drawer-tab .drawer-tab-eye:active { transform: scale(0.9); }
.drawer-tab .drawer-tab-eye.off { color: #c4392f; }
.drawer-tab .drawer-tab-eye.off:hover { color: #8a2c25; }
.drawer-tab.active .drawer-tab-eye { color: #2a1d09; }
.drawer-tab.active .drawer-tab-eye.off { color: #c4392f; }

/* v2.13.14.5 (kept for backwards compat — no longer rendered in
   v2.13.14.6, the sub-tab strip was promoted to primary tabs): */
.drawer-sub-tab-strip {
    display: flex;
    gap: 4px;
    padding: 4px 10px 0;
    border-top: 1px solid #e8e8e8;
    background: #f7f7f7;
    flex-wrap: wrap;
    width: 100%;
}

.drawer-sub-tab {
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #ececec;
    color: #555;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}

.drawer-sub-tab:hover {
    background: #e0e0e0;
}

.drawer-sub-tab.active {
    background: white;
    border-color: #b96c28;
    color: #7a4d27;
    font-weight: 600;
}

.drawer-sub-tab .drawer-sub-tab-count {
    font-size: 10px;
    color: #888;
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 8px;
}

.drawer-sub-tab.active .drawer-sub-tab-count {
    background: #fbe8d8;
    color: #7a4d27;
}

.drawer-sub-tab .drawer-sub-tab-eye {
    margin-left: 2px;
    padding: 0 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.12s, background 0.12s;
}

.drawer-sub-tab .drawer-sub-tab-eye:hover {
    opacity: 1;
    background: #f0f0f0;
}

.drawer-sub-tab .drawer-sub-tab-eye.off {
    opacity: 0.6;
    filter: grayscale(1);
}

/* v2.13.2.11: per-tab clear button (Wells/Permits/Production), only
 * rendered when Edit Mode is active. Sits inline at the right of the
 * tab pill; clicking it routes to window.clearEntityWithConfirm. */
.drawer-tab .drawer-tab-clear {
    margin-left: 6px;
    padding: 0 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #b96c28;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.12s, background 0.12s, border-color 0.12s, color 0.12s;
}
.drawer-tab .drawer-tab-clear:hover {
    opacity: 1;
    background: #fbe8d8;
    border-color: #d47e2f;
    color: #8a3c0e;
}
/* v2.13.2.13: the active tab is white-on-white-background, so the
 * × needs to stay the same brown accent (not switch to white).
 * Slightly bumped opacity so it reads against the active-tab's
 * stronger contrast. */
.drawer-tab.active .drawer-tab-clear {
    color: #b96c28;
    opacity: 0.95;
}
.drawer-tab.active .drawer-tab-clear:hover {
    background: #fbe8d8;
    border-color: #d47e2f;
    color: #8a3c0e;
}

/* v2.28.3.0 — State Wells control panel (per-state groups + status chips).
   Reuses .source-chip / .source-chip-hidden from css/source-chips.css. */
#state-wells-panel .regwells-enrich-hint {
    font-size: 11px;
    color: #2b6cb0;
    min-height: 14px;
    margin: 2px 0 4px;
}
.regwells-state-group {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin: 4px 0;
    background: #fbfdff;
}
.regwells-state-group.regwells-state-off { opacity: 0.55; }
.regwells-state-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.03em;
    color: #334155;
}
.regwells-state-head:hover { background: #f1f5f9; border-radius: 6px; }
.regwells-state-caret { width: 10px; color: #64748b; }
.regwells-state-label { flex: 1; }
.regwells-state-count {
    font-variant-numeric: tabular-nums;
    background: #e2e8f0;
    color: #475569;
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 500;
}
.regwells-state-body { padding: 2px 8px 8px; }
.regwells-state-body .checkbox-row { padding: 2px 0; font-size: 12px; }
.regwells-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}
.regwells-chip { padding: 2px 8px; font-size: 11px; }
/* v2.29.1.0 — statewide category present in the cache but none in the current
   viewport: dimmed so it reads as "toggleable but off-screen right now". */
.regwells-chip-offscreen { opacity: 0.55; border-style: dashed; }
.regwells-chip-offscreen:hover { opacity: 0.85; }

/* v2.28.4.0 — manual "Load operator/status" trigger for dense TX viewports */
.regwells-load-details {
    display: block;
    width: 100%;
    margin: 4px 0 2px;
    padding: 5px 8px;
    border: 1px solid #2b6cb0;
    border-radius: 5px;
    background: #ebf4ff;
    color: #1e4e8c;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.regwells-load-details:hover { background: #d9ebff; }
.regwells-load-hint { font-size: 10.5px; color: #718096; margin-bottom: 4px; }
