* {
  box-sizing: border-box;
}

html {
  color: #17351d;
  background: #eef7ea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.login-panel {
  display: grid;
  grid-template-columns: auto minmax(280px, 520px) minmax(280px, 360px);
  gap: 28px;
  align-items: center;
  width: min(1120px, 100%);
  padding: 28px;
  border: 1px solid rgb(57 115 61 / 0.16);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.82);
  box-shadow: 0 22px 60px rgb(23 53 29 / 0.13);
}

.login-panel img,
.brand img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.eyebrow,
article span,
.summary-card span {
  margin: 0;
  color: #39733d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

h3 {
  font-size: 1.35rem;
}

.muted {
  color: #5f725d;
  line-height: 1.45;
}

form,
.dialog-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #39733d;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgb(57 115 61 / 0.24);
  border-radius: 8px;
  color: #17351d;
  background: white;
  padding: 11px 12px;
}

button,
.button-link {
  border: 0;
  border-radius: 999px;
  color: white;
  background: #28723a;
  font-weight: 800;
  padding: 11px 16px;
  text-decoration: none;
}

.error {
  color: #9b1c1c;
  font-weight: 800;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 24px;
  overflow: auto;
  border-right: 1px solid rgb(57 115 61 / 0.16);
  background: rgb(255 255 255 / 0.68);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  font-size: 2rem;
}

.month-tools,
.day-header,
.day-actions,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.month-panel {
  display: grid;
  gap: 10px;
}

.previous-month-panel {
  width: 100%;
  align-self: start;
}

.month-tools button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  font-size: 1.45rem;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.weekdays span {
  color: #70806d;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.calendar-grid button,
.calendar-grid span {
  display: grid;
  min-height: 39px;
  place-items: center;
  border-radius: 8px;
  background: white;
  color: #17351d;
  padding: 0;
}

.calendar-grid button {
  align-content: center;
  gap: 1px;
}

.calendar-grid button strong {
  font-size: 1.05rem;
  line-height: 1;
}

.calendar-grid button small {
  font-size: 0.52rem;
  font-weight: 500;
  line-height: 1;
  color: #5f725d;
}

.calendar-grid button.active {
  background: #28723a;
  color: white;
}

.calendar-grid button.active small {
  color: rgb(255 255 255 / 0.86);
}

.calendar-grid button.weather-sun:not(.active) {
  background: #fffbd3;
}

.calendar-grid button.weather-rain:not(.active) {
  background: #d9edff;
}

.calendar-grid button.weather-heavy-rain:not(.active) {
  background: #99bee8;
}

.calendar-grid button.weather-mixed:not(.active) {
  background: #edefeb;
}

.logout {
  justify-content: center;
  margin-top: auto;
  text-align: center;
}

.day-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.day-header {
  align-items: end;
}

.day-actions input {
  width: 170px;
}

.map-card,
.panel,
.overview-grid article,
.summary-card {
  border: 1px solid rgb(57 115 61 / 0.14);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.78);
}

.map-card {
  overflow: hidden;
  height: min(56vh, 560px);
  min-height: 360px;
}

#map {
  width: 100%;
  height: 100%;
}

.map-pin {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  border: 4px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color, #28723a);
  transform: rotate(-45deg);
}

.map-pin::after {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.map-marker {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 0.95);
  border-radius: 50%;
  background: white;
  color: #28723a;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.map-marker-symbol {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.map-marker-calendar .map-marker-symbol {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.map-marker-calendar .map-marker-symbol::before {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  content: "";
}

.map-marker-calendar .map-marker-symbol::after {
  position: absolute;
  top: -5px;
  left: 4px;
  width: 8px;
  height: 5px;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
}

.map-marker-photo {
  color: #0f9fad;
  width: 28px;
  height: 28px;
  border: 1px solid rgb(40 114 58 / 0.24);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgb(20 50 28 / 0.16);
  transform: none;
}

.map-marker-photo .map-marker-symbol {
  width: 13px;
  height: 13px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: currentColor;
}

.map-marker-photo .map-marker-symbol::before {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  content: "";
}

.map-marker-photo .map-marker-symbol::after {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 6px;
  background:
    linear-gradient(135deg, transparent 44%, white 45% 60%, transparent 61%),
    linear-gradient(45deg, transparent 42%, white 43% 62%, transparent 63%);
  content: "";
}

.map-photo-symbol {
  display: block;
  width: 18px;
  height: 18px;
}

.map-marker-entry {
  color: #b66a1a;
}

.map-marker-entry .map-marker-symbol {
  border: 2px solid currentColor;
  border-radius: 2px;
}

.map-marker-entry .map-marker-symbol::before,
.map-marker-entry .map-marker-symbol::after {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: currentColor;
  content: "";
}

.map-marker-entry .map-marker-symbol::before {
  top: 5px;
  box-shadow: 0 5px 0 currentColor;
}

.map-marker-entry .map-marker-symbol::after {
  top: 15px;
}

.map-marker-badge {
  position: absolute;
  z-index: 2;
  top: -9px;
  right: -9px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  color: white;
  background: #28723a;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 4px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview-grid article,
.summary-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  text-align: left;
}

.overview-grid strong,
.summary-card strong {
  color: #17351d;
  font-size: clamp(0.84rem, 1.45vw, 1.08rem);
  line-height: 1.2;
  white-space: nowrap;
}

.summary-card {
  color: #17351d;
}

.hours-wide-card {
  min-height: auto;
}

.hours-wide-card strong {
  white-space: normal;
}

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

.panel {
  padding: 18px;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.row {
  padding: 12px 0;
  border-bottom: 1px solid rgb(57 115 61 / 0.12);
}

.row b {
  display: block;
}

.row small {
  display: block;
  margin-top: 4px;
  color: #5f725d;
}

.event-link {
  display: inline-block;
  margin-top: 7px;
  color: #28723a;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.event-link:hover {
  text-decoration: underline;
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photos button {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #d7edca;
  padding: 0;
}

.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photos span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgb(23 53 29 / 0.76);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 8px;
}

dialog {
  width: min(680px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  background: #f8fbf5;
  color: #17351d;
  padding: 0;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.24);
}

dialog::backdrop {
  background: rgb(10 23 14 / 0.45);
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid rgb(57 115 61 / 0.14);
}

dialog header button,
.photo-dialog > button,
.panel-title button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
}

dialog dl,
.dialog-form {
  margin: 0;
  padding: 18px;
}

dl {
  display: grid;
  gap: 8px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid rgb(57 115 61 / 0.12);
}

dt {
  font-weight: 800;
}

dd {
  margin: 0;
  color: #5f725d;
  text-align: right;
}

.photo-dialog {
  width: fit-content;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.photo-dialog > button[data-close] {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  background: #28723a;
}

.photo-dialog img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.32);
}

.photo-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  border: 1px solid rgb(255 255 255 / 0.38);
  background: rgb(248 251 245 / 0.78);
  color: #17351d;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}

.photo-arrow:hover {
  background: #f8fbf5;
}

.photo-arrow-left {
  left: 12px;
  right: auto;
}

.photo-arrow-right {
  left: auto;
  right: 12px;
}

.photo-arrow[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .app-shell,
  .content-grid,
  .overview-grid,
  .login-panel {
    grid-template-columns: 1fr;
  }

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

  .day-header {
    align-items: start;
    flex-direction: column;
  }
}
