/* ─────────────────────────────────────────────────────────────────────────
 * Property Master drawer (Batch K2 — 2026-05-20)
 *
 * Per-well editor for operator + legal_description + Starting + per-well Top
 * + per-(well × agent) caps. Sibling primitive to OMv2 + Cap Manager (.drawer
 * right-rail slide-in, 560px wide on desktop, full-screen below 640px).
 *
 * Aesthetic per .impeccable.md Wireline:
 *   - Hairline borders (1px low-opacity tinted)
 *   - White card surfaces on cool-mist body bg (inherited from .drawer)
 *   - JetBrains Mono + green (--color-money) for $/NRA + cap values
 *   - Newsreader italic for drawer-title (matches OMv2 + Cap Manager)
 *   - No decorative stripes (BAN 1 + 3)
 *   - No card-in-card (each section is one panel)
 *   - 4pt spacing scale (BAN 4 — only even-pixel values)
 * ───────────────────────────────────────────────────────────────────────── */

.property-master-drawer .drawer-body {
  padding: 16px 22px 24px;
}

/* ─── Sections ────────────────────────────────────────────────────────── */
.pm-section {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.pm-section-title {
  font-family: 'Geist Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
  margin: 0 0 12px 0;
}

/* ─── Editable field primitive ────────────────────────────────────────── */
.pm-field {
  margin-bottom: 14px;
}
.pm-field:last-child {
  margin-bottom: 0;
}
.pm-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}
.pm-field-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #FAFBFC;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  min-height: 36px;
}
.pm-field-value {
  flex: 1;
  font-family: 'Geist Sans', sans-serif;
  font-size: 13px;
  color: #111827;
  word-break: break-word;
  white-space: pre-wrap;
}
.pm-field-empty {
  color: #9CA3AF;
  font-style: italic;
}
.pm-field-edit-btn {
  flex-shrink: 0;
}
.pm-field-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
  font-style: italic;
}

/* Editing mode */
.pm-field-editing .pm-field-input,
.pm-field-editing .pm-field-textarea {
  width: 100%;
  font-family: 'Geist Sans', sans-serif;
  font-size: 13px;
  color: #111827;
  padding: 8px 10px;
  background: #FFFFFF;
  border: 1px solid #94A3B8;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.pm-field-editing .pm-field-textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
}
.pm-field-editing .pm-field-input:focus,
.pm-field-editing .pm-field-textarea:focus {
  border-color: var(--brand-og-accent, #298084);
  box-shadow: 0 0 0 3px rgba(41, 128, 132, 0.12);
}
.pm-field-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

/* ─── Source-legal divergence row (audit transparency) ────────────────── */
.pm-source-row {
  margin-top: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #FAFBFC;
  border: 1px dashed #D1D5DB;
  border-radius: 6px;
}
.pm-source-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
  margin-bottom: 4px;
}
.pm-source-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #4B5563;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.pm-source-hint {
  margin-top: 4px;
  font-size: 10px;
  color: #9CA3AF;
  font-style: italic;
}

/* ─── Read-only context grid (county/state/source key) ────────────────── */
.pm-readonly-grid {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #E5E7EB;
}
.pm-readonly-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
}
.pm-readonly-label {
  color: #6B7280;
}
.pm-readonly-value {
  color: #111827;
  text-align: right;
}
.pm-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

/* ─── Pricing — effective resolved cap block ──────────────────────────── */
.pm-effective {
  margin-top: 14px;
  padding: 12px 14px;
  background: #F0F9FA;
  border: 1px solid #CFFAFE;
  border-radius: 8px;
}
.pm-effective-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.pm-effective-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #155E75;
}
.pm-effective-value {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-money, #047857);
}
.pm-effective-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #475569;
  line-height: 1.5;
}
.pm-effective-link {
  appearance: none;
  background: none;
  border: none;
  color: var(--brand-og-accent, #298084);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}
.pm-effective-link:hover {
  text-decoration: underline;
}

/* ─── Agents list ─────────────────────────────────────────────────────── */
.pm-agent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #FAFBFC;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
}
.pm-agent-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #111827;
}
.pm-agent-cap {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-money, #047857);
}
.pm-agent-row-editing {
  background: #FFFFFF;
  border-color: #94A3B8;
}
.pm-agent-input {
  width: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #94A3B8;
  border-radius: 4px;
  outline: none;
}
.pm-agent-input:focus {
  border-color: var(--brand-og-accent, #298084);
  box-shadow: 0 0 0 2px rgba(41, 128, 132, 0.12);
}
.pm-agent-remove {
  color: #B91C1C;
}
.pm-agent-empty {
  padding: 12px;
  font-size: 12px;
  color: #6B7280;
  font-style: italic;
  text-align: center;
  background: #FAFBFC;
  border: 1px dashed #D1D5DB;
  border-radius: 6px;
}
.pm-agents-hint {
  margin-top: 10px;
  font-size: 11px;
  color: #6B7280;
  font-style: italic;
}

/* ─── Cap-change banner toast (Batch K2 industry-validated UX) ────────── */
.pm-cap-banner-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  max-width: 360px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid #CFFAFE;
  border-left-width: 3px;
  border-left-color: var(--brand-og-accent, #298084);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  font-family: 'Geist Sans', sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: #111827;
  animation: pm-cap-banner-slide 0.2s ease-out;
}
.pm-cap-banner-toast-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.pm-cap-banner-toast-body {
  color: #4B5563;
}
@keyframes pm-cap-banner-slide {
  from { transform: translateX(8px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── pv-well-name-btn — Project View entry point into Property Master ── */
.pv-well-name-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  text-decoration: none;
  transition: color 0.1s;
}
.pv-well-name-btn:hover {
  color: var(--brand-og-accent, #298084);
  text-decoration: underline;
}
.pv-well-name-btn:focus-visible {
  outline: 2px solid var(--brand-og-accent, #298084);
  outline-offset: 1px;
  border-radius: 2px;
}

/* ─── omv2-prop-name-btn — Owner Modal V2 property card entry to Property Master ──
   K2 integration fill-in (workflow walkthrough 2026-05-20). Mirrors the
   pv-well-name-btn pattern from the project owner-row table, scaled up
   to match the property card's title typography. */
.omv2-prop-name-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: color 0.1s;
}
.omv2-prop-name-btn:hover {
  color: var(--brand-og-accent, #298084);
  text-decoration: underline;
}
.omv2-prop-name-btn:focus-visible {
  outline: 2px solid var(--brand-og-accent, #298084);
  outline-offset: 2px;
  border-radius: 2px;
}
