:root {
  color-scheme: light;
  font-family: "Space Grotesk", system-ui, sans-serif;
  --ink: #11211f;
  --muted: #5a6c69;
  --paper: #fffdf8;
  --panel: #f3efe4;
  --accent: #e85d2a;
  --accent-deep: #b83f16;
  --teal: #1f8f7a;
  --gold: #dca531;
  --rose: #c85a5a;
  --line: #e2dacd;
  --shadow: 0 22px 50px rgba(14, 23, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 236, 212, 0.85), transparent 28%),
    radial-gradient(circle at top right, rgba(167, 216, 203, 0.7), transparent 26%),
    linear-gradient(180deg, #f9f4eb 0%, #e7efe9 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background:
    linear-gradient(180deg, rgba(10, 27, 24, 0.98), rgba(15, 40, 36, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent);
  color: #f5f2ea;
}

.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-copy {
  margin-top: 10px;
  color: rgba(245, 242, 234, 0.72);
  line-height: 1.5;
}

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

.nav a {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.nav a.active {
  background: rgba(232, 93, 42, 0.18);
  border-color: rgba(232, 93, 42, 0.4);
}

.main {
  padding: 28px;
}

.hero,
.panel {
  display: grid;
  gap: 22px;
  margin-bottom: 28px;
}

.hero {
  padding: 28px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.hero-head h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.02;
  max-width: 12ch;
}

.hero-head p {
  margin-top: 12px;
  max-width: 56ch;
  color: var(--muted);
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-note span,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #efe7d6;
  font-size: 12px;
  font-weight: 600;
}

.badge.warn {
  background: #f6d8d8;
  color: #8d2d2d;
}

.stats-grid,
.section-grid {
  display: grid;
  gap: 18px;
}

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

.section-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.wide-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.stat-card,
.card {
  background: var(--paper);
  border: 1px solid rgba(17, 33, 31, 0.06);
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(17, 33, 31, 0.08);
}

.stat-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.stat-card strong {
  font-size: 34px;
  line-height: 1;
}

.card {
  padding: 20px;
}

.card-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.panel-head h2 {
  font-size: 28px;
}

.panel-head p,
.soft {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.search-input {
  width: min(320px, 100%);
}

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

.field-span {
  grid-column: 1 / -1;
}

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

label {
  font-size: 13px;
  font-weight: 600;
}

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

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

select[multiple] {
  min-height: 132px;
}

textarea {
  resize: vertical;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  cursor: pointer;
  font-weight: 700;
}

.button.ghost,
.button.muted {
  color: var(--ink);
  background: #ece5d7;
}

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

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

.capacity-bar {
  height: 10px;
  border-radius: 999px;
  background: #e8e0d3;
  overflow: hidden;
}

.capacity-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0d665c, #4cc2a6);
}

.capacity-bar.orange span {
  background: linear-gradient(90deg, #bd7f15, #ebb94f);
}

.bar-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

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

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

.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 20, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}

.modal-shell.hidden {
  display: none;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.review-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.review-row strong {
  text-align: right;
}

.result-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fffdfa;
  margin-bottom: 14px;
}

.result-card.recommended {
  border-color: rgba(31, 143, 122, 0.28);
  background: linear-gradient(180deg, rgba(241, 251, 248, 0.95), #fffdfa);
}

.result-card.blocked {
  border-color: rgba(200, 90, 90, 0.2);
  background: linear-gradient(180deg, rgba(252, 243, 243, 0.95), #fffdfa);
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.result-head p {
  margin-top: 6px;
  color: var(--muted);
}

.result-score {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.reason-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.reason-list li + li {
  margin-top: 6px;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
  background: rgba(255, 253, 248, 0.85);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.error {
  color: #9b2f2f;
  font-size: 14px;
}

.user-box {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .wide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .hero,
  .card {
    padding: 16px;
  }

  .hero-head,
  .panel-head,
  .card-head,
  .result-head {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
