/* ==========================================================================
   TaskFlow — Premium Design System & Stylesheet
   ========================================================================== */

:root {
  /* Color Palette - Dark Luxury (Default) */
  --bg-app: #080c14;
  --bg-surface: rgba(16, 22, 34, 0.75);
  --bg-surface-elevated: rgba(22, 30, 46, 0.85);
  --bg-surface-hover: rgba(30, 41, 62, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d16;

  /* Brand / Accents */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-rgb: 99, 102, 241;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);

  /* Status / Priorities */
  --priority-urgent: #ef4444;
  --priority-urgent-bg: rgba(239, 68, 68, 0.15);
  --priority-high: #f97316;
  --priority-high-bg: rgba(249, 115, 22, 0.15);
  --priority-medium: #38bdf8;
  --priority-medium-bg: rgba(56, 189, 248, 0.15);
  --priority-low: #10b981;
  --priority-low-bg: rgba(16, 185, 129, 0.15);

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Dimensions & Spacing */
  --sidebar-width: 280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-surface-elevated: rgba(255, 255, 255, 0.95);
  --bg-surface-hover: #ffffff;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-strong: rgba(15, 23, 42, 0.16);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

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

/* Ambient Glow Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: opacity var(--transition-normal);
}
.glow-1 {
  top: -10%;
  left: 20%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
}
.glow-2 {
  bottom: 5%;
  right: 5%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 70%);
  opacity: 0.3;
}
[data-theme="light"] .ambient-glow {
  opacity: 0.2;
}

/* Confetti Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Glass Panel Component */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), background var(--transition-normal);
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform var(--transition-normal), background var(--transition-normal);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: block;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-close-btn {
  display: none;
}

/* Productivity Widget */
.productivity-widget {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.widget-percentage {
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.progress-container {
  margin-bottom: 14px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
[data-theme="light"] .progress-bar-bg {
  background: rgba(15, 23, 42, 0.08);
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px var(--accent-glow);
}

.widget-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* Sidebar Nav Lists */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 10px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
}
.nav-item.active .nav-badge {
  background: var(--primary);
  color: #ffffff;
}

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

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.btn-subtle:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-subtle svg {
  width: 15px;
  height: 15px;
}

.footer-extra-links {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.link-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
  padding: 2px;
}
.link-btn:hover {
  color: var(--primary);
}

/* ==========================================================================
   Main Content & Top Navbar
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(8, 12, 20, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}
[data-theme="light"] .top-navbar {
  background: rgba(241, 245, 249, 0.7);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
}

.view-header-info {
  display: flex;
  flex-direction: column;
}

.current-view-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.current-date-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Content Body */
.content-body {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   Add Task Section
   ========================================================================== */

.add-task-card {
  padding: 18px 22px;
  box-shadow: var(--shadow-glow), var(--shadow-md);
  border: 1px solid var(--border-strong);
}

.add-task-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.add-icon-indicator {
  color: var(--primary);
  display: flex;
  align-items: center;
}
.add-icon-indicator svg {
  width: 24px;
  height: 24px;
}

.task-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  padding: 6px 0;
}
.task-input::placeholder {
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.add-task-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.field-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.select-pill, .form-input-date {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.select-pill:focus, .form-input-date:focus {
  border-color: var(--border-focus);
}

/* Star Toggle Pill */
.star-toggle-label {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}
.star-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.star-toggle-pill svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-spring);
}
.star-toggle-label input:checked + .star-toggle-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--color-warning);
}
.star-toggle-label input:checked + .star-toggle-pill svg {
  transform: scale(1.15);
}

/* ==========================================================================
   Toolbar (Search, Sort, Priority Filters)
   ========================================================================== */

.toolbar-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 36px 9px 40px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}
.clear-search-btn svg {
  width: 14px;
  height: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sort-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.sort-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.sort-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 34px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
}
.sort-select:focus {
  border-color: var(--border-focus);
}

.priority-filters {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.filter-pill {
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-pill:hover {
  color: var(--text-primary);
}
.filter-pill.active {
  background: var(--bg-surface-elevated);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Tasks Section & Task Item Cards
   ========================================================================== */

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

.tasks-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.tasks-heading-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tasks-subheading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.active-count-tag {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--border-subtle);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}
.btn-text-danger svg {
  width: 14px;
  height: 14px;
}

/* Task List */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Single Task Item Card */
.task-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  animation: taskSlideIn 0.25s ease-out;
  position: relative;
}

.task-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

@keyframes taskSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item.completed {
  opacity: 0.72;
  background: rgba(16, 22, 34, 0.45);
}
[data-theme="light"] .task-item.completed {
  background: rgba(241, 245, 249, 0.6);
}

/* Custom Checkbox */
.task-checkbox-wrap {
  margin-top: 2px;
  flex-shrink: 0;
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all var(--transition-spring);
  position: relative;
}
.task-checkbox:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}
.task-checkbox:checked {
  background: var(--primary-gradient);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--accent-glow);
}
.task-checkbox:checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

/* Task Content */
.task-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.task-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  transition: all var(--transition-fast);
}
.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-description {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* Priority Badges */
.badge-priority {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.priority-urgent-badge {
  background: var(--priority-urgent-bg);
  color: var(--priority-urgent);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.priority-high-badge {
  background: var(--priority-high-bg);
  color: var(--priority-high);
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.priority-medium-badge {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.priority-low-badge {
  background: var(--priority-low-bg);
  color: var(--priority-low);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Category Badges */
.badge-category {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Due Date Badge */
.badge-due-date {
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.badge-due-date svg {
  width: 12px;
  height: 12px;
}
.badge-due-date.overdue {
  color: var(--color-danger);
  font-weight: 600;
}
.badge-due-date.today {
  color: var(--color-warning);
  font-weight: 600;
}

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

.action-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.action-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}
.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn.star-btn.active {
  color: var(--color-warning);
}
.action-btn.star-btn.active svg {
  fill: currentColor;
}
.action-btn.delete-btn:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 4px;
}
.empty-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 400px;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  place-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.modal-backdrop.show {
  display: grid;
  opacity: 1;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: scale(0.95);
  transition: transform var(--transition-spring);
}
.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.col {
  flex: 1;
}
.form-row {
  display: flex;
  gap: 14px;
}

.flex-center-end {
  display: flex;
  align-items: flex-end;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-control:focus {
  border-color: var(--border-focus);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Keyboard Shortcuts Modal Content */
.shortcuts-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.shortcut-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.kbd {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--primary);
  box-shadow: 0 2px 0 var(--border-strong);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-message {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-undo-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* ==========================================================================
   Utility Color Classes
   ========================================================================== */
.text-amber { color: #f59e0b; }
.text-blue { color: #38bdf8; }
.text-warning { color: #f59e0b; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-muted { color: var(--text-muted); }

/* ==========================================================================
   Mobile Sidebar Backdrop & Responsive Design System
   ========================================================================== */

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Tablet & Smaller Screens Breakpoint */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: transform var(--transition-spring);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.5);
  }
  .mobile-close-btn {
    display: inline-flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .content-body {
    padding: 20px 16px 48px 16px;
    max-width: 100%;
  }
  .top-navbar {
    padding: 14px 20px;
  }
}

/* Mobile Phones (Standard Breakpoint <= 640px) */
@media (max-width: 640px) {
  /* Top Navbar */
  .top-navbar {
    padding: 12px 14px;
  }
  .navbar-left {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .view-header-info {
    min-width: 0;
  }
  .current-view-title {
    font-size: 1.18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .current-date-subtitle {
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navbar-right {
    gap: 6px;
    flex-shrink: 0;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }

  /* Content Body */
  .content-body {
    padding: 14px 12px 48px 12px;
    gap: 16px;
  }

  /* Add Task Section */
  .add-task-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }
  .add-task-top {
    gap: 8px;
  }
  .add-icon-indicator svg {
    width: 20px;
    height: 20px;
  }
  .task-input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 6px 0;
  }
  .btn-primary {
    padding: 8px 14px;
    font-size: 0.84rem;
  }
  .btn-primary .btn-text {
    font-size: 0.82rem;
  }

  .add-task-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }
  .field-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .field-item label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
  }
  .select-pill, .form-input-date {
    width: 100%;
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    min-height: 36px;
  }
  .star-toggle-label {
    grid-column: span 2;
    width: 100%;
  }
  .star-toggle-pill {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    min-height: 36px;
    border-radius: var(--radius-sm);
  }

  /* Toolbar Section */
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-box {
    min-width: 100%;
  }
  .search-input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 10px 36px 10px 38px;
  }
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sort-wrapper {
    width: 100%;
  }
  .sort-select {
    width: 100%;
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 9px 12px 9px 34px;
  }
  .priority-filters {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 3px;
    padding: 4px;
  }
  .priority-filters::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    flex: 1;
    min-width: 56px;
    text-align: center;
    padding: 7px 4px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* Tasks Section */
  .tasks-header-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tasks-subheading {
    font-size: 1.05rem;
  }

  /* Task Item */
  .task-item {
    padding: 12px 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }
  .task-checkbox {
    width: 22px;
    height: 22px;
  }
  .task-title {
    font-size: 0.92rem;
    line-height: 1.35;
  }
  .task-description {
    font-size: 0.8rem;
    margin-top: 2px;
  }
  .task-meta {
    gap: 6px;
    margin-top: 6px;
  }
  .badge-priority, .badge-category, .badge-due-date {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
  .task-actions {
    gap: 2px;
  }
  .action-btn {
    width: 32px;
    height: 32px;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .modal-dialog {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px 16px;
  }
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  .form-control {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    min-height: 42px;
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Toast Notifications */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast-item {
    min-width: unset;
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
  }
}

/* Compact Mobile (<= 440px like iPhone SE) */
@media (max-width: 440px) {
  .current-date-subtitle {
    display: none;
  }
  .add-task-details {
    grid-template-columns: 1fr;
  }
  .star-toggle-label {
    grid-column: span 1;
  }
  .task-item {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 6px;
    align-items: start;
  }
  .task-checkbox-wrap {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 2px;
  }
  .task-content {
    grid-column: 2;
    grid-row: 1;
  }
  .task-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
    margin-top: 4px;
    width: 100%;
  }
}

