:root {
  color-scheme: light;
  --ink: #20242c;
  --muted: #657080;
  --line: #d9dee7;
  --panel: #ffffff;
  --surface: #f4f6f8;
  --field: #fbfcfd;
  --accent: #256f67;
  --accent-strong: #16524b;
  --accent-soft: #e6f3f0;
  --amber: #b9681f;
  --red: #b94848;
  --green: #3d7f4d;
  --blue: #386fa4;
  --shadow: 0 18px 44px rgba(30, 37, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(244, 246, 248, 0.92), rgba(232, 236, 241, 0.94)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1440px, 100%);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 222, 231, 0.88);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.calendar-nav,
.month-controls,
.field-row,
.section-heading,
.calendar-heading,
.legend,
.item-actions {
  display: flex;
  align-items: center;
}

.calendar-nav {
  gap: 12px;
}

.month-controls {
  gap: 8px;
}

.month-controls h2 {
  min-width: 170px;
  text-align: center;
}

.icon-button,
.today-button,
.primary-button,
.ghost-button,
.small-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 30px;
  line-height: 1;
}

.today-button {
  min-width: 92px;
  height: 42px;
  padding: 0 14px;
  font-weight: 700;
}

.icon-button:hover,
.today-button:hover,
.ghost-button:hover,
.small-button:hover {
  background: #eef3f2;
  border-color: #aab9b6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
}

.calendar-panel {
  padding: 22px 24px 24px;
  border-right: 1px solid var(--line);
}

.calendar-heading {
  justify-content: flex-end;
  gap: 16px;
  min-height: 32px;
  margin-bottom: 16px;
}

.legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
}

.planned {
  background: var(--amber);
}

.done {
  background: var(--green);
}

.cancelled {
  background: var(--red);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
}

.weekday-row {
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  gap: 8px;
}

.day-cell {
  position: relative;
  min-height: 142px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.day-cell:not(.other-month):hover {
  border-color: #aab9b6;
  background: #fbfcfd;
}

.day-cell.other-month {
  background: rgba(244, 246, 248, 0.72);
  color: #9aa3af;
}

.day-cell.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.day-cell.selected {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow:
    inset 0 0 0 2px var(--accent-strong),
    0 10px 24px rgba(37, 111, 103, 0.16);
}

.day-cell.selected .date-number > span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #ffffff;
}

.day-cell.has-events:not(.selected)::after {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.date-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.today-marker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.add-day {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #edf5f3;
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.day-events {
  display: grid;
  gap: 5px;
}

.mobile-dots {
  display: none;
}

.event-chip {
  width: 100%;
  min-height: 64px;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 7px;
  background: #f8fafb;
  color: var(--ink);
  text-align: left;
}

.event-chip strong,
.event-chip span {
  display: block;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

.event-chip strong {
  font-size: 13px;
  line-height: 1.2;
  max-height: 32px;
}

.event-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  max-height: 31px;
}

.event-chip.planned {
  border-left-color: var(--amber);
}

.event-chip.done {
  border-left-color: var(--green);
}

.event-chip.cancelled {
  border-left-color: var(--red);
}

.more-events {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.selected-day-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.selected-day-heading,
.selected-day-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-day-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-kicker {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.primary-button.compact {
  width: auto;
  min-width: 132px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.selected-day-list {
  display: grid;
  gap: 8px;
}

.selected-day-item {
  padding: 10px;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.selected-day-copy {
  min-width: 0;
  flex: 1;
}

.selected-day-copy h3 {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.selected-day-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.empty-state.slim {
  padding: 12px;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 0;
}

.editor,
.agenda {
  padding: 22px;
}

.editor {
  border-bottom: 1px solid var(--line);
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  min-height: 88px;
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 111, 103, 0.13);
}

.field-row {
  gap: 10px;
}

.field-row > label {
  flex: 1;
}

.salary-row > label:last-child {
  flex: 0.7;
}

.primary-button {
  height: 44px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hidden {
  display: none;
}

.counter {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.agenda-list {
  display: grid;
  gap: 10px;
}

.agenda-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.item-main {
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.planned {
  background: var(--amber);
}

.status-pill.done {
  background: var(--green);
}

.status-pill.cancelled {
  background: var(--red);
}

.agenda-item h3 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.agenda-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.item-actions {
  align-self: start;
  gap: 6px;
}

.small-button {
  height: 31px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.small-button.delete:hover {
  border-color: #e1a4a4;
  background: #fff0f0;
  color: var(--red);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #c7ced8;
  border-radius: 8px;
  background: rgba(248, 250, 251, 0.78);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .app-shell {
    padding: 14px;
  }

  .workspace {
    min-height: calc(100vh - 28px);
  }

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

  .calendar-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(58px, 1fr));
  }

  .day-cell {
    min-height: 120px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar,
  .calendar-panel,
  .editor,
  .agenda {
    padding: 16px;
  }

  .topbar,
  .calendar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .calendar-nav,
  .month-controls {
    width: 100%;
  }

  .calendar-nav {
    display: grid;
    gap: 10px;
  }

  .month-controls {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .month-controls h2 {
    min-width: 0;
    font-size: 17px;
  }

  .today-button {
    width: 100%;
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .weekday-row {
    gap: 4px;
    font-size: 10px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 7px;
  }

  .date-number {
    justify-content: center;
    min-height: 18px;
    margin-bottom: 4px;
    font-size: 12px;
  }

  .today-marker {
    display: none;
  }

  .day-cell.selected .date-number > span {
    min-width: 24px;
    height: 24px;
  }

  .add-day {
    display: none;
  }

  .day-events {
    place-items: center;
  }

  .event-chip,
  .more-events {
    display: none;
  }

  .mobile-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    min-height: 10px;
  }

  .mobile-dots .dot {
    width: 7px;
    height: 7px;
    margin: 0;
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agenda-item {
    grid-template-columns: 1fr;
  }

  .selected-day-heading,
  .selected-day-item {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button.compact {
    width: 100%;
  }

  .item-actions {
    justify-content: stretch;
  }

  .small-button {
    flex: 1;
  }
}
