:root {
  --bg: #f6f7f2;
  --panel: #ffffff;
  --line: #d7ddd2;
  --text: #20251d;
  --muted: #5d6758;
  --green: #256f52;
  --green-dark: #174c39;
  --gold: #b27a25;
  --red: #a63b34;
  --blue: #2b5f8f;
  --shadow: 0 10px 30px rgba(35, 42, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

a.secondary,
a.primary {
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.public-form-shell {
  min-height: 100vh;
  padding: 32px;
}

.public-form-intro {
  max-width: 980px;
  margin: 0 auto 18px;
}

.public-form-intro h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 4vw, 48px);
}

.public-form-intro p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-weight: 800;
  font-size: 20px;
}

.form-star {
  font-weight: 800;
  color: var(--gold);
}

.notice {
  padding: 12px;
  border: 1px solid #e4c58d;
  border-radius: 8px;
  background: #fff8e9;
}

.public-form-card {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
}

.public-form-card h2 {
  margin: 18px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--green-dark);
}

.public-form-card h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.declaration {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf5;
  color: var(--muted);
  line-height: 1.5;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  color: var(--text);
}

.check-row input {
  min-height: auto;
  width: auto;
  margin-top: 3px;
}

.login-visual {
  padding: 56px;
  background:
    linear-gradient(rgba(20, 61, 45, 0.82), rgba(20, 61, 45, 0.78)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-visual h1 {
  max-width: 780px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.02;
  margin: 0;
}

.login-visual p {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 42px;
}

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  padding: 30px;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
}

.login-card h2,
.section h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

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

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

label span {
  font-weight: 500;
  color: #7a8375;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  min-height: 42px;
}

textarea {
  resize: vertical;
}

.primary,
.secondary,
.danger,
.icon-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary:hover {
  background: var(--green-dark);
}

.secondary {
  background: #eef2ea;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.danger {
  background: #f7e8e5;
  color: var(--red);
}

.icon-btn {
  width: 38px;
  padding: 0;
  background: #eef2ea;
  color: var(--green-dark);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #263126;
  color: #f6f8f2;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.user-pill {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  padding: 11px 12px;
  text-align: left;
  font-weight: 700;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 17px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.section {
  padding: 18px;
  margin-bottom: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 190px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 980px;
}

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

td select {
  min-width: 170px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2ea;
  color: #334030;
}

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

.actions {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.message {
  min-height: 22px;
  color: var(--red);
  font-weight: 650;
}

.success {
  color: var(--green);
}

.list {
  display: grid;
  gap: 8px;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.compact-bars {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr minmax(36px, auto);
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.bar-label {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e6ece1;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.badge {
  border-radius: 999px;
  padding: 3px 9px;
  background: #e9eee5;
  color: #334030;
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 15, 0.45);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(820px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 20px;
}

.modal-head,
.modal-actions,
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .login-shell,
  .app-shell,
  .split,
  .chart-grid,
  .stats,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 32px;
  }

  .public-form-shell {
    padding: 16px;
  }

  .sidebar {
    position: static;
  }

  .content {
    padding: 16px;
  }
}
