/* بذر — داشبورد. RTL، بدون فونت خارجی (باید آفلاین هم کار کند). */
:root {
  --bg: #0f1419; --card: #1a2129; --border: #2b3540;
  --text: #e6edf3; --muted: #8b98a5; --accent: #4caf7d;
  --red: #e5534b; --amber: #d4a72c; --blue: #539bf5;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px; line-height: 1.7;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem 1.2rem; background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; gap: 1rem; }
.controls { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }

main { padding: 1.2rem; max-width: 1200px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.2rem;
}
.card.wide { grid-column: 1 / -1; }
.card h2 { margin: 0 0 .8rem; font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: .35rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.muted { color: var(--muted); font-size: .88rem; }
.error { color: var(--red); }

/* Destructive, and dressed as such: outlined rather than filled, so it never
   competes with the one button on this dashboard that matters more. */
.danger-outline {
  background: transparent; color: var(--red); border: 1px solid var(--red);
  border-radius: 6px; padding: .15rem .6rem; font: inherit; font-size: .82rem;
  cursor: pointer;
}
.danger-outline:hover { background: var(--red); color: var(--bg); }
/* A subtotal row that heads the detail rows below it. */
tr.group td { border-bottom: none; padding-top: .7rem; }
.pre { white-space: pre-wrap; word-break: break-word; font-size: .88rem; }
.ltr { direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: .85rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }

.badge {
  display: inline-block; padding: .05rem .55rem; border-radius: 999px;
  font-size: .78rem; border: 1px solid var(--border); background: var(--bg);
}
.badge.stopped, .badge.s-failed, .badge.sev-critical { color: #fff; background: var(--red); border-color: var(--red); }
.badge.s-done { color: #fff; background: var(--accent); border-color: var(--accent); }
.badge.s-canary, .badge.s-deploying, .badge.sev-warning { color: #000; background: var(--amber); border-color: var(--amber); }
.badge.s-coding, .badge.s-review, .badge.s-testing, .badge.s-planning { color: #fff; background: var(--blue); border-color: var(--blue); }
.badge.s-split { color: var(--muted); border-style: dashed; }
/* Not a state of the order: the pre-plan finding, which reads as a note. */
.badge.s-recon { color: var(--muted); border-style: dotted; }
.badge.sev-notice { color: var(--amber); }

.btn {
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  padding: .35rem .9rem; border-radius: 7px; cursor: pointer; font: inherit; font-size: .88rem;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.btn.stop { background: var(--red); border-color: var(--red); color: #fff; }
.btn.resume { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { color: var(--muted); }

.tree, .tree ul { list-style: none; padding-inline-start: 1.1rem; margin: 0; }
.tree > li { padding-inline-start: 0; }
.tree li { position: relative; padding: .15rem 0; }
.tree li::before { content: "└ "; color: var(--muted); }
.tree > li::before { content: ""; }
.tree-name { font-weight: 600; }

.report summary { cursor: pointer; padding: .4rem 0; }
.report .pre { background: var(--bg); border-radius: 8px; padding: .8rem; margin: .4rem 0; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; direction: ltr; overflow-x: auto; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; min-width: 26px; }
.bar { width: 18px; background: var(--accent); border-radius: 3px 3px 0 0; }
.bar-label { font-size: .6rem; color: var(--muted); margin-top: 3px; }

.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 2rem; width: min(360px, 90vw); display: flex; flex-direction: column; gap: .9rem;
}
.login-card h1 { margin: 0; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.login-card input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); padding: .5rem .7rem; font: inherit;
}
