:root {
  --bg: #f4f1ea;
  --panel: #fffdf9;
  --ink: #1f2427;
  --muted: #6b7377;
  --line: #d9d2c4;
  --accent: #0c5c56;
  --accent-2: #af5b2d;
  --danger: #8a2f2a;
  --warn: #8d6700;
  --shadow: 0 20px 40px rgba(31, 36, 39, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(175, 91, 45, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(12, 92, 86, 0.14), transparent 26%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  padding: 2rem 3rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.topbar h1, .auth-card h1 { margin: 0.1rem 0 0; font-family: "IBM Plex Serif", Georgia, serif; }

.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.layout {
  padding: 0 3rem 3rem;
  display: grid;
  gap: 1.2rem;
}

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

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

.stack.dense { gap: 0.65rem; }

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.muted {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.metric-grid .label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

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

input, textarea, select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

button {
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #0a403c);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.button-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 0;
}

.alert.success { background: rgba(12, 92, 86, 0.08); border-color: rgba(12, 92, 86, 0.25); }
.alert.warning { background: rgba(141, 103, 0, 0.08); border-color: rgba(141, 103, 0, 0.24); }
.alert.error { background: rgba(138, 47, 42, 0.08); border-color: rgba(138, 47, 42, 0.24); }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid rgba(217, 210, 196, 0.7);
  font-size: 0.94rem;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(100%, 960px);
  padding: 2rem;
}

.auth-card {
  max-width: 440px;
  margin: 0 auto;
}

.auth-card.wide {
  max-width: 880px;
}

.mfa-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: center;
}

.qr {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.toggle input {
  width: auto;
}

@media (max-width: 900px) {
  .topbar, .layout { padding-left: 1rem; padding-right: 1rem; }
  .grid.two, .mfa-grid, .metric-grid { grid-template-columns: 1fr; }
  .topbar { align-items: start; flex-direction: column; gap: 1rem; }
}
