/* Page-level styling for the apps that render through templates/base_app.html.

   The chrome — icon rail, brand topbar, app switcher — comes from
   static/shell.css, which base_app.html loads first. Everything here is the
   content below it: cards, forms, tables, badges, messages. The variables
   alias shell.css's tokens so a brand change stays a one-line edit there. */

:root {
  --primary: var(--shell-green-800);
  --primary-2: var(--shell-green-600);
  --bg-light: var(--shell-cream-50);
  --bg-card: #ffffff;
  --bg-soft: var(--shell-cream-100);
  --accent: var(--shell-lime-600);
  --accent-soft: var(--shell-lime-500);
  --text-dark: var(--shell-green-800);
  --text-body: #2e4a40;
  --text-light: var(--shell-green-400);
  --danger: #ef4444;
  --success: #10b981;
  --border: var(--shell-line);
  --shadow: 0 2px 12px rgba(1, 69, 49, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-body);
  min-height: 100vh;
  /* Crisp grayscale rendering instead of macOS subpixel — text reads sharp,
     not heavy, exactly as it does in the console. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 30px 30px 64px; }
.container-wide { max-width: 1500px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; color: var(--text-dark); margin: 0; letter-spacing: -0.01em; }
.page-head .sub { color: var(--text-light); font-size: 14px; margin-top: 6px; line-height: 1.45; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-light); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 18px; color: var(--text-dark); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.project-card { display: block; padding: 20px; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.project-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(1, 69, 49, .14);
  border-color: rgba(1, 69, 49, .24);
}
.project-card h3 { margin: 0 0 6px; color: var(--text-dark); font-size: 17px; }
.project-card p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-light); min-height: 18px; }
.project-card .meta { font-size: 12.5px; color: var(--text-light); display: flex; gap: 14px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; color: var(--text-dark); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  font: inherit;
  color: var(--text-body);
}
input:focus, textarea:focus { outline: 2px solid rgba(200, 235, 45, .55); border-color: var(--primary-2); background: #fff; }
input[type=file] { font: inherit; color: var(--text-light); margin-top: 4px; }
.helptext { display: block; font-size: 12.5px; color: var(--text-light); margin-top: 4px; font-weight: 400; }
.errorlist { color: var(--danger); font-size: 13px; margin: 4px 0 0; padding-left: 18px; }

.btn {
  display: inline-block;
  border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14.5px;
  padding: 10px 20px; border-radius: 10px;
  background: linear-gradient(135deg, #014531 0%, #026d4a 100%);
  color: #fff;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn-accent { background: linear-gradient(135deg, #dfff68 0%, #c5e650 100%); color: var(--primary); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- Tables ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-light); padding: 8px 12px; border-bottom: 2px solid var(--border);
}
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.list tr:hover td { background: var(--bg-soft); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge.pending { background: rgba(1, 69, 49, .08); color: var(--text-light); }
.badge.running { background: rgba(200, 235, 45, .3); color: var(--primary); }
.badge.succeeded { background: rgba(16, 185, 129, .15); color: #067a58; }
.badge.failed { background: rgba(239, 68, 68, .12); color: var(--danger); }
.badge.waiting { background: rgba(245, 158, 11, .16); color: #b45309; }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.messages li.success { background: rgba(16, 185, 129, .12); color: #067a58; }
.messages li.error { background: rgba(239, 68, 68, .1); color: var(--danger); }
.messages li.info, .messages li.warning { background: rgba(200, 235, 45, .25); color: var(--primary); }

/* ---------- Log viewer ---------- */
.log-box {
  background: #012a1f; color: #c7d9d4;
  border-radius: 12px; padding: 18px;
  font-family: "SF Mono", Menlo, monospace; font-size: 12.5px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  max-height: 480px; overflow-y: auto;
}

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2.5px solid rgba(1, 69, 49, .2); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sign-in ---------- */
/* The one page with no rail and no switcher: there is no session to put in
   them yet. It keeps the brand topbar so signing in does not feel like a
   different product from the one you land in. */
.login-body { padding-left: 0; }
.login-wrap {
  min-height: calc(100vh - 74px);
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(223, 255, 104, .3), transparent 60%),
    radial-gradient(700px 450px at -10% 110%, rgba(1, 69, 49, .1), transparent 55%);
  padding: 40px 24px 64px;
}
.login-card { width: 100%; max-width: 410px; padding: 36px; margin: 0; }
.login-card h1 { text-align: center; font-size: 21px; color: var(--text-dark); margin: 0 0 4px; }
.login-card .tagline { text-align: center; color: var(--text-light); font-size: 13.5px; margin: 0 0 20px; line-height: 1.5; }
.login-card .btn { width: 100%; margin-top: 20px; }

/* ---------- Misc ---------- */
.kv { display: grid; grid-template-columns: 180px 1fr; row-gap: 10px; font-size: 14px; }
.kv dt { color: var(--text-light); font-weight: 600; }
.kv dd { margin: 0; color: var(--text-dark); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot.ok { background: var(--success); }
.dot.bad { background: var(--danger); }
.report-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.empty { text-align: center; color: var(--text-light); padding: 48px 20px; }
.empty .big { font-size: 38px; margin-bottom: 8px; }

@media (max-width: 760px) {
  .container { padding: 22px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
