:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #2b2420;
  --muted: #6f625a;
  --accent: #2a9d8f;
  --accent-2: #e9c46a;
  --border: #e3ded7;
  --danger: #c8553d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff8e7, transparent 55%),
    radial-gradient(circle at bottom right, #e6f6f4, transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

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

button {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.control {
  background: var(--card);
  padding: 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.control label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.control input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 15px;
}

.hint {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.dates {
  background: var(--card);
  padding: 16px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  height: fit-content;
}

.dates-header h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.dates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.date-btn {
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff7e0;
  border: 1px solid #f1e2bd;
  color: var(--ink);
}

.date-btn.active {
  background: var(--accent-2);
  border-color: #d9b751;
}

.table-wrap {
  background: var(--card);
  padding: 16px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status {
  margin-bottom: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #fce8e2;
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: var(--card);
  padding: 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 360px;
  width: 100%;
}

.modal-card input {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

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

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

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

  .dates {
    order: 2;
  }
}
