:root {
  color-scheme: dark;
  --bg: #0f1411;
  --surface: #171d19;
  --surface-soft: #202821;
  --ink: #eef5ef;
  --muted: #a8b8ae;
  --line: #334137;
  --accent: #59b77a;
  --accent-strong: #ddf8e4;
  --accent-soft: #1f3c2a;
  --warning: #ff856f;
  --gold: #f0b64d;
  --sky: #70c7df;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(10, 15, 12, 0.88), rgba(10, 15, 12, 0.88)),
    url("https://images.unsplash.com/photo-1504280390367-361c6d9f38f4?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  background: rgba(18, 24, 20, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #07100a;
  background: var(--accent);
}

.brand h1,
.brand p,
.page-header h2,
.page-header p,
.quick-panel h2,
.form-panel h3,
.list-section h3,
.column-header h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.brand p,
.page-header p {
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.tab-button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: #356b47;
}

.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(240, 182, 77, 0.4);
  border-radius: 8px;
  background: rgba(240, 182, 77, 0.14);
  color: #ffd98a;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.quick-panel,
.form-panel,
.task-column,
.calendar-board,
.list-section {
  background: rgba(23, 29, 25, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quick-panel {
  padding: 18px;
  margin-top: auto;
}

.quick-panel h2,
.form-panel h3,
.list-section h3,
.column-header h3 {
  font-size: 1rem;
}

.next-booking {
  margin-top: 12px;
}

.main-content {
  min-width: 0;
  padding: 32px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.month-controls {
  display: grid;
  grid-template-columns: 42px minmax(160px, auto) 42px;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(23, 29, 25, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.month-controls strong {
  text-align: center;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.calendar-layout,
.supplies-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.supplies-layout {
  grid-template-columns: 340px minmax(0, 1fr);
}

.calendar-board {
  padding: 16px;
}

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

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

.calendar-grid {
  gap: 8px;
}

.day-cell {
  min-height: 118px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.day-cell.outside-month {
  opacity: 0.45;
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  font-weight: 700;
}

.today-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.booking-chip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--accent);
  color: #07100a;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holiday-chip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(240, 182, 77, 0.45);
  border-radius: 6px;
  background: rgba(240, 182, 77, 0.14);
  color: #ffd98a;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-panel {
  padding: 18px;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111713;
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #75867b;
}

textarea {
  resize: vertical;
}

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

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #07100a;
  font-weight: 800;
}

.primary-button:hover,
.icon-button:hover {
  filter: brightness(0.96);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--warning);
  font-size: 0.9rem;
  font-weight: 700;
}

.list-section {
  margin-top: 20px;
  padding: 18px;
}

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

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.list-item.done {
  opacity: 0.6;
}

.list-item h4 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.small-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111713;
  color: var(--ink);
}

.small-button.danger {
  color: var(--warning);
}

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
}

.supply-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.task-column {
  padding: 18px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sky);
}

svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

@media (max-width: 1020px) {
  .app-shell,
  .calendar-layout,
  .supplies-layout,
  .supply-columns {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .quick-panel {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .main-content {
    padding: 14px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-header h2 {
    font-size: 1.65rem;
  }

  .page-header p {
    font-size: 0.92rem;
  }

  .month-controls {
    grid-template-columns: 42px 1fr 42px;
  }

  .calendar-board {
    padding: 8px;
    overflow-x: visible;
  }

  .weekday-row {
    gap: 3px;
    margin-bottom: 5px;
    font-size: 0.66rem;
  }

  .calendar-grid {
    gap: 3px;
  }

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

  .day-number {
    min-height: 17px;
    font-size: 0.78rem;
  }

  .today-dot {
    width: 6px;
    height: 6px;
  }

  .booking-chip,
  .holiday-chip {
    margin-top: 3px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 800;
  }

  .holiday-chip {
    border-width: 0;
  }

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

@media (max-width: 420px) {
  .sidebar,
  .main-content {
    padding: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .tab-button {
    justify-content: center;
    gap: 6px;
    padding-inline: 8px;
  }

  .calendar-board {
    padding: 6px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 2px;
  }

  .weekday-row {
    font-size: 0.58rem;
  }

  .day-cell {
    min-height: 50px;
    padding: 3px;
  }

  .day-number {
    font-size: 0.72rem;
  }

  .booking-chip,
  .holiday-chip {
    font-size: 0.5rem;
    padding: 2px 3px;
  }
}
