:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef3f4;
  --ink: #16212a;
  --muted: #65727e;
  --line: #d9e0e4;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #a16207;
  --danger: #b42318;
  --ok: #1f7a4d;
  --focus: #2563eb;
  --shadow: 0 8px 24px rgba(21, 34, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

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

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-shell,
.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 750;
}

.mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 6px;
  font-size: 0.9rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.nav a {
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.93rem;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
  background: var(--surface-muted);
}

.layout {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.narrow {
  width: min(760px, calc(100% - 2rem));
}

.page-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.12;
}

.page-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero {
  display: grid;
  align-items: center;
  min-height: 52vh;
  padding: 3rem 0 2rem;
}

.hero h1 {
  max-width: 860px;
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.hero p {
  max-width: 720px;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button:hover,
button:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.button.secondary,
button.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button.secondary:hover,
button.secondary:hover {
  background: var(--surface-muted);
}

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

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

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

.card {
  padding: 1rem;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.card h2,
.card h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-body {
  padding: 1rem;
}

.metric {
  display: grid;
  gap: 0.35rem;
}

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

.metric strong {
  font-size: 2rem;
  line-height: 1;
}

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

.form {
  display: grid;
  gap: 1rem;
}

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

label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button:focus {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
  border-color: var(--focus);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.checkbox-row input {
  width: 1.1rem;
  min-height: 1.1rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  max-width: 100%;
  padding: 0.25rem 0.45rem;
  color: var(--accent-strong);
  background: #e3f4f1;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.status.completed {
  color: var(--ok);
  background: #e8f5ee;
}

.status.warning {
  color: var(--warn);
  background: #fff4d6;
}

.empty {
  display: grid;
  gap: 0.35rem;
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--ink);
}

.notice {
  padding: 0.75rem 0.9rem;
  color: var(--accent-strong);
  background: #e3f4f1;
  border: 1px solid #b9ded8;
  border-radius: 6px;
}

.notice.error {
  color: var(--danger);
  background: #fff0ef;
  border-color: #ffd1ce;
}

.stack {
  display: grid;
  gap: 1rem;
}

.detail-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.55rem 1rem;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .layout {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
