/* Cabinet: the same donor-native visual as the terminal, laid out as a page
   rather than a chart. Palette, reset, #topbar and the sign-in card come from
   /shared/base.css, which index.html links first. */

body { display: flex; flex-direction: column; }

/* ---- top bar ---- */

#topnav { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }

#whoami {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 13px;
}

.link-btn {
  background: transparent;
  border: none;
  color: #707070;
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--accent); }

/* ---- body: section list + panel ---- */

#cabinet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

#sections {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-right: 1px solid #3a3a3a;
  overflow-y: auto;
}

.section-link {
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s, background-color 0.15s;
}
.section-link:hover { background-color: #3a3a3a; color: #ffffff; }
.section-link.active {
  color: var(--text);
  border-left-color: var(--accent);
  background-color: #333333;
}
/* Listed, not offered: these sections are the shape of the cabinet, and the
   map is shown whole on purpose (owner's decision 2026-07-26). */
.section-link.disabled {
  color: #505050;
  cursor: default;
  pointer-events: none;
}

#panel {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 28px;
}

.section-body { max-width: 720px; }

/* ---- blocks ---- */

.block { margin-bottom: 34px; }

.block-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #3a3a3a;
}

.block-note { color: var(--text-mute); margin-bottom: 12px; }
.block-note.error { color: var(--accent); }

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-dim);
  cursor: pointer;
}
.checkbox input { accent-color: var(--accent); }

/* ---- body section: provider cards ----
   The card face is the verdict and the door; everything operational folds
   inside and opens on a header click (owner's model, 2026-08-01). */

.provider { border: 1px solid var(--border); margin-bottom: 12px; }

/* The master is the surface the client trades on and the legs below mirror
   it: the section's order says so, and one accent edge keeps it saying so
   after a third card joins the list. */
.provider.master { border-left: 2px solid var(--accent); }
.provider.master .provider-name { color: #ffffff; }

.provider-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
}
.provider-head.static { cursor: default; }
.provider-head:focus-visible { outline: 1px solid var(--border); }

.provider-name { flex: 0 0 110px; color: var(--text); font-size: 15px; }

.provider-status {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  font-size: 13px;
}
.provider-status.error { color: var(--accent); }
.provider-status.mute { color: var(--text-mute); }

/* The door is an <a> wearing .btn, which is sized for <button>. */
.provider-charts {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.provider-detail {
  padding: 16px 16px 4px;
  border-top: 1px solid #3a3a3a;
}
.provider-detail[hidden] { display: none; }

/* Backfill progress: many short lines, so they sit tighter than a form. */
.ingest .row { padding: 3px 0; }
.ingest .row-value { color: var(--text-dim); }
.ingest .row-value.error { color: var(--accent); }

.row {
  display: flex;
  gap: 16px;
  padding: 7px 0;
  align-items: baseline;
}
.row-label { flex: 0 0 150px; color: var(--text-mute); }
.row-value { flex: 1 1 auto; min-width: 0; color: var(--text); }

.empty { color: var(--text-mute); }

/* ---- controls ---- */

.btn {
  height: 30px;
  padding: 0 14px;
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.btn:disabled { color: #505050; border-color: #3a3a3a; cursor: default; }

.handle-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.handle-input {
  height: 30px;
  width: 220px;
  padding: 0 10px;
  background-color: #262626;
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
}
.handle-input:focus { outline: none; border-color: #707070; }

.form-note {
  flex: 1 0 100%;
  color: var(--text-mute);
  font-size: 12px;
}
.form-note.error { color: var(--accent); }

/* ---- sign-in ----
   Unlike the terminal (which keeps its navigation visible behind the card),
   the cabinet has nothing to show a stranger, so the overlay takes the page. */

#login-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 10;
}

/* --- History (docs/design/trade_history.md section 8) -------------------- */
.hist-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.hist-switch { display: flex; gap: 6px; }
.hist-switch-btn.active { border-color: var(--accent); color: var(--text); }
.hist-tz { color: var(--text-mute); font-size: 12px; }
.hist-totals { margin-bottom: 16px; }
.hist-total { padding: 4px 0; color: var(--text-dim); font-size: 13px; }
.hist-open {
  border: 1px solid var(--border);
  border-left: 3px solid #e0a030;
  padding: 8px 10px;
  margin-bottom: 14px;
}
.hist-open-title {
  color: #e0a030;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.hist-group {
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.hist-group-key { color: var(--text-dim); font-weight: 600; }
.hist-group-sums { display: inline-flex; gap: 6px; align-items: center; }
.hist-item { border-bottom: 1px solid #3a3a3a; }
.hist-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 2px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  flex-wrap: wrap;
}
.hist-row:hover { background-color: #333333; }
.hist-row-open { background-color: rgba(224, 160, 48, 0.07); }
.hist-dir { font-weight: 700; font-size: 11px; width: 44px; }
.hist-sym { color: var(--text); min-width: 130px; }
.hist-time { min-width: 200px; }
.hist-qty { min-width: 110px; }
.hist-pts { min-width: 70px; text-align: right; }
.hist-money { min-width: 80px; text-align: right; }
.hist-net { font-weight: 600; }
.hist-pos { color: #26a69a; }
.hist-neg { color: #ef5350; }
.hist-unknown { color: var(--text-mute); }
.hist-badge {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
  color: var(--text-mute);
}
.hist-badge-real { color: var(--text-dim); }
.hist-chart-link {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
  color: var(--text-dim);
  text-decoration: none;
}
.hist-chart-link:hover { color: #e0e0e0; border-color: #5a5a5a; }
.hist-badge-paper { color: #e0a030; border-color: #e0a030; }
/* the master channel: the client's one trading surface, teal like the
   terminal's long/target accent -- never the paper amber */
.hist-badge-master { color: #26a69a; border-color: #26a69a; }
.hist-badge-warn { color: var(--accent); border-color: var(--accent); }
.hist-detail { padding: 6px 2px 12px 46px; font-size: 12px; }
/* the expansion: one line per channel execution of the decision */
.hist-exec { margin-bottom: 4px; }
.hist-exec-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 3px 0; border-bottom: 1px dotted var(--line, #444);
}
.hist-legs { border-collapse: collapse; margin-bottom: 8px; }
.hist-legs th, .hist-legs td {
  padding: 3px 10px 3px 0;
  text-align: left;
  color: var(--text-dim);
  font-weight: normal;
}
.hist-legs th { color: var(--text-mute); font-size: 11px; }
.hist-leg-adj td { color: #e0a030; }
.hist-asof { font-size: 12px; }
.hist-dim { color: var(--text-mute); }
