:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #64727d;
  --line: #dce3e8;
  --paper: #ffffff;
  --soft: #f4f7f8;
  --accent: #1f7a6b;
  --accent-strong: #145c51;
  --warn: #a35316;
  --danger: #b42318;
  --nav: #24323d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--soft);
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #e7eef0;
  color: var(--ink);
}

button.secondary:hover {
  background: #d8e3e6;
}

button.ghost {
  background: transparent;
  color: var(--accent-strong);
  padding: 0 8px;
}

button.danger {
  background: var(--danger);
}

button.danger-text {
  color: var(--danger);
}

.row input {
  flex: 1 1 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 10px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: var(--nav);
  color: white;
  padding: 28px 18px;
}

.brand {
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 28px;
}

.navbutton {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  background: transparent;
  color: #dbe6e9;
  justify-content: flex-start;
}

.navbutton.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.workspace {
  padding: 28px;
  overflow: auto;
}

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

.topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p,
.muted {
  color: var(--muted);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

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

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

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

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #33434d;
}

.form-section {
  margin: 18px 0 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.metric {
  min-height: 112px;
}

.metric b {
  display: block;
  font-size: 30px;
  margin-top: 12px;
}

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  font-size: 12px;
  color: #4a5963;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e7eef0;
  color: #2d414c;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: #dff4eb;
  color: #17664f;
}

.pill.warn {
  background: #fff1db;
  color: var(--warn);
}

.checkitem {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.checkitem input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

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

.login .panel {
  width: min(460px, 100%);
}

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.doclist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.doclist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: white;
}

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

.detail-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: white;
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-item b {
  overflow-wrap: anywhere;
}

.notice {
  border-left: 4px solid var(--accent);
  background: #eef8f5;
  padding: 12px;
  color: #24463f;
}

.template-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.template-links a {
  color: var(--accent-strong);
  font-weight: 800;
}

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

  .sidebar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px;
    align-items: center;
  }

  .brand {
    margin: 0 10px 0 0;
    white-space: nowrap;
  }

  .navbutton {
    width: auto;
    white-space: nowrap;
    margin: 0;
  }

  .workspace {
    padding: 18px;
  }

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