/* Acolad dark theme — palette matches SA_unified_toolkit_ui.py's Tkinter shell for visual continuity. */
:root {
  --bg: #0A1628;
  --surface: #0D1E38;
  --surface-raised: #122a4a;
  --border: #1c3a5e;
  --text: #E7ECF3;
  --text-muted: #8FA3BF;
  --blue: #1E6FD9;
  --blue-hover: #2f83ee;
  --green: #6EE7B7;
  --red: #EF4444;
  --amber: #F5B94D;
  --gray: #64748B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--blue); }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header.topbar .brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}

header.topbar .brand .accent { color: var(--blue); }

header.topbar nav { display: flex; gap: 16px; align-items: center; }
header.topbar .user-tag { color: var(--text-muted); font-size: 13px; }

main.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--text-muted); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-header h2 { margin: 0; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--blue-hover); }
.btn.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.btn-danger { background: var(--red); }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 13px; }
.field { margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--surface-raised); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-queued { background: rgba(100,116,139,0.25); color: var(--gray); }
.badge-running { background: rgba(30,111,217,0.2); color: var(--blue); }
.badge-succeeded { background: rgba(110,231,183,0.15); color: var(--green); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-stopped { background: rgba(245,185,77,0.15); color: var(--amber); }
.badge-stalled { background: rgba(245,185,77,0.15); color: var(--amber); }

/* SA project/item status pills - same palette as the job badges above */
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-gray  { background: rgba(100,116,139,0.25); color: var(--gray); }
.status-blue  { background: rgba(30,111,217,0.2);   color: var(--blue); }
.status-green { background: rgba(110,231,183,0.15); color: var(--green); }
.status-red   { background: rgba(239,68,68,0.15);   color: var(--red); }
.status-amber { background: rgba(245,185,77,0.15);  color: var(--amber); }

.status-breakdown { display: flex; flex-wrap: wrap; gap: 5px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}
.status-chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-chip.status-gray .dot  { background: var(--gray); }
.status-chip.status-blue .dot  { background: var(--blue); }
.status-chip.status-green .dot { background: var(--green); }
.status-chip.status-red .dot   { background: var(--red); }
.status-chip.status-amber .dot { background: var(--amber); }

.error-banner {
  background: rgba(239,68,68,0.12);
  border: 1px solid var(--red);
  color: #ffb4b4;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

pre.log {
  background: #061020;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 360px; }
.login-card h1 { text-align: center; }

.muted { color: var(--text-muted); font-size: 13px; }

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.shortcut-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.shortcut-card:hover { border-color: var(--blue-hover); }
.shortcut-card .shortcut-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.shortcut-card .shortcut-desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
.pill-ready { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(110,231,183,0.15); color: var(--green); }
.pill-soon { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(245,185,77,0.15); color: var(--amber); }

.section-intro { color: var(--text-muted); font-size: 13px; margin: -12px 0 16px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.stat-tile .stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-tile .stat-label { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 640px; }

.project-name { font-weight: 600; }
.project-name a { color: var(--text); text-decoration: none; }
.project-name a:hover { color: var(--blue); }
