:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --text: #17211d;
  --muted: #69736f;
  --line: #dce3dd;
  --accent: #157f65;
  --accent-dark: #0d5e4a;
  --warn: #9a5a00;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(24, 38, 32, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1.05rem;
}

.brand p {
  color: var(--muted);
  font-size: .88rem;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}

.nav {
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 12px;
}

.nav button,
.ghost,
.secondary {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
}

.nav button {
  justify-content: flex-start;
}

.nav button.active,
.secondary {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(22, 33, 29, .04);
}

.ghost:hover,
.nav button:hover,
.secondary:hover {
  border-color: #c8d4cc;
}

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

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

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  color: var(--muted);
  font-size: .86rem;
  margin: 0 0 6px;
}

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

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

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

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.tile strong {
  display: block;
  font-size: 1.45rem;
}

.tile span {
  color: var(--muted);
  font-size: .9rem;
}

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

.primary,
.danger,
.warning {
  min-height: 58px;
  border-radius: 8px;
  padding: 0 18px;
  color: white;
  font-weight: 750;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.primary {
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

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

.warning {
  background: var(--warn);
}

.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: .88rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .88rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

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

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

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

th {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
}

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.copy-field {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
  color: var(--accent-dark);
}

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

.login-card {
  width: min(440px, 100%);
}

.login-actions {
  display: grid;
  gap: 10px;
}

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-soft);
  padding: 5px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.segment button {
  min-height: 40px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.segment button.active {
  color: var(--text);
  background: white;
  box-shadow: 0 5px 15px rgba(24, 38, 32, .08);
}

.timeline {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.hidden-action {
  margin-top: 12px;
  opacity: .54;
  text-align: right;
}

.hidden-action button {
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  min-height: 38px;
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #fff7e8;
  color: #6c4300;
  border: 1px solid #f1d3a1;
}

@media (max-width: 860px) {
  .shell {
    padding: 12px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

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

  .nav button {
    justify-content: center;
    padding: 0 8px;
  }

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

  .hero-panel,
  .form-grid,
  .work-action {
    grid-template-columns: 1fr;
  }
}

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

  .brand p {
    display: none;
  }

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

  .panel,
  .tile {
    padding: 14px;
  }

  .link-box {
    grid-template-columns: 1fr;
  }

  .primary,
  .danger,
  .warning {
    width: 100%;
  }
}
