:root {
  --bg: #0f1412;
  --bg-elev: #171e1b;
  --bg-soft: #1e2823;
  --line: #2c3a33;
  --text: #e8efe9;
  --muted: #9aaca1;
  --accent: #3d9b6e;
  --accent-2: #c4a35a;
  --danger: #d1645c;
  --ok: #3d9b6e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 155, 110, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(196, 163, 90, 0.12), transparent 50%),
    var(--bg);
  line-height: 1.45;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, time {
  font-family: var(--mono);
  font-size: 0.86rem;
}
code.break { word-break: break-all; }

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.4rem 1rem;
  border-right: 1px solid var(--line);
  background: rgba(15, 20, 18, 0.85);
  backdrop-filter: blur(8px);
}

.brand { display: flex; gap: 0.75rem; align-items: center; padding: 0.35rem 0.5rem; }
.brand strong { display: block; font-size: 0.98rem; }
.brand span { color: var(--muted); font-size: 0.78rem; }
.brand-mark {
  width: 12px; height: 28px; border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(61, 155, 110, 0.12);
}
.brand-mark.lg { width: 14px; height: 36px; }

.rail nav { display: flex; flex-direction: column; gap: 0.25rem; }
.rail nav a {
  color: var(--text);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  text-decoration: none;
}
.rail nav a:hover { background: var(--bg-soft); }

.rail-foot {
  margin-top: auto;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.who { color: var(--muted); font-size: 0.85rem; }
.linkish {
  background: none; border: 0; color: var(--accent-2);
  font: inherit; cursor: pointer; padding: 0;
}
.linkish:hover { text-decoration: underline; }

.main { padding: 1.5rem 1.75rem 2.5rem; }
.page-head h1 { margin: 0 0 1.25rem; font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat strong { display: block; margin-top: 0.35rem; font-size: 1.7rem; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.85rem;
}
.panel-head h2 { margin: 0; font-size: 1.05rem; }

.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.person strong { display: block; }
.person span { color: var(--muted); font-size: 0.82rem; }
.clip {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.actions { white-space: nowrap; }
.inline { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.primary {
  background: linear-gradient(180deg, #49b07d, #2f7d56);
  border-color: transparent;
  color: #04140c;
  font-weight: 600;
}
.btn.ok { border-color: rgba(61,155,110,.45); color: #9ee0bc; }
.btn.danger { border-color: rgba(209,100,92,.45); color: #f0b0ab; }
.btn.ghost { background: transparent; }

.tabs {
  display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.tabs a em {
  font-style: normal;
  margin-left: 0.35rem;
  color: var(--text);
}
.tabs a.active {
  color: var(--text);
  background: var(--bg-elev);
  border-color: var(--line);
}

.stack { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.35rem; }
label span { color: var(--muted); font-size: 0.86rem; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
}
input:focus {
  outline: 2px solid rgba(61, 155, 110, 0.45);
  outline-offset: 1px;
}

.alert {
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.alert.error { background: rgba(209, 100, 92, 0.12); border-color: rgba(209, 100, 92, 0.35); }
.alert.ok { background: rgba(61, 155, 110, 0.12); border-color: rgba(61, 155, 110, 0.35); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.meta { display: grid; grid-template-columns: 140px 1fr; gap: 0.55rem 0.75rem; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.bullets { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.bullets li { margin: 0.4rem 0; }

.guest {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.guest-wrap { width: min(420px, 100%); }
.login-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 1.2rem; }
.login-brand h1 { margin: 0.7rem 0 0.35rem; font-size: 1.45rem; }
.login-brand p { margin: 0; color: var(--muted); font-size: 0.92rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .stats, .grid-2 { grid-template-columns: 1fr; }
  .clip { max-width: 160px; }
}
