* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-alt: #eef3ff;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e7ebf3;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 48px rgba(31, 41, 55, 0.08);
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #f8f9fe 0%, #eef3ff 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.app-shell {
  max-width: 1400px;
  margin: 32px auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.sidebar,
.panel,
.stats-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 22px 18px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-wrap h1,
.topbar h2,
.section-header h3,
.mini-card h3 {
  margin: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  transition: 0.2s ease;
}

.nav-item.active,
.nav-item:hover {
  background: var(--primary-soft);
  border-color: #dfe6ff;
  color: var(--primary);
}

.mini-card {
  margin-top: 26px;
  background: linear-gradient(180deg, #f6f7ff 0%, #eef3ff 100%);
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.tiny-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.tiny-list li {
  margin-bottom: 8px;
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 18px;
  transition: transform 0.12s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #6d5df5 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79,70,229,0.28);
}

.secondary-btn {
  background: #f3f4f6;
  color: var(--text);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stats-card {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-card.accent {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.stats-card span {
  color: var(--muted);
  font-size: 13px;
}

.stats-card strong {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
  line-height: 1;
}

.content-grid,
.lists-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 18px;
}

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

.task-form,
.note-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input, select, textarea {
  width: 100%;
  background: #f9f9fc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(79,70,229,0.12);
  border-color: rgba(79,70,229,0.32);
}

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

.list-panel {
  min-height: 290px;
}

.full-width {
  grid-column: 1 / -1;
}

.task-list,
.note-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item,
.note-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: #f8f9ff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
}

.task-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}

.task-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

.task-title {
  font-weight: 600;
  margin: 0 0 4px;
}

.task-meta {
  font-size: 12px;
  color: var(--muted);
}

.complete-btn,
.delete-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: 0.15s ease;
}

.complete-btn {
  background: rgba(16,185,129,0.08);
  color: var(--success);
}

.delete-btn {
  background: rgba(239,68,68,0.08);
  color: var(--danger);
}

.note-item {
  flex-direction: column;
}

.note-text {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--border);
  background: #fbfcff;
  border-radius: 14px;
  padding: 14px;
}

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

  .stats-grid,
  .content-grid,
  .lists-grid {
    grid-template-columns: 1fr;
  }
}
