:root {
  color-scheme: light;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #d9dee7;
  --border-strong: #c5ccd7;
  --text: #172033;
  --text-secondary: #5c667a;
  --navy: #17365d;
  --blue: #1f65a6;
  --blue-hover: #174f84;
  --blue-soft: #eaf2f9;
  --success: #216e4e;
  --success-bg: #e7f4ed;
  --danger: #a12c2c;
  --danger-bg: #fbeaea;
  --warning: #8a5a12;
  --warning-bg: #fff4d6;
  --radius: 6px;
  --shadow: 0 1px 2px rgb(15 23 42 / 7%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 68px minmax(0, 1fr);
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .06em;
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand-copy span { color: var(--text-secondary); font-size: 12px; }
#identity { color: var(--text-secondary); font-size: 13px; }
#identity a { margin-left: 8px; }

nav {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  padding: 22px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

nav::before {
  content: "Workspace";
  padding: 0 10px 8px;
  color: #7a8496;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

nav button {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #414c60;
  text-align: left;
  font: inherit;
  font-weight: 520;
  cursor: pointer;
}

nav button:hover { background: #f1f4f7; color: var(--text); }
nav button.active { border-color: #d7e4f0; background: var(--blue-soft); color: #174f84; font-weight: 650; }

main {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: 1500px;
  min-width: 0;
  padding: 30px 34px 60px;
}

h1, h2, h3 { color: var(--text); line-height: 1.25; }
h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 650; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.muted, small { color: var(--text-secondary); }
.hidden { display: none !important; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { min-height: 96px; padding: 16px 18px; }
.panel { padding: 18px; }
.metric { margin-top: 8px; color: var(--navy); font-size: 26px; font-weight: 650; letter-spacing: -.02em; }

.view { margin-bottom: 28px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }

button, .primary, button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: #303b50;
  font: inherit;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
}
button:hover { border-color: #aeb7c5; background: var(--surface-subtle); }
.primary, button.primary { border-color: var(--blue); background: var(--blue); color: white; }
.primary:hover, button.primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); text-decoration: none; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
th, td { padding: 11px 14px; border-bottom: 1px solid #e7eaf0; text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
th { background: #f7f8fa; color: #657084; font-size: 11px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
td { color: #30394b; }
td code { color: #43516a; font-size: 12px; }
td select { width: auto; min-width: 130px; margin-right: 4px; }

.status { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid #dce1e8; border-radius: 999px; background: #f2f4f7; color: #566175; font-size: 12px; font-weight: 600; }
.status.passed, .status.completed, .status.low { border-color: #c8e4d4; background: var(--success-bg); color: var(--success); }
.status.failed, .status.infrastructure-error, .status.high, .status.critical { border-color: #f0caca; background: var(--danger-bg); color: var(--danger); }
.status.running, .status.claimed, .status.queued, .status.medium { border-color: #ead8a3; background: var(--warning-bg); color: var(--warning); }

.observer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; }
.screen { display: block; width: 100%; min-height: 420px; border: 1px solid #222b39; border-radius: 4px; background: #111827; object-fit: contain; }
.timeline { height: 560px; overflow: auto; }
.timeline p { margin: 0; padding: 10px 0; border-bottom: 1px solid #e7eaf0; }
progress { accent-color: var(--blue); }

dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 50px rgb(15 23 42 / 20%);
}
dialog::backdrop { background: rgb(23 32 51 / 40%); }
dialog form { display: grid; gap: 14px; padding: 24px 26px 26px; }
.close { justify-self: end; width: 32px; min-height: 32px; margin: -10px -10px -28px 0; padding: 0; border: 0; background: transparent; color: #697386; font-size: 22px; font-weight: 400; }

label { display: grid; gap: 6px; color: #3e485a; font-size: 13px; font-weight: 600; }
input, textarea, select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(31 101 166 / 12%); }
.notice { padding: 12px 14px; border: 1px solid #cbddeb; border-radius: 4px; background: #f1f7fb; color: #324b63; }

body.login { display: grid; place-items: center; background: var(--page); }
.login-card {
  grid-column: auto;
  grid-row: auto;
  display: grid;
  gap: 18px;
  width: min(410px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(15 23 42 / 8%);
}
.login-card h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.login-card p { margin: -6px 0 4px; color: var(--text-secondary); }
.login-card .primary { width: 100%; min-height: 40px; }

@media (max-width: 980px) {
  body { grid-template-columns: 180px minmax(0, 1fr); }
  main { padding: 24px 22px 50px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .observer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { display: block; }
  header { height: 64px; padding: 0 16px; }
  .brand-copy span { display: none; }
  nav { flex-direction: row; gap: 2px; padding: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  nav::before { display: none; }
  nav button { width: auto; white-space: nowrap; }
  main { padding: 20px 14px 40px; }
  .cards { gap: 10px; }
  .toolbar { align-items: flex-start; }
  table { display: block; overflow-x: auto; }
  #identity { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
