:root {
  color-scheme: light;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  --bg: #f4f6f2;
  --ink: #17201b;
  --muted: #68736d;
  --line: #d8ded7;
  --panel: #ffffff;
  --green: #176b4d;
  --green-2: #e4f3ec;
  --amber: #9a6500;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

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

.sidebar {
  background: #17201b;
  color: #fff;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

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

.sidebar .eyebrow {
  color: #aeb9b2;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 18px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  color: #dce5df;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #26352e;
  color: #fff;
}

.content {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 24px;
}

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

.primary {
  border: 0;
  background: var(--green);
  color: white;
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary:hover {
  background: #11543b;
}

.view {
  display: none;
}

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

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

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

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

.metric strong {
  font-size: 24px;
}

.message-preview {
  background: var(--green-2);
  border-left: 4px solid var(--green);
  padding: 14px;
  border-radius: 8px;
  line-height: 1.5;
}

.assignment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.assignment-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.assignment-pill strong {
  display: block;
}

.assignment-pill span {
  color: var(--muted);
  font-size: 13px;
}

.qr-panel {
  max-width: 360px;
}

.qr-panel img {
  display: block;
  width: 280px;
  max-width: 100%;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.9fr 0.9fr auto;
  gap: 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

td input {
  padding: 8px 9px;
}

.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.danger {
  color: var(--red);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

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

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px;
}

.history-item.error {
  border-left-color: var(--red);
}

.history-item time {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  background: #17201b;
  color: white;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

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

  .sidebar {
    padding: 18px;
    gap: 18px;
  }

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

  .nav-item {
    text-align: center;
    padding: 10px 8px;
  }

  .content {
    padding: 18px;
  }

  .topbar,
  .form-row,
  .settings-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}
