:root {
  /* WCAG AAA Compliant Colors */
  --primary: #0052cc;
  --secondary: #1a1a1a;
  --success: #0b6623;
  --danger: #9e2104;
  --warning: #7a4700;
  --critical: #7c0a02;
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --text: #1a1a1a;
  --text-light: #404040;
  --border: #d4d4d4;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-secondary: #1e1e1e;
  --text: #ffffff;
  --text-light: #e0e0e0;
  --border: #3a3a3a;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
  color: currentColor;
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

.moon-icon {
  display: block;
}

.sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: block;
  color: white;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger-menu span {
  width: 24px;
  height: 2px;
  background-color: var(--text);
  transition: all 0.3s ease;
  border-radius: 1px;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.nav-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-menu.mobile-visible {
  max-height: 400px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 400px;
  }
}

.nav-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.nav-section:last-child {
  border-bottom: none;
}

.nav-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.nav-item {
  width: 100%;
  padding: 12px 12px;
  margin-bottom: 8px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.3s;
}

.nav-item:hover {
  background-color: var(--border);
}

.nav-item.active {
  background-color: var(--primary);
  color: white;
}

.nav-item .icon {
  font-size: 16px;
}

.project-list,
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.project-item,
.tag-item {
  padding: 8px 12px;
  background-color: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.3s;
}

.project-item:hover,
.tag-item:hover {
  background-color: var(--border);
}

.project-item.active {
  border-left-color: var(--primary);
  background-color: var(--border);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  padding: 24px;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-title {
  font-size: 28px;
  font-weight: 600;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-light);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.filter-bar {
  padding: 16px 24px;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 500;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.views-container {
  flex: 1;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
}

.view.active {
  display: block;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--border);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Mobile/touch device styles */
  button,
  a,
  input[type="checkbox"] {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-item {
    padding: 12px;
    min-height: 44px;
  }

  .task-item {
    padding: 12px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  .btn-sm {
    padding: 10px 12px;
    min-height: 40px;
  }

  .task-checkbox {
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  textarea,
  select {
    padding: 12px;
    font-size: 14px;
  }

  /* Reduce hover effects on touch */
  button:active {
    transform: scale(0.98);
  }

  .task-item:active {
    background-color: var(--bg-secondary);
  }
}

/* Optimizations for devices with low memory or processing power */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode adjustments for better visibility on small screens */
@media (max-width: 480px) and (prefers-color-scheme: dark) {
  .modal-content {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

/* Task List View */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Task sections for active and completed */
.task-section {
  margin-bottom: 24px;
}

.task-section-header {
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
}

.task-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.task-section-header.completed {
  border-left-color: var(--success);
}

.task-section-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.task-item.critical {
  border-left-color: var(--critical);
}

.task-item.high {
  border-left-color: var(--danger);
}

.task-item.medium {
  border-left-color: var(--warning);
}

.task-item.low {
  border-left-color: var(--primary);
}

.task-item.overdue {
  background-color: rgba(231, 76, 60, 0.05);
}

.task-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.task-title {
  font-size: 16px;
  font-weight: 500;
  word-break: break-word;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.task-priority {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.task-priority.Critical {
  background-color: rgba(192, 57, 43, 0.1);
  color: var(--critical);
}

.task-priority.High {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

.task-priority.Medium {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning);
}

.task-priority.Low {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--primary);
}

.task-status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.task-status.Done {
  background-color: rgba(39, 174, 96, 0.1);
  color: var(--success);
}

.task-status.Review {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning);
}

.task-status.In {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--primary);
}

.task-due-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-due-date.overdue {
  color: var(--danger);
  font-weight: 600;
}

.task-due-date.today {
  color: var(--warning);
  font-weight: 600;
}

.task-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.task-tag {
  display: inline-flex;
  padding: 2px 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-light);
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
}

.subtask-item input[type="checkbox"] {
  cursor: pointer;
}

.subtask-text {
  font-size: 13px;
  flex: 1;
}

.subtask-item.done .subtask-text {
  text-decoration: line-through;
  color: var(--text-light);
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  height: 100%;
  overflow-x: auto;
}

.kanban-column {
  background-color: var(--bg-secondary);
  border-radius: 6px;
  padding: 16px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.column-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.card-count {
  background-color: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 12px;
  cursor: grab;
  transition: all 0.3s;
  user-select: none;
}

.kanban-card:active {
  cursor: grabbing;
  opacity: 0.8;
}

.kanban-card:hover {
  box-shadow: var(--shadow);
}

.kanban-card.dragging {
  opacity: 0.5;
}

.kanban-card.critical {
  border-left-color: var(--critical);
}

.kanban-card.high {
  border-left-color: var(--danger);
}

.kanban-card.medium {
  border-left-color: var(--warning);
}

.kanban-card.low {
  border-left-color: var(--primary);
}

/* Calendar View */
.calendar-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.calendar-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.calendar-controls h3 {
  min-width: 150px;
  text-align: center;
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  flex: 1;
}

.calendar-day-header {
  font-weight: 600;
  text-align: center;
  padding: 12px;
  font-size: 12px;
}

.calendar-day {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  min-height: 100px;
  cursor: pointer;
  transition: all 0.3s;
}

.calendar-day:hover {
  box-shadow: var(--shadow);
}

.calendar-day.other-month {
  opacity: 0.4;
}

.calendar-day-number {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 12px;
}

.calendar-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-task {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task.critical {
  background-color: rgba(192, 57, 43, 0.2);
  color: var(--critical);
}

.calendar-task.high {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.calendar-task.medium {
  background-color: rgba(243, 156, 18, 0.2);
  color: var(--warning);
}

.calendar-task.low {
  background-color: rgba(52, 152, 219, 0.2);
  color: var(--primary);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}

/* Timeline View */
.timeline-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-x: auto;
}

.timeline-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background-color: var(--bg);
}

.timeline-label {
  font-weight: 600;
  font-size: 12px;
}

.timeline-dates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
}

.timeline-date {
  font-size: 11px;
  text-align: center;
  padding: 4px;
}

.timeline-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: center;
}

.timeline-task-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
}

.timeline-block {
  background-color: var(--primary);
  height: 24px;
  border-radius: 3px;
  opacity: 0.7;
}

.timeline-block.critical {
  background-color: var(--critical);
}

.timeline-block.high {
  background-color: var(--danger);
}

.timeline-block.medium {
  background-color: var(--warning);
}

/* Analytics View */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  height: 100%;
  overflow-y: auto;
}

.analytics-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.analytics-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-light);
}

.analytics-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.analytics-number.critical {
  color: var(--critical);
}

.analytics-card.full-width {
  grid-column: 1 / -1;
}

.project-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.progress-bar {
  height: 6px;
  background-color: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.3s;
}

.activity-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  font-size: 13px;
}

.activity-time {
  color: var(--text-light);
  font-size: 11px;
  min-width: 60px;
}

/* Next Task View */
.next-task-container {
  max-width: 600px;
  margin: 0 auto;
}

.next-task-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.suggested-reasons {
  background-color: var(--bg-secondary);
  border-radius: 6px;
  padding: 16px;
}

.suggested-reasons h3 {
  font-size: 14px;
  margin-bottom: 12px;
}

.suggested-reasons ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggested-reasons li {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggested-reasons li:before {
  content: "✓";
  color: var(--success);
  font-weight: 600;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--bg);
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s;
}

.modal-close:hover {
  background-color: var(--border);
  color: var(--text);
}

/* Form */
.task-form,
.settings-form {
  padding: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.full {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.subtask-input-row {
  display: flex;
  gap: 8px;
}

.subtask-input-row input {
  flex: 1;
}

.subtask-input-row button {
  padding: 10px 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Settings */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.rule-item {
  background-color: var(--bg-secondary);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rule-delete {
  background-color: var(--danger);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background-color: var(--secondary);
  color: white;
  padding: 16px;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s;
  max-width: 300px;
}

.toast.success {
  background-color: var(--success);
}

.toast.error {
  background-color: var(--danger);
}

.toast.warning {
  background-color: var(--warning);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Workflow and Suggestions Styles */
.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.suggestion-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.suggestion-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.priority-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-critical {
  background-color: var(--critical);
  color: white;
}

.priority-high {
  background-color: var(--danger);
  color: white;
}

.priority-medium {
  background-color: var(--warning);
  color: white;
}

.priority-low {
  background-color: var(--primary);
  color: white;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-style: italic;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.template-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.1);
}

.template-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.template-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-light);
}

.insights-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.insight-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.insight-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.insight-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.motivation {
  text-align: center;
  font-style: italic;
  color: var(--text-light);
  margin: 0;
  padding: 12px;
  background-color: var(--bg);
  border-radius: 6px;
}

/* Responsive Design */

/* Desktop - Large screens (1440px and above) */
@media (min-width: 1440px) {
  .sidebar {
    width: 300px;
  }

  .main-content {
    padding: 24px;
  }

  .kanban-board {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }

  .kanban-column {
    min-height: 600px;
  }

  .modal-content {
    width: 600px;
  }
}

/* Tablet/Medium screens (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .sidebar {
    width: 260px;
  }

  .kanban-board {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .modal-content {
    width: 550px;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

/* Small Desktop/Large Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-container {
    flex-direction: row;
  }

  .sidebar {
    width: 220px;
  }

  .main-content {
    flex: 1;
    padding: 16px;
  }

  .app-header {
    flex-direction: column;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    gap: 8px;
  }

  .kanban-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .kanban-column {
    min-height: 400px;
  }

  .task-item {
    padding: 12px;
    gap: 8px;
  }

  .task-title {
    font-size: 14px;
  }

  .task-meta {
    font-size: 11px;
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    width: 90%;
    max-height: 90vh;
  }

  .nav-section {
    padding: 12px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .calendar-day {
    min-height: 80px;
    font-size: 11px;
    padding: 6px;
  }

  .nav-title {
    font-size: 12px;
  }
}

/* Tablet (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-header {
    padding: 12px;
  }

  .app-title {
    font-size: 20px;
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
  }

  .nav-section {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 12px;
    min-width: 140px;
    flex-shrink: 0;
  }

  .nav-title {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .nav-item {
    padding: 8px 12px;
    font-size: 12px;
  }

  .main-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
  }

  .header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .view-title {
    font-size: 18px;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .search-box {
    width: 100%;
  }

  .search-input {
    padding: 8px 12px;
    font-size: 14px;
  }

  .filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .filter-bar select,
  .filter-bar input {
    padding: 8px 12px;
    font-size: 12px;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kanban-column {
    min-height: 300px;
  }

  .kanban-card {
    padding: 12px;
  }

  .task-list {
    gap: 8px;
  }

  .task-item {
    padding: 12px;
    gap: 8px;
    flex-direction: column;
  }

  .task-content {
    width: 100%;
  }

  .task-title {
    font-size: 13px;
  }

  .task-meta {
    font-size: 11px;
    flex-wrap: wrap;
  }

  .task-priority,
  .task-status,
  .task-due-date {
    padding: 2px 6px;
    font-size: 10px;
  }

  .task-checkbox {
    width: 18px;
    height: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 8px;
    font-size: 12px;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
    margin: auto;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .calendar-day {
    min-height: 60px;
    font-size: 10px;
    padding: 4px;
  }

  .timeline-bar {
    min-width: 2px;
  }

  .insight-value {
    font-size: 20px;
  }

  .insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
  }

  .templates-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }

  .suggestion-card {
    padding: 12px;
    gap: 8px;
  }

  .suggestion-header {
    gap: 6px;
  }

  .suggestion-header h4 {
    font-size: 14px;
  }

  .priority-badge {
    font-size: 10px;
    padding: 2px 8px;
  }
}

/* Mobile (up to 480px) */
@media (max-width: 480px) {
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .app-title {
    font-size: 16px;
  }

  .theme-toggle {
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
  }

  .hamburger-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .hamburger-menu span {
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }

  .nav-menu.hidden {
    display: none;
  }

  .nav-menu.mobile-visible {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    flex-direction: column;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 100;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 0;
  }

  .nav-section {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 8px;
    min-width: 100px;
    flex-shrink: 0;
  }

  .nav-title {
    font-size: 10px;
    margin-bottom: 4px;
    display: none;
  }

  .nav-section:first-child .nav-title {
    display: block;
  }

  .nav-item {
    padding: 6px 8px;
    font-size: 11px;
    flex-direction: column;
    gap: 2px;
  }

  .nav-item .icon {
    font-size: 14px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .nav-item.active span:last-child {
    display: block;
  }

  .main-content {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    margin-bottom: 8px;
  }

  .header-left h2 {
    font-size: 16px;
  }

  .breadcrumb {
    display: none;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    gap: 6px;
  }

  .search-box {
    width: 100%;
  }

  .search-input {
    padding: 8px;
    font-size: 13px;
    width: 100%;
  }

  .search-icon {
    font-size: 16px;
    right: 8px;
  }

  .filter-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .filter-bar select,
  .filter-bar input {
    padding: 8px;
    font-size: 13px;
    width: 100%;
  }

  .task-list {
    gap: 8px;
  }

  .task-section {
    margin-bottom: 16px;
  }

  .task-section-header {
    padding: 10px 12px;
  }

  .task-section-header h3 {
    font-size: 13px;
  }

  .task-item {
    padding: 10px;
    gap: 8px;
    flex-direction: row;
    align-items: flex-start;
  }

  .task-checkbox {
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin-top: 4px;
  }

  .task-content {
    flex: 1;
    min-width: 0;
  }

  .task-title {
    font-size: 13px;
    font-weight: 500;
  }

  .task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 10px;
    margin-top: 4px;
  }

  .task-priority,
  .task-status,
  .task-due-date {
    padding: 2px 6px;
    font-size: 9px;
    border-radius: 3px;
  }

  .task-tags {
    gap: 4px;
    margin-top: 6px;
  }

  .task-tag {
    padding: 2px 6px;
    font-size: 9px;
  }

  .task-actions {
    display: none;
  }

  .task-item:active .task-actions,
  .task-item:focus-within .task-actions {
    display: flex;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 8px;
    font-size: 13px;
    width: 100%;
    border-radius: 4px;
  }

  .form-group textarea {
    min-height: 80px;
  }

  .modal {
    padding: 8px;
  }

  .modal-content {
    width: 100% !important;
    max-height: 90vh;
    border-radius: 8px;
    max-width: 100%;
  }

  .modal-header {
    padding: 12px 16px;
    gap: 8px;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .modal-close {
    font-size: 24px;
    padding: 4px;
  }

  .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 12px;
    flex: 1;
    border-radius: 4px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kanban-column {
    min-height: auto;
    max-height: 300px;
  }

  .kanban-column-title {
    padding: 10px 12px;
    font-size: 12px;
  }

  .kanban-column-content {
    max-height: 250px;
  }

  .kanban-card {
    padding: 10px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .calendar-day {
    min-height: 50px;
    font-size: 9px;
    padding: 2px;
  }

  .calendar-day-header {
    font-size: 10px;
    padding: 4px;
  }

  .calendar-event {
    font-size: 8px;
    padding: 2px;
  }

  .timeline-view {
    font-size: 11px;
  }

  .timeline-date {
    min-width: 40px;
    font-size: 9px;
    padding: 4px 2px;
  }

  .timeline-task-name {
    min-width: 80px;
    font-size: 11px;
    padding: 8px 4px;
  }

  .timeline-bar {
    min-width: 2px;
    height: 20px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .analytics-card {
    padding: 12px;
  }

  .analytics-card h3 {
    font-size: 13px;
  }

  .chart-container {
    max-width: 100%;
  }

  .insight-card {
    padding: 10px;
  }

  .insight-label {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .insight-value {
    font-size: 18px;
  }

  .insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 6px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .template-card {
    padding: 12px;
    gap: 8px;
  }

  .template-card h4 {
    font-size: 13px;
  }

  .template-card p {
    font-size: 12px;
  }

  .suggestion-card {
    padding: 12px;
    gap: 8px;
  }

  .suggestion-header {
    gap: 6px;
    flex-wrap: wrap;
  }

  .suggestion-header h4 {
    font-size: 13px;
    flex: 1;
  }

  .priority-badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  .suggestion-card p {
    font-size: 12px;
    margin: 0;
  }

  .suggestion-card button {
    width: 100%;
  }

  .subtask-item {
    padding: 8px;
    gap: 6px;
  }

  .subtask-text {
    font-size: 12px;
  }

  .task-description {
    font-size: 12px;
    line-height: 1.4;
  }

  /* Scrollbar styling for mobile */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
  }
}

/* Extra small devices (320px - 380px) */
@media (max-width: 380px) {
  .sidebar-header {
    padding: 8px;
  }

  .app-title {
    font-size: 14px;
  }

  .nav-item {
    padding: 4px 6px;
    font-size: 10px;
  }

  .nav-item .icon {
    font-size: 12px;
  }

  .app-header {
    padding: 0;
    margin-bottom: 6px;
  }

  .view-title {
    font-size: 14px;
  }

  .search-input {
    padding: 6px;
    font-size: 12px;
  }

  .filter-bar select,
  .filter-bar input {
    padding: 6px;
    font-size: 12px;
  }

  .task-item {
    padding: 8px;
  }

  .task-title {
    font-size: 12px;
  }

  .task-meta {
    font-size: 9px;
  }

  .modal-content {
    padding: 12px;
  }

  .btn {
    padding: 8px 10px;
    font-size: 11px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 6px;
    font-size: 12px;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    max-height: 80px;
  }

  .main-content {
    max-height: calc(100vh - 80px);
  }

  .app-header {
    margin-bottom: 4px;
  }

  .modal-content {
    max-height: 80vh;
    overflow-y: auto;
  }

  .kanban-column {
    min-height: 300px;
  }

  .calendar-day {
    min-height: 40px;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .app-header,
  .filter-bar,
  .btn,
  .theme-toggle,
  .modal {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  .task-item {
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }
}
