:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #111827;
  --panel-soft: #161f2b;
  --border: #273447;
  --text: #e7ecf5;
  --text-muted: #acb8ca;
  --accent: #7cb4ff;
  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.12rem;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --radius: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-3);
  background: linear-gradient(180deg, #0f1724 0%, #0d1117 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.brand h1 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

.brand-mark {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(124, 180, 255, 0.5);
}

.sidebar-nav {
  display: grid;
  gap: var(--space-1);
}

.nav-link,
.mobile-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav-link:hover,
.mobile-link:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.nav-link.is-active,
.mobile-link.is-active {
  background: rgba(124, 180, 255, 0.12);
  border-color: rgba(124, 180, 255, 0.4);
  color: #d8e8ff;
}

.main-column {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.menu-button {
  display: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.topbar h2 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
  font-weight: 650;
}

.mobile-menu {
  display: none;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.page-wrap {
  padding: var(--space-5);
}

.page {
  display: none;
}

.page.is-visible {
  display: block;
}

.page-grid {
  display: grid;
  gap: var(--space-4);
}

.two-column {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.column {
  display: grid;
  gap: var(--space-4);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #131b29 0%, #101723 100%);
  min-height: 180px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.chip {
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: var(--text-xs);
}

.card-body {
  padding: var(--space-4);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.inline-form-goal {
  grid-template-columns: minmax(0, 1fr) 84px auto;
}

.inline-form input,
.inline-form button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
  min-height: 2.5rem;
}

.inline-form input {
  background: rgba(152, 166, 187, 0.06);
  color: var(--text);
  padding: 0.62rem 0.8rem;
}

.inline-form input::placeholder {
  color: var(--text-muted);
}

.inline-form button {
  background: rgba(124, 180, 255, 0.24);
  color: #d8e8ff;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
}

.inline-form button:hover {
  background: rgba(124, 180, 255, 0.24);
}

.meta-text {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.item-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(152, 166, 187, 0.04);
  padding: 0.6rem 0.7rem;
}

.item-title {
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.35;
}

.item-title.is-done {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-action {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  padding: 0.46rem 0.65rem;
  min-height: 2.5rem;
  cursor: pointer;
}

.item-action:hover {
  color: var(--text);
  background: rgba(152, 166, 187, 0.1);
}

.item-action.is-hidden {
  display: none;
}

.weather-card {
  min-height: 0;
}

.weather-body {
  display: grid;
  gap: var(--space-2);
}

.weather-actions {
  display: flex;
  gap: var(--space-2);
}

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

.goal-main {
  display: grid;
  gap: 0.5rem;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.goal-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(152, 166, 187, 0.26);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(124, 180, 255, 0.58), rgba(124, 180, 255, 0.95));
}

.goal-controls {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.note-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(152, 166, 187, 0.06);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  padding: 0.7rem 0.8rem;
}

.note-input::placeholder {
  color: var(--text-muted);
}

.note-actions {
  margin-top: var(--space-2);
  display: flex;
  justify-content: flex-end;
}

.note-actions button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(124, 180, 255, 0.24);
  color: #d8e8ff;
  padding: 0.58rem 0.9rem;
  min-height: 2.5rem;
  font: inherit;
  cursor: pointer;
}

.note-actions button:hover {
  background: rgba(124, 180, 255, 0.24);
}

.note-row {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.note-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  max-width: 62ch;
}

.note-date {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.placeholder-block {
  min-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(152, 166, 187, 0.35);
  background: rgba(152, 166, 187, 0.03);
}

.placeholder-block.tall {
  min-height: 260px;
}

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

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 var(--space-3);
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-menu {
    display: none;
  }

  .mobile-menu.is-open {
    display: grid;
  }

  .page-wrap {
    padding: var(--space-3);
    margin-top: var(--space-1);
  }

  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .inline-form-goal {
    grid-template-columns: minmax(0, 1fr);
  }

  .goal-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .goal-controls {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .item-row input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
  }
}
