:root {
  --ink: #171310;
  --muted: #6c6259;
  --paper: #fff8ea;
  --panel: #fffaf0;
  --line: #dfceb4;
  --amber: #f4b74a;
  --amber-dark: #9d5d0c;
  --green: #20785c;
  --blue: #284f88;
  --shadow: 0 26px 76px rgba(45, 31, 16, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 206, 180, .86);
  background: rgba(255, 248, 234, .9);
  backdrop-filter: blur(18px);
}
.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--amber);
  background: var(--ink);
}
.mark svg { width: 21px; height: 21px; }
.nav-links { display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: 14px; font-weight: 650; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 5px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff8ea;
  font-weight: 760;
  cursor: pointer;
}
.btn:hover { box-shadow: 0 12px 24px rgba(23, 19, 16, .18); transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.secondary:hover { border-color: var(--ink); }
.eyebrow {
  margin: 0 0 18px;
  color: var(--amber-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { max-width: 820px; font-size: clamp(54px, 8vw, 92px); }
h2 { font-size: clamp(40px, 5.5vw, 66px); }
.lead { max-width: 690px; margin: 24px 0 0; color: var(--muted); font-size: 19px; }
.hero { padding: 78px 0 62px; border-bottom: 1px solid var(--line); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); }
.card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .32);
  padding: 30px;
}
.grid-3 .card { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid-3 .card:nth-child(3n) { border-right: 0; }
.grid-3 .card:nth-last-child(-n+3) { border-bottom: 0; }
.card h3 { font-size: 20px; font-weight: 800; }
.card p { color: var(--muted); margin: 12px 0 0; }
.section { padding: 78px 0; border-bottom: 1px solid var(--line); }
.split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 42px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 30px;
}
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 760; }
.input, .form input, .form textarea, .form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.form input:focus, .form textarea:focus, .form select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(244, 183, 74, .22);
}
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; }
.auth-shell {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 52px;
  align-items: center;
  padding: 64px 0;
}
.auth-card { border: 1px solid var(--line); background: #fffaf0; box-shadow: var(--shadow); padding: 32px; }
.auth-card h1 { font-size: 48px; }
.sso { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f7eddb;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #fff8ea;
  padding: 24px;
}
.side-nav { display: grid; gap: 8px; margin-top: 28px; }
.side-nav a, .side-nav button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 12px;
  cursor: pointer;
}
.side-nav a.active, .side-nav a:hover, .side-nav button:hover { background: #f0dfc6; color: var(--ink); }
.main { padding: 30px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.dash-head h1 { font-size: 48px; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { border: 1px solid var(--line); background: #fffaf0; padding: 18px; }
.metric strong { display: block; font-size: 28px; line-height: 1; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-top: 8px; }
.app-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 14px 10px; text-align: left; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted); font-size: 12px; }
.chain-list { display: grid; gap: 10px; margin-top: 16px; }
.chain-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: #fff; padding: 12px; }
.dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff8ea; font-weight: 800; }
footer { padding: 34px 0; background: var(--ink); color: rgba(255, 248, 234, .72); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 14px; }

@media (max-width: 920px) {
  .nav-links { display: none; }
  .grid-2, .split, .auth-shell, .app-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 .card:nth-child(3n) { border-right: 1px solid var(--line); }
  .grid-3 .card:nth-child(2n) { border-right: 0; }
  .grid-3 .card:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .grid-3 .card:nth-last-child(-n+2) { border-bottom: 0; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 28px, 1120px); }
  .nav-actions .secondary { display: none; }
  h1 { font-size: 46px; }
  .lead { font-size: 17px; }
  .grid-3, .metric-row, .sso { grid-template-columns: 1fr; }
  .grid-3 .card, .grid-3 .card:nth-child(2n), .grid-3 .card:nth-child(3n), .grid-3 .card:nth-last-child(-n+2), .grid-3 .card:nth-last-child(-n+3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .grid-3 .card:last-child { border-bottom: 0; }
  .hero, .section { padding: 56px 0; }
  .auth-card, .panel, .card { padding: 24px; }
  .main { padding: 18px; }
}
