:root {
  --bg: #f7f4ed;
  --card: #fffdf8;
  --ink: #1f2a1f;
  --muted: #5d6959;
  --line: #d7d1c5;
  --accent: #2f6d4d;
  --accent-soft: #e3efe7;
  --warn: #a56b00;
  --warn-soft: #fff2d8;
  --danger: #a83f2f;
  --danger-soft: #ffe4df;
  --shadow: 0 12px 30px rgba(31, 42, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(47, 109, 77, 0.12), transparent 35%),
    linear-gradient(180deg, #f6f0e2, var(--bg));
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}

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

.shell {
  width: min(1540px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 244, 237, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 42, 31, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.top-nav,
.actions,
.split,
.week-nav,
.entry-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 0 1rem;
}

.hero {
  padding: 3rem 0;
}

.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.card,
.day-card,
.slot,
.pill,
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.card,
.day-card,
.slot {
  padding: 1rem;
  min-width: 0;
  overflow: hidden;
}

.card.soft {
  background: rgba(255, 253, 248, 0.8);
}

.grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

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

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

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

.admin-day {
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(47, 109, 77, 0.22);
  background:
    linear-gradient(180deg, rgba(47, 109, 77, 0.12), rgba(47, 109, 77, 0.03) 92px, transparent 92px),
    var(--card);
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.stack.compact {
  gap: 0.55rem;
}

.slot {
  margin-top: 0.75rem;
}

.slot-filled {
  background: linear-gradient(180deg, rgba(227, 239, 231, 0.92), rgba(245, 250, 246, 0.96));
  border-color: rgba(47, 109, 77, 0.24);
}

.slot-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.slot-head strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.slot-text {
  margin: 0.55rem 0;
  color: var(--muted);
}

.slot-text strong {
  color: var(--ink);
}

.group-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.person-chip {
  display: inline-flex;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #f0ece2;
}

.person-chip.confirmed {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #ece8de;
  color: var(--muted);
  max-width: 100%;
  white-space: normal;
}

.badge.success {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.open {
  background: #f1efea;
}

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

button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: transparent;
  color: var(--accent);
}

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

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox input {
  width: auto;
}

.notice {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.list-link {
  display: block;
  padding: 0.45rem 0;
}

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

.clickable-slot {
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.clickable-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 109, 77, 0.35);
}

.clickable-slot.is-selected {
  border-color: rgba(47, 109, 77, 0.45);
  background: rgba(227, 239, 231, 0.55);
}

.clickable-slot.slot-filled-soft,
.clickable-slot.slot-filled-soft.is-selected {
  border-color: rgba(47, 109, 77, 0.28);
  background: linear-gradient(180deg, rgba(234, 244, 237, 0.92), rgba(247, 251, 248, 0.96));
}

.clickable-slot.slot-filled-self,
.clickable-slot.slot-filled-self.is-selected {
  border-color: rgba(47, 109, 77, 0.42);
  background: linear-gradient(180deg, rgba(212, 235, 219, 0.96), rgba(236, 246, 239, 0.98));
}

.slot-footer {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-start;
}

.slot-action {
  width: 100%;
}

.quick-entry-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

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

.pill {
  padding: 0.5rem 0.9rem;
}

.pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.inline-form,
.entry-form {
  display: inline-block;
}

.entry-form {
  width: 100%;
  padding: 0.9rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.split > * {
  flex: 1 1 0;
}

.split.triple > * {
  min-width: 0;
}

.right {
  margin-top: 0.5rem;
}

.align-end {
  align-self: end;
}

.wrap {
  flex-wrap: wrap;
}

.gap-top {
  margin-top: 1rem;
}

.border-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.admin-summary {
  min-height: 4.5rem;
}

.admin-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(47, 109, 77, 0.14);
}

.admin-day-head h2 {
  margin: 0;
}

.admin-shift-list {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.25rem 1.25rem;
}

.admin-shift-panel {
  border: 1px solid rgba(47, 109, 77, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.admin-shift-panel[open] {
  background: #fffdf8;
  border-color: rgba(47, 109, 77, 0.3);
}

.admin-shift-panel.is-confirmed:not([open]) {
  background: linear-gradient(180deg, rgba(227, 239, 231, 0.92), rgba(240, 247, 242, 0.92));
  border-color: rgba(47, 109, 77, 0.28);
}

.admin-shift-panel.is-empty:not([open]) {
  background: linear-gradient(180deg, rgba(255, 235, 231, 0.92), rgba(255, 246, 244, 0.92));
  border-color: rgba(168, 63, 47, 0.22);
}

.admin-shift-panel.needs-attention {
  border-color: rgba(165, 107, 0, 0.26);
  box-shadow: 0 10px 24px rgba(165, 107, 0, 0.08);
}

.admin-shift-summary {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.admin-shift-summary::-webkit-details-marker {
  display: none;
}

.admin-shift-main,
.admin-shift-glance {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-shift-glance {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-glance-note {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.admin-shift-body {
  display: grid;
  gap: 0.9rem;
  padding: 0 1rem 1rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.admin-confirm-box {
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(247, 244, 237, 0.78);
}

.admin-shift-tools {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.candidate-row {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(47, 109, 77, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.candidate-row input {
  width: auto;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.candidate-content {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.candidate-note {
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.candidate-row strong {
  display: block;
}

.stat-card strong {
  font-size: 2rem;
}

.audit-row {
  align-items: flex-start;
}

@media (max-width: 980px) {
  .week-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100vw - 1rem, 100%);
  }
}

@media print {
  .site-header,
  .actions,
  form,
  .button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .shell {
    width: 100%;
  }

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

  .day-card,
  .slot {
    box-shadow: none;
    break-inside: avoid;
  }
}
