/* Pipelet Firmware Campaigns — minimal Momentum-aligned styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f5efe4 0%, #ffffff 100%);
  background-attachment: fixed;
  color: #181D27;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #c49a6c, #1170cf 50%, #c49a6c);
  z-index: 10;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(160%) blur(10px);
  position: sticky; top: 0; z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'GT Alpina', 'Fraunces', 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #181D27;
}

.auth-hint { font-size: 12px; color: #A4A7AE; }

.content {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

h2 {
  font-family: 'GT Alpina', 'Fraunces', 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

h3 {
  font-family: 'GT Alpina', 'Fraunces', 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 18px;
}

h4 {
  font-size: 13px;
  font-weight: 600;
  color: #535862;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 8px;
}

.muted { color: #535862; font-size: 14px; }

button {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
button.primary { background: #1170cf; color: #fff; }
button.primary:hover { background: #0353a8; }
button.ghost { background: #fff; color: #181D27; border-color: #D5D7DA; }
button.ghost:hover { border-color: #1170cf; color: #1170cf; }
button.danger { background: #fff; color: #ab0a15; border-color: #FECDCA; }
button.danger:hover { background: #ffe8ea; }

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

.card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.card-title { font-size: 15px; font-weight: 600; color: #181D27; }
.card-meta { font-size: 12px; color: #A4A7AE; font-family: 'JetBrains Mono', monospace; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.draft      { background: #f5efe4; color: #6b4f2a; }
.badge.queued     { background: #eef4fd; color: #1170cf; }
.badge.running    { background: #fff4d6; color: #8a5a00; }
.badge.paused     { background: #f4f4f5; color: #525252; }
.badge.succeeded  { background: #cef5eb; color: #185e46; }
.badge.failed     { background: #ffe8ea; color: #ab0a15; }
.badge.cancelled  { background: #eef1f4; color: #4b5563; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 12px;
  color: #535862;
}
.stats span { font-family: 'JetBrains Mono', monospace; color: #181D27; }

.card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
}
.card-actions button { padding: 6px 12px; font-size: 12px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(24, 29, 39, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-card {
  background: #fff; border-radius: 16px;
  max-width: 720px; width: 100%;
  max-height: 90vh; overflow: auto;
  padding: 28px 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-card form { display: flex; flex-direction: column; gap: 12px; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #414651; font-weight: 500; }
.modal-card input, .modal-card select {
  padding: 8px 12px; font-size: 14px;
  border: 1px solid #D5D7DA; border-radius: 8px;
  background: #fff; color: #181D27; font-family: inherit;
}
.modal-card input:focus, .modal-card select:focus {
  outline: none; border-color: #1170cf;
  box-shadow: 0 0 0 3px rgba(17,112,207,0.12);
}
.kind-fields.hidden { display: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 200;
}
.toast.ok    { background: #cef5eb; color: #185e46; border: 1px solid #A6F4C5; }
.toast.err   { background: #ffe8ea; color: #ab0a15; border: 1px solid #FECDCA; }
