:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #162033;
  --muted: #64748b;
  --line: #dbe3ef;
  --line-strong: #c7d2e3;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --good: #0f766e;
  --warning: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(31, 41, 55, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(225, 233, 246, .72), rgba(245, 247, 251, 0) 300px),
    var(--bg);
  font-family: Inter, "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 760;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.admin-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-head a,
.locked-actions a,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

.admin-head a:hover,
.locked-actions a:hover,
button:hover {
  border-color: #9fb2cc;
  box-shadow: 0 8px 22px rgba(31, 41, 55, .08);
}

button#save,
.locked-actions .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 760;
}

button#add {
  border-color: #b7c7dd;
  background: #eef5ff;
  color: #1d4ed8;
  font-weight: 720;
}

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

.site-panel {
  padding: 18px;
}

.panel-head,
.toolbar,
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head p,
.toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

#status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 260px;
  border: 1px solid #b9e3dc;
  border-radius: 999px;
  background: #eefcf9;
  color: var(--good);
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dirty #status {
  border-color: #f5d29b;
  background: #fff8eb;
  color: var(--warning);
}

.site-form {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

textarea {
  resize: vertical;
}

.toolbar {
  margin: 22px 0 12px;
}

.project-editor {
  display: grid;
  gap: 12px;
}

.project-row {
  padding: 14px;
}

.row-head {
  margin-bottom: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--good);
  font-size: 13px;
  font-weight: 760;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--good);
}

.delete.danger {
  border-color: #fecaca;
  background: #fff7f7;
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: minmax(130px, .9fr) 90px minmax(160px, 1.1fr) 116px minmax(170px, 1.2fr) minmax(190px, 1.35fr);
  gap: 12px;
}

.wide {
  grid-column: span 2;
}

.locked-panel {
  width: min(560px, 100%);
  margin-top: 36px;
  padding: 24px;
}

.locked-panel h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.locked-panel p:not(.eyebrow) {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.locked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 980px) {
  .admin-shell {
    width: min(100% - 28px, 760px);
  }

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

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

  .wide {
    grid-column: auto;
  }

  #status {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .admin-head,
  .site-panel,
  .project-row,
  .locked-panel {
    padding: 12px;
  }

  .admin-head nav,
  .locked-actions,
  .row-head {
    width: 100%;
  }

  .admin-head a,
  .locked-actions a,
  button {
    width: 100%;
  }
}
