:root {
  --paper: #f3ecdf;
  --paper-deep: #e7dcc8;
  --ink: #1c2430;
  --muted: #5d675f;
  --line: #ddcfb8;
  --card: #fffdf8;
  --seal: #0c6b52;
  --seal-dark: #084838;
  --brass: #a56a22;
  --brass-soft: #f4e2c4;
  --danger: #8d2e2e;
  --danger-soft: #f8e4e0;
  --shadow: 0 18px 50px rgba(48, 36, 18, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Segoe UI", "Nirmala UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(165, 106, 34, 0.16), transparent 60%),
    radial-gradient(800px 380px at -10% 0%, rgba(12, 107, 82, 0.12), transparent 55%),
    var(--paper);
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.seal {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--seal);
  color: #f6f1e6;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 230, 0.25);
}
.brand b { display: block; font-size: 18px; letter-spacing: -0.03em; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a, .btn {
  border: 1px solid var(--line);
  background: transparent;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
}
.btn.solid, .nav a.solid {
  background: var(--ink);
  color: #f7f2e8;
  border-color: var(--ink);
}
.btn.seal {
  width: auto;
  height: auto;
  display: inline-flex;
  background: var(--seal);
  color: white;
  border-color: var(--seal);
  box-shadow: none;
  border-radius: 999px;
  font-family: "Segoe UI", sans-serif;
  letter-spacing: 0;
}
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 28px; padding: 42px 0 20px; align-items: end; }
.kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--seal);
  font-weight: 700;
  margin: 0 0 10px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.96;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
}
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 46ch; }
.hero-card, .panel, .key-card, .login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero-card { padding: 22px; }
.hero-card ol { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.hero-card li { line-height: 1.4; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 28px; }
.panel { padding: 18px 18px 16px; }
.panel strong { display: block; font-size: 16px; margin-bottom: 6px; }
.panel p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 14px; }
.num {
  font-family: Georgia, serif;
  color: var(--brass);
  font-size: 28px;
}

.check { padding: 22px; margin-bottom: 28px; }
.check h2, .section-title {
  font-family: Georgia, serif;
  font-size: 32px;
  margin: 0 0 6px;
}
.row { display: flex; gap: 10px; margin-top: 14px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--seal); }
textarea { min-height: 74px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.field { margin-bottom: 12px; }
.result {
  margin-top: 14px;
  border-radius: 16px;
  padding: 14px 16px;
  background: #f6f1e6;
  display: none;
}
.result.show { display: block; }
.result b { font-family: Georgia, serif; font-size: 42px; line-height: 1; }
.result em { font-style: normal; color: var(--muted); }
.days-ok { color: var(--seal); }
.days-bad { color: var(--danger); }
code, .mono { font-family: Consolas, "Courier New", monospace; }

.foot {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0 28px;
}

.admin-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding-bottom: 40px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-family: Georgia, serif; font-size: 36px; margin-top: 4px; }
.work { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
}
.chip.on { background: var(--brass-soft); border-color: #e2c48a; }
.list { display: grid; gap: 12px; }
.key-card { padding: 16px 16px 14px; display: grid; grid-template-columns: 92px 1fr; gap: 14px; }
.daycount { text-align: center; padding-top: 6px; }
.daycount b { display: block; font-family: Georgia, serif; font-size: 34px; line-height: 0.9; }
.daycount span { font-size: 12px; color: var(--muted); }
.key-card h3 { margin: 0 0 4px; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #e5f4ee;
  color: var(--seal-dark);
}
.pill.used { background: var(--brass-soft); color: var(--brass); }
.pill.expired, .pill.revoked { background: var(--danger-soft); color: var(--danger); }
.banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--brass-soft);
  font-size: 14px;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 28px; }
.login-card h1 { font-size: 40px; margin-bottom: 8px; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; }

@media (max-width: 860px) {
  .hero, .grid-3, .work, .stats, .key-card { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
}
