:root {
  --ink: #18201c;
  --muted: #6e766f;
  --line: #d7ded5;
  --paper: #f7f8f3;
  --panel: #ffffff;
  --accent: #246b55;
  --accent-2: #b84d36;
  --soft: #e9efe7;
  --shadow: 0 16px 40px rgba(24, 32, 28, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  letter-spacing: 0;
}
a { color: var(--accent); text-decoration: none; }
button, .button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
}
button.secondary, .button.secondary { background: var(--soft); color: var(--ink); }
button.ghost { width: 100%; background: transparent; color: var(--muted); border: 1px solid var(--line); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: auto; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 18px;
  background: #10231d;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d9c88f;
  color: #10231d;
  font-weight: 900;
  font-family: Georgia, serif;
}
.brand small { display: block; color: #b8c6bf; margin-top: 2px; }
nav { display: grid; gap: 4px; }
nav a {
  color: #dce7e2;
  padding: 10px;
  border-radius: 6px;
  font-weight: 700;
}
nav a.active, nav a:hover { background: rgba(255,255,255,.12); color: white; }
.content { margin-left: 250px; padding: 30px; }
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
h1 { margin: 0; font-family: Georgia, serif; font-size: 34px; }
h2 { margin: 0 0 14px; font-size: 18px; }
p { margin: 6px 0 0; color: var(--muted); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.metric span, .profile-grid span, .muted { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 6px; font-size: 30px; font-family: Georgia, serif; }
.two-cols, .profile-grid, .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--soft); font-size: 12px; text-transform: uppercase; color: #4e5a52; }
tr:last-child td { border-bottom: 0; }
td input { min-width: 120px; }
.search { display: flex; gap: 8px; width: min(520px, 100%); }
.inline-form { display: grid; grid-template-columns: 1.1fr .6fr .6fr 1.4fr 1fr .5fr .7fr auto; gap: 10px; align-items: center; }
.stack { display: grid; gap: 14px; }
.pill { background: var(--soft); color: var(--accent); padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.row-credit-form {
  display: grid;
  grid-template-columns: 72px 34px;
  gap: 6px;
  align-items: center;
  width: 112px;
}
.row-credit-form input[type="number"] {
  min-width: 0;
  height: 34px;
  padding: 7px 8px;
}
.row-credit-form button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}
.row-credit-form--subtract button { background: var(--accent-2); }
.content-editor { display: grid; gap: 16px; padding-bottom: 78px; }
.content-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.content-card__media {
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto auto;
  gap: 10px;
}
.content-card__media img,
.media-empty {
  width: 100%;
  min-height: 150px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #edf2ed;
}
.media-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.media-empty span {
  display: block;
  font-family: Georgia, serif;
  font-size: 34px;
  color: #9aa79e;
}
.media-empty small { display: block; margin-top: 4px; }
.file-pick {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcf8;
}
.file-pick span { color: var(--accent); }
.file-pick input { margin-top: 8px; padding: 0; border: 0; background: transparent; }
.media-remove { font-size: 12px; color: var(--accent-2); }
.content-card__text textarea { min-height: 170px; }
.sticky-actions {
  position: fixed;
  right: 30px;
  bottom: 20px;
  left: 280px;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: rgba(247, 248, 243, .88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.credit-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.credit-card { border-top: 4px solid var(--accent); }
.credit-card--subtract { border-top-color: var(--accent-2); }
.credit-card--subtract button { background: var(--accent-2); }
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
  font-weight: 800;
}
.notice.success { color: var(--accent); background: #f1f8f2; border-color: #c9dccd; }
.key-editor { display: grid; gap: 14px; padding-bottom: 78px; }
.key-card { display: grid; gap: 12px; }
.key-card__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.key-card h2 { margin: 0 0 5px; }
.key-card code {
  display: inline-block;
  color: var(--muted);
  background: var(--soft);
  padding: 4px 6px;
  border-radius: 5px;
}
.key-card small { color: var(--muted); line-height: 1.45; }
.muted-pill { color: var(--muted); }
.login-page { display: grid; place-items: center; padding: 20px; }
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 10px; }
.error { color: var(--accent-2); font-weight: 800; }

@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .content { margin-left: 0; padding: 18px; }
  .metric-grid, .two-cols, .profile-grid, .form-grid, .compact { grid-template-columns: 1fr; }
  .content-card, .credit-actions { grid-template-columns: 1fr; }
  .key-card__head { display: grid; }
  .sticky-actions { left: 18px; right: 18px; bottom: 12px; }
  .page-head { display: grid; align-items: start; }
  .inline-form { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
