/* Design tokens follow frontend-2.0 (globals.css): Plus Jakarta Sans, the
   green/navy/cream palette, 10px pill buttons, 14px card radius. */
:root {
  --green-50: oklch(98.5% 0.012 142);
  --green-100: oklch(95.5% 0.03 142);
  --green-200: oklch(91.8% 0.06 143.6);
  --green-500: oklch(68.9% 0.197 142.7);
  --green-600: oklch(62.2% 0.178 142.7);
  --green-700: oklch(54.1% 0.153 142.6);
  --green-800: oklch(43% 0.123 143);
  --navy-800: oklch(28.8% 0.044 260.6);
  --navy-950: oklch(22.6% 0.052 257.3);
  --gray-200: oklch(92.8% 0.006 264.5);
  --gray-300: oklch(87.2% 0.009 258.3);
  --gray-400: oklch(71.4% 0.019 261.3);
  --gray-500: oklch(55.1% 0.023 264.4);
  --gray-700: oklch(37.3% 0.031 259.7);
  --cream-50: oklch(98.6% 0.004 110);
  --cream-100: oklch(97.2% 0.007 106.5);
  --cream-200: oklch(93.6% 0.011 95.2);
  --cream-300: oklch(88.8% 0.018 92.7);
  --error-50: oklch(96.9% 0.015 27.3);
  --error-100: oklch(93.1% 0.035 26.5);
  --error-700: oklch(51% 0.195 25.4);
  --warning-100: oklch(93.8% 0.046 70.4);
  --warning-300: oklch(84.6% 0.12 69.3);
  --warning-800: oklch(43.4% 0.11 53.1);
  --warning-950: oklch(28.4% 0.071 54);
  --info-100: oklch(92.1% 0.037 247);
  --info-200: oklch(84.9% 0.072 248.7);
  --info-700: oklch(48.6% 0.14 254.5);

  --background: var(--cream-100);
  --foreground: var(--navy-950);
  --card: #fff;
  --muted-foreground: var(--gray-500);
  --border: var(--gray-200);
  --input: var(--gray-300);
  --primary: var(--green-600);
  --ring: var(--green-500);

  --radius-card: 14px;
  --radius-pill: 10px;
  --shadow-card: 0 1px 3px oklch(36% 0.1 143.2 / 0.06), 0 1px 2px oklch(36% 0.1 143.2 / 0.04);
  --shadow-btn-dark: inset 0 1px 0 oklch(100% 0 0 / 0.22), inset 0 -1px 0 oklch(0% 0 0 / 0.1);
  --shadow-btn-light: inset 0 1px 0 oklch(100% 0 0 / 0.6), inset 0 -1px 0 oklch(0% 0 0 / 0.06);

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-width: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, pre { font-family: var(--font-mono); font-size: 12.5px; }
code { background: var(--cream-200); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted-foreground); }
.text-warning { color: var(--warning-800); font-weight: 600; }
.text-destructive { color: var(--error-700); font-weight: 600; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  width: var(--sidebar-width); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--border);
  padding: 20px 14px;
}
.sidebar__brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 18px; text-decoration: none; }
.sidebar__logo { height: 22px; width: auto; align-self: flex-start; }
.sidebar__product { font-size: 12px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.02em; text-transform: uppercase; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar__section { font-size: 11.5px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; padding: 14px 10px 6px; }
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-pill);
  color: var(--gray-700); font-weight: 500; text-decoration: none;
}
.sidebar__link:hover { background: var(--cream-200); }
.sidebar__link.is-active { background: var(--green-100); color: var(--green-700); }
.sidebar__count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warning-300); color: var(--warning-950); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.table__row--unread td { background: var(--green-50); }
.page-header__actions form { display: inline; }
.sidebar__footer { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sidebar__user-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar__user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 12px; color: var(--gray-500); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-100); color: var(--green-800); font-weight: 700;
}
.content { flex: 1; min-width: 0; padding: 24px 32px 40px; max-width: 1400px; }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-header__row { display: flex; align-items: center; gap: 12px; }
.page-header__title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.page-header__description { color: var(--muted-foreground); font-size: 13px; margin-top: 6px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--gray-300);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 20px 24px;
}
.card + .card, .grid + .card, .banner + .grid, .banner + .banner, .banner + .card { margin-top: 16px; }
.card--table { padding: 0; overflow-x: auto; }
.card__title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px oklch(62.2% 0.178 142.7 / 0.35); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-btn-dark); }
.btn--primary:hover { background: var(--green-700); }
.btn--outline { background: #fff; color: var(--navy-800); border-color: var(--gray-300); box-shadow: var(--shadow-btn-light); }
.btn--outline:hover { background: var(--cream-50); border-color: var(--gray-400); }
.btn--ghost { background: transparent; color: var(--gray-700); }
.btn--ghost:hover { background: var(--cream-200); }
.btn--destructive { background: var(--error-50); color: var(--error-700); box-shadow: var(--shadow-btn-light); }
.btn--destructive:hover { background: var(--error-100); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--lg { height: 42px; padding: 0 24px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge--success { background: var(--green-100); color: var(--green-800); }
.badge--secondary { background: var(--cream-200); color: var(--gray-700); }
.badge--warning { background: var(--warning-100); color: var(--warning-800); }
.badge--destructive { background: var(--error-100); color: var(--error-700); }
.badge--info { background: var(--info-100); color: var(--info-700); }
.badge--outline { background: transparent; border-color: var(--border); color: var(--foreground); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em; background: var(--cream-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--cream-50); }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions .btn { display: flex; }
.table__actions .btn + .btn { margin-top: 6px; }
.table__builds { display: flex; flex-direction: column; gap: 3px; }
.table__name { white-space: nowrap; }
.table__tickets { display: flex; flex-wrap: wrap; gap: 4px; max-width: 200px; }
.build { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; white-space: nowrap; }
.build__app { width: 68px; color: var(--gray-500); flex-shrink: 0; }

.table--builds { table-layout: fixed; }
.table--builds th:first-child { width: 110px; }
.table--builds th:last-child { width: 110px; }
.table--builds code { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.table__row--main td { background: var(--green-50); }

/* Links */
.link { color: var(--green-700); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link--strong { font-weight: 600; }
.link--muted { color: var(--gray-500); font-size: 12.5px; margin-left: 8px; }
.link--back { display: inline-block; font-size: 13px; margin-bottom: 8px; color: var(--gray-500); }

/* Definition lists */
.dl { display: flex; flex-direction: column; }
.dl__row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.dl__row:last-child { border-bottom: 0; }
.dl dt { color: var(--gray-500); font-weight: 500; }
.dl dd { min-width: 0; overflow-wrap: anywhere; }

/* Banners */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid;
  font-size: 14px; margin-bottom: 16px;
}
.banner svg { flex-shrink: 0; }
.banner--info { border-color: var(--info-200); background: oklch(84.9% 0.072 248.7 / 0.12); }
.banner--success { border-color: oklch(62.2% 0.178 142.7 / 0.3); background: oklch(62.2% 0.178 142.7 / 0.06); }
.banner--warning { border-color: var(--warning-300); background: oklch(84.6% 0.12 69.3 / 0.2); color: var(--warning-950); }
.banner--destructive { border-color: oklch(51% 0.195 25.4 / 0.3); background: oklch(51% 0.195 25.4 / 0.08); color: var(--error-700); }
.messages { margin-bottom: 4px; }

/* Forms */
.form { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; }
.field input, .field select {
  height: 36px; padding: 0 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--input); border-radius: 8px; background: #fff; color: var(--foreground);
  outline: none; transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus-visible, .field select:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px oklch(68.9% 0.197 142.7 / 0.25); }
.field--invalid input { border-color: var(--error-700); }
.field__help { font-size: 12.5px; color: var(--gray-500); }
.field__error { font-size: 12.5px; color: var(--error-700); font-weight: 500; }
.form__actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); }

.form--wide { max-width: 960px; }
.form__section { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.field--check { flex-direction: row; align-items: center; gap: 10px; }
.field--check input { width: 16px; height: 16px; accent-color: var(--primary); }
.card__intro { color: var(--gray-500); font-size: 13px; margin: -8px 0 12px; }
.table--accounts td, .table--accounts th { padding: 8px 12px; }
.secret { display: inline-flex; align-items: center; gap: 4px; }
.secret__value { min-width: 110px; display: inline-block; }
.empty-state .btn { margin-top: 16px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state__title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state__text { color: var(--gray-500); }

/* Step log */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { padding-left: 22px; position: relative; }
.step__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step__dot { position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); }
.step--running .step__dot { background: var(--info-700); box-shadow: 0 0 0 4px var(--info-100); }
.step--succeeded .step__dot { background: var(--green-500); }
.step--failed .step__dot { background: var(--error-700); }
.step__name { font-weight: 600; }
.step__meta { font-size: 12px; color: var(--gray-500); }
.step__output { margin-top: 6px; }
.step__output summary { cursor: pointer; font-size: 12.5px; color: var(--gray-500); }
.step__output pre { margin: 6px 0 0; padding: 12px; background: var(--navy-950); color: var(--cream-100); border-radius: 10px; overflow-x: auto; max-height: 360px; white-space: pre-wrap; }

/* Entrance (login, errors) */
.entrance { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.entrance__card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 32px; text-align: center; }
.entrance__logo { height: 26px; width: auto; align-self: center; margin-bottom: 8px; }
.entrance__title { font-size: 22px; font-weight: 700; }
.entrance__text { color: var(--gray-500); margin-bottom: 8px; }
.entrance__foot { font-size: 12.5px; color: var(--gray-500); }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; height: auto; width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .content { padding: 16px; }
  .page-header { flex-direction: column; }
  .table__builds { min-width: 220px; }
}
