:root {
  --pine: #3F5B4B;
  --sage: #6F8F7B;
  --cream: #EEE6DE;
  --ink: #24352c;
  --line: #d5cbbf;
  --paper: #fffdf8;
  --glacier: #d5e0d8;
  --font-display: "SUSE", "Segoe UI", sans-serif;
  --font-body: "Golos Text", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream); }
a { color: var(--pine); }
h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.03em; color: var(--pine); }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--pine); color: white; padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; }
.side__brand { display: flex; align-items: center; gap: .6rem; color: white; text-decoration: none; font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; }
.side__brand img { width: 42px; height: 42px; border-radius: 50%; }
.side nav { display: grid; gap: .15rem; overflow: auto; }
.side nav a { color: white; text-decoration: none; padding: .5rem .7rem; border-radius: 999px; }
.side nav a[aria-current="page"], .side nav a:hover { background: rgba(255,255,255,.14); }
.side__foot { margin-top: auto; display: grid; gap: .5rem; }
.side__foot form { margin: 0; }
.side__foot .btn { width: 100%; }
.main { padding: 1.6rem 1.6rem 3rem; max-width: 1120px; min-width: 0; }
h1 { font-size: clamp(1.8rem, 1.4rem + 1vw, 2.4rem); margin: 0 0 .4rem; line-height: 1.1; }
h2 { font-size: 1.25rem; margin: 0; }
.lead, .muted { color: #5c6b62; line-height: 1.55; }
.flash { background: #e7f0e6; border: 1px solid #c5d9c2; padding: .75rem 1rem; border-radius: 16px; }
.hello { margin-bottom: 1.25rem; }
.eyebrow {
  margin: 0 0 .45rem;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5c6b62;
}
.hello .lead { max-width: 62ch; margin: .35rem 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; margin: 0 0 1rem; }
.stats a {
  background: var(--paper);
  border-radius: 22px;
  padding: 1.15rem 1.2rem 1rem;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: .15rem;
  box-shadow: 0 1px 2px rgba(16, 20, 18, .05);
}
.stats a:hover { transform: translateY(-2px); }
.stats strong { font-family: var(--font-display); font-size: 2.4rem; font-weight: 500; letter-spacing: -.04em; color: var(--pine); line-height: 1; }
.stats span { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: #5c6b62; }
.step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-top: .35rem; }
.step-card {
  background: var(--paper);
  border-radius: 22px;
  padding: 1.1rem 1.15rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .85rem;
  align-items: center;
}
.step-card b {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: #d5e0d8; color: var(--pine);
  font-family: var(--font-display); font-weight: 500;
}
.step-card p { margin: 0; line-height: 1.45; }
.note { margin: 1rem 0 0; color: #5c6b62; }
.bar { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.btn, button.btn {
  background: var(--pine); color: white; border: 0; border-radius: 999px;
  min-height: 48px; padding: .7rem 1.25rem;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font: inherit; font-weight: 500; line-height: 1;
}
.btn:hover { background: #314838; }
.btn.btn--ghost, button.btn.btn--ghost { background: transparent; color: var(--pine); border: 1px solid var(--line); }
.btn.btn--ghost:hover, button.btn.btn--ghost:hover { background: white; color: var(--pine); }
.btn.btn--danger, button.btn.btn--danger { background: #f4e4e2; color: #8a3d3d; }
.btn.btn--danger:hover, button.btn.btn--danger:hover { background: #8a3d3d; color: white; }
.btn.btn--cream, button.btn.btn--cream { background: var(--cream); color: var(--pine); }
.btn.btn--cream:hover, button.btn.btn--cream:hover { background: white; color: var(--pine); }
.table-wrap { overflow: auto; border-radius: 22px; background: var(--paper); }
.grid { width: 100%; border-collapse: collapse; background: var(--paper); }
.actions, .grid th:last-child { position: sticky; right: 0; background: var(--paper); z-index: 1; }
.actions { box-shadow: -10px 0 12px -12px rgba(16, 20, 18, .45); }
.grid th, .grid td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #5c6b62; font-weight: 600; }
.grid tr:last-child td { border-bottom: 0; }
.actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.row-actions form { margin: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: white; color: var(--pine);
  cursor: pointer; text-decoration: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--pine); color: white; border-color: var(--pine); }
.icon-btn--danger { color: #8a3d3d; }
.icon-btn--danger:hover { background: #8a3d3d; border-color: #8a3d3d; color: white; }
.stack { display: grid; gap: .85rem; background: var(--paper); padding: 1.15rem; border-radius: 22px; margin-bottom: 1rem; }
.stack label, .stack legend { display: grid; gap: .4rem; font-size: .92rem; color: var(--pine); font-weight: 500; }
.stack input, .stack select, .stack textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink);
  min-height: 48px; padding: .65rem 1rem;
  border: 1px solid var(--line); border-radius: 16px; background: white;
}
.stack textarea { min-height: 120px; border-radius: 18px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; align-items: start; }
.form-grid > .span-2,
.form-grid > .row2,
.form-grid > .row3,
.form-grid > .row4,
.form-grid > .media-line,
.form-grid > .checks,
.form-grid > .day,
.form-grid > .photos,
.form-grid > p,
.form-grid > .btn,
.form-grid > button,
.form-grid > label:has(textarea),
.form-grid > label:has(input[type="file"]) { grid-column: 1 / -1; }
fieldset.form-grid { border: 1px solid var(--line); border-radius: 18px; padding: .9rem; }
fieldset.form-grid > legend { grid-column: 1 / -1; padding: 0 .25rem; }
.row2, .row3, .row4 { display: grid; gap: .85rem 1rem; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: flex !important; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: auto; min-height: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
fieldset { border: 1px solid var(--line); border-radius: 18px; padding: .9rem; display: grid; gap: .75rem; }
.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; }
.photos, .inline { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.photos figure { margin: 0; }
.photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; }
.day, .leg { display: grid; gap: .45rem; padding-bottom: .7rem; border-bottom: 1px dashed var(--line); }
.day { grid-template-columns: 140px 1fr; }
.day textarea { grid-column: 1 / -1; }
.leg { grid-template-columns: repeat(3, 1fr); }
.linkish { background: none; border: 0; color: #8a3d3d; cursor: pointer; padding: 0; font: inherit; }
.plain { padding-left: 1.1rem; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(20, 36, 28, .28), rgba(20, 36, 28, .18)),
    url("https://images.pexels.com/photos/1450353/pexels-photo-1450353.jpeg?auto=compress&cs=tinysrgb&w=1800") center / cover no-repeat;
}
.login {
  width: min(440px, 100%);
  background: var(--paper);
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: 28px;
  display: grid;
  gap: .85rem;
  box-shadow: 0 24px 60px -28px rgba(16, 20, 18, .55);
}
.login img { width: 64px; height: 64px; border-radius: 50%; }
.login h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.login p { margin: -.35rem 0 0; color: #5c6b62; }
.login label { display: grid; gap: .4rem; color: var(--pine); font-weight: 600; font-size: .95rem; }
.login input {
  font: inherit; font-weight: 400; color: var(--ink);
  min-height: 52px; padding: 0 1.15rem;
  border: 1px solid var(--line); border-radius: 999px; background: white;
}
.login input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px #d5e0d8; }
.login .btn { width: 100%; min-height: 54px; margin-top: .2rem; }
.login .flash { margin: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; z-index: 5; }
  .side nav { display: flex; gap: .25rem; }
  .side nav a { white-space: nowrap; }
  .stats, .step-grid, .form-grid, .row2, .row3, .row4, .leg, .day { grid-template-columns: 1fr; }
  .form-grid > .span-2,
  .form-grid > .row2,
  .form-grid > .row3,
  .form-grid > .row4,
  .day textarea { grid-column: auto; }
  .main { padding: 1rem; }
  .side__foot { grid-template-columns: 1fr 1fr; }
  .savebar { align-items: stretch; }
  .savebar > label, .savebar .btn, .savebar > form { width: 100%; }
}

.media-line { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.stack label.file-btn { position: relative; display: inline-flex; align-items: center; gap: .65rem; width: fit-content; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: auto; min-height: 0; }
.file-btn span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.15rem;
  border: 1px solid var(--line); border-radius: 999px; background: white; font-weight: 400;
}
.savebar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: 0 0 1.25rem; }
.savebar > form { margin: 0; }
.savebar > label { display: grid; gap: .4rem; min-width: 190px; color: var(--pine); font-weight: 500; }
.input {
  display: flex; align-items: center; width: 100%; min-height: 50px; padding: 0 1.1rem;
  background: white; border: 1px solid var(--line); border-radius: 999px;
}
.stack .input select, .savebar .input select {
  width: 100%; min-height: 46px; padding: 0; border: 0; border-radius: 0; background: transparent;
  appearance: none; -webkit-appearance: none;
}
.input:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px var(--glacier); }
.picker { position: relative; flex: 1; min-width: 0; }
.picker.is-open { z-index: 90; }
.picker__native {
  position: absolute !important; width: 1px !important; height: 1px !important;
  min-height: 0 !important; opacity: 0 !important; pointer-events: none !important;
}
.picker__btn {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  width: 100%; min-height: 48px; padding: 0; border: 0; background: transparent;
  color: var(--pine); font: inherit; font-weight: 400; text-align: left; cursor: pointer;
}
.picker__btn svg { width: 16px; height: 16px; flex: none; }
.picker__menu {
  position: fixed; z-index: 120; margin: 0; padding: .4rem; list-style: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px -24px rgba(16, 20, 18, .55);
  max-height: 280px; overflow: auto;
}
.picker__opt {
  display: flex; align-items: center; min-height: 42px; padding: .45rem .9rem;
  border-radius: 12px; color: var(--pine); cursor: pointer;
}
.picker__opt--child { padding-left: 1.7rem; }
.picker__opt:hover, .picker__opt[aria-selected="true"] { background: var(--glacier); color: var(--pine); }
#days { display: grid; gap: .75rem; }
.day-card {
  background: var(--cream); border-radius: 18px; padding: .9rem; display: grid; gap: .55rem;
}
.day-card header { display: flex; gap: .55rem; align-items: center; }
.day-card header input { flex: 1; }
.grip { width: 46px; }
.grip__btn {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent;
  color: var(--pine); cursor: grab; display: grid; place-items: center;
}
.grip__btn svg { width: 18px; height: 18px; }
tr.is-dragging { opacity: .45; }
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 1rem;
  background: rgba(36, 53, 44, .46);
}
.modal__card {
  width: min(440px, 100%); background: var(--paper); border-radius: 28px;
  padding: 1.4rem 1.3rem 1.2rem; box-shadow: 0 24px 60px -28px rgba(16, 20, 18, .55);
}
.modal__card h2 { margin: 0 0 .4rem; font-size: 1.55rem; }
.modal__card p { margin: 0; color: #5c6b62; }
.modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.15rem; }
.media-line form { margin: 0; }
