/* DeployPro dashboard.
 *
 * One stylesheet, no framework, no build step. The dashboard is the tool you
 * open when a deploy is broken, so it has no dependency that could be broken
 * at the same time.
 */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --border: #e3e3df;
  --border-strong: #cfcfc9;
  --text: #1a1a18;
  --text-dim: #6b6b64;
  --text-faint: #9a9a92;
  --accent: #2f6f4f;
  --accent-soft: #e6f0ea;
  --danger: #9d2f2f;
  --danger-soft: #f7e8e8;
  --warn: #8a6216;
  --warn-soft: #f8f0dc;
  --info: #2c5a8a;
  --info-soft: #e6eef6;
  --radius: 7px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131314;
    --surface: #1a1a1c;
    --surface-2: #212124;
    --border: #2c2c30;
    --border-strong: #3d3d43;
    --text: #e8e8e4;
    --text-dim: #9d9d97;
    --text-faint: #6e6e69;
    --accent: #6aba8e;
    --accent-soft: #1b2a22;
    --danger: #e08585;
    --danger-soft: #2c1d1d;
    --warn: #d6ab5c;
    --warn-soft: #2b2417;
    --info: #7fb0e0;
    --info-soft: #1a242e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- layout */

.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead-inner,
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 54px;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 15px;
}
.wordmark:hover { text-decoration: none; }
.wordmark span { color: var(--accent); }

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.page { padding-top: 28px; padding-bottom: 72px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 620;
}
.page-head .spacer { margin-left: auto; }
.breadcrumb {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 34px 0 12px;
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-body { padding: 16px; }

.rows > * + * { border-top: 1px solid var(--border); }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}
a.row:hover { background: var(--surface-2); text-decoration: none; }
.row-main { min-width: 0; flex: 1; }
.row-title {
  font-weight: 560;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.row-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-aside {
  text-align: right;
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- pieces */

.mono { font-family: var(--mono); font-size: 0.9em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-ready     { background: var(--accent-soft); color: var(--accent); }
.pill-failed    { background: var(--danger-soft); color: var(--danger); }
.pill-cancelled { background: var(--surface-2);   color: var(--text-dim); }
.pill-building,
.pill-deploying { background: var(--warn-soft);   color: var(--warn); }
.pill-queued    { background: var(--info-soft);   color: var(--info); }
.pill-prod {
  background: var(--accent);
  color: var(--surface);
  font-weight: 600;
}
.pill-plain {
  background: var(--surface-2);
  color: var(--text-dim);
  border-color: var(--border);
}

/* A quietly breathing dot, so an in-flight deploy looks in flight. */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.pill-building .dot,
.pill-deploying .dot,
.pill-queued .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .pill-building .dot, .pill-deploying .dot, .pill-queued .dot { animation: none; }
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 520;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #10231a; }
}
.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-small { font-size: 12.5px; padding: 4px 9px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ----------------------------------------------------------------- forms */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.field .hint {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 5px;
  font-weight: 400;
}
input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}
.field-mono input { font-family: var(--mono); font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 150px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* --------------------------------------------------------------- notices */

.notice {
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.notice-ok   { background: var(--accent-soft); color: var(--accent); }
.notice-bad  { background: var(--danger-soft); color: var(--danger); }
.notice-info { background: var(--info-soft);   color: var(--info); }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-dim);
}
.empty p { margin: 0 0 14px; }

/* ------------------------------------------------------------------ logs */

.log {
  background: #0e0e10;
  color: #d4d4cf;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 14px 16px;
  border-radius: var(--radius);
  max-height: 65vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
}
.log-line { display: block; }
/* DeployPro's own narration, so the three interesting lines of a deploy are not
   lost among six hundred lines of npm output. */
.log-system { color: #7fd1a4; }
.log-run    { color: #9fc0e0; }
.log-empty  { color: #6e6e69; }

.log-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 9px;
  font-family: var(--mono);
}

/* ------------------------------------------------------------------ misc */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: 13.5px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.login {
  max-width: 380px;
  margin: 13vh auto 0;
  padding: 0 16px;
}
.login .wordmark { font-size: 21px; display: block; margin-bottom: 6px; }
.login .tagline { color: var(--text-dim); font-size: 13.5px; margin: 0 0 22px; }

@media (max-width: 620px) {
  .row { flex-wrap: wrap; gap: 8px; }
  .row-aside { text-align: left; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head .spacer { margin-left: 0; width: 100%; }
}
