/* data-console.css: Phase 19 data-plane operator console additions.
   Extends app.css. Uses the existing palette via CSS variables when
   available; otherwise falls back to safe defaults. */

.nav-group.nav-data-plane { margin-top: 12px; }
.nav-group .nav-group-label {
  text-transform: uppercase; font-size: 11px; opacity: 0.6; letter-spacing: 1px;
  margin: 8px 12px 4px; font-weight: 700;
}

.data-banner {
  padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-size: 13px;
}
.data-banner.offline { background: #fff5e6; color: #6b3a00; border: 1px solid #f4b78a; }
.data-banner.error   { background: #fdecea; color: #611a15; border: 1px solid #f1a8a2; }
.data-banner.auth    { background: #ecf3fd; color: #1a3661; border: 1px solid #a8c1f1; }
.data-banner.denied  { background: #fdf6e3; color: #6b5b00; border: 1px solid #f1d27a; }

.data-list { margin-top: 12px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid #e6e7eb;
  font-size: 13px; vertical-align: top;
}
.data-table th { background: #f4f5f7; font-weight: 600; }
.data-table .status, .data-table .outcome, .data-table .sev, .data-table .effect {
  text-transform: lowercase; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px;
}
.data-table .status.healthy, .data-table .outcome.allow, .data-table .effect.allow {
  color: #1a6b3a; font-weight: 600;
}
.data-table .status.degraded, .data-table .sev.medium { color: #8a5a00; font-weight: 600; }
.data-table .status.unavailable, .data-table .status.quarantined,
.data-table .outcome.DATA_DENIED, .data-table .effect.deny, .data-table .sev.high {
  color: #a01818; font-weight: 600;
}
.data-table .effect.approval { color: #1a3661; font-weight: 600; }

/* Clean-job lifecycle state colours (cleanjob/types.go). */
.data-table .status.completed { color: #1a6b3a; font-weight: 600; }
.data-table .status.running, .data-table .status.reconciling { color: #1a3661; font-weight: 600; }
.data-table .status.paused, .data-table .status.pending, .data-table .status.approved { color: #8a5a00; font-weight: 600; }
.data-table .status.halted, .data-table .status.stuck { color: #a01818; font-weight: 600; }
.data-table .status.cancelled, .data-table .status.rolled_back { color: #6b6f78; font-weight: 600; }

.data-empty { color: #6b6f78; padding: 12px; font-style: italic; }

/* Shown instead of an error banner when the deployment structurally
   cannot serve a screen. Deliberately not styled as an error: nothing is
   broken and there is nothing to retry. */
.data-unsupported {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #e6e7eb;
  border-left: 3px solid #c5c8cf;
  border-radius: 4px;
  background: #fafbfc;
}
.data-unsupported h2 { font-size: 15px; margin: 0 0 6px; }
.data-unsupported p { margin: 0; color: #5b6472; font-size: 13px; max-width: 62ch; }

.data-panel { margin-top: 18px; }
.data-panel > h2 { font-size: 16px; margin-bottom: 6px; }

.data-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.data-btn {
  border: 1px solid #c5c8cf; background: #fff; color: #1a1a1a;
  padding: 6px 12px; border-radius: 5px; font-size: 13px; cursor: pointer;
}
.data-btn.primary { background: #1a3661; color: #fff; border-color: #1a3661; }
.data-btn:hover { background: #f4f5f7; }
.data-btn.primary:hover { background: #244a82; }
.data-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.data-btn.danger { border-color: #a01818; color: #a01818; }
.data-btn.danger:hover { background: #fdecea; }

.data-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.data-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.data-input { padding: 6px 8px; border: 1px solid #c5c8cf; border-radius: 4px; font-size: 13px; }
.data-input:focus { border-color: #1a3661; outline: 1px solid #b4c4e0; }
.data-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-bottom: 10px; }
/* A checkbox belongs beside its label, not above it. */
.data-field:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 8px; }
.data-field[hidden] { display: none; }
.data-field-error { color: #a01818; font-size: 12px; min-height: 14px; }
.data-hint { font-size: 12px; color: #6b6f78; margin: 0 0 10px; }
.data-form-status { font-size: 13px; min-height: 16px; }

.data-editor {
  width: 100%; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px;
  border: 1px solid #c5c8cf; border-radius: 4px; padding: 8px;
}
.data-counter { font-size: 11px; color: #6b6f78; text-align: right; }
.data-note { font-size: 12px; color: #6b6f78; }
.data-validation .ok { color: #1a6b3a; font-weight: 600; }
.data-validation .error, .data-validation .severity-error { color: #a01818; }
.data-validation .warn,  .data-validation .severity-warn  { color: #8a5a00; }

.data-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.data-split-pane label { font-weight: 600; font-size: 12px; text-transform: uppercase; opacity: 0.7; }
.data-dryrun { margin-top: 12px; padding: 8px; background: #f4f5f7; border-radius: 4px; }
.data-dryrun-out { white-space: pre-wrap; background: #fff; padding: 8px; border: 1px solid #e6e7eb; border-radius: 4px; }
.data-effective { margin-top: 10px; }

.data-filterbar { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }

.data-modal-scrim {
  position: fixed; inset: 0; background: rgba(15, 22, 35, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1200;
}
.data-modal {
  background: #fff; padding: 18px 22px; border-radius: 8px; min-width: 360px;
  max-width: 720px; max-height: 80vh; overflow: auto; box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.data-modal h3 { margin: 0 0 12px; font-size: 16px; }
.data-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.data-kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 13px; }
.data-kv dt { color: #6b6f78; }
.data-kv dd { margin: 0; }

.data-ops { padding-left: 20px; font-size: 13px; }
.data-lineage { background: #f4f5f7; padding: 8px; margin-top: 10px; border-radius: 4px; font-size: 13px; }

.data-loading { color: #6b6f78; font-style: italic; padding: 12px; }

/* These screens append bare h1/h2/section straight into #view, which app.css
   only styles inside .view-head. Without a rule here every heading, note and
   form sits flush against the next one and the page reads as one block. */
#view > h1 { margin: 0 0 6px; }
#view > p.data-note { margin: 0 0 20px; max-width: 70ch; }
#view > section { margin-top: 24px; }
#view > section > h2 { font-size: 16px; margin: 0 0 8px; }
