:root {
  --mint-50: #effaf6;
  --mint-100: #d7f2e9;
  --mint-300: #7fe1c9;
  --mint-500: #28c5a5;
  --mint-600: #17a98d;
  --teal-700: #0f7b6a;
  --teal-900: #172f2a;
  --lime-100: #dff2cf;
  --lime-200: #cceba9;
  --yellow-100: #fff1bd;
  --yellow-700: #8d6800;
  --canvas: #dfecea;
  --surface: #f7fbf9;
  --panel: rgba(255, 255, 255, 0.88);
  --line: #dbe8e3;
  --muted: #728681;
  --text: #213b36;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 22px 70px rgba(28, 63, 55, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 78% 0%, rgba(40, 197, 165, 0.22), transparent 32%),
    radial-gradient(circle at 12% 12%, rgba(223, 242, 207, 0.88), transparent 30%),
    linear-gradient(90deg, rgba(15, 123, 106, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 106, 0.06) 1px, transparent 1px),
    var(--canvas);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mobile-menu-button,
.mobile-scrim {
  display: none;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  width: min(1500px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(246, 250, 248, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: calc(100vh - 32px);
  padding: 28px 18px;
  border-right: 1px solid rgba(219, 232, 227, 0.78);
  border-radius: 30px 0 0 30px;
  background: rgba(239, 250, 246, 0.74);
  overflow: hidden;
}

.brand,
.nav-item,
.badge,
.task-meta,
.task-top,
.task-status,
.week-controls,
.search {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, var(--mint-500), var(--teal-700));
  box-shadow: 0 12px 28px rgba(40, 197, 165, 0.2);
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.system-nav {
  margin-top: auto;
}

.nav-label {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  gap: 10px;
  min-height: 44px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: #5e766f;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: var(--teal-700);
  border-color: var(--mint-300);
  background: var(--mint-50);
  transform: translateY(-1px);
}

.nav-item:focus-visible {
  outline: 0;
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(40, 197, 165, 0.15);
}

.nav-item.active {
  color: #fff;
  background: var(--mint-500);
  box-shadow: 0 12px 26px rgba(40, 197, 165, 0.2);
}

.nav-item.active:hover {
  color: #fff;
  border-color: transparent;
  background: var(--mint-600);
}

.nav-count {
  min-width: 22px;
  margin-left: auto;
  color: inherit;
  font-size: 11px;
  text-align: right;
  opacity: 0.82;
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  font-weight: 800;
}

.collapse-handle {
  position: absolute;
  top: 50%;
  left: 230px;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(28, 63, 55, 0.12);
  font-size: 28px;
  font-weight: 800;
  transform: translateY(-50%);
  transition: left 220ms ease, transform 160ms ease, background 160ms ease;
  cursor: pointer;
}

.collapse-handle:hover {
  background: var(--mint-50);
  transform: translate(-1px, -50%);
}

.sidebar-toggle:checked ~ .shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar-toggle:checked ~ .shell .collapse-handle {
  left: 64px;
  transform: translateY(-50%) rotate(180deg);
}

.sidebar-toggle:checked ~ .shell .sidebar {
  align-items: center;
  padding-inline: 14px;
}

.sidebar-toggle:checked ~ .shell .brand {
  padding: 0;
}

.sidebar-toggle:checked ~ .shell .brand div,
.sidebar-toggle:checked ~ .shell .nav-label,
.sidebar-toggle:checked ~ .shell .nav-text,
.sidebar-toggle:checked ~ .shell .nav-count {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-toggle:checked ~ .shell .nav-item {
  display: grid;
  justify-content: center;
  justify-items: center;
  width: 46px;
  padding: 0;
}

.sidebar-toggle:checked ~ .shell .nav-group {
  justify-items: center;
  width: 100%;
}

.sidebar-toggle:checked ~ .shell .nav-icon {
  width: 22px;
  height: 22px;
  margin: 0;
  text-align: center;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(220px, 320px) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.eyebrow {
  color: var(--mint-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.week-controls {
  gap: 8px;
}

.icon-button,
.today-button,
.add-button,
.composer button,
.column-add {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button {
  display: grid;
  width: 40px;
  place-items: center;
  color: var(--teal-700);
  border-color: var(--line);
  background: #fff;
  font-size: 24px;
}

.today-button {
  padding: 0 14px;
  color: var(--teal-700);
  border-color: var(--mint-100);
  background: var(--mint-50);
}

.add-button,
.composer button {
  padding: 0 16px;
  color: #fff;
  background: var(--mint-500);
}

.icon-button:hover,
.today-button:hover,
.add-button:hover,
.composer button:hover,
.column-add:hover {
  border-color: var(--mint-300);
  transform: translateY(-1px);
}

.search {
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.composer {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 120px minmax(140px, 0.8fr) 130px auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.composer[hidden] {
  display: none;
}

.composer input,
.composer select {
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}

.composer input:focus,
.composer select:focus {
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(40, 197, 165, 0.15);
}

.content {
  min-width: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
}

.panel {
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background: var(--panel);
  backdrop-filter: blur(14px);
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title h2,
.hero-panel h2,
.settings-panel h2 {
  font-size: 20px;
  line-height: 1.1;
}

.hero-panel {
  display: grid;
  gap: 12px;
  min-height: 170px;
  align-content: center;
  border-color: rgba(40, 197, 165, 0.25);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 250, 246, 0.72)),
    radial-gradient(circle at 100% 0%, rgba(40, 197, 165, 0.22), transparent 42%);
}

.hero-panel p:last-child,
.project-card p,
.quick-help p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
}

.list-panel,
.project-card,
.settings-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.project-grid,
.stats-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.project-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.settings-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.8fr);
}

.metric-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 34px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.setting-row input[type="checkbox"] {
  width: 44px;
  height: 24px;
  accent-color: var(--mint-500);
}

.mini-input {
  width: 70px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
}

.btn-secondary {
  min-height: 38px;
  border: 1px solid var(--mint-100);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--teal-700);
  background: var(--mint-50);
  font-weight: 800;
}

.quick-help {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--lime-100);
}

.day-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background: var(--panel);
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, background 160ms ease;
}

.day-column.drag-over {
  border-color: var(--mint-500);
  background: rgba(239, 250, 246, 0.96);
}

.column-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: start;
}

.day-code {
  color: var(--mint-600);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.column-head h2 {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.1;
}

.column-date {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.column-add {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal-700);
  border-color: var(--line);
  background: #fff;
  font-size: 22px;
}

.task-stack {
  display: grid;
  gap: 10px;
  min-height: 90px;
}

.task-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 63, 55, 0.06);
  transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.task-card.priority-high {
  border-left: 4px solid var(--mint-500);
}

.task-card.priority-medium {
  border-left: 4px solid var(--lime-200);
}

.task-card.priority-low {
  border-left: 4px solid var(--line);
}

.task-card:hover {
  border-color: var(--mint-300);
  transform: translateY(-1px);
}

.task-card.dragging {
  opacity: 0.5;
}

.task-top,
.task-status {
  justify-content: space-between;
  gap: 8px;
}

.task-meta {
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-wrap: wrap;
}

.badge,
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.priority.high {
  color: var(--yellow-700);
  background: var(--yellow-100);
}

.priority.medium {
  color: var(--teal-700);
  background: var(--mint-100);
}

.priority.low {
  color: var(--teal-700);
  background: var(--lime-100);
}

.task-menu {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  font-weight: 800;
}

.task-card h3 {
  font-size: 15px;
  line-height: 1.25;
}

.status-button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.status-button.active {
  color: #fff;
  background: var(--mint-500);
}

.empty {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(247, 251, 249, 0.56);
  font-size: 12px;
  font-weight: 800;
}

.compact-mode .task-card {
  gap: 8px;
  padding: 10px;
}

.compact-mode .task-meta {
  display: none;
}

@media (max-width: 1180px) {
  body {
    overflow-x: hidden;
  }

  .mobile-menu-button {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(28, 63, 55, 0.14);
    cursor: pointer;
  }

  .mobile-menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--teal-700);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .mobile-menu-button span + span {
    margin-top: 0;
  }

.sidebar-toggle:checked + .mobile-menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .sidebar-toggle:checked + .mobile-menu-button span:nth-child(2),
  .mobile-menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .sidebar-toggle:checked + .mobile-menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-button[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-scrim {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: min(344px, 100vw);
    z-index: 40;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(23, 47, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.menu-open {
    overflow: hidden;
  }

  .sidebar-toggle:checked ~ .mobile-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open .mobile-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .shell {
    position: relative;
    z-index: 1;
    grid-template-columns: 1fr;
    width: min(100% - 24px, 960px);
    margin-top: 12px;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 80;
    width: min(320px, calc(100vw - 24px));
    height: auto;
    overflow-y: auto;
    border: 1px solid rgba(219, 232, 227, 0.92);
    border-radius: 24px;
    background: rgba(239, 250, 246, 0.98);
    box-shadow: 0 24px 70px rgba(28, 63, 55, 0.22);
    backdrop-filter: blur(18px);
    transform: translateX(calc(-100% - 24px));
    transition: transform 220ms ease;
  }

  .collapse-handle {
    display: none;
  }

  .sidebar-toggle:checked ~ .shell {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle:checked ~ .shell .sidebar {
    align-items: stretch;
    padding: 28px 18px;
    transform: translateX(0);
  }

  body.menu-open .shell .sidebar {
    align-items: stretch;
    padding: 28px 18px;
    transform: translateX(0);
  }

  .sidebar-toggle:checked ~ .shell .brand {
    padding: 0 8px;
  }

  .sidebar-toggle:checked ~ .shell .brand div,
  .sidebar-toggle:checked ~ .shell .nav-label,
  .sidebar-toggle:checked ~ .shell .nav-text,
  .sidebar-toggle:checked ~ .shell .nav-count {
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
  }

  .sidebar-toggle:checked ~ .shell .nav-item {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 0 12px;
  }

  .sidebar .nav-item:not(.active):hover,
  .sidebar .nav-item:not(.active):focus-visible {
    color: var(--teal-700);
    border-color: var(--mint-300);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 4px 0 0 var(--mint-500);
  }

  .nav-group {
    grid-template-columns: 1fr;
  }

  .nav-label {
    grid-column: auto;
  }

  .system-nav {
    margin-top: 0;
  }

  .topbar,
  .composer {
    grid-template-columns: 1fr;
  }

  .planner {
    padding: 28px 18px 18px;
  }

  .board,
  .split-view,
  .project-grid,
  .stats-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .planner,
  .sidebar {
    padding: 18px;
  }

  .board,
  .split-view,
  .project-grid,
  .stats-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
