* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  background: #e6eefd;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 30px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  grid-column: 1/-1;
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-bar input {
  width: 100%;
  padding: 12px 45px;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
}

.search-bar input:focus {
  border-color: #8b5cf6;
}

.search-bar i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.header-icons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  position: relative;
}

.icon-btn:hover {
  background: #e5e7eb;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
}

.main-content {
  padding-right: 20px;
}

.title-section {
  margin-bottom: 40px;
}

.greeting {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 10px;
}

.title-section h1 {
  font-size: 42px;
  font-weight: 700;
  color: #1f2937;
}

.title-section h1 .task-count {
  color: #dc5397;
}

.add-btn {
  background-color: #8b5cf6;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  margin-left: 15px;
  transition: 0.3s;
}

.add-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-inactive {
  background: #fee2e2;
  color: #dc2626;
}

.task-item {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
}

.task-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-item.missed {
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}

.task-item.missed .task-checkbox {
  border-color: #ef4444;
}

.task-item.missed .task-due-date {
  color: #dc2626;
  font-weight: 600;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ec4899;
  cursor: pointer;
  transition: 0.3s;
}

.task-checkbox.completed {
  background: #ec4899;
  position: relative;
}

.task-checkbox.completed::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 5px;
}

.task-title.completed {
  text-decoration: line-through;
  color: #9ca3af;
}

.task-due-date {
  font-size: 12px;
  color: #6b7280;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-due-date i {
  color: #9ca3af;
  font-size: 11px;
}

.status-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending   { background-color: #fef3c7; color: #f59e0b; }
.status-progress  { background-color: #dbeafe; color: #3b82f6; }
.status-completed { background: #d1fae5; color: #10b981; }
.status-cancelled { background: #fee2e2; color: #ef4444; }

.priority-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.priority-critical { color: #dc2626; }
.priority-normal   { color: #f59e0b; }
.priority-minor    { color: #10b981; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #8b5cf6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ── SIDEBAR ── */
.sidebar {
  background: #f9fafb;
  border-radius: 20px;
  padding: 25px;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 15px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: 10px;
  transition: width 0.5s;
}

/* ── MODAL (shared) ── */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  animation: modalPop .22s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.modal-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1f2937;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
}

.form-group input:focus,
.form-group select:focus { border-color: #8b5cf6; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.btn-primary { background: #8b5cf6; color: #fff; }
.btn-primary:hover { background: #7c3aed; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(139,92,246,0.3); }

.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }

/* ── DELETE MODAL ── */
.delete-modal-content {
  max-width: 400px;
  text-align: center;
}

.delete-icon-wrap {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: #dc2626;
}

.delete-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  margin-top: -10px;
  padding: 0 10px;
  line-height: 1.5;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ── FOCUS TIMER ── */
.timer-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.timer-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.timer-emoji { font-size: 18px; }

.timer-name {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.timer-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 14px;
}

.timer-display {
  font-size: 40px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 2px;
  cursor: pointer;
  display: inline-block;
  transition: color .2s;
  margin-bottom: 2px;
}

.timer-display:hover { color: #8b5cf6; }

/* edit row */
.timer-edit {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.timer-edit.visible { display: flex; }
.timer-edit input {
  width: 58px;
  padding: 8px;
  text-align: center;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #8b5cf6;
  outline: none;
  transition: border-color .2s;
}
.timer-edit input:focus { border-color: #8b5cf6; }
.timer-edit-sep { font-size: 22px; font-weight: 700; color: #6b7280; }
.timer-edit-hint { font-size: 11px; color: #9ca3af; }

.timer-progress-wrap {
  height: 6px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0;
}
.timer-progress-bar {
  height: 100%;
  background: #8b5cf6;
  border-radius: 10px;
  transition: width .5s linear;
}

.timer-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.preset-pill {
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.preset-pill:hover,
.preset-pill.active { border-color: #8b5cf6; color: #8b5cf6; }

.timer-btns { display: flex; gap: 10px; }
.timer-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.timer-btn:hover { border-color: #8b5cf6; color: #8b5cf6; }
.timer-btn.primary { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.timer-btn.primary:hover { background: #7c3aed; border-color: #7c3aed; }

/* ── PRIORITY MIX ── */
.priority-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── THIS WEEK ── */
.week-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.week-big-num { font-size: 38px; font-weight: 700; color: #8b5cf6; line-height: 1; margin-bottom: 4px; }
.week-big-sub { font-size: 12px; color: #9ca3af; margin-bottom: 14px; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 5px;
  margin-bottom: 6px;
}
.week-cell { aspect-ratio: 1; border-radius: 5px; background: #e5e7eb; }
.week-cell.full    { background: #8b5cf6; }
.week-cell.partial { background: #c4b5fd; }

.week-labels {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 5px;
}
.week-labels span { text-align: center; font-size: 10px; color: #9ca3af; font-weight: 600; }

/* ── RESPONSIVE DESIGN ────────────────────────────────────────────────────── */

/* Tablets and smaller desktops */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    padding: 30px 20px;
    gap: 20px;
  }

  .main-content {
    padding-right: 0;
  }

  .title-section h1 {
    font-size: 32px;
  }

  .add-btn {
    padding: 10px 16px;
    font-size: 12px;
    margin-left: 10px;
  }

  .sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Tablets */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }

  .container {
    border-radius: 20px;
    padding: 20px;
    gap: 15px;
  }

  .title-section h1 {
    font-size: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .add-btn {
    width: 100%;
    margin-left: 0;
  }

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

  .task-item {
    flex-wrap: wrap;
    padding: 15px;
    gap: 10px;
  }

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

  .task-title {
    font-size: 14px;
  }

  .status-badge,
  .priority-badge {
    font-size: 11px;
    padding: 4px 12px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .icon-btn i {
    font-size: 11px !important;
  }

  .timer-display {
    font-size: 32px;
  }

  .modal-content {
    width: 90%;
    max-height: 80vh;
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
  }

  .sidebar-section {
    margin-bottom: 15px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 12px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  body {
    padding: 15px 10px;
  }

  .container {
    border-radius: 15px;
    padding: 15px;
    gap: 12px;
  }

  .greeting {
    font-size: 14px;
    margin-bottom: 5px;
  }

  .title-section h1 {
    font-size: 18px;
    font-weight: 600;
  }

  .task-count {
    display: block;
    font-size: 20px;
    color: #dc5397;
  }

  .add-btn {
    padding: 8px 12px;
    font-size: 11px;
    width: 100%;
    margin-top: 8px;
  }

  .section {
    margin-bottom: 20px;
  }

  .section-header h2 {
    font-size: 16px;
  }

  .task-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    gap: 8px;
  }

  .task-item .task-content {
    width: 100%;
    order: 2;
  }

  .task-item .task-checkbox {
    order: 1;
    margin-bottom: 5px;
  }

  .task-item .status-badge {
    order: 3;
    width: 100%;
  }

  .task-item .priority-badge,
  .task-item .avatar,
  .task-item .icon-btn {
    display: none;
  }

  .task-title {
    font-size: 13px;
    font-weight: 500;
  }

  .task-due-date {
    font-size: 11px;
  }

  .status-badge {
    font-size: 10px;
    padding: 3px 10px;
    width: auto;
  }

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

  .sidebar-section {
    margin-bottom: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
  }

  .sidebar-title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .stat-card {
    padding: 8px;
    margin-bottom: 8px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 18px;
  }

  .progress-bar {
    height: 4px;
  }

  .timer-card {
    padding: 12px;
  }

  .timer-top {
    margin-bottom: 8px;
  }

  .timer-emoji {
    font-size: 20px;
  }

  .timer-name {
    font-size: 12px;
  }

  .timer-display {
    font-size: 28px;
    margin: 8px 0;
  }

  .timer-presets {
    gap: 6px;
    margin: 10px 0;
  }

  .preset-pill {
    font-size: 10px;
    padding: 6px 10px;
  }

  .timer-btns {
    gap: 8px;
  }

  .timer-btn {
    font-size: 11px;
    padding: 8px 12px;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: center;
  }

  .donut-legend {
    margin-top: 10px;
    width: 100%;
  }

  .legend-row {
    font-size: 11px;
  }

  .week-grid {
    gap: 4px;
  }

  .week-cell {
    width: 100%;
    height: 20px;
  }

  .week-labels span {
    font-size: 9px;
  }

  .week-big-num {
    font-size: 28px;
  }

  .modal-header {
    font-size: 18px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input,
  .form-group select {
    font-size: 14px;
    padding: 8px;
  }

  .btn {
    font-size: 12px;
    padding: 10px 12px;
  }

  .delete-modal-content {
    padding: 20px;
  }

  .delete-icon-wrap {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .delete-subtitle {
    font-size: 12px;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .container {
    padding: 12px;
    border-radius: 12px;
  }

  .title-section h1 {
    font-size: 16px;
  }

  .task-title {
    font-size: 12px;
  }

  .timer-display {
    font-size: 24px;
  }

  .stat-value {
    font-size: 16px;
  }

  .modal-content {
    width: 95%;
  }

  .btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}