:root {
  --bg: #0c0f1a;
  --bg-soft: #131829;
  --panel: #161c30;
  --panel-2: #1b2138;
  --line: #28304d;
  --text: #e8ecf8;
  --muted: #9aa6c8;
  --primary: #6d8bff;
  --primary-press: #5a78f0;
  --accent: #4fd1b3;
  --danger: #ff7a7a;
  --warn: #ffcf6b;
  --radius: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 540px at 80% -10%, rgba(109, 139, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(79, 209, 179, 0.10), transparent 55%),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1080px, 92vw); margin: 0 auto; }

code { font-family: var(--mono); font-size: 0.92em; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(12, 15, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(109,139,255,0.12);
}
.brand-name { font-size: 1.02rem; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
  border: 1px solid transparent; color: var(--text);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #0b1024; }
.btn-primary:hover { background: var(--primary-press); }
.btn-accent { background: rgba(79, 209, 179, 0.16); color: var(--accent); border-color: rgba(79,209,179,0.4); }
.btn-accent:hover { background: rgba(79, 209, 179, 0.26); }
.btn-ghost { background: rgba(255,255,255,0.04); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); }
.file-btn { cursor: pointer; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 24px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: 0.72rem; font-weight: 700;
  color: var(--accent); margin: 0 0 12px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; margin: 0 0 16px; letter-spacing: -0.5px; }
.lede { font-size: 1.07rem; color: var(--muted); max-width: 70ch; margin: 0 0 24px; }
.lede code { color: var(--text); }

.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; min-width: 118px;
}
.stat-val { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-val.bad { color: var(--danger); }
.stat-val.good { color: var(--accent); }
.stat-label { font-size: 0.74rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.6px; }

/* ---------- board ---------- */
.board {
  display: grid; grid-template-columns: 340px 1fr; gap: 20px;
  padding: 18px 0 40px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel-title { margin: 0 0 16px; font-size: 1.05rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.panel-head .panel-title { margin: 0; }
.panel-head-actions { display: flex; gap: 8px; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select {
  font: inherit; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(109,139,255,0.2); }
.btn-primary[type="submit"] { width: 100%; justify-content: center; margin-top: 4px; }

.settings { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.settings h3 { margin: 0 0 14px; font-size: 0.92rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }

/* ---------- timeline ---------- */
.timeline {
  position: relative; height: 84px; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent calc(100%/24 - 1px), rgba(255,255,255,0.05) calc(100%/24 - 1px), rgba(255,255,255,0.05) calc(100%/24));
  border: 1px solid var(--line); background-color: var(--bg-soft);
  margin-bottom: 8px; overflow: hidden;
}
.tl-hours { position: relative; height: 16px; margin-bottom: 14px; }
.tl-hour { position: absolute; top: 0; font-size: 0.62rem; color: var(--muted); transform: translateX(-50%); }
.tl-bar {
  position: absolute; top: 10px; height: 30px; border-radius: 7px;
  background: linear-gradient(180deg, var(--primary), var(--primary-press));
  color: #0b1024; font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; padding: 0 7px; overflow: hidden; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: default;
  min-width: 3px;
}
.tl-bar.light { top: 46px; height: 24px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); box-shadow: none; }
.tl-bar.collide { background: linear-gradient(180deg, var(--danger), #e85d5d); box-shadow: 0 0 0 2px rgba(255,122,122,0.4); }

.alerts { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.alert {
  font-size: 0.85rem; padding: 10px 12px; border-radius: 10px;
  border: 1px solid; display: flex; gap: 8px; align-items: flex-start;
}
.alert.ok { border-color: rgba(79,209,179,0.4); background: rgba(79,209,179,0.08); color: var(--accent); }
.alert.bad { border-color: rgba(255,122,122,0.4); background: rgba(255,122,122,0.08); color: var(--danger); }
.alert.warn { border-color: rgba(255,207,107,0.4); background: rgba(255,207,107,0.08); color: var(--warn); }
.alert b { font-weight: 700; }

/* ---------- job list ---------- */
.list-title { font-size: 0.92rem; margin: 22px 0 10px; }
.muted { color: var(--muted); font-weight: 400; }
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.job-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px;
}
.job-item.collide { border-color: rgba(255,122,122,0.5); }
.job-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.job-dot.light { background: var(--muted); }
.job-dot.collide { background: var(--danger); }
.job-main { min-width: 0; }
.job-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.job-del {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 4px 6px; border-radius: 8px;
}
.job-del:hover { color: var(--danger); background: rgba(255,122,122,0.1); }
.empty-state { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 16px 0; }

.export-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- how ---------- */
.how { padding: 24px 0 56px; }
.how h2 { font-size: 1.5rem; margin: 0 0 22px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.how-grid h3 { margin: 0 0 8px; font-size: 1rem; color: var(--primary); }
.how-grid p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.footnote { margin-top: 22px; color: var(--muted); font-size: 0.88rem; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 22px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.85rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all 0.25s ease; font-size: 0.9rem; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn-ghost[href] { display: none; }
}
