:root {
  --green: #005c3d;
  --green-dark: #003f2b;
  --green-soft: #e8f3ee;
  --silver: #adb0b3;
  --ink: #17201d;
  --muted: #65716d;
  --line: #dce3e0;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --danger: #9b2c2c;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
header {
  min-height: 68px; display: flex; align-items: center; gap: 28px;
  padding: 0 34px; background: var(--green-dark); color: white;
}
.brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 750; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  color: var(--green-dark); background: white; font-size: 12px; letter-spacing: .03em;
}
nav { display: flex; align-items: center; gap: 8px; flex: 1; }
nav a { color: #e6f4ee; text-decoration: none; padding: 9px 10px; border-radius: 8px; }
nav a:hover { background: rgba(255,255,255,.1); }
.nav-spacer { flex: 1; }
.nav-user { color: #bcd8cc; font-size: 13px; }
main { max-width: 1240px; margin: 0 auto; padding: 36px 28px 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin-bottom: 4px; }
.page-heading p:last-child { margin-bottom: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); margin: 5px 0 10px; letter-spacing: -.025em; }
h2 { margin-top: 0; font-size: 20px; }
p { line-height: 1.55; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 800; color: var(--green); }
.muted { color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.toolbar .spacer { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 8px 28px rgba(25,55,43,.05); }
.card.narrow { max-width: 620px; margin: 40px auto; }
.metric-card { display: grid; gap: 4px; }
.metrics { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 22px; }
.table-card { padding: 0; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.metric { font-size: 38px; font-weight: 780; color: var(--green-dark); }
.button, button {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 9px 15px; border: 0; border-radius: 10px;
  background: var(--green); color: white; text-decoration: none; font-weight: 700; cursor: pointer;
}
.button.secondary { background: var(--green-soft); color: var(--green-dark); }
.button.wide { width: 100%; }
.button.danger, button.danger { background: #f7eaea; color: var(--danger); }
button.secondary { background: var(--green-soft); color: var(--green-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.table-wrap { width: 100%; overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9f8; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.inline-form { display: grid; grid-template-columns: minmax(250px,1fr) auto; align-items: end; gap: 16px; margin-bottom: 22px; }
form.stack { display: grid; gap: 18px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
.field { display: grid; gap: 7px; }
.field-label { font-weight: 700; font-size: 14px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid #bdc8c3; border-radius: 10px;
  background: white; color: var(--ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.optional { color: var(--muted); font-weight: 500; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-card { max-width: 900px; }
.form-actions { display: flex; gap: 10px; }
.assignment-builder { border: 1px solid var(--line); border-radius: 14px; background: #f7f9f8; }
.assignment-heading { padding: 18px; margin: 0; align-items: center; }
.assignment-heading h2 { margin: 0 0 4px; }
.assignment-heading p { margin: 0; }
.assignment-rows { display: grid; gap: 10px; padding: 0 18px 18px; }
.assignment-row {
  display: grid; grid-template-columns: minmax(180px,.8fr) minmax(240px,1.4fr) auto;
  align-items: end; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: white;
}
.assignment-row .remove-assignment { min-height: 43px; }
.assignment-type-shell { display: block; position: relative; }
.assignment-type {
  appearance: none; min-height: 43px; padding: 11px 38px 11px 12px;
  border: 1px solid #bdc8c3; border-radius: 10px; background: white;
  color: var(--ink); font-weight: 500; cursor: pointer;
}
.assignment-type-shell::after {
  content: "⌄"; position: absolute; pointer-events: none;
  right: 13px; top: 8px; color: var(--muted); font-size: 18px; font-weight: 500;
}
.assignment-type:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(0,92,61,.12);
}
.assignment-type option:disabled { color: var(--muted); }
.assignment-target-host { display: block; position: relative; }
.target-picker { position: relative; font-weight: 500; }
.target-picker summary {
  list-style: none; min-height: 43px; padding: 11px 38px 11px 12px; border: 1px solid #bdc8c3;
  border-radius: 10px; background: white; cursor: pointer; position: relative;
}
.target-picker summary::-webkit-details-marker { display: none; }
.target-picker summary::after {
  content: "⌄"; position: absolute; right: 13px; top: 8px; color: var(--muted); font-size: 18px;
}
.target-picker[open] summary { border-color: var(--green); box-shadow: 0 0 0 2px rgba(0,92,61,.12); }
.target-options {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 260px; overflow-y: auto; padding: 7px; border: 1px solid #bdc8c3;
  border-radius: 10px; background: white; box-shadow: 0 12px 30px rgba(23,32,29,.16);
}
.target-search { position: sticky; top: 0; z-index: 1; margin-bottom: 6px; background: white; }
.target-option {
  display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 8px;
  font-weight: 500; cursor: pointer;
}
.target-option:hover { background: var(--green-soft); }
.target-option[hidden] { display: none; }
.target-option input { width: auto; margin: 0; }
.assignment-everyone .target-option { color: var(--muted); cursor: default; }
.filter-card {
  display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 10px;
  padding: 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: white;
}
.search input { min-width: min(480px, 80vw); }
.code-sample { padding: 14px; border-radius: 10px; background: #f5f7f6; border: 1px solid var(--line); }
.flash { padding: 14px 17px; margin-bottom: 20px; border-radius: 11px; background: var(--green-soft); color: var(--green-dark); font-weight: 650; }
.pill { display: inline-block; padding: 4px 8px; margin: 2px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; }
.blocked { color: var(--danger); font-weight: 750; }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #edf0ef; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.status.good { color: var(--green-dark); background: var(--green-soft); }
.status.bad { color: var(--danger); background: #f7eaea; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.subtle-link { color: var(--muted); font-size: 12px; }
.full-url { display: block; margin: 8px 0; max-width: 620px; white-space: normal; }
.login-shell { min-height: calc(100vh - 140px); display: grid; grid-template-columns: 1fr minmax(360px, 520px); align-items: center; gap: 48px; }
.login-art { min-height: 460px; display: grid; place-items: center; align-content: center; border-radius: 30px; color: white; background: radial-gradient(circle at 75% 20%, #18845e, var(--green-dark) 64%); }
.login-art .cross { font-size: 120px; line-height: 1; }
.login-art p { font-size: 20px; }
.login-card { padding: 38px; }
.pagination { display: flex; gap: 8px; margin-top: 18px; }
.legal { max-width: 820px; margin: 18px auto; }
.legal h2 { margin-top: 30px; }
.legal li { margin: 10px 0; line-height: 1.5; }
code { word-break: break-all; }
@media (max-width: 860px) {
  header { align-items: flex-start; padding: 16px 20px; flex-direction: column; gap: 12px; }
  nav { width: 100%; flex-wrap: wrap; }
  .nav-spacer, .nav-user { display: none; }
  main { padding: 26px 16px 60px; }
  .form-grid, .filter-card, .metrics, .login-shell, .assignment-row { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
