:root {
  --bg: #eef2e6;
  --panel: #fbfcf7;
  --panel-strong: #ffffff;
  --ink: #1f2a1d;
  --muted: #687363;
  --line: #d6ddcd;
  --accent: #20543d;
  --accent-soft: #dff1e7;
  --danger: #a43629;
  --warning: #8f5b14;
  --shadow: 0 20px 45px rgba(32, 54, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(160deg, #eef2e6 0%, #f7f8f2 45%, #ebf4f0 100%);
  color: var(--ink);
}

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

a:hover {
  text-decoration: underline;
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.site-header,
.content-shell {
  display: grid;
  gap: 18px;
}

.site-header {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 20px;
}

.brand {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

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

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.content-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar,
.main-panel,
.card,
.notice,
.stat {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(214, 221, 205, 0.9);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: fit-content;
}

.sidebar a {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.sidebar a.is-active,
.sidebar a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.main-panel {
  border-radius: 26px;
  padding: 22px;
}

.notice {
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #f3fbf6;
}

.stack {
  display: grid;
  gap: 18px;
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  border-radius: 22px;
  padding: 18px;
}

.card h2,
.card h3,
.section-title {
  margin-top: 0;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
  border-radius: 18px;
  padding: 16px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-strong);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #edf5ef;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

form {
  margin: 0;
}

.inline-form {
  display: inline;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

button.secondary,
.button-link.secondary {
  background: #dde9e2;
  color: var(--ink);
}

button.warning,
.button-link.warning {
  background: #f3e5c8;
  color: #5f4305;
}

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

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ecf2ea;
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.success {
  background: #dff1e7;
  color: #1d6a47;
}

.pill.warning {
  background: #f8e8c7;
  color: var(--warning);
}

.pill.danger {
  background: #f6d8d3;
  color: var(--danger);
}

.user-pill {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 600;
}

.login-shell {
  max-width: 520px;
  margin: 60px auto;
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

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

  .sidebar {
    flex-direction: row;
    overflow: auto;
  }
}
