:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --panel: #ffffff;
  --line: #e6eaf0;
  --page: #f4f7fb;
  --nav: #111827;
  --nav-soft: #202a3d;
  --accent: #3f6df6;
  --accent-dark: #2451d5;
  --red: #ef4444;
  --red-soft: #fff1f1;
  --yellow: #f5b942;
  --yellow-soft: #fff8df;
  --green: #22a06b;
  --green-soft: #eaf8f1;
  --shadow: 0 24px 60px rgba(16, 24, 40, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(63, 109, 246, 0.10), rgba(34, 160, 107, 0.08)),
    var(--page);
  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;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 28px;
  background: var(--nav);
  color: #fff;
}

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

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #3f6df6, #22a06b);
  font-weight: 850;
}

.brand h1,
.topbar h2,
.agenda-header h3,
.dialog-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 25px;
}

.eyebrow {
  display: block;
  color: #8ea0bd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

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

.topbar h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.month-controls {
  display: flex;
  align-items: center;
  min-width: 290px;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

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

.icon-button,
.ghost-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #eef3ff;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 28px rgba(63, 109, 246, 0.28);
}

.primary-action:hover {
  background: var(--accent-dark);
}

.secondary-action {
  background: #eef3ff;
  color: #24406f;
}

.danger-action {
  background: #fff1f1;
  color: #b42318;
}

.compact {
  min-height: 38px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  min-width: 0;
  padding: 18px;
  background: var(--nav-soft);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.muted {
  color: #a5b4cc;
  font-size: 14px;
  line-height: 1.5;
}

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

.status-filter {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  background: transparent;
  color: #dbe4f3;
  text-align: left;
}

.status-filter.is-active,
.status-filter:hover {
  background: rgba(255, 255, 255, 0.10);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot-all {
  background: #90a4c4;
}

.dot-new {
  background: var(--red);
}

.dot-progress {
  background: var(--yellow);
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 22px;
  min-width: 0;
  align-items: start;
}

.calendar-panel,
.agenda-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.calendar-panel {
  padding: 18px;
}

.calendar-scroll {
  max-width: 100%;
  overflow-x: auto;
}

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

.weekday-row span {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.calendar-grid {
  gap: 8px;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fff;
  text-align: left;
}

.day:hover,
.day.is-selected {
  border-color: rgba(63, 109, 246, 0.55);
  box-shadow: 0 12px 24px rgba(63, 109, 246, 0.12);
}

.day.is-muted {
  opacity: 0.45;
}

.day.is-today .date-number {
  background: var(--ink);
  color: #fff;
}

.date-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  font-weight: 850;
}

.day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 18px;
}

.pill {
  height: 8px;
  min-width: 24px;
  border-radius: 999px;
}

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

.pill.progress {
  background: var(--yellow);
}

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

.day-title {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.agenda-panel {
  padding: 18px;
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.task-card {
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.task-card.new {
  border-left-color: var(--red);
  background: linear-gradient(90deg, var(--red-soft), #fff 36%);
}

.task-card.progress {
  border-left-color: var(--yellow);
  background: linear-gradient(90deg, var(--yellow-soft), #fff 36%);
}

.task-card.done {
  border-left-color: var(--green);
  background: linear-gradient(90deg, var(--green-soft), #fff 36%);
}

.task-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.task-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.task-meta,
.task-notes {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.status-actions button,
.edit-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-actions button.is-current {
  color: #fff;
}

.status-actions button[data-status="new"].is-current {
  background: var(--red);
  border-color: var(--red);
}

.status-actions button[data-status="progress"].is-current {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #3b2b00;
}

.status-actions button[data-status="done"].is-current {
  background: var(--green);
  border-color: var(--green);
}

.task-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
}

.task-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  background: #111827;
  color: #fff;
  box-shadow: 0 22px 50px rgba(16, 24, 40, 0.28);
  font-weight: 750;
}

.task-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-head,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.dialog-actions {
  grid-template-columns: auto 1fr auto auto;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7e3;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 109, 246, 0.12);
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .month-controls {
    min-width: 0;
  }

  .calendar-panel {
    padding: 12px;
  }

  .weekday-row,
  .calendar-grid {
    min-width: 690px;
  }

  .day {
    min-height: 98px;
  }

  .form-grid,
  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
