/* ==========================================================================
   TASK MANAGER REDESIGN - MODERN DARK THEME
   Matching sidebar aesthetic
   ========================================================================== */

:root {
    /* Main Colors - matching login page */
    --bg-primary: #0f0f13;
    --bg-secondary: #1a1a20;
    --bg-tertiary: #24242a;
    --bg-hover: #2b2d31;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-hover: #7c3aed;
    --accent-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    
    /* Border Colors */
    --border-color: #27272a;
    --border-light: #3f3f46;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

.container-task {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  padding: 2rem;
  flex: 1;
  min-width: 0;
  height: 100%;
  /* height: calc(98vh - 60px); */
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: 0;
  margin-left: 0;
}

h1 {
  margin-bottom: 2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 28px;
  font-weight: 700;
}

h1 svg.btn-done {
  width: 32px;
  height: 32px;
}

h1 svg rect,
h1 svg.task-icon line {
  stroke: var(--accent-primary);
}

h1 .btn-done {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ── Sort / Filter toolbar buttons ── */
.h1-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* All 3 action buttons: identical height + padding */
.btn-toolbar,
h1 .btn-done {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.btn-toolbar {
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* SVG inside toolbar btns inherits text color → sort matches filter */
.btn-toolbar svg {
  color: inherit;
  flex-shrink: 0;
}

.btn-toolbar:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.btn-toolbar.active {
  color: #fff;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-toolbar .badge-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 1px 6px;
  font-size: 10px;
}

/* ── Sort / Filter overlay ── */
.sf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sf-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Float box ── */
.sf-float-box {
  position: fixed;
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.06);
  width: 460px;
  max-width: calc(100vw - 32px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sf-float-box.visible {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.sf-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color);
}

.sf-box-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sf-box-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all 0.15s;
}

.sf-box-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.sf-box-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.sf-box-body::-webkit-scrollbar { width: 4px; }
.sf-box-body::-webkit-scrollbar-track { background: transparent; }
.sf-box-body::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.sf-box-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Field label ── */
.sf-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 5px;
  font-family: 'Courier New', monospace;
}

/* ── Shared select/input in sf boxes ── */
.sf-float-box select,
.sf-float-box input[type="text"],
.sf-float-box input[type="date"],
.sf-float-box input[type="time"] {
  width: 100%;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sf-float-box input[type="date"],
.sf-float-box input[type="time"] {
  color-scheme: dark;
  cursor: text;
}

.sf-float-box select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.sf-float-box select:focus,
.sf-float-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.sf-float-box select option { background: var(--bg-tertiary); }

/* ── Add condition btn ── */
.sf-add-condition-btn {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s;
  padding-bottom: 12px;
  margin: 0 20px 0;
  width: calc(100% - 40px);
}

.sf-add-condition-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

/* ── Footer buttons ── */
.sf-btn-apply {
  padding: 9px 20px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sf-btn-apply:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.sf-btn-cancel {
  padding: 9px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.sf-btn-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* ── Sort condition card ── */
.sf-sort-condition {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
  user-select: none;
}

.sf-sort-condition.is-new { animation: sfFadeSlide 0.2s ease both; }
.sf-sort-condition.drag-over { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25); }
.sf-sort-condition.dragging  { opacity: 0.4; transform: scale(0.98); }

@keyframes sfFadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sf-sort-row-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.sf-sort-dir-group { display: flex; gap: 6px; }

.sf-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  cursor: grab;
  color: var(--text-tertiary);
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.sf-drag-handle:hover { color: var(--text-secondary); }
.sf-drag-handle:active { cursor: grabbing; }

.sf-dir-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  color: var(--text-secondary);
  transition: all 0.15s;
}

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

.sf-dir-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.sf-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all 0.15s;
  flex-shrink: 0;
}

.sf-remove-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ── Drop indicator ── */
.sf-drop-indicator {
  height: 2px;
  border-radius: 2px;
  background: var(--accent-primary);
  margin: 2px 0;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
  pointer-events: none;
}

/* ── Filter condition card ── */
.sf-filter-condition {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sf-filter-condition.is-new { animation: sfFadeSlide 0.2s ease both; }

.sf-filter-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.sf-filter-value-area { display: flex; flex-direction: column; gap: 8px; }

.sf-between-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

/* ── Match toggle ── */
.sf-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sf-match-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.sf-match-opt {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  transition: all 0.15s;
}

.sf-match-opt.active {
  background: var(--accent-primary);
  color: #fff;
}

/* ── Priority chips ── */
.sf-chip-group { display: flex; flex-wrap: wrap; gap: 7px; }

.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-hover);
  color: var(--text-tertiary);
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  user-select: none;
}

.sf-chip.high   { border-color: rgba(239, 68, 68, 0.35);  color: #ef4444; }
.sf-chip.medium { border-color: rgba(245, 158, 11, 0.35); color: #f59e0b; }
.sf-chip.low    { border-color: rgba(16, 185, 129, 0.35); color: #10b981; }

.sf-chip.selected.high   { background: rgba(239, 68, 68, 0.18);  border-color: #ef4444; }
.sf-chip.selected.medium { background: rgba(245, 158, 11, 0.18); border-color: #f59e0b; }
.sf-chip.selected.low    { background: rgba(16, 185, 129, 0.18); border-color: #10b981; }

/* ── Empty state in sf boxes ── */
.sf-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.sf-empty-icon { margin-bottom: 10px; opacity: 0.5; }

/* ── Mobile: stack toolbar buttons ── */
@media (max-width: 768px) {
  .h1-actions {
    margin-left: 0;
    width: 100%;
    margin-top: 0.5rem;
    justify-content: flex-start;
  }

  h1 {
    flex-wrap: wrap;
  }
}

h1 .btn-done:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.task-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  justify-content: start;
}

.task {
  min-height: 130px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #1d1d24 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 4px solid;
  padding: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  position: relative;
}

.task::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.task:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.task:hover::before {
  opacity: 1;
}

/* Priority colors - Modern gradient style */
.task.high { 
  border-left-color: #ef4444;
}

.task.medium { 
  border-left-color: #f59e0b;
}

.task.low { 
  border-left-color: #10b981;
}

/* Task Header */
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.task-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.btn-done {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.btn-done:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

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

/* Task Deadline */
.task-deadline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 0.25rem 0;
}

.task-deadline svg {
  flex-shrink: 0;
  opacity: 0.7;
  width: 16px;
  height: 16px;
}

.task-deadline svg rect,
.task-deadline svg line {
  stroke: var(--text-secondary);
}

.task-deadline span {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Task Progress */
.task-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #a78bfa);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 45px;
  text-align: right;
  letter-spacing: 0.5px;
}

/* Task Completed State */
.task.completed {
  opacity: 0.65;
  border-left-color: #6b7280;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.1) 0%, var(--bg-secondary) 100%);
}

.task.completed .task-name {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task.completed .btn-done {
  background: #6b7280;
  cursor: default;
  box-shadow: none;
}

.task.completed .btn-done:hover {
  transform: none;
  box-shadow: none;
}

.task.completed .progress-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.task.completed .progress-bar-fill::after {
  animation: none;
}

.task.completed .progress-percent {
  color: #10b981;
}

/* Task item: progress = 100% → green */
.task-progress.progress-full .progress-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.task-progress.progress-full .progress-bar-fill::after {
  animation: none;
}

.task-progress.progress-full .progress-percent {
  color: #10b981;
}

/* Priority Badges (Optional Enhancement) */
.task::after {
  content: attr(data-priority);
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.task:hover::after {
  opacity: 0.8;
}

/* Hover effect for entire task */
.task {
  cursor: pointer;
}

.task:active {
  transform: translateY(-2px);
}

/* Loading skeleton animation (for future use) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.task.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Empty state */
.task-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.task-list-empty svg {
  width: 100px;
  height: 100px;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.task-list-empty h3 {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 0.5rem;
}

.task-list-empty p {
  color: var(--text-tertiary);
  font-size: 14px;
}
/* =================================================================
   TASK DETAIL OVERLAY
   ================================================================= */
.task-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 299;
}
.task-detail-overlay.active { display: block; }

/* =================================================================
   TASK DETAIL PANEL — CENTERED FLOATING CARD
   ================================================================= */
.task-detail-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: min(700px, calc(100vw - 340px));
    max-height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 300;

    visibility: hidden;
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.2s ease,
                visibility 0s 0.2s;
}

/* Accent rainbow stripe on top */
.task-detail-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #a78bfa 50%, #ec4899 100%);
    border-radius: 16px 16px 0 0;
    z-index: 2;
    pointer-events: none;
}

.task-detail-panel.active {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.2s ease,
                visibility 0s 0s;
}

/* ── Header ── */
.task-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem 0.875rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.task-detail-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.btn-close-detail {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-close-detail:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

/* ── Scrollable Content ── */
.task-detail-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.task-detail-content::-webkit-scrollbar { width: 4px; }
.task-detail-content::-webkit-scrollbar-track { background: transparent; }
.task-detail-content::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* ── Task Name ── */
.detail-task-name-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-task-name {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    outline: none;
    line-height: 1.35;
    letter-spacing: -0.02em;
    font-family: inherit;
}

.detail-task-name::placeholder { color: var(--text-tertiary); }
.detail-task-name:focus { color: var(--accent-primary); }

/* ── Progress Section (compact card) ── */
.tdp-progress-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(167, 139, 250, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.25s, background 0.25s;
}

.tdp-progress-section.is-complete {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.04) 100%);
    border-color: rgba(16, 185, 129, 0.28);
}

.tdp-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tdp-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--accent-primary);
    transition: color 0.25s;
}

.tdp-section-label svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.tdp-progress-section.is-complete .tdp-section-label { color: #10b981; }

.tdp-progress-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    line-height: 1;
    transition: color 0.25s;
    min-width: 40px;
    text-align: right;
}

.tdp-progress-section.is-complete .tdp-progress-value { color: #10b981; }

/* ── Range Slider ── */
.process-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(
        to right,
        #6366f1 var(--slider-fill, 0%),
        rgba(255,255,255,0.08) var(--slider-fill, 0%)
    );
    outline: none;
    cursor: pointer;
    transition: height 0.15s ease, background 0.15s;
    display: block;
}

.process-slider:hover { height: 8px; }

.tdp-progress-section.is-complete .process-slider {
    background: linear-gradient(
        to right,
        #10b981 var(--slider-fill, 100%),
        rgba(255,255,255,0.08) var(--slider-fill, 100%)
    );
}

.process-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.process-slider:hover::-webkit-slider-thumb,
.process-slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 2px 10px rgba(0,0,0,0.5);
}

.tdp-progress-section.is-complete .process-slider::-webkit-slider-thumb {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2), 0 2px 8px rgba(0,0,0,0.4);
}

.process-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transition: transform 0.15s;
}

.process-slider::-moz-range-track {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}

/* ── Properties Card ── */
.tdp-properties {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.detail-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: 46px;
    transition: background 0.12s;
}

.detail-section:last-child { border-bottom: none; }
.detail-section:hover { background: rgba(255,255,255,0.025); }

.detail-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    min-width: 105px;
    flex-shrink: 0;
}

.detail-label svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ── Priority Badge ── */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

.priority-badge.low {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

.priority-badge:hover {
    filter: brightness(1.12);
    transform: scale(1.05);
}

.priority-badge svg {
    width: 8px;
    height: 8px;
}

/* ── Time Spent ── */
.time-spent-display {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.time-value {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ── Notes Section — fills remaining space ── */
.tdp-difficulty-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tdp-difficulty-section .tdp-section-label {
    color: var(--text-tertiary);
}

.tdp-difficulty-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tdp-difficulty-dots .difficulty-dot {
    cursor: pointer;
    transition: transform 0.15s;
}

.tdp-difficulty-dots .difficulty-dot:hover {
    transform: scale(1.2);
}

.tdp-notes-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.tdp-notes-section .tdp-section-label {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.notes-textarea {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 0.5rem 0.625rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.notes-textarea::placeholder { color: var(--text-tertiary); }
.notes-textarea:hover { border-color: var(--border-light); }
.notes-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── Footer ── */
.task-detail-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.btn-delete-task {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-delete-task:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-delete-task svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Mobile: task detail slides up from near top ── */
@media (max-width: 768px) {
    .task-detail-panel {
        top: 8%;
        left: 50%;
        transform: translateX(-50%) translateY(20px) scale(0.98);
        width: 94%;
        max-height: 88vh;
        border-radius: 16px;
    }
    .task-detail-panel.active {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.container-task .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.6;
    height: calc(60vh - 60px);
}

.container-task .task-list:has(.empty-state) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Completed section divider ── */
.task-section-divider {
    margin: 1rem 0 0.5rem;
}

.task-section-divider .divider-line {
    height: 1px;
    background: var(--border-color);
    margin-bottom: 0.5rem;
}

.task-section-divider .divider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.task-section-divider .divider-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn-toggle-completed {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.18s ease;
    line-height: 1;
}

.btn-toggle-completed:hover {
    color: var(--text-secondary);
}

/* ── Completed task list ── */
.task-list-completed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    justify-content: start;
}

/* ── Completed task card ── */
.task--completed {
    opacity: 0.55;
    filter: grayscale(30%);
    cursor: default;
    min-height: auto;
}

.task--completed:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.btn-restore {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.btn-restore:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

/* ── Difficulty rating dots ── */
.task-difficulty {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 2px;
}

.difficulty-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: 2px;
    white-space: nowrap;
}

.difficulty-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.difficulty-dot.active {
    background: var(--accent-primary);
}

/* AI Estimate loading pulse */
@keyframes difficulty-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.tdp-difficulty-dots.is-estimating {
    pointer-events: none;
}

.tdp-difficulty-dots.is-estimating .difficulty-dot {
    animation: difficulty-pulse 0.9s ease-in-out infinite;
}

.tdp-difficulty-dots.is-estimating .difficulty-dot:nth-child(2) { animation-delay: 0.1s; }
.tdp-difficulty-dots.is-estimating .difficulty-dot:nth-child(3) { animation-delay: 0.2s; }
.tdp-difficulty-dots.is-estimating .difficulty-dot:nth-child(4) { animation-delay: 0.3s; }
.tdp-difficulty-dots.is-estimating .difficulty-dot:nth-child(5) { animation-delay: 0.4s; }

/* Date Picker Button in Task Detail */
.date-picker-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-picker-btn:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.date-picker-btn.has-date {
    /* border-color: var(--accent-primary); */
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.date-btn-text.placeholder {
    color: var(--text-tertiary);
}

/* Calendar Overlay */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.calendar-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Calendar Popup */
.calendar-popup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0.75rem;
    min-width: 280px;
    
    /* Animation */
    opacity: 0;
    transform: scale(0.95);
    animation: scaleIn 0.2s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.calendar-nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.calendar-nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.calendar-nav-btn svg {
    width: 14px;
    height: 14px;
}

.calendar-title {
    flex: 1;
    display: flex;
    gap: 0.375rem;
}

.month-select,
.year-select {
    flex: 1;
    padding: 0.375rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.month-select:hover,
.year-select:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.month-select:focus,
.year-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Weekday Headers */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.375rem;
}

.weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 0.375rem 0;
}

/* Calendar Days */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.calendar-day:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
    opacity: 0.4;
}

.calendar-day.today {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
}

.calendar-day.selected:hover {
    background: var(--accent-hover);
}

/* Footer */
.calendar-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.375rem;
}

.calendar-footer button {
    flex: 1;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.btn-today {
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: white;
}

.btn-today:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

.year-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.375rem;
}

.year-step-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

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

.year-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 36px;
    text-align: center;
    user-select: none;
}

.task {
    user-select: none;
}
.task:active {
    cursor: grabbing;
}

.task.sortable-ghost {
    opacity: 0.4;
}

/* ==========================================================================
   MOBILE RESPONSIVE - CONTAINER TASK + TASK DETAIL PANEL
   Thêm vào cuối container_task.css
   ========================================================================== */


   
@media (max-width: 768px) {
    /* --- CONTAINER TASK: chiếm toàn màn hình --- */
    .container-task {
        margin: 0;
        width: 100%;
        height: calc(100vh - 60px);
        padding: 1rem;
    }

    h1 {
        margin-bottom: 1rem;
        font-size: 24px;
        flex-wrap: wrap;
    }

    h1 svg {
        width: 24px;
        height: 24px;
    }

    /* On mobile: actions row wraps below the title */
    .h1-actions {
        margin-left: 0;
        width: 100%;
        flex-wrap: nowrap;      /* keep buttons on one line, scroll if needed */
        overflow-x: auto;
        padding: 10px;
        padding-bottom: 20px;
    }

    /* "New task" stays compact — not full width */
    h1 .btn-done {
        margin-left: auto;      /* push to right end of h1-actions */
        margin-right: 10px;
    }

    /* Task list 1 cột */
    .task-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .task {
        min-height: 110px;
    }

    /* Ẩn due date trên mobile */
    .task .task-deadline {
        display: none;
    }

    /* Task card nhỏ gọn hơn */
    .task {
        min-height: unset;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    /* Task name 1 dòng thôi */
    .task-name {
        -webkit-line-clamp: 1;
        font-size: 14px;
    }

    /* Header: name + nút done sát nhau */
    .task-header {
        gap: 0.5rem;
        align-items: center;
    }

    /* Progress bar mỏng hơn chút */
    .task-progress {
        gap: 0.5rem;
        margin-top: 0;
    }

    .progress-bar-container {
        height: 6px;
    }

    .progress-percent {
        font-size: 12px;
        min-width: 38px;
    }

    /* Nút done nhỏ gọn */
    .task .btn-done {
        padding: 0.3rem 0.625rem;
        font-size: 11px;
    }

    /* --- TASK DETAIL PANEL: handled by the ≤768px block above --- */

    .task-detail-header {
        padding: 0.875rem 1rem;
    }

    .task-detail-content {
        padding: 0.875rem 1rem;
    }

    .notes-textarea {
        min-height: 100px;
    }

    .task-detail-footer {
        padding: 0.75rem 1rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .container-task {
        padding: 0.75rem;
    }

    .task {
        padding: 0.75rem;
    }

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

    h1 {
        font-size: 18px;
    }
}

/* ==========================================================================
   TASK SKELETON LOADING
   ========================================================================== */

@keyframes tsk-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Card-shaped skeleton — matches .task grid cells */
.task-skeleton-item {
    min-height: 130px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #1d1d24 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid #3f3f46;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tsk-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
    animation: tsk-shimmer 1.4s ease-in-out infinite;
}

.tsk-line--title {
    height: 14px;
    width: 70%;
}

.tsk-line--sub {
    height: 12px;
    width: 45%;
}

.tsk-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tsk-badge {
    width: 58px;
    height: 22px;
    border-radius: 12px;
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
    animation: tsk-shimmer 1.4s ease-in-out infinite;
}

.tsk-meta {
    width: 40px;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
    animation: tsk-shimmer 1.4s ease-in-out infinite;
}

/* ==========================================================================
   TASK LOAD ERROR (bottom of list, horizontal row)
   ========================================================================== */

.task-load-error {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--text-secondary);
}

.task-load-error > svg {
    flex-shrink: 0;
    color: #ef4444;
}

.task-load-error-text {
    flex: 1;
    min-width: 0;
}

.task-load-error-text p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.task-load-error-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.task-retry-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.task-retry-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

@media (max-width: 480px) {
    .task-load-error {
        flex-wrap: wrap;
        gap: 8px;
    }

    .task-retry-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================================================
   OVERDUE TASK INDICATOR
   ========================================================================== */

.task--overdue {
    border-left-color: var(--accent-danger) !important;
    box-shadow: var(--shadow-md), -2px 0 8px rgba(239, 68, 68, 0.2);
}

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

.task-deadline.overdue span {
    color: var(--accent-danger);
    font-weight: 600;
}

.task-deadline.overdue svg rect,
.task-deadline.overdue svg line {
    stroke: var(--accent-danger);
}

.overdue-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-danger);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    margin-left: 2px;
}

@media (max-width: 768px) {
    .task--overdue .task-deadline {
        display: flex;
    }

    .task--overdue .task-deadline svg,
    .task--overdue .task-deadline span {
        display: none;
    }

    .task--overdue .task-deadline .overdue-badge {
        display: inline-flex;
    }
}