:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #15181d;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --line: #e6e8ec;
  --muted: #6b7280;
  --text: #15181d;
  --accent: #111827;
  --good: #16794b;
  --warn: #9a6700;
  --bad: #b42318;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f6f8;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin: 0;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.muted,
.security-note {
  color: var(--muted);
}

.security-note {
  margin: 20px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid #d9dde4;
  background: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: #737b8c;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.07);
}

.primary,
.secondary,
.ghost,
.icon-button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: #eceff3;
  color: var(--text);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.error {
  color: var(--bad);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  background: #0e1116;
  color: #fff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 26px;
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row strong {
  font-size: 14px;
}

.brand-row span {
  margin-top: 2px;
  color: #8f98a7;
  font-size: 11px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-section {
  margin: 18px 10px 6px;
  color: #677181;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.nav-section:first-child {
  margin-top: 2px;
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 0;
  padding: 10px 11px;
  border-radius: 9px;
  background: transparent;
  color: #aeb5c0;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  background: #1b2028;
  color: #fff;
}

.sidebar .ghost {
  border-color: #2b323d;
  color: #aeb5c0;
}

.main {
  min-width: 0;
  padding: 0 32px 48px;
}

.topbar {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.topbar select {
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 800;
  min-width: 180px;
}

.user-box {
  text-align: right;
}

.user-box span,
.user-box small {
  display: block;
}

.user-box span {
  font-weight: 750;
}

.user-box small {
  color: var(--muted);
  margin-top: 2px;
}

.view {
  padding-top: 30px;
}

.page-heading,
.panel-heading,
.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.page-heading {
  margin-bottom: 22px;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-heading h1 {
  margin: 0;
  font-size: 30px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card {
  padding: 18px;
  min-height: 132px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.metric-card span,
.metric-card small,
.metric-card strong {
  display: block;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card span {
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  margin: 8px 0 4px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.metric-card small {
  font-size: 11px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.project-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.project-card,
.run-row {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.run-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card:first-child,
.run-row:first-child {
  border-top: 0;
}

.project-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card strong,
.project-card small {
  display: block;
}

.project-card small {
  color: var(--muted);
  margin-top: 3px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 62px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f0f2f5;
  color: #4b5563;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.passed {
  background: #e8f5ee;
  color: var(--good);
}

.badge.failed {
  background: #feeceb;
  color: var(--bad);
}

.badge.running {
  background: #fff5d6;
  color: var(--warn);
}

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.filter-row {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.filter-row select {
  width: min(340px, 100%);
}

.status {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
  font-size: 13px;
}

.status.good {
  border-color: #b7dfc8;
  color: var(--good);
}

.status.bad {
  border-color: #fac5c1;
  color: var(--bad);
}

dialog {
  width: min(520px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(13, 17, 23, 0.52);
}

.dialog-card {
  padding: 22px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dialog-heading {
  margin-bottom: 18px;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.icon-button {
  font-size: 22px;
  line-height: 1;
  background: transparent;
  color: var(--muted);
}

code.token-output {
  display: block;
  padding: 12px;
  background: #10141a;
  color: #e7ebf0;
  border-radius: 9px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1000px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-section {
    grid-column: 1 / -1;
  }

  .main {
    padding: 0 16px 36px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-end;
    padding: 16px 0;
  }
}

.table-action {
  border: 0;
  background: transparent;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}

.table-action:hover {
  background: #f3f4f6;
}

.table-action.danger {
  color: var(--bad);
}

.table-action.danger:hover {
  background: #feeceb;
}

.check-list {
  display: grid;
  gap: 8px;
  padding: 4px 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.check-row input {
  width: auto;
  margin: 0;
}

.readiness-panel {
  margin-bottom: 20px;
}

.readiness-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.readiness-copy p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.readiness-suites {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.readiness-suite {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.readiness-suite span,
.readiness-suite strong,
.readiness-suite small {
  display: block;
}

.readiness-suite span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.readiness-suite strong {
  margin: 6px 0 3px;
  font-size: 13px;
}

.readiness-suite small {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 900px) {
  .readiness-summary {
    grid-template-columns: 1fr;
  }
}
