:root {
  color-scheme: light;
  --ink: #14202b;
  --muted: #687581;
  --line: #dfe5e8;
  --paper: #f5f7f8;
  --white: #ffffff;
  --navy: #17384b;
  --navy-2: #0c2737;
  --copper: #c77a44;
  --green: #147d64;
  --red: #b34343;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: inherit; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.5rem, 2vw, 2.1rem); }
h2 { margin-bottom: 0; font-size: 1.15rem; }

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

.eyebrow {
  margin-bottom: .35rem;
  color: var(--copper);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.muted, small { color: var(--muted); }
small { display: block; margin-top: .25rem; font-size: .76rem; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 8% 10%, rgba(199, 122, 68, .2), transparent 25rem),
    linear-gradient(145deg, var(--navy-2), var(--navy));
}

.login-card {
  width: min(100%, 28rem);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

.brand-mark {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
  border-radius: .9rem;
  color: white;
  background: var(--navy);
  font-size: 1.45rem;
  font-weight: 800;
}

.stack { display: grid; gap: 1rem; }

label { display: grid; gap: .4rem; }
label > span { font-size: .82rem; font-weight: 700; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .78rem .9rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(199, 122, 68, .14);
}

textarea { resize: vertical; }

.button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: .7rem;
  padding: .65rem 1rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { color: white; background: var(--navy); }
.button.secondary { color: white; background: var(--copper); }
.button.ghost { border: 1px solid var(--line); background: var(--white); }
.button.wide { width: 100%; }

.build-meta {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.alert {
  margin-bottom: 1rem;
  border-radius: .7rem;
  padding: .8rem 1rem;
  font-size: .88rem;
}
.alert.error { color: #7f2424; background: #fceaea; }
.alert.success { color: #0e604c; background: #def5ed; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 3.5rem);
  color: white;
  background: var(--navy-2);
}

.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.version-pill { color: #bdcad1; font-size: .75rem; }

.admin-shell, .form-shell {
  width: min(100% - 2rem, 90rem);
  margin: 1.5rem auto 4rem;
}
.form-shell { width: min(100% - 2rem, 58rem); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric, .panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(20, 32, 43, .04);
}

.metric { padding: 1.15rem; }
.metric span { color: var(--muted); font-size: .78rem; }
.metric strong { display: block; margin-top: .3rem; font-size: 1.65rem; }
.metric .status-ok { color: var(--green); font-size: 1rem; }

.panel { margin-bottom: 1rem; padding: 1.25rem; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 46rem; }
th, td { padding: .8rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .86rem; }
td strong { display: block; }
.empty { padding: 2rem; color: var(--muted); text-align: center; }

.status {
  display: inline-block;
  border-radius: 2rem;
  padding: .25rem .55rem;
  font-size: .7rem;
  font-weight: 800;
}
.status-published { color: #0d624e; background: #dcf5ed; }
.status-draft { color: #78521c; background: #fff0d6; }
.status-archived { color: #59626a; background: #e9edf0; }
.text-link { color: var(--copper); font-weight: 750; text-decoration: none; }

.two-column {
  display: grid;
  grid-template-columns: minmax(20rem, .8fr) minmax(30rem, 1.2fr);
  gap: 1rem;
}

.category-list { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.category-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
}

.compact-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.compact-form .button { align-self: end; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }

.check-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  align-self: end;
  min-height: 2.75rem;
}
.check-label input { width: auto; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .5rem;
}

.legal-shell {
  width: min(100% - 2rem, 48rem);
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  line-height: 1.75;
}
.legal-shell h2 { margin-top: 2rem; }

@media (max-width: 800px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .field-grid, .field-grid.three, .compact-form { grid-template-columns: 1fr; }
  .version-pill { display: none; }
  .topbar { align-items: flex-start; }
}
