/* BMIE — base theme. Research-terminal feel: dense but readable, full-width,
   fluid, no fixed max-width anywhere. Orange is reserved for ACTIVE state. */

:root {
  --ink:        #14202b;
  --ink-soft:   #4b5a68;
  --paper:      #f4f6f8;
  --card:       #ffffff;
  --line:       #d9e0e7;
  --brand:      #1b4f8a;
  --brand-deep: #123a66;
  --brand-dark: #0b2545;
  --accent:     #e07a1f;   /* ACTIVE state only — never decoration */
  --good:       #1f7a4a;
  --warn:       #9a6a00;
  --danger:     #a3301d;
  --pending:    #6b7785;

  --tap: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Full-width and fluid. */
.wrap { width: 100%; padding: clamp(16px, 3vw, 44px); text-align: left; }

/* ------------------------------------------------------------------ header */
.site-head { background: var(--brand-dark); color: #fff; width: 100%; }
.site-head .wrap {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-top: clamp(12px, 1.6vw, 18px); padding-bottom: clamp(12px, 1.6vw, 18px);
}
.brand { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.5px; color: #fff; text-decoration: none; }
.brand span { color: #8fc1ff; }
.tagline { color: #c7d6e6; font-size: 15px; }
.head-links { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.head-links a { color: #fff; text-decoration: none; padding: 10px 14px; border: 1px solid #3b5f8a; border-radius: 8px; min-height: var(--tap); display: inline-flex; align-items: center; }
.head-links a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* -------------------------------------------------------------------- type */
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.5px; }
h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 10px; }
h3 { font-size: 18px; margin: 18px 0 8px; }
.lead { font-size: clamp(17px, 1.8vw, 20px); color: var(--ink-soft); max-width: none; margin: 0 0 24px; }
a { color: var(--brand); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
pre { background: #0f1c2b; color: #dbe7f3; padding: 14px; border-radius: 8px; overflow-x: auto; }

/* ------------------------------------------------------------------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 2vw, 24px); margin: 0 0 18px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.kv th { width: 34%; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; width: 100%; }

/* ---------------------------------------------------------------- statuses */
.pending { color: var(--pending); font-style: italic; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; }
.status-success, .status-connected { background: var(--good); }
.status-running, .status-registered { background: var(--brand); }
.status-partial, .status-paused { background: var(--warn); }
.status-failed { background: var(--danger); }
.status-dry_run, .status-retired { background: var(--pending); }

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 10px 18px; border-radius: 8px; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-go { background: var(--brand); color: #fff; }
.btn-go:hover { background: var(--brand-deep); }
.btn-danger { background: var(--danger); color: #fff; }
.btn.active { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------- forms */
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.notice { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; }
.notice-ok { background: #e6f4ec; color: var(--good); }
.notice-err { background: #fbe9e5; color: var(--danger); }

.site-foot { color: var(--ink-soft); font-size: 14px; border-top: 1px solid var(--line); }
