/* ONYX — panel operatorski. UI-bez-designu (design/ jeszcze nie istnieje).
   Kierunek §10 spec: chłodne niebieskawe grafity, JEDEN akcent pomarańczowy,
   mała gęsta typografia (baza 13px), hierarchia kontrastem, chipy kroków. */

:root {
  --bg: #12151a;
  --bg-2: #171b21;
  --panel: #1c2129;
  --panel-2: #222834;
  --border: #2b323d;
  --text-hi: #e9edf2;   /* niemal-biel: tylko treści pierwszorzędne */
  --text: #a8b2bf;
  --text-dim: #67717e;
  --accent: #f97316;    /* jedyny akcent: CTA, stany aktywne, kluczowe liczby */
  --accent-dim: #b45309;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--text-hi); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text-hi);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 8px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent-dim); }

.btn {
  background: var(--panel-2); color: var(--text-hi);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 14px;
}
.btn:hover { border-color: var(--text-dim); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #16100a; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { background: var(--accent-dim); cursor: not-allowed; }
.btn-sm { padding: 3px 9px; font-size: 12px; }

/* ---- shell ---- */
header.top {
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; height: 44px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.logo { color: var(--text-hi); font-weight: 700; letter-spacing: 0.14em; font-size: 13px; }
.logo b { color: var(--accent); }
nav.main { display: flex; gap: 4px; }
nav.main a {
  color: var(--text); padding: 4px 10px; border-radius: var(--radius); font-size: 12.5px;
}
nav.main a.active { color: var(--text-hi); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.top .spacer { flex: 1; }
.ws-switch { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 12px; }
.userbox { color: var(--text-dim); font-size: 12px; display: flex; gap: 10px; align-items: center; }

main { padding: 20px; max-width: 1180px; margin: 0 auto; }
h1 { font-size: 15px; color: var(--text-hi); margin: 0 0 14px; font-weight: 600; }
h2 { font-size: 13px; color: var(--text); margin: 18px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.muted { color: var(--text-dim); font-size: 12px; }
.hi { color: var(--text-hi); }
.num { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- login ---- */
.login-wrap { display: grid; place-items: center; min-height: 100vh; }
.login-box { width: 300px; display: flex; flex-direction: column; gap: 10px; }
.login-box input { width: 100%; }

/* ---- kafle narzędzi ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer;
}
.tile:hover { border-color: var(--accent-dim); }
.tile .t-name { color: var(--text-hi); font-weight: 600; margin-bottom: 4px; }

/* ---- formularz toola ---- */
.form-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; align-items: center; max-width: 640px; }
.form-grid label { color: var(--text); font-size: 12.5px; }
.drop {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center; color: var(--text-dim); cursor: pointer;
}
.drop.has { border-style: solid; }
.thumb { max-width: 130px; max-height: 130px; border-radius: 4px; display: block; margin: 6px auto 0; }
.estimate { margin-top: 12px; }

/* ---- chipy kroków pipeline'u (widoczna maszyneria) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.chip.running .dot { background: var(--accent); animation: pulse 1s infinite; }
.chip.done .dot { background: var(--ok); }
.chip.failed .dot { background: var(--err); }
.chip.pending .dot { background: var(--text-dim); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---- tabele ---- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
td { color: var(--text); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg-2); }
td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- karty statystyk ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .s-label { color: var(--text-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .s-val { color: var(--text-hi); font-size: 19px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s-sub { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }

/* ---- wyniki runu ---- */
.outputs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.out-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; text-align: center; }
.out-card img {
  max-width: 240px; max-height: 240px; display: block; border-radius: 4px;
  background: repeating-conic-gradient(#2b323d 0% 25%, #1c2129 0% 50%) 0 0/16px 16px;
}
.out-actions { display: flex; gap: 6px; margin-top: 6px; justify-content: center; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); }
.badge.done { color: var(--ok); border-color: var(--ok); }
.badge.failed { color: var(--err); border-color: var(--err); }
.badge.running, .badge.queued { color: var(--accent); border-color: var(--accent); }
.badge.mock { color: var(--warn); border-color: var(--warn); }

.err-box { color: var(--err); background: rgba(248,113,113,0.08); border: 1px solid var(--err); border-radius: var(--radius); padding: 8px 12px; margin: 10px 0; font-size: 12.5px; }
.crumbs { color: var(--text-dim); font-size: 12px; margin-bottom: 10px; }
.crumbs a { color: var(--text); }
