:root {
  --ink: #1e1e1e;
  --navy: #17263d;
  --blue: #2864d7;
  --blue-soft: #eaf1ff;
  --green: #2f6b4f;
  --amber: #b56a18;
  --red: #a53d35;
  --muted: #647080;
  --line: #dfe4ea;
  --canvas: #f4f5f6;
  --panel: #fff;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar { min-height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 18px; }
.brand img { width: 94px; height: auto; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-title { font-size: 13px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.user-area { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.ghost-button { color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 9px 14px; }

.nav { background: var(--navy); color: #fff; padding: 0 32px; display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.nav button { border: 0; color: #b6c4d7; background: transparent; padding: 17px 14px; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav button.active, .nav button:hover { color: #fff; border-bottom-color: #83aaff; }
.nav-spacer { flex: 1; }

.workspace { max-width: 1440px; margin: 0 auto; padding: 28px 32px 64px; }
.case-strip { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; color: var(--navy); }
h1 { font-size: 28px; margin-top: 5px; }
h2 { font-size: 19px; margin-bottom: 18px; }
h3 { font-size: 14px; margin-bottom: 9px; }
.case-controls { display: flex; align-items: center; gap: 10px; }
select, input, textarea { border: 1px solid #cbd3dc; border-radius: 4px; background: #fff; color: var(--ink); padding: 10px 11px; }
.case-controls select { min-width: 180px; }
.primary-button { background: var(--blue); color: #fff; border: 0; border-radius: 4px; padding: 11px 16px; font-weight: 700; }
.primary-button:hover { background: #1e52ba; }
.secondary-button { background: var(--blue-soft); color: #17469f; border: 1px solid #c7d7fb; border-radius: 4px; padding: 10px 14px; font-weight: 700; }

.status-banner { background: var(--navy); color: #fff; padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; border-left: 7px solid var(--green); }
.status-banner.status-amber { border-left-color: var(--amber); }
.status-banner.status-red { border-left-color: var(--red); }
.status-banner.status-neutral { border-left-color: #91a0b2; }
.status-name { font-size: 18px; font-weight: 700; }
.status-code { color: #bdc9d7; font-size: 12px; margin-top: 5px; font-family: Consolas, monospace; }
.status-pill { border: 1px solid rgba(255,255,255,.45); border-radius: 20px; padding: 8px 13px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr); gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 24px; box-shadow: 0 3px 14px rgba(23,38,61,.04); }
.panel + .panel { margin-top: 20px; }
.panel-header { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 18px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { color: var(--navy); font-size: 12px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.notice { background: #f7f8fa; border-left: 3px solid #a4b2c2; padding: 13px 15px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.notice.warning { border-left-color: var(--amber); background: #fff8ed; }
.notice.success { border-left-color: var(--green); background: #eff8f2; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { background: #f7f8fa; border: 1px solid var(--line); padding: 15px; }
.metric strong { display: block; color: var(--blue); font-size: 24px; margin-bottom: 5px; }
.metric span { color: var(--muted); font-size: 12px; }
.list { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); padding: 13px 14px; display: flex; justify-content: space-between; gap: 15px; }
.list-item small { color: var(--muted); display: block; margin-top: 5px; }
.tag { display: inline-block; border-radius: 3px; padding: 4px 7px; font-size: 11px; font-weight: 700; background: #edf0f4; color: #536171; white-space: nowrap; }
.tag.pass { background: #e3f3e9; color: var(--green); }
.tag.warn { background: #fff0d9; color: var(--amber); }
.tag.fail { background: #fae6e4; color: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; vertical-align: top; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--navy); background: #f7f8fa; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
pre { background: #17202c; color: #e3edf9; padding: 16px; overflow: auto; font-size: 12px; line-height: 1.5; border-radius: 3px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -5px 0 20px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 11px 13px; white-space: nowrap; }
.tabs button.active { border-bottom-color: var(--blue); color: var(--blue); font-weight: 700; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.error { color: var(--red); margin-top: 12px; font-size: 13px; }

@media (max-width: 800px) {
  .topbar, .nav { padding-left: 16px; padding-right: 16px; }
  .topbar { align-items: flex-start; padding-top: 16px; padding-bottom: 16px; }
  .user-area { display: none; }
  .workspace { padding: 22px 16px 48px; }
  .case-strip, .status-banner { align-items: stretch; flex-direction: column; }
  .case-controls { width: 100%; }
  .case-controls select { flex: 1; min-width: 0; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
