:root {
  --bg: #f3efe5;
  --panel: #fffdf8;
  --panel-2: #f8f3ea;
  --ink: #1f2522;
  --muted: #5e655f;
  --line: #d7cfbf;
  --accent: #2f6c5a;
  --accent-strong: #20483d;
  --danger: #8b3a2b;
  --ok: #365f2b;
  --shadow: 0 18px 40px rgba(39, 45, 40, 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 left, rgba(47, 108, 90, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8f4eb 0%, var(--bg) 100%);
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
dt {
  font-family: "IBM Plex Serif", Georgia, serif;
}

h1,
h2,
h3,
p,
ul,
dl {
  margin-top: 0;
}

.shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 1.5rem;
  border-right: 1px solid rgba(215, 207, 191, 0.75);
  background: rgba(255, 252, 245, 0.82);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.brand-mark {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-title {
  font-weight: 700;
}

.brand-subtitle,
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav {
  display: grid;
  gap: 0.4rem;
}

.nav a {
  padding: 0.8rem 0.95rem;
  border-radius: 0.8rem;
  color: var(--ink);
}

.nav a.active,
.nav a:hover {
  background: rgba(47, 108, 90, 0.12);
  text-decoration: none;
}

.content {
  padding: 2rem;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header p {
  max-width: 48rem;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(215, 207, 191, 0.7);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.inset-panel {
  background: var(--panel-2);
  box-shadow: none;
}

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

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

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

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

.meta-grid dt {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.meta-grid dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.92rem;
  color: var(--muted);
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: rgba(47, 108, 90, 0.12);
  color: var(--accent-strong);
  font-size: 0.86rem;
  white-space: nowrap;
}

.badge-mode {
  background: rgba(32, 72, 61, 0.12);
}

.badge-ok {
  background: rgba(54, 95, 43, 0.14);
  color: var(--ok);
}

.badge-muted {
  background: rgba(94, 101, 95, 0.12);
  color: var(--muted);
}

.flash {
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.flash-success {
  background: rgba(54, 95, 43, 0.14);
  color: var(--ok);
}

.flash-error {
  background: rgba(139, 58, 43, 0.14);
  color: var(--danger);
}

.inline-form,
.stack-form,
.compact-form,
.action-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.stack-form {
  align-items: stretch;
  flex-direction: column;
}

.compact-form input,
.compact-form select,
.inline-form input,
.inline-form select,
.stack-form input,
.stack-form select {
  min-height: 2.5rem;
}

input,
select,
button {
  border-radius: 0.72rem;
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

button {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
  cursor: pointer;
}

button:hover {
  opacity: 0.94;
}

.button-danger {
  background: var(--danger);
  border-color: var(--danger);
}

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

.compact-stack {
  gap: 0.7rem;
}

.event-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.72);
}

.event-head {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0;
  list-style: none;
}

.empty-state {
  color: var(--muted);
  padding: 0.6rem 0;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(215, 207, 191, 0.75);
  }

  .two-up,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 1rem;
  }
}
