/*
 * GOLDMINE local tokens — MUST come AFTER maobapp-shell.css (link order matters).
 * Matches purchase tokens on top of the shell. Dense, boring, legible.
 */

:root {
  /* Purchase-matching overrides / additions */
  --bg:     #f6f7fb;
  --primary: #2f6bff;
  --card-border: #dde3eb;
  --card-radius: 12px;
  --font: 14px/1.45 system-ui, sans-serif;
}

body { font: var(--font); background: var(--bg); }

/* ── Layout ── */
.wrap { padding: 12px 16px; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #445; }

/* ── Pills ── */
.pill        { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef; }
.pill.ok     { background: #d1fae5; color: #065f46; }
.pill.warn   { background: #fef3c7; color: #92400e; }
.pill.no     { background: #fee2e2; color: #991b1b; }
.pill.muted  { background: #f1f5f9; color: #64748b; }

/* ── Tags ── */
.tag         { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.tag.ok      { background: #d1fae5; color: #065f46; }
.tag.warn    { background: #fef3c7; color: #92400e; }
.tag.no      { background: #fee2e2; color: #991b1b; }
.tag.info    { background: #dbeafe; color: #1e40af; }

/* ── Banner ── */
.banner      { padding: 8px 14px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
.banner.warn { background: #fef3c7; color: #92400e; border-left: 3px solid #f59e0b; }
.banner.error{ background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.banner.ok   { background: #d1fae5; color: #065f46; border-left: 3px solid #10b981; }

/* ── Numbers (tabular, right-aligned) ── */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Muted ── */
.muted { color: #778; font-size: 12px; }

/* ── Filters ── */
.filters { background: #fff; border: 1px solid var(--card-border); border-radius: var(--card-radius); padding: 10px 14px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .f { display: flex; flex-direction: column; gap: 2px; }
.filters label { font-size: 11px; color: #667; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.filters select, .filters input[type=text] { font: inherit; padding: 3px 6px; border: 1px solid #ccd; border-radius: 4px; background: #fff; font-size: 13px; }
.filters select[multiple] { min-width: 130px; height: 64px; }
.filters .checkboxes { display: flex; flex-direction: column; gap: 3px; }
.filters .checkboxes label { text-transform: none; letter-spacing: 0; font-size: 12px; color: #334; font-weight: 400; display: flex; gap: 4px; align-items: center; cursor: pointer; }

/* ── Buttons ── */
.btn         { font: inherit; padding: 4px 11px; border: 1px solid #99a; border-radius: 4px; background: #eef; cursor: pointer; font-size: 13px; }
.btn:hover   { background: #dde; }
.btn.primary { background: var(--primary); color: #fff; border-color: #1f55e8; }
.btn.primary:hover { background: #1f55e8; }
.btn:disabled { opacity: .45; cursor: default; }

/* ── Grid / table ── */
.grid-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 12px; }
th, td { border: 1px solid #e3e6ea; padding: 4px 7px; text-align: left; white-space: nowrap; }
th { background: #eef1f5; position: sticky; top: 0; cursor: default; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { background: #e0e6ef; }
th .arrow   { color: var(--primary); font-weight: 700; }
tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:hover { background: #eef6ff; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Pager ── */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ── Meta line ── */
.meta-line { font-size: 12px; color: #778; margin-bottom: 6px; }

/* ── Pipeline flow ── */
.pipeline-flow { display: flex; flex-wrap: wrap; gap: 0; align-items: flex-start; }
.pipeline-step { display: flex; align-items: flex-start; }
.pipeline-card { background: #fff; border: 1px solid var(--card-border); border-radius: var(--card-radius); padding: 12px 14px; width: 210px; min-height: 130px; cursor: pointer; transition: box-shadow .15s; }
.pipeline-card:hover { box-shadow: 0 2px 10px rgba(47,107,255,.15); }
.pipeline-card h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--primary); }
.pipeline-card .io { font-size: 11px; color: #667; margin-bottom: 6px; }
.pipeline-card .io span { color: #334; }
.pipeline-card .sources-row { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.pipeline-card .rules-list { font-size: 11px; color: #778; padding-left: 14px; margin: 0 0 6px; }
.pipeline-card .run-link { font-size: 11px; }
.pipeline-arrow { display: flex; align-items: center; padding: 0 4px; color: #aab; font-size: 18px; align-self: center; margin-top: 0; }

/* ── Sources cards ── */
.sources-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.source-card { background: #fff; border: 1px solid var(--card-border); border-radius: var(--card-radius); padding: 14px 16px; width: 320px; }
.source-card h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.source-card .type-tag { font-size: 10px; color: #778; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-weight: 400; }
.source-card .state-reason { margin-top: 6px; font-size: 11px; color: #778; border-left: 2px solid #dde; padding-left: 8px; }
.source-card .cost-model { font-size: 11px; color: #667; margin-top: 5px; }
.source-card .yield-line { font-size: 11px; margin-top: 4px; }
.source-card .month-cost { font-size: 11px; color: #334; margin-top: 4px; }

/* ── ok/no/warn helpers ── */
.ok   { color: #16a34a; }
.no   { color: #bbb; }
.warn { color: #dc2626; font-weight: 600; }
