/* ═══════════════════════════════════════════════
   LifeSync – components.css
   Buttons, cards, forms, modals, badges, toasts
   ═══════════════════════════════════════════════ */

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--trans-fast);
  box-shadow: 0 2px 12px rgba(99,102,241,0.4);
  border: 1px solid rgba(99,102,241,0.3);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.55);
  background: linear-gradient(135deg, var(--indigo-light), var(--indigo));
}

.btn-primary:active { transform: translateY(0); }

.btn-primary i { width: 16px; height: 16px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 20px;
  background: var(--bg-glass);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--trans-fast);
}

.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 20px;
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid rgba(244, 63, 94, 0.25);
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  box-shadow: 0 0 16px rgba(244,63,94,0.3);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-sm i { width: 14px; height: 14px; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.icon-btn i { width: 18px; height: 18px; }

.quick-add-btn i { width: 16px; height: 16px; }

/* ─── Notification Dropdown ─── */
.notif-wrapper {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 370px;
  max-width: calc(100vw - 32px);
  background: rgba(15, 22, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.notif-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-header-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-count-pill {
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: var(--indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.notif-refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.notif-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: rotate(45deg);
}

.notif-refresh-btn i, .notif-refresh-btn svg {
  width: 15px;
  height: 15px;
}

.notif-dropdown-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--trans-fast);
  position: relative;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.notif-item.overdue {
  border-left: 3px solid var(--rose);
  background: rgba(244, 63, 94, 0.06);
}

.notif-item.upcoming {
  border-left: 3px solid var(--amber);
  background: rgba(245, 158, 11, 0.06);
}

.notif-item.today {
  border-left: 3px solid var(--indigo);
  background: rgba(99, 102, 241, 0.06);
}

.notif-icon-col {
  padding-top: 2px;
}

.notif-type-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.notif-item.overdue .notif-type-icon {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose);
}

.notif-item.upcoming .notif-type-icon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
}

.notif-item.today .notif-type-icon {
  background: rgba(99, 102, 241, 0.2);
  color: var(--indigo);
}

.notif-content-col {
  flex: 1;
  min-width: 0;
}

.notif-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-time-badge {
  font-weight: 600;
}

.notif-item.overdue .notif-time-badge {
  color: var(--rose);
}

.notif-item.upcoming .notif-time-badge {
  color: var(--amber);
}

.notif-quick-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.notif-quick-action:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald);
  color: var(--emerald);
}

.notif-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
}

.notif-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.notif-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notif-empty-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.notif-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.notif-system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.notif-footer-action {
  background: transparent;
  border: none;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notif-footer-action:hover {
  text-decoration: underline;
}

/* ─── Task Cards ─── */
.task-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--priority-color, var(--indigo));
  border-radius: 3px 0 0 3px;
}

.task-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: rgba(15, 22, 41, 0.95);
}

.task-card.completed {
  opacity: 0.55;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Priority colors applied via JS */
.task-card[data-priority="urgent"]  { --priority-color: var(--priority-urgent); }
.task-card[data-priority="high"]    { --priority-color: var(--priority-high); }
.task-card[data-priority="medium"]  { --priority-color: var(--priority-medium); }
.task-card[data-priority="low"]     { --priority-color: var(--priority-low); }

/* Checkbox */
.task-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--priority-color, var(--border-hover));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--trans-fast);
  background: transparent;
}

.task-checkbox:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--indigo);
}

.task-checkbox.checked {
  background: linear-gradient(135deg, var(--emerald), #059669);
  border-color: var(--emerald);
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

.task-checkbox.checked i { color: white; width: 12px; height: 12px; }

/* Task body */
.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
  word-break: break-word;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-top: 6px;
}

.task-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-category {
  background: rgba(99,102,241,0.12);
  color: var(--indigo-light);
  border: 1px solid rgba(99,102,241,0.2);
}

.badge-priority-urgent { background: rgba(244,63,94,0.15); color: var(--priority-urgent); border: 1px solid rgba(244,63,94,0.2); }
.badge-priority-high   { background: rgba(249,115,22,0.15); color: var(--priority-high);   border: 1px solid rgba(249,115,22,0.2); }
.badge-priority-medium { background: rgba(245,158,11,0.15); color: var(--priority-medium); border: 1px solid rgba(245,158,11,0.2); }
.badge-priority-low    { background: rgba(16,185,129,0.15); color: var(--priority-low);    border: 1px solid rgba(16,185,129,0.2); }

.badge-time {
  background: rgba(6,182,212,0.1);
  color: var(--cyan-light);
  border: 1px solid rgba(6,182,212,0.15);
}

/* Task actions */
.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.task-card:hover .task-actions { opacity: 1; }

.task-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.task-action-btn:hover { background: var(--bg-glass); color: var(--text-primary); }
.task-action-btn.delete:hover { color: var(--rose); background: rgba(244,63,94,0.1); }
.task-action-btn i { width: 14px; height: 14px; }

/* ─── Task List ─── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ─── Progress Bar ─── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--cyan));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Day panel progress */
.dp-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex: 1;
}

.dp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--cyan));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ─── Stats Cards ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  transition: all var(--trans-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--stat-color, rgba(99,102,241,0.15)), transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-sm);
  background: var(--stat-bg, rgba(99,102,241,0.15));
}

.stat-icon i { width: 20px; height: 20px; color: var(--stat-color, var(--indigo)); }

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Dashboard Layout ─── */
.dashboard-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-lg);
}

.today-tasks-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  backdrop-filter: blur(12px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: var(--space-sm);
}

.today-date-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--indigo-light);
  background: rgba(99,102,241,0.1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99,102,241,0.2);
}

/* ─── Dashboard Right Sidebar ─── */
.dashboard-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Progress Ring Card */
.progress-ring-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  backdrop-filter: blur(12px);
  text-align: center;
}

.progress-ring-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.ring-wrapper {
  position: relative;
  width: 130px; height: 130px;
  margin: 0 auto;
}

.progress-ring {
  width: 130px; height: 130px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ring-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.ring-percent {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--indigo-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ring-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* SVG gradient def */
body::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
}

/* Upcoming card */
.upcoming-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  backdrop-filter: blur(12px);
  flex: 1;
}

.upcoming-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex; align-items: center; gap: var(--space-xs);
}

.upcoming-card h3 i { width: 14px; height: 14px; }

.upcoming-list { display: flex; flex-direction: column; gap: var(--space-xs); }

.upcoming-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  transition: all var(--trans-fast);
  cursor: pointer;
}

.upcoming-item:hover { background: var(--bg-glass-hover); border-color: var(--border-hover); }

.upcoming-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.upcoming-item-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-item-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ─── Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
  text-align: center;
}

.empty-state i { width: 40px; height: 40px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ─── Modals ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: var(--space-lg);
  animation: fadeIn 0.15s ease;
}

.modal {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  animation: slideUp 0.2s ease;
}

.modal-sm { max-width: 360px; }

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

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body { padding: var(--space-lg); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ─── Forms ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--trans-fast);
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  background: rgba(99,102,241,0.05);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group textarea { resize: vertical; min-height: 60px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: var(--space-sm);
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.1);
  border-radius: var(--radius-sm);
  margin-top: -var(--space-sm);
}

.required { color: var(--rose); }

/* Date mode tabs */
.date-mode-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  margin-bottom: var(--space-md);
}

.date-tab {
  flex: 1;
  padding: 7px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--trans-fast);
  text-align: center;
}

.date-tab.active {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

.date-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.date-mode-panel { display: none; }
.date-mode-panel.active { display: block; }

/* ─── Day Detail Panel ─── */
.day-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 300;
}

.day-panel {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  height: 100vh;
  background: #0D1628;
  border-left: 1px solid var(--border);
  z-index: 310;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
  overflow: hidden;
}

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

.day-panel-weekday {
  font-size: 12px;
  font-weight: 600;
  color: var(--indigo-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-panel-date {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.day-panel-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.dp-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.day-panel-tasks {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.day-panel-add-btn {
  margin: var(--space-md) var(--space-lg) var(--space-lg);
  width: calc(100% - var(--space-2xl));
  justify-content: center;
}

/* ─── Toast ─── */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 8500;
}

.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 9000;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 18px;
  background: #1a2235;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast i { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success i { color: var(--emerald); }
.toast.error { border-color: rgba(244,63,94,0.3); }
.toast.error i { color: var(--rose); }
.toast.warning { border-color: rgba(245,158,11,0.3); }
.toast.warning i { color: var(--amber); }
.toast.info { border-color: rgba(99,102,241,0.3); }
.toast.info i { color: var(--indigo-light); }
.toast.exit { animation: toastOut 0.25s ease forwards; }

/* ─── All Tasks View ─── */
.tasks-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.search-box i { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

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

.filter-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--trans-fast);
  backdrop-filter: blur(8px);
}

.filter-select:focus { border-color: var(--border-focus); }

.all-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ─── Settings ─── */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 680px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.settings-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.settings-section-title i { width: 18px; height: 18px; color: var(--indigo-light); }

.settings-sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

.settings-hint {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.1);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.settings-hint a { color: var(--cyan-light); text-decoration: underline; }

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
  backdrop-filter: blur(3px);
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(var(--space-sm), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-sm), env(safe-area-inset-right, 0px));
  background: rgba(10, 15, 30, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: all var(--trans-fast);
  cursor: pointer;
}

.mobile-nav-item i { width: 20px; height: 20px; }

.mobile-nav-item.active {
  color: var(--indigo-light);
}

.mobile-nav-item.active i {
  filter: drop-shadow(0 0 6px rgba(99,102,241,0.6));
}

/* Calendar header */
.calendar-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.calendar-period {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  color: var(--text-primary);
}

/* ─── Cloud Sync Component Styles ─── */
.sync-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(99, 102, 241, 0.25);
}

.sync-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-xs);
}

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.sync-status-badge.synced {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}

.sync-status-badge.syncing {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--sky);
}

.sync-status-badge.error {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.green { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.status-dot.blue  { background: var(--sky); box-shadow: 0 0 6px var(--sky); animation: pulse 1s infinite; }
.status-dot.yellow{ background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.status-dot.red   { background: var(--rose); box-shadow: 0 0 6px var(--rose); }

.sync-box {
  margin-top: var(--space-md);
}

.sync-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sync-input-group input {
  flex: 1;
}

.sync-or-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 0;
  position: relative;
}

.sync-or-divider::before,
.sync-or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.sync-or-divider::before { left: 0; }
.sync-or-divider::after { right: 0; }

.btn-full {
  width: 100%;
  justify-content: center;
}

.connected-info-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--space-md);
}

.connected-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.connected-key-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-key-code {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--sky);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.2);
  letter-spacing: 1px;
  word-break: break-all;
}

.connected-guide {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

.sync-connected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ─── QR Code Modal ─── */
.qr-modal {
  max-width: 360px !important;
  text-align: center;
}

.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.qr-image-wrapper {
  background: #0f172a;
  padding: 12px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 240px;
}

.qr-image-wrapper img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius-md);
}

.text-danger {
  color: var(--rose) !important;
}

/* ─── User Account Styles ─── */
.auth-box {
  margin-top: var(--space-md);
}

.auth-hint-box {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.logged-in-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: var(--space-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.profile-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
  text-transform: uppercase;
  flex-shrink: 0;
}

.profile-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-username {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-badge-pro {
  font-size: 10px;
  font-weight: 600;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 99px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-sync-state {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-connected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
