:root {
  --ink: #0d1b2a;
  --muted: #657386;
  --line: #dde6ef;
  --paper: #f7fafc;
  --white: #ffffff;
  --blue: #2563eb;
  --green: #00c2a8;
  --violet: #7c3aed;
  --amber: #b7791f;
  --red: #dc2626;
  --shadow: 0 22px 60px rgba(13, 27, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(13, 27, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 27, 42, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 14% 14%, rgba(37, 99, 235, 0.1), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(0, 194, 168, 0.12), transparent 26%),
    var(--paper);
  background-size: 56px 56px, 56px 56px, auto, auto, auto;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid rgba(221, 230, 239, 0.9);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
}

.brand img {
  width: 36px;
  height: 36px;
}

.beta-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #cfe1ff;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-nav {
  display: grid;
  gap: 8px;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.app-nav a:hover,
.app-nav a.is-active {
  background: #eef5ff;
  color: var(--blue);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f5f8fc;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid #cceee6;
  border-radius: 10px;
  background: #effaf7;
  color: #047866;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.app-main {
  padding: 34px clamp(20px, 4vw, 58px) 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(38px, 4.2vw, 66px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(26px, 2.3vw, 38px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
}

.subtext {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

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

.user-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.user-box a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 22px;
}

.metric {
  min-height: 150px;
  padding: 20px;
}

.metric span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-weight: 750;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status.approved,
.status.passed,
.status.low,
.status.complete,
.status.preparation-approved {
  background: #e8faf5;
  color: #047866;
}

.status.submitted,
.status.under-review,
.status.review-required,
.status.medium,
.status.preparation,
.status.pending {
  background: #fff7df;
  color: var(--amber);
}

.status.rejected,
.status.blocked,
.status.high {
  background: #fff1f2;
  color: var(--red);
}

.status.draft,
.status.created {
  background: #eef5ff;
  color: var(--blue);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button.blue {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

textarea {
  min-height: 132px;
  padding: 13px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.table th,
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.empty {
  padding: 28px;
  border: 1px dashed #bfd0e3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 750;
}

.auth-panel {
  max-width: 520px;
  margin: 8vh auto;
}

.command-area {
  min-height: 190px;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 800;
  line-height: 1.28;
}

.step-list {
  display: grid;
  gap: 12px;
}

.step-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.step-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef5ff;
  color: var(--blue);
  font-weight: 900;
}

.route-flow {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
  gap: 10px;
  align-items: center;
}

.route-node {
  min-height: 86px;
  display: grid;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 850;
}

.route-arrow {
  color: var(--blue);
  text-align: center;
  font-weight: 900;
}

.notice {
  padding: 16px;
  border: 1px solid #bcebdc;
  border-radius: 10px;
  background: #effaf7;
  color: #047866;
  font-weight: 760;
  line-height: 1.45;
}

.disclaimer {
  padding: 16px;
  border: 1px solid #d7e2ef;
  border-radius: 10px;
  background: #f6f9fc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.report-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.report-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

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

  .grid.cards-4,
  .grid.two,
  .grid.three,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 24px 16px 48px;
  }

  .topbar,
  .route-flow {
    grid-template-columns: 1fr;
    display: grid;
  }

  .app-nav {
    grid-template-columns: 1fr;
  }

  .route-arrow {
    display: none;
  }
}
