/* Reset and Global Setup */
:root {
  /* Color System */
  --bg-color: #060913;
  --panel-bg: rgba(13, 20, 38, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent Colors */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.15);

  /* Status Colors (6 States) */
  --color-pending: #f59e0b; /* Amber */
  --color-pending-light: rgba(245, 158, 11, 0.12);
  
  --color-progress: #3b82f6; /* Blue */
  --color-progress-light: rgba(59, 130, 246, 0.12);
  
  --color-nearly-done: #8b5cf6; /* Purple/Violet */
  --color-nearly-done-light: rgba(139, 92, 246, 0.12);
  
  --color-completed: #10b981; /* Emerald */
  --color-completed-light: rgba(16, 185, 129, 0.12);
  
  --color-cancelled: #ef4444; /* Red */
  --color-cancelled-light: rgba(239, 68, 68, 0.12);
  
  --color-wont-do: #64748b; /* Slate Gray */
  --color-wont-do-light: rgba(100, 116, 139, 0.12);

  /* Sticky Note Palettes (Modern paper look) */
  --color-note-yellow: #fef08a;
  --color-note-blue: #bfdbfe;
  --color-note-pink: #fbcfe8;
  --color-note-green: #bbf7d0;
  
  --font-sans: 'Outfit', sans-serif;
  --font-hand: 'Caveat', cursive;
  
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background mesh glows */
.glow-bg {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.glow-purple {
  top: -15%;
  left: -15%;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

.glow-blue {
  bottom: -15%;
  right: -15%;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* App Layout Grid (Sidebar + Content) */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Sidebar Styling */
.sidebar {
  width: 290px;
  background-color: rgba(9, 14, 26, 0.85);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.sidebar-logo h2 {
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--color-primary-light);
  color: #a5b4fc;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.15rem;
}

/* Sidebar Global Progress Widget */
.global-progress-widget {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  padding: 1rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
}

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

.global-percentage-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-primary), #8b5cf6);
  width: 0%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.progress-status-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Sidebar navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-smooth);
}

.nav-btn i {
  font-size: 1.05rem;
  width: 20px;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: white;
}

.nav-btn.active {
  background-color: var(--color-primary-light);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--panel-border);
  padding-top: 1.25rem;
}

.user-profile {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Main Content Area Styling */
.main-content {
  flex: 1;
  padding: 2.5rem 3rem;
  overflow-y: auto;
  height: 100vh;
  height: 100dvh;
}

@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 20, 38, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar-logo {
    margin-bottom: 0;
  }
  .global-progress-widget {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    gap: 0.5rem;
    flex: none;
  }
  .sidebar-footer {
    display: none;
  }
  .main-content {
    height: auto;
    padding: 1.5rem;
    padding-top: 1rem;
  }
}

@media (max-width: 600px) {
  .nav-btn-text {
    display: none;
  }
  .nav-btn {
    padding: 0.75rem;
    justify-content: center;
  }
  .sidebar {
    padding: 0.75rem 1rem;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .sidebar-logo h2 {
    font-size: 1rem;
  }
  .version-badge {
    display: none;
  }
}

/* Top header bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-bar-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn-primary,
.btn-primary-sm,
.btn-danger-sm {
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
  color: white;
  padding: 0.85rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

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

.btn-primary-sm {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
  color: white;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-primary-sm:hover {
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.25);
  color: white;
}

/* Page Views Setup */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: fadeInView 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   PAGE 1: DASHBOARD PAGE
   ========================================================================== */
.dashboard-hero {
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15) 0%, transparent 60%), var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (max-width: 1000px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.dashboard-hero h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.dashboard-hero p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.large-progress-section {
  width: 100%;
}

.large-progress-section .progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.large-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.02);
}

.large-progress-fill {
  height: 100%;
  background: linear-gradient(to right, #6366f1, #3b82f6, #10b981);
  width: 0%;
  border-radius: 6px;
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* Mini Stats Grid inside Hero */
.mini-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (max-width: 1000px) {
  .mini-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mini-stat-card {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.mini-stat-card .stat-num {
  font-size: 1.65rem;
  font-weight: 700;
  color: white;
}

.mini-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* 6-State Breakdown Row */
.states-breakdown {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1200px) {
  .states-breakdown {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .states-breakdown {
    grid-template-columns: repeat(2, 1fr);
  }
}

.breakdown-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.breakdown-card:hover {
  transform: translateY(-2px);
  background-color: rgba(13, 20, 38, 0.8);
}

.breakdown-meta {
  display: flex;
  flex-direction: column;
}

.breakdown-meta .count {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.breakdown-meta .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.breakdown-card .icon {
  font-size: 1.25rem;
  opacity: 0.75;
}

/* Dashboard splits */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 1000px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-all-link {
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Priority Focus List in Dash */
.priority-focus-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.focus-task-item {
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.03);
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.focus-task-item:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}

.focus-task-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 70%;
}

.focus-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-category {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.focus-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.focus-state-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

/* Mini Progress Bar */
.mini-progress-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 70px;
}

.mini-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--color-primary);
  width: 0%;
}

.mini-progress-pct {
  font-size: 0.7rem;
  font-weight: 600;
  width: 26px;
  text-align: right;
  color: var(--text-secondary);
}

/* Category Statistics List */
.category-stats-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0.5rem 0;
}

.cat-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cat-stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cat-stat-name {
  font-weight: 600;
  color: white;
}

.cat-stat-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  overflow: hidden;
}

.cat-stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s ease;
}

/* ==========================================================================
   PAGE 2: STICKY NOTES BOARD VIEW
   ========================================================================== */
.board-page-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .board-page-layout {
    grid-template-columns: 1fr;
  }
}

.form-pane {
  position: sticky;
  top: 90px;
}

/* Creator Card (New Task Form on Board Page) */
.creator-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.creator-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.75rem;
}

#task-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group input[type="text"],
.input-group select,
.input-group input[type="datetime-local"] {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  outline: none;
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition-smooth);
}

.input-group input[type="text"]:focus,
.input-group select:focus,
.input-group input[type="datetime-local"]:focus {
  border-color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.45);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.color-picker-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-picker-container label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.color-options {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.color-radio {
  position: relative;
  cursor: pointer;
}

.color-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-radio span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--note-color);
  border: 2px solid transparent;
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.color-radio input[type="radio"]:checked + span {
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 10px var(--note-color);
}

.sticky-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 0.25rem;
}

/* Sticky notes details styling */
.sticky-note {
  --note-theme: var(--color-note-yellow);
  background-color: var(--note-theme);
  color: #0f172a;
  padding: 1.25rem;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 10px 20px -3px rgba(0,0,0,0.4), 0 4px 8px -2px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 240px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.sticky-note::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f43f5e; /* Red push pin */
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.note-pin {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 6px;
  background-color: #64748b;
}

.sticky-note:hover {
  transform: translateY(-5px) scale(1.02) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.note-tag {
  background: rgba(0, 0, 0, 0.07);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-delete {
  border: none;
  background: none;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.note-delete:hover {
  color: #dc2626;
}

.note-body {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  flex: 1;
  overflow-y: auto;
  word-wrap: break-word;
  padding-bottom: 0.5rem;
  color: #0f172a;
}

/* Mini Progress Bar in Sticky Note */
.note-progress-container {
  margin-bottom: 0.65rem;
}

.note-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.note-progress-fill {
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  width: 0%;
  transition: width 0.4s ease;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  padding-top: 0.65rem;
}

.note-time {
  font-size: 0.65rem;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

.note-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   PAGE 3: TRANSITION TABLE VIEW
   ========================================================================== */
.table-section {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  padding: 0.25rem;
  border-radius: var(--border-radius-md);
  gap: 0.25rem;
  flex-wrap: wrap;
}

.filter-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-tab:hover {
  color: white;
}

.filter-tab.active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.task-table th {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--panel-border);
}

.task-table td {
  padding: 1.15rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.task-table tbody tr {
  transition: var(--transition-smooth);
  cursor: pointer;
}

.task-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Row animations */
.row-entering {
  animation: slideInRow 0.35s ease forwards;
}

.row-leaving {
  animation: slideOutRow 0.25s ease forwards;
}

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

@keyframes slideOutRow {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.97); }
}

/* Title and metadata block */
.td-task-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.td-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.td-time-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pending {
  background: var(--color-pending-light);
  color: var(--color-pending);
}

.badge-progress {
  background: var(--color-progress-light);
  color: var(--color-progress);
}

.badge-nearly_done {
  background: var(--color-nearly-done-light);
  color: var(--color-nearly-done);
}

.badge-completed {
  background: var(--color-completed-light);
  color: var(--color-completed);
  text-decoration: line-through;
  opacity: 0.8;
}

.badge-cancelled {
  background: var(--color-cancelled-light);
  color: #f87171;
  text-decoration: line-through;
}

.badge-wont_do {
  background: var(--color-wont-do-light);
  color: var(--color-wont-do);
  text-decoration: line-through;
}

/* Category Badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
}

/* State selector buttons in row */
.state-selector-row {
  display: flex;
  align-items: center;
}

.table-state-trigger {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.table-state-trigger:focus {
  border-color: var(--color-primary);
}

/* Empty State Card */
.empty-state {
  text-align: center;
  padding: 4.5rem 2rem;
  color: var(--text-secondary);
  display: none;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.85rem;
}

/* ==========================================================================
   MODAL / SLIDE-OVER DETAIL PAGE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 19, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none; /* Controlled by JS */
  justify-content: center;
  align-items: center;
}

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

.modal-container {
  background: rgba(13, 20, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 580px;
  max-width: 95vw;
  max-height: 90vh;
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: slideInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow-y: auto;
}

@keyframes slideInModal {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-primary-light);
  color: #a5b4fc;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.modal-close {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.editable-title {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: white;
  font-size: 1.45rem;
  font-weight: 700;
  padding: 0.25rem 0;
  width: 100%;
  outline: none;
  transition: var(--transition-smooth);
}

.editable-title:focus {
  border-bottom-color: var(--color-primary);
}

.modal-grid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.form-group select,
.form-group input[type="datetime-local"],
.form-group textarea {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  outline: none;
  font-size: 0.9rem;
}

.form-group select:focus,
.form-group input[type="datetime-local"]:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
}

/* Modal slider progress styling */
.progress-section-modal {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--panel-border);
  padding: 1.25rem;
  border-radius: var(--border-radius-md);
}

.progress-info-modal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-info-modal label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-val-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.slider-wrapper {
  margin-bottom: 0.75rem;
}

/* Range input styling overrides */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.modal-progress-bar-container {
  height: 4px;
}

/* Checklist / Subtasks */
.subtasks-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.checklist-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 0.25rem;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  gap: 0.75rem;
}

.subtask-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.subtask-checkbox {
  cursor: pointer;
  accent-color: var(--color-primary);
  width: 14px;
  height: 14px;
}

.subtask-text-input {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  color: white;
  font-size: 0.85rem;
  padding: 0.15rem 0;
  width: 100%;
  outline: none;
  transition: var(--transition-smooth);
}

.subtask-text-input:focus {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

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

.btn-subtask-del {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
}

.btn-subtask-del:hover {
  color: #ef4444;
}

.add-subtask-row {
  display: flex;
  gap: 0.5rem;
}

.add-subtask-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.btn-subtask-add {
  background: var(--color-primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-subtask-add:hover {
  background: var(--color-primary);
  color: white;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 1.75rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 1.25rem;
}

/* ==========================================================================
   PRIORITY COMPONENT MODIFICATIONS
   ========================================================================== */
.priority-btn-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 0.15rem;
  gap: 0.15rem;
  align-items: center;
}

.priority-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sticky-note .priority-btn {
  color: rgba(0, 0, 0, 0.4);
}

.priority-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sticky-note .priority-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.8);
}

.priority-btn.active.btn-prio-low {
  background-color: var(--color-progress-light);
  color: var(--color-progress);
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.sticky-note .priority-btn.active.btn-prio-low {
  background-color: rgba(59, 130, 246, 0.2);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.priority-btn.active.btn-prio-medium {
  background-color: var(--color-pending-light);
  color: var(--color-pending);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.sticky-note .priority-btn.active.btn-prio-medium {
  background-color: rgba(245, 158, 11, 0.25);
  color: #78350f;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.priority-btn.active.btn-prio-high {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.25);
}
.sticky-note .priority-btn.active.btn-prio-high {
  background-color: rgba(239, 68, 68, 0.2);
  color: #7f1d1d;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   TOASTS & NOTIFICATIONS
   ========================================================================== */
.notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(13, 20, 38, 0.95);
  border-left: 4px solid var(--color-primary);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  border-right: 1px solid var(--panel-border);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  min-width: 320px;
  max-width: 400px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-completed {
  border-left-color: var(--color-completed);
}

.toast-reminder {
  border-left-color: var(--color-pending);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.toast-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.toast-close:hover {
  color: white;
}

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

.toast-leaving {
  animation: toastOut 0.35s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* Modal Responsiveness Improvements */
@media (max-width: 550px) {
  .modal-container {
    padding: 1.25rem;
  }
  .modal-grid-fields {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .priority-btn-group {
    width: fit-content;
  }
}

@media (max-width: 400px) {
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }
  .modal-footer button {
    width: 100%;
    justify-content: center;
  }
}

/* iOS Specific & Zoom Prevention Enhancements */
@media (max-width: 900px) {
  .input-group input[type="text"],
  .input-group select,
  .input-group input[type="datetime-local"],
  .form-group select,
  .form-group input[type="datetime-local"],
  .form-group textarea,
  .subtask-text-input,
  .add-subtask-row input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }
  
  .sidebar {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
  }
}
