:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Prompt', 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
}

/* Header */
.app-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-avatar {
  font-size: 2rem;
  background: #eef2ff;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d2fe;
}

.brand h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-preset { background: #e0e7ff; color: var(--primary-dark); font-weight: 600; }
.btn-preset:hover { background: #c7d2fe; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon { font-size: 2rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-value { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }

/* Controls & Filter */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.view-toggles {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all 0.2s;
}

.view-btn.active {
  background: white;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill {
  background: white;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all 0.2s;
}

.cat-pill.active, .cat-pill:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* View Panels */
.view-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.hidden { display: none; }

.timeline-header-bar, .list-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
}

.hint-text { font-size: 0.8rem; color: var(--text-muted); }

/* Horizontal Timeline Track */
.timeline-scroll-wrapper {
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.timeline-track {
  display: flex;
  gap: 16px;
  min-width: 900px;
  padding: 10px 4px;
}

.timeline-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  width: 220px;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.timeline-card.completed {
  opacity: 0.6;
  background: #f1f5f9;
}

.card-time-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.card-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  flex-grow: 1;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.6rem;
}

.btn-toggle-done {
  background: none;
  border: none;
  color: #10b981;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-delete {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
}

/* List View */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.task-item-row:hover {
  background: white;
  border-color: var(--primary-light);
}

.task-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-clear {
  background: none;
  border: 1px solid #fca5a5;
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Modals */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.active { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.modal-box {
  position: relative;
  max-width: 500px;
  margin: 60px auto;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 25px rgba(0,0,0,0.15);
}

.modal-top {
  padding: 1rem 1.4rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.form-body { padding: 1.4rem; }
.modal-bottom {
  padding: 1rem 1.4rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-row { display: flex; gap: 14px; font-size: 0.85rem; }

.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
