:root {
  --navy: #102e42;
  --teal: #007f78;
  --line: #dce6ea;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f3f6f7;
  color: var(--navy);
  font:
    16px system-ui,
    sans-serif;
}
a {
  color: #006b79;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  display: inline-block;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  border-radius: 9px;
  padding: 10px 15px;
  text-decoration: none;
}
button:hover,
.button:hover {
  filter: brightness(0.93);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #edaa36;
  outline-offset: 3px;
}
.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.danger {
  color: #a02323;
}
header {
  background: var(--navy);
  color: white;
  padding: 18px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
header small,
.brand small {
  display: block;
  color: #bfd3df;
  font-size: 14px;
}
header form {
  margin-top: 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: white;
  font-size: 25px;
  font-weight: 750;
}
.brand img {
  background: white;
  border-radius: 6px;
  object-fit: contain;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 28px 24px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
nav a {
  padding: 10px 14px;
  background: white;
  border-radius: 9px;
  text-decoration: none;
  color: var(--navy);
}
nav .active {
  background: var(--teal);
  color: white;
}
h1 {
  font-size: 32px;
  margin: 0 0 12px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.5;
  overflow-wrap: anywhere;
}
small {
  display: block;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 24px;
  margin-bottom: 22px;
}
.narrow {
  max-width: 560px;
  margin: auto;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
label {
  display: block;
  margin: 12px 0;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #9cb3bf;
  border-radius: 7px;
  padding: 10px;
  background: white;
  color: var(--navy);
  margin-top: 6px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: auto;
  margin: 0;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 18px 0;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar label {
  margin: 0;
}
.toolbar button {
  margin-bottom: 1px;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.day {
  border: 1px solid var(--line);
  padding: 8px;
  min-height: 160px;
}
.event {
  background: #e1f3ef;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 8px;
  margin: 10px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.event.own {
  background: #e8eefb;
  border-color: #4a6ab2;
}
.event small {
  margin-top: 4px;
}
.row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inline {
  display: inline-block;
}
.post {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.post form {
  margin-top: 10px;
}
.boat-photo,
.boat-placeholder {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}
.boat-placeholder {
  display: grid;
  place-items: center;
  font-size: 70px;
  background: linear-gradient(155deg, #e1eff2, #b4d5dc);
}
.badge {
  display: inline-block;
  padding: 6px 10px;
  background: #e1f3ef;
  border-radius: 20px;
  font-size: 13px;
}
.notice {
  padding: 16px;
  border-radius: 10px;
  background: #def1e9;
}
.error {
  background: #ffe8e5;
  color: #8f2626;
}
footer {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 24px;
  color: #536c7a;
  font-size: 13px;
}
@media (max-width: 750px) {
  header {
    padding: 12px;
  }
  .brand {
    font-size: 19px;
    gap: 8px;
  }
  .brand img {
    width: 72px;
    height: 54px;
  }
  main {
    padding: 20px 12px;
  }
  h1 {
    font-size: 26px;
  }
  .heading,
  .row {
    align-items: flex-start;
    flex-direction: column;
  }
  .cards,
  .columns {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 16px;
  }
  .calendar {
    grid-template-columns: 1fr;
  }
  .day {
    min-height: 100px;
  }
  nav a {
    flex: 1;
    text-align: center;
    font-size: 14px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar label {
    flex: 1;
    min-width: 120px;
  }
}

.badge.blocked {
  background: #ffe8e5;
  color: #a02323;
}
.boat-photo {
  height: auto;
  aspect-ratio: 3 / 2;
}
.boat-detail {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.boat-detail .boat-photo {
  width: min(45%, 480px);
  flex-shrink: 0;
}
.boat-description {
  flex: 1;
  min-width: 0;
}
.boat-editor {
  max-width: 900px;
  margin-inline: auto;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
@media (max-width: 750px) {
  .boat-detail {
    flex-direction: column;
  }
  .boat-detail .boat-photo {
    width: 100%;
    max-width: 480px;
  }
}

.event.boat-blocked strong,
.event.boat-blocked small {
  text-decoration: line-through;
}
.event.boat-blocked {
  background: #ffe8e5;
  border-color: #a02323;
}
.blocked-note {
  display: block;
  color: #a02323;
  margin-top: 4px;
  font-weight: 600;
}

.boat-actions {
  gap: 12px;
  align-items: center;
}
.boat-actions > form {
  margin: 0;
}

.year-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
}
.year-month { border: 1px solid var(--line); padding: 12px; min-width: 0; }
.year-month h3 { margin: 0 0 12px; }
.year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.year-weekday { text-align: center; font-size: 12px; }
.year-date { text-align: center; padding: 7px 0; border-radius: 4px; text-decoration: none; }
.year-date.booked { background: #e1f3ef; font-weight: 700; }
.year-date.own { background: #e8eefb; }
.year-date.blocked { color: #a02323; text-decoration: line-through; }
.year-bookings { margin-top: 12px; }
.year-bookings summary { cursor: pointer; }

.calendar-scroll { overflow-x: auto; }
.calendar.month-view { grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 840px; }
.calendar-weekday { text-align: center; padding: 10px 4px; font-weight: 700; }
.calendar-empty { border: 1px solid var(--line); background: #f5f7f8; }

@media (max-width: 750px) {
  header { flex-wrap: wrap; }
  .brand { min-width: 0; max-width: 100%; }
  .brand span { min-width: 0; overflow-wrap: anywhere; }
  .brand img { flex-shrink: 0; }
}
