/* ========================================
   TASKFLOW — Design System
   Based on Stitch Variant 2
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  /* Dark Theme (default) */
  --bg-primary: #0F0F14;
  --bg-secondary: #1A1A24;
  --bg-tertiary: #222233;
  --bg-hover: #2A2A3E;
  --bg-card: #1E1E2E;
  --border: #2A2A3C;
  --border-light: #323248;

  --text-primary: #E8E8F0;
  --text-secondary: #9898B8;
  --text-muted: #5C5C7A;
  --text-inverse: #0F0F14;

  --accent: #6C63FF;
  --accent-hover: #7B74FF;
  --accent-glow: rgba(108, 99, 255, 0.2);
  --accent-subtle: rgba(108, 99, 255, 0.1);

  --success: #4CAF82;
  --warning: #F5A623;
  --danger: #FF5E6E;
  --danger-hover: #FF3D50;

  --priority-low: #4CAF82;
  --priority-medium: #F5A623;
  --priority-high: #FF8C42;
  --priority-urgent: #FF5E6E;

  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 4px 24px rgba(108, 99, 255, 0.3);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #F4F4F8;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EDECF5;
  --bg-hover: #E8E7F3;
  --bg-card: #FFFFFF;
  --border: #E2E1EE;
  --border-light: #D8D7EC;

  --text-primary: #1A1A2E;
  --text-secondary: #5C5C7A;
  --text-muted: #9898B8;
  --text-inverse: #FFFFFF;

  --accent: #6C63FF;
  --accent-hover: #5B53EE;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-subtle: rgba(108, 99, 255, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: var(--transition-slow);
  overflow: hidden;
  height: 100vh;
}

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: 'Inter', sans-serif;
}

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ── App Layout ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: var(--transition-slow);
  z-index: 100;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-inner::-webkit-scrollbar {
  width: 4px;
}

.sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-inner::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #9B8EFF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Navigation */
.sidebar-nav {
  padding: 4px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  position: relative;
}

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

.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.nav-item .material-icons-round {
  font-size: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
  display: none;
}

.nav-badge:not(:empty) {
  display: block;
}

.nav-badge[data-count="0"] {
  display: none !important;
}

/* Sidebar Sections */
.sidebar-section {
  padding: 8px 8px 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 4px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Project List */
.project-list {
  padding: 2px 0;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  position: relative;
}

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

.project-item.active {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

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

.project-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.project-actions {
  display: flex;
  gap: 2px;
  margin-left: 4px;
  flex-shrink: 0;
}

.project-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.project-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.project-action-btn .material-icons-round {
  font-size: 14px;
}

.project-action-btn.delete:hover {
  color: var(--danger);
}

/* Tag List */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 6px 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tag-chip:hover,
.tag-chip.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-chip .remove-tag {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: var(--transition);
  display: none;
}

.tag-chip:hover .remove-tag {
  display: inline-flex;
}

.tag-chip:hover .remove-tag:hover {
  color: var(--danger);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-footer {
  padding: 8px 8px 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-primary);
  position: relative;
}

/* Header */
.main-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
  gap: 16px;
}

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

.header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-count-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.view-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--accent);
  color: white;
}

.view-btn .material-icons-round {
  font-size: 18px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-bar .material-icons-round {
  color: var(--text-muted);
  font-size: 20px;
}

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

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

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content-area::-webkit-scrollbar {
  width: 6px;
}

.content-area::-webkit-scrollbar-track {
  background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

/* Date Header */
.date-header {
  margin-bottom: 20px;
}

.date-header>span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.progress-bar-wrap {
  flex: 1;
  max-width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9B8EFF);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================
   TASK GROUPS & TASKS
   ======================================== */
.task-group {
  margin-bottom: 28px;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.task-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.task-group-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Task Item */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  background: var(--bg-card);
  border-color: var(--border);
  animation: taskFadeIn 0.25s ease;
}

@keyframes taskFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.task-item.completed {
  opacity: 0.5;
}

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

/* Task Checkbox */
.task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: transparent;
  position: relative;
}

.task-check:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.task-check.checked {
  border-color: var(--success);
  background: var(--success);
}

.task-check.checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Priority indicator on checkbox */
.task-check[data-priority="urgent"] {
  border-color: var(--priority-urgent);
}

.task-check[data-priority="high"] {
  border-color: var(--priority-high);
}

.task-check[data-priority="medium"] {
  border-color: var(--priority-medium);
}

.task-check[data-priority="low"] {
  border-color: var(--priority-low);
}

/* 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;
}

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

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

.task-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  opacity: 0.9;
}

.task-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.task-date .material-icons-round {
  font-size: 12px;
}

.task-date.overdue {
  color: var(--danger);
}

.task-date.today {
  color: var(--warning);
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-tag {
  font-size: 11px;
  padding: 1px 7px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* Task Actions */
.task-actions {
  display: none;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.task-item:hover .task-actions {
  display: flex;
}

.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: var(--transition);
}

.task-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.task-action-btn.delete:hover {
  color: var(--danger);
  background: rgba(255, 94, 110, 0.1);
}

.task-action-btn .material-icons-round {
  font-size: 16px;
}

/* Add Task inline */
.add-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}

.add-task-row:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.add-task-row .material-icons-round {
  font-size: 18px;
}

.add-task-row span:last-child {
  font-size: 14px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-icon {
  font-size: 64px !important;
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 280px;
}

/* FAB */
.fab {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #9B8EFF);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  transition: var(--transition);
  z-index: 10;
  border: none;
  cursor: pointer;
}

.fab:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 6px 32px rgba(108, 99, 255, 0.5);
}

.fab .material-icons-round {
  font-size: 28px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BUTTONS & INPUTS
   ======================================== */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

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

.icon-btn .material-icons-round {
  font-size: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), #9B8EFF);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.5);
}

.btn-primary .material-icons-round {
  font-size: 18px;
}

.btn-secondary {
  padding: 9px 18px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Inputs */
.input-field {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.input-title {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 10px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.input-title:focus {
  border-bottom-color: var(--accent);
}

.input-title::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-desc {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  outline: none;
  resize: none;
  transition: var(--transition);
}

.input-desc:focus {
  border-bottom-color: var(--accent);
}

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

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

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

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

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.half {
  flex: 1;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label .material-icons-round {
  font-size: 14px;
}

/* Tag Selector */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-option {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tag-option.selected {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* "Nova etiqueta" button inside task modal */
.tag-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px dashed var(--border-light);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.tag-create-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.tag-create-btn .material-icons-round {
  font-size: 14px;
}

/* Color Picker */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  border: 3px solid transparent;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.selected {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

.color-swatch.selected::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  min-width: 160px;
  padding: 6px;
  animation: contextFadeIn 0.15s ease;
}

@keyframes contextFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
}

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

.context-item.danger:hover {
  background: rgba(255, 94, 110, 0.1);
  color: var(--danger);
}

.context-item .material-icons-round {
  font-size: 16px;
}

.context-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Sidebar toggle for mobile */
.sidebar-toggle {
  display: none;
}

/* Scrollbar for main content */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .app-layout {
    flex-direction: column;
  }

  .main-content {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
  }

  .mobile-overlay.show {
    display: block;
  }
}

/* ========================================
   LOGIN OVERLAY
   ======================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(108, 99, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(155, 142, 255, 0.12) 0%, transparent 55%),
    #0a0a12;
  animation: loginFadeIn 0.4s ease;
}

.login-overlay.hidden {
  animation: loginFadeOut 0.35s ease forwards;
  pointer-events: none;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes loginFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(26, 26, 36, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 44px 40px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: loginCardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-logo-icon {
  font-size: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(108, 99, 255, 0.6));
}

.login-logo-text {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #9B8EFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: var(--transition);
}

.login-field:focus-within {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.login-field-icon {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.login-field input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

.login-field input::placeholder {
  color: var(--text-muted);
}

.login-error {
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  min-height: 18px;
  display: none;
  animation: shake 0.35s ease;
}

.login-error.visible {
  display: block;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #9B8EFF 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
  margin-top: 4px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108, 99, 255, 0.5);
  filter: brightness(1.08);
}

.login-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.login-btn .material-icons-round {
  font-size: 20px;
}

/* Logout button in sidebar */
.logout-btn {
  color: var(--text-muted) !important;
}

.logout-btn:hover {
  background: rgba(255, 94, 110, 0.1) !important;
  color: var(--danger) !important;
}