/* =============================================================
     NTasks - Design Tokens & Production Stylesheet
     WCAG AA Compliant (Contrast >= 4.5:1) | Responsive Touch Target >= 44px
     Unified 48px Topbar (h-12) | Compact Table (py-2 px-3) | Floating Pill Bar (z-40)
     ============================================================= */

  :root {
    --bg-primary: #f8fafc;        /* Slate-50 background */
    --bg-surface: #ffffff;        /* Crisp white surface */
    --bg-secondary: #f1f5f9;      /* Slate-100 secondary */
    --bg-card: #ffffff;
    --text-primary: #0f172a;       /* Slate-900: 18.5:1 contrast on white */
    --text-secondary: #334155;     /* Slate-700: 8.9:1 contrast on white */
    --text-muted: #64748b;         /* Slate-500: 4.6:1 contrast on white */
    --border-color: #e2e8f0;       /* Slate-200 border */
    --border-hover: #94a3b8;       /* Slate-400 */
    --border-focus: #2563eb;       /* Blue-600 */
    --accent: #2563eb;             /* Blue-600 */
    --accent-hover: #1d4ed8;       /* Blue-700 */
    --accent-subtle: #eff6ff;      /* Blue-50 */
    --danger: #dc2626;             /* Red-600 */
    --success: #059669;            /* Emerald-600 */
    --warning: #d97706;            /* Amber-600 */
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --modal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  }

  .dark {
    --bg-primary: #090d16;        /* Slate-950 deep background */
    --bg-surface: #0f172a;        /* Slate-900 surface */
    --bg-secondary: #1e293b;      /* Slate-800 secondary */
    --bg-card: #0f172a;
    --text-primary: #f8fafc;      /* Slate-50: 16.2:1 contrast on #0f172a */
    --text-secondary: #cbd5e1;    /* Slate-300: 9.8:1 contrast on #0f172a */
    --text-muted: #94a3b8;        /* Slate-400: 6.2:1 contrast on #0f172a */
    --border-color: #1e293b;      /* Dark border */
    --border-hover: #475569;      /* Slate-600 */
    --border-focus: #3b82f6;      /* Blue-500 */
    --accent: #3b82f6;            /* Blue-500 */
    --accent-hover: #60a5fa;      /* Blue-400 */
    --accent-subtle: #172554;     /* Blue-950 */
    --danger: #f87171;            /* Red-400 */
    --success: #34d399;           /* Emerald-400 */
    --warning: #fbbf24;           /* Amber-400 */
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  }

  /* Base Reset & Typography */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.16s ease, color 0.16s ease;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* -------------------------------------------------------------
     Unified 48px Topbar (h-12) & Header Components
     ------------------------------------------------------------- */
  .topbar-compact {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
  }

  .dark .topbar-compact {
    background-color: rgba(15, 23, 42, 0.92);
    border-bottom-color: var(--border-color);
  }

  .btn-icon-compact {
    width: 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
  }

  /* -------------------------------------------------------------
     Highlighted Rich Links (.rich-link)
     ------------------------------------------------------------- */
  .rich-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1px 6px;
    margin: 0 1px;
    border-radius: 6px;
    background-color: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    transition: all 0.15s ease;
  }

  .rich-link:hover {
    color: #1d4ed8;
    background-color: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.4);
    text-decoration: underline;
  }

  .dark .rich-link {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
  }

  .dark .rich-link:hover {
    color: #93c5fd;
    background-color: rgba(96, 165, 250, 0.22);
    border-color: rgba(96, 165, 250, 0.5);
  }

  /* -------------------------------------------------------------
     Markdown Typography & Preview Styles (.markdown-body)
     ------------------------------------------------------------- */
  .markdown-body {
    line-height: 1.6;
    word-break: break-word;
  }
  .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    font-weight: 700;
    line-height: 1.35;
    margin-top: 0.65rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
  }
  .markdown-body h1 { font-size: 1.15rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.25rem; }
  .markdown-body h2 { font-size: 1.05rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.2rem; }
  .markdown-body h3 { font-size: 0.95rem; }
  .markdown-body h4 { font-size: 0.85rem; }
  .markdown-body p { margin-top: 0.25rem; margin-bottom: 0.45rem; }
  .markdown-body ul { list-style-type: disc; padding-left: 1.25rem; margin: 0.35rem 0; }
  .markdown-body ol { list-style-type: decimal; padding-left: 1.25rem; margin: 0.35rem 0; }
  .markdown-body li { margin-bottom: 0.15rem; }
  .markdown-body blockquote {
    border-left: 3px solid var(--accent);
    background-color: var(--accent-subtle);
    padding: 0.35rem 0.75rem;
    margin: 0.45rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
  }
  .markdown-body code, .md-inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    background-color: rgba(148, 163, 184, 0.18);
    color: #e11d48;
  }
  .dark .markdown-body code, .dark .md-inline-code {
    background-color: rgba(148, 163, 184, 0.2);
    color: #fb7185;
  }
  .markdown-body pre {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-size: 0.8em;
  }
  .dark .markdown-body pre {
    background-color: #020617;
    border: 1px solid #1e293b;
  }
  .markdown-body pre code {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
  }
  .markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85em;
  }
  .markdown-body th, .markdown-body td {
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.5rem;
    text-align: left;
  }
  .markdown-body th {
    background-color: var(--bg-secondary);
    font-weight: 600;
  }
  .markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.75rem 0;
  }
  .markdown-body input[type="checkbox"] {
    margin-right: 0.35rem;
    vertical-align: middle;
  }
  .markdown-body del {
    color: var(--text-muted);
    text-decoration: line-through;
  }
  .md-tool-btn {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .md-tool-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
  }
  .dark .md-tool-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  /* -------------------------------------------------------------
     Compact Table List View (.table-compact, py-2 px-3)
     ------------------------------------------------------------- */
  .table-compact th,
  .table-compact td {
    padding-top: 0.5rem;      /* py-2: 8px */
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;    /* px-3: 12px */
    padding-right: 0.75rem;
    vertical-align: middle;
  }

  .table-compact tr {
    transition: background-color 0.12s ease;
  }

  /* -------------------------------------------------------------
     Floating Bottom-Center Pill Bar (z-40) for Bulk Actions
     ------------------------------------------------------------- */
  .floating-bottom-bar {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: modalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  /* -------------------------------------------------------------
     Responsive Touch Targets (>= 44px on Mobile) & Buttons
     ------------------------------------------------------------- */
  .touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.625rem;
    font-weight: 600;
    line-height: 1.25rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    cursor: pointer;
  }

  .btn-action:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
  }

  @media (max-width: 640px) {
    .btn-action,
    .btn-compact {
      min-height: 44px;
      min-width: 44px;
      padding: 0.625rem 0.875rem;
    }
    input, select, textarea {
      font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    }
  }

  @media (min-width: 641px) {
    .btn-action {
      min-height: 36px;
      padding-left: 0.875rem;
      padding-right: 0.875rem;
      font-size: 0.8125rem;
    }
    .btn-compact {
      min-height: 30px;
      height: 30px;
      padding: 0.25rem 0.5rem;
      font-size: 0.75rem;
    }
  }

  /* -------------------------------------------------------------
     Panels & Surfaces
     ------------------------------------------------------------- */
  .panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
  }

  .panel-interactive {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  }

  .panel-interactive:hover {
    border-color: var(--border-hover);
  }

  /* -------------------------------------------------------------
     Semantic Status Badges (WCAG AA Compliant Contrast >= 4.5:1)
     ------------------------------------------------------------- */
  .badge-todo {
    background-color: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
  }
  .dark .badge-todo {
    background-color: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
  }

  .badge-in_progress {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
  }
  .dark .badge-in_progress {
    background-color: #172554;
    color: #93c5fd;
    border-color: #1e3a8a;
  }

  .badge-blocked {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
  }
  .dark .badge-blocked {
    background-color: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
  }

  .badge-review {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
  }
  .dark .badge-review {
    background-color: #451a03;
    color: #fcd34d;
    border-color: #78350f;
  }

  .badge-completed {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
  }
  .dark .badge-completed {
    background-color: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
  }

  .badge-cancelled {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
  }
  .dark .badge-cancelled {
    background-color: #0f172a;
    color: #94a3b8;
    border-color: #334155;
  }

  /* Overdue Alert Badge */
  .badge-overdue {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #f87171;
    font-weight: 700;
  }
  .dark .badge-overdue {
    background-color: #450a0a;
    color: #fca5a5;
    border-color: #ef4444;
  }

  /* -------------------------------------------------------------
     Priority Left Stripes & Pills
     ------------------------------------------------------------- */
  .priority-low { border-left: 3.5px solid #94a3b8; }
  .priority-medium { border-left: 3.5px solid #3b82f6; }
  .priority-high { border-left: 3.5px solid #f59e0b; }
  .priority-urgent { border-left: 3.5px solid #ef4444; }

  .priority-pill-low { background-color: #f1f5f9; color: #475569; }
  .priority-pill-medium { background-color: #eff6ff; color: #1d4ed8; }
  .priority-pill-high { background-color: #fffbeb; color: #b45309; }
  .priority-pill-urgent { background-color: #fef2f2; color: #b91c1c; }

  .dark .priority-pill-low { background-color: #1e293b; color: #94a3b8; }
  .dark .priority-pill-medium { background-color: #172554; color: #93c5fd; }
  .dark .priority-pill-high { background-color: #451a03; color: #fcd34d; }
  .dark .priority-pill-urgent { background-color: #450a0a; color: #fca5a5; }

  /* -------------------------------------------------------------
     Custom Scrollbars (Smooth, High Visibility)
     ------------------------------------------------------------- */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
  .dark ::-webkit-scrollbar-thumb {
    background: #334155;
  }

  /* -------------------------------------------------------------
     Modals & Dialogs
     ------------------------------------------------------------- */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    padding: 1rem;
  }

  @keyframes modalScaleIn {
    0% {
      opacity: 0;
      transform: scale(0.96) translateY(6px);
    }
    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .animate-modal {
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

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

  .animate-fade-in {
    animation: fadeIn 0.15s ease-out forwards;
  }

  /* -------------------------------------------------------------
     Toast Feedback (#toast-root and #toast-container)
     ------------------------------------------------------------- */
  #toast-root,
  #toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
    max-width: 90vw;
  }

  @media (max-width: 640px) {
    #toast-root,
    #toast-container {
      bottom: 1rem;
      left: 1rem;
      right: 1rem;
      max-width: none;
    }
  }

  .toast {
    pointer-events: auto;
    padding: 0.75rem 1.125rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.22), 0 8px 10px -6px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .toast-success { background: #065f46; color: #ecfdf5; border: 1px solid #10b981; }
  .toast-error { background: #991b1b; color: #fef2f2; border: 1px solid #ef4444; }
  .toast-info { background: #1e40af; color: #eff6ff; border: 1px solid #3b82f6; }
  .toast-warning { background: #92400e; color: #fffbeb; border: 1px solid #f59e0b; }

  /* -------------------------------------------------------------
     Calendar View Components
     ------------------------------------------------------------- */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-day-cell {
    min-height: 100px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transition: background-color 0.12s ease;
  }

  @media (max-width: 640px) {
    .calendar-day-cell {
      min-height: 64px;
    }
  }

  .calendar-day-cell:hover {
    background-color: rgba(59, 130, 246, 0.05);
  }

  .calendar-day-other {
    opacity: 0.42;
    background-color: rgba(148, 163, 184, 0.04);
  }

  .calendar-day-today {
    background-color: rgba(59, 130, 246, 0.08);
  }

  .calendar-event-pill {
    font-size: 0.6875rem;
    line-height: 0.875rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.1s ease;
  }

  .calendar-event-pill:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
  }

  /* -------------------------------------------------------------
     Gantt View Components
     ------------------------------------------------------------- */
  .gantt-chart-bar {
    height: 24px;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: filter 0.15s ease;
  }

  .gantt-chart-bar:hover {
    filter: brightness(1.08);
  }

  .gantt-progress-fill {
    height: 100%;
    border-radius: 6px 0 0 6px;
    background: rgba(255, 255, 255, 0.28);
  }

  /* Focus Ring Utility */
  .input-ring {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .input-ring:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }

  /* -------------------------------------------------------------
     Vertex42 Project Schedule Gantt Components
     ------------------------------------------------------------- */
  .gantt-schedule-scroll {
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .gantt-schedule-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    line-height: 1rem;
    width: max-content;
  }

  .gantt-schedule-table th,
  .gantt-schedule-table td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    vertical-align: middle;
  }

  .gantt-sticky-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: var(--bg-surface);
  }

  .gantt-cell-day {
    width: 26px;
    min-width: 26px;
    max-width: 26px;
    text-align: center;
  }

  .gantt-weekend {
    background-color: rgba(148, 163, 184, 0.08);
  }
  .dark .gantt-weekend {
    background-color: rgba(30, 41, 59, 0.35);
  }

  .gantt-today-col {
    background-color: rgba(59, 130, 246, 0.12);
  }

  .gantt-cat-row {
    background-color: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
  }
  .dark .gantt-cat-row {
    background-color: #1e293b;
    color: #f8fafc;
  }

  .gantt-date-cell {
    background-color: rgba(16, 185, 129, 0.08);
    color: #065f46;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    text-align: center;
    white-space: nowrap;
  }
  .dark .gantt-date-cell {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
  }

  .gantt-pct-cell {
    background-color: rgba(241, 245, 249, 0.6);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    text-align: center;
    font-weight: 600;
  }
  .dark .gantt-pct-cell {
    background-color: rgba(30, 41, 59, 0.5);
    color: #e2e8f0;
  }

  .gantt-dual-bar {
    position: absolute;
    top: 5px;
    height: 22px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.18);
    transition: transform 0.1s ease, filter 0.15s ease;
    cursor: pointer;
    z-index: 10;
  }

  .gantt-dual-bar:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    z-index: 15;
  }

  .gantt-bar-done {
    background-color: #52525b; /* Dark zinc / charcoal */
    height: 100%;
    flex-shrink: 0;
  }
  .dark .gantt-bar-done {
    background-color: #71717a;
  }

  .gantt-bar-remaining {
    background-color: #0284c7; /* Classic Blue */
    height: 100%;
    flex-grow: 1;
  }
  .dark .gantt-bar-remaining {
    background-color: #0ea5e9;
  }

  /* Gantt Priority Dual Bars */
  .gantt-dual-bar.gantt-bar-urgent .gantt-bar-remaining {
    background-color: #ef4444; /* Red 500 */
  }
  .dark .gantt-dual-bar.gantt-bar-urgent .gantt-bar-remaining {
    background-color: #f87171;
  }
  .gantt-dual-bar.gantt-bar-urgent .gantt-bar-done {
    background-color: #991b1b; /* Red 800 */
  }
  .dark .gantt-dual-bar.gantt-bar-urgent .gantt-bar-done {
    background-color: #7f1d1d;
  }

  .gantt-dual-bar.gantt-bar-high .gantt-bar-remaining {
    background-color: #f59e0b; /* Amber 500 */
  }
  .dark .gantt-dual-bar.gantt-bar-high .gantt-bar-remaining {
    background-color: #fbbf24;
  }
  .gantt-dual-bar.gantt-bar-high .gantt-bar-done {
    background-color: #92400e; /* Amber 800 */
  }
  .dark .gantt-dual-bar.gantt-bar-high .gantt-bar-done {
    background-color: #78350f;
  }

  .gantt-dual-bar.gantt-bar-medium .gantt-bar-remaining {
    background-color: #3b82f6; /* Blue 500 */
  }
  .dark .gantt-dual-bar.gantt-bar-medium .gantt-bar-remaining {
    background-color: #60a5fa;
  }
  .gantt-dual-bar.gantt-bar-medium .gantt-bar-done {
    background-color: #1e40af; /* Blue 800 */
  }
  .dark .gantt-dual-bar.gantt-bar-medium .gantt-bar-done {
    background-color: #1e3a8a;
  }

  .gantt-dual-bar.gantt-bar-low .gantt-bar-remaining {
    background-color: #64748b; /* Slate 500 */
  }
  .dark .gantt-dual-bar.gantt-bar-low .gantt-bar-remaining {
    background-color: #94a3b8;
  }
  .gantt-dual-bar.gantt-bar-low .gantt-bar-done {
    background-color: #334155; /* Slate 700 */
  }
  .dark .gantt-dual-bar.gantt-bar-low .gantt-bar-done {
    background-color: #1e293b;
  }

  /* Kanban Drag-and-Drop & Status UI */
  .kanban-col {
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .kanban-col.drag-over {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), inset 0 0 12px rgba(59, 130, 246, 0.1);
  }
  .kanban-card {
    cursor: grab;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
  }
  .kanban-card:active {
    cursor: grabbing;
  }
  .kanban-card.is-dragging {
    opacity: 0.38 !important;
    transform: scale(0.97);
    border-style: dashed !important;
    border-color: #3b82f6 !important;
  }

  /* Smooth view & filter transitions */
  .view-container-animated {
    animation: viewFadeSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes viewFadeSlide {
    0% {
      opacity: 0.15;
      transform: translateY(4px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Segmented Controls (iOS / Modern Dashboard style) */
  .segment-pill-group {
    background-color: #f1f5f9;
    padding: 2.5px;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    gap: 2px;
    user-select: none;
  }
  .dark .segment-pill-group {
    background-color: #1e293b;
    border-color: #334155;
  }
  .segment-btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
    border: none;
    background: transparent;
    white-space: nowrap;
  }
  .dark .segment-btn {
    color: #94a3b8;
  }
  .segment-btn:hover {
    color: #0f172a;
  }
  .dark .segment-btn:hover {
    color: #f8fafc;
  }
  .segment-btn:active {
    transform: scale(0.97);
  }
  .segment-btn.active {
    background-color: #ffffff;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  }
  .dark .segment-btn.active {
    background-color: #334155;
    color: #60a5fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  /* -------------------------------------------------------------
     Rich Text Links (Contrast & Minimal Theme Adaptive)
     ------------------------------------------------------------- */
  .rich-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    margin: 0 0.125rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    color: #2563eb;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    transition: all 0.15s ease;
    word-break: break-all;
    vertical-align: baseline;
  }
  .rich-link:hover {
    color: #1d4ed8;
    background-color: #dbeafe;
    border-color: #93c5fd;
    text-decoration: underline;
  }
  .dark .rich-link {
    color: #60a5fa;
    background-color: rgba(30, 58, 138, 0.25);
    border-color: rgba(59, 130, 246, 0.3);
  }
  .dark .rich-link:hover {
    color: #93c5fd;
    background-color: rgba(30, 58, 138, 0.4);
    border-color: rgba(96, 165, 250, 0.5);
    text-decoration: underline;
  }
  .rich-link svg {
    color: currentColor;
    flex-shrink: 0;
  }

  /* -------------------------------------------------------------
     Priority Prominence & Visual Hierarchy
     ------------------------------------------------------------- */
  .priority-urgent-card {
    border-left: 4px solid #ef4444 !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.06), transparent) !important;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.12) !important;
  }
  .dark .priority-urgent-card {
    border-left: 4px solid #f87171 !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.14), transparent) !important;
    box-shadow: 0 1px 6px rgba(239, 68, 68, 0.25) !important;
  }
  .priority-high-card {
    border-left: 4px solid #f97316 !important;
    background: linear-gradient(to right, rgba(249, 115, 22, 0.04), transparent) !important;
  }
  .dark .priority-high-card {
    border-left: 4px solid #fb923c !important;
    background: linear-gradient(to right, rgba(249, 115, 22, 0.10), transparent) !important;
  }
  .priority-medium-card {
    border-left: 4px solid #3b82f6 !important;
  }
  .dark .priority-medium-card {
    border-left: 4px solid #60a5fa !important;
  }
  .priority-low-card {
    border-left: 4px solid #94a3b8 !important;
  }
  .dark .priority-low-card {
    border-left: 4px solid #64748b !important;
  }

  /* Priority Badges */
  .badge-priority-urgent {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 700;
  }
  .dark .badge-priority-urgent {
    background-color: rgba(153, 27, 27, 0.4);
    color: #fca5a5;
    border-color: #ef4444;
  }
  .badge-priority-high {
    background-color: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
    font-weight: 600;
  }
  .dark .badge-priority-high {
    background-color: rgba(154, 52, 18, 0.35);
    color: #fed7aa;
    border-color: #f97316;
  }
  .badge-priority-medium {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 500;
  }
  .dark .badge-priority-medium {
    background-color: rgba(30, 58, 138, 0.3);
    color: #93c5fd;
    border-color: #3b82f6;
  }
  .badge-priority-low {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 500;
  }
  .dark .badge-priority-low {
    background-color: #1e293b;
    color: #94a3b8;
    border-color: #334155;
  }

  /* -------------------------------------------------------------
     Overdue Alert Pulse Animation & Highlights
     ------------------------------------------------------------- */
  @keyframes overduePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
  }
  .badge-overdue-alert {
    animation: overduePulse 2.2s infinite ease-in-out;
  }
  .task-overdue-card {
    border-color: #f87171 !important;
    background-color: rgba(254, 242, 242, 0.5) !important;
  }
  .dark .task-overdue-card {
    border-color: #b91c1c !important;
    background-color: rgba(127, 29, 29, 0.18) !important;
  }

  /* -------------------------------------------------------------
     Long Text Handling & Reader Mode
     ------------------------------------------------------------- */
  .text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .text-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .text-clamp-none {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  .custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
  }
  .dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
  .dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
  }

  /* Fullscreen Distraction-Free Reader Mode */
  .reader-mode-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #ffffff;
    padding: 2rem;
    overflow-y: auto;
  }
  .dark .reader-mode-fullscreen {
    background-color: #090d16;
    color: #f8fafc;
  }
  .reader-content-prose {
    max-width: 54rem;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.85;
    letter-spacing: -0.01em;
  }
  .reader-content-prose p {
    margin-bottom: 1.25rem;
  }
  .reader-content-prose h1, .reader-content-prose h2, .reader-content-prose h3 {
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
  }
  .dark .reader-content-prose h1, .dark .reader-content-prose h2, .dark .reader-content-prose h3 {
    color: #f1f5f9;
  }

  /* -------------------------------------------------------------
     Workspace Vault & TimeTable Schedule Card Styles
     ------------------------------------------------------------- */
  .vault-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .vault-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .dark .vault-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  }

  .schedule-timeline-hour {
    position: relative;
    border-top: 1px dashed var(--border-color);
  }
  .schedule-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
  }
  .dark .schedule-time-badge {
    background-color: rgba(30, 58, 138, 0.35);
    color: #93c5fd;
    border-color: #3b82f6;
  }

  /* -------------------------------------------------------------
     Mobile Bottom Navigation Bar (< 640px)
     ------------------------------------------------------------- */
  .mobile-bottom-nav {
    display: none;
  }

  @media (max-width: 640px) {
    .mobile-bottom-nav {
      display: flex;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 56px;
      background-color: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-top: 1px solid var(--border-color);
      z-index: 50;
      padding-bottom: env(safe-area-inset-bottom);
      box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    }

    .dark .mobile-bottom-nav {
      background-color: rgba(15, 23, 42, 0.95);
      border-top-color: var(--border-color);
      box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    }

    .mobile-nav-btn {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      color: var(--text-muted);
      font-size: 10px;
      font-weight: 600;
      transition: all 0.15s ease;
      cursor: pointer;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      padding: 4px 0;
    }

    .mobile-nav-btn.active {
      color: var(--accent);
    }

    .mobile-nav-btn:active {
      transform: scale(0.94);
    }

    /* Đảm bảo nội dung trang không bị che khuất bởi Bottom Bar */
    main {
      padding-bottom: 5rem !important;
    }
  }

  /* -------------------------------------------------------------
     Quick Approve 1-Click Action Buttons (Đơn sắc - Monochrome)
     ------------------------------------------------------------- */
  .quick-approve-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .btn-quick-approve {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background-color: #0f172a;
    color: #ffffff;
    border: 1px solid #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    cursor: pointer;
  }

  .dark .btn-quick-approve {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
  }

  .btn-quick-approve:hover {
    opacity: 0.85;
    transform: translateY(-1px);
  }

  .btn-quick-reject {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    background-color: transparent;
    color: #475569;
    border: 1px solid #cbd5e1;
    transition: all 0.15s ease;
    cursor: pointer;
  }

  .dark .btn-quick-reject {
    color: #94a3b8;
    border-color: #334155;
  }

  .btn-quick-reject:hover {
    background-color: #f1f5f9;
  }

  .dark .btn-quick-reject:hover {
    background-color: #1e293b;
  }

  /* -------------------------------------------------------------
     Rich Result Product Link Badges (Đơn sắc - Monochrome)
     ------------------------------------------------------------- */
  .rich-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    background-color: transparent;
    color: #334155;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    transition: all 0.15s ease;
  }

  .dark .rich-product-badge {
    color: #cbd5e1;
    border-color: #334155;
  }

  .rich-product-badge:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
  }

  .dark .rich-product-badge:hover {
    background-color: #1e293b;
    border-color: #64748b;
  }

  /* -------------------------------------------------------------
     Rich Link Preview Cards (.rich-link-card)
     ------------------------------------------------------------- */
  .rich-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(203, 213, 225, 0.8);
    background-color: #ffffff;
    text-decoration: none;
    transition: all 0.15s ease;
    margin: 0.375rem 0;
  }

  .dark .rich-link-card {
    border-color: rgba(51, 65, 85, 0.8);
    background-color: rgba(15, 23, 42, 0.6);
  }

  .rich-link-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
  }

  .dark .rich-link-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 4px 12px -2px rgba(96, 165, 250, 0.16);
  }

  .rich-link-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background-color: #f1f5f9;
    color: #475569;
    flex-shrink: 0;
  }

  .dark .rich-link-icon-box {
    background-color: #1e293b;
    color: #94a3b8;
  }

  .rich-link-meta {
    flex: 1;
    min-width: 0;
  }

  .rich-link-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dark .rich-link-title {
    color: #f8fafc;
  }

  .rich-link-domain {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 0.125rem;
  }

  .dark .rich-link-domain {
    color: #94a3b8;
  }

  .rich-link-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background-color: #e2e8f0;
    color: #334155;
  }

  .dark .rich-link-badge {
    background-color: #334155;
    color: #cbd5e1;
  }

  .rich-link-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: #64748b;
    transition: all 0.12s ease;
    flex-shrink: 0;
  }

  .rich-link-card:hover .rich-link-open-btn {
    color: #2563eb;
    background-color: #eff6ff;
  }

  .dark .rich-link-card:hover .rich-link-open-btn {
    color: #60a5fa;
    background-color: rgba(30, 58, 138, 0.3);
  }

  /* -------------------------------------------------------------
     Today Focus Filter Pill & Streak Gamification Badge
     ------------------------------------------------------------- */
  .today-focus-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
  }

  .today-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    background-color: #ef4444;
    color: #ffffff;
    line-height: 1;
  }

  .streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    user-select: none;
    transition: all 0.15s ease;
  }

  .dark .streak-badge {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
  }

  /* -------------------------------------------------------------
     WCAG AA Accessible Focus Visible Rings
     ------------------------------------------------------------- */
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
  }

  .dark button:focus-visible,
  .dark a:focus-visible,
  .dark input:focus-visible,
  .dark select:focus-visible,
  .dark textarea:focus-visible {
    outline-color: #60a5fa;
  }

  /* -------------------------------------------------------------
     Sub-task Checklist Component (100% Monochrome & Responsive)
     ------------------------------------------------------------- */
  .task-checklist-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
  }

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

  .checklist-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  .checklist-title-icon {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
  }

  .checklist-count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--bg-tertiary, #e2e8f0);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
  }

  .dark .checklist-count-badge {
    background-color: #334155;
    color: #cbd5e1;
    border-color: #475569;
  }

  .checklist-progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.875rem;
  }

  .dark .checklist-progress-bar-bg {
    background-color: #334155;
  }

  .checklist-progress-bar-fill {
    height: 100%;
    background-color: #2563eb;
    border-radius: 9999px;
    transition: width 0.25s ease-in-out;
  }

  .dark .checklist-progress-bar-fill {
    background-color: #3b82f6;
  }

  .checklist-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }

  .checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
  }

  .checklist-item:hover {
    border-color: #94a3b8;
  }

  .dark .checklist-item:hover {
    border-color: #64748b;
  }

  .checklist-item.is-completed {
    background-color: rgba(0, 0, 0, 0.02);
    opacity: 0.75;
  }

  .dark .checklist-item.is-completed {
    background-color: rgba(255, 255, 255, 0.02);
  }

  .checklist-item-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
  }

  .checklist-checkbox-custom {
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    border-radius: 0.25rem;
    border: 1.5px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: transparent;
  }

  .checklist-item.is-completed .checklist-checkbox-custom {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
  }

  .checklist-checkbox-custom svg {
    display: none;
    width: 0.75rem;
    height: 0.75rem;
    stroke: currentColor;
    stroke-width: 3;
    fill: none;
  }

  .checklist-item.is-completed .checklist-checkbox-custom svg {
    display: block;
  }

  .checklist-item-title {
    font-size: 0.84375rem;
    color: var(--text-primary);
    word-break: break-word;
    user-select: none;
    transition: all 0.15s ease;
  }

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

  .checklist-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .checklist-btn-del {
    background: transparent;
    border: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .checklist-btn-del:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
  }

  .checklist-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
  }

  .checklist-add-input {
    flex: 1;
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
  }

  .checklist-add-input:focus {
    border-color: #2563eb;
    outline: none;
  }

  .checklist-add-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
  }

  .checklist-add-btn:hover {
    background-color: var(--bg-secondary);
    border-color: #94a3b8;
  }

  /* Badge checklist trên Task Card & Table Row */
  .checklist-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 1.2;
  }

  .checklist-badge.is-all-done {
    border-color: #10b981;
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.08);
  }

  .dark .checklist-badge.is-all-done {
    border-color: #059669;
    color: #34d399;
    background-color: rgba(5, 150, 105, 0.15);
  }

  .checklist-badge svg {
    width: 0.75rem;
    height: 0.75rem;
    stroke: currentColor;
    fill: none;
  }

  /* =============================================================
     SUPERCHARGED DESIGN TOKENS - SPRINT 7 FRONTEND SQUAD
     ============================================================= */

  /* Ambient Mesh Glow for Landing / Hero Section */
  .hero-glow-container {
    position: relative;
    overflow: hidden;
  }

  .hero-glow-container::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
  }

  .dark .hero-glow-container::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
  }

  /* KPI Summary Stats Cards */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  @media (min-width: 768px) {
    .kpi-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  .kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  }

  .kpi-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .kpi-card-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
  }

  /* Ultra-slim Custom Scrollbar */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 9999px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
  }

  .dark ::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
  }

  .dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.8);
  }

  /* Toast Notification Advanced Styling */
  .toast-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

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

  .toast-item.toast-leave {
    animation: toastSlideOut 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes toastSlideOut {
    to {
      opacity: 0;
      transform: translateY(12px) scale(0.95);
    }
  }

  .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--accent);
    width: 100%;
    animation: toastProgress 3.5s linear forwards;
  }

  @keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
  }

  /* Feature Showcase Badge */
  .feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .feature-pill svg {
    width: 0.875rem;
    height: 0.875rem;
    stroke: currentColor;
  }

  /* Floating Filter Bar */
  .floating-filter-bar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-shadow: var(--card-shadow);
  }

  .dark .floating-filter-bar {
    background-color: rgba(15, 23, 42, 0.85);
  }

  /* =============================================================
     Visual Depth & Innovation Tokens (Refined Elevation & Glassmorphism)
     ============================================================= */
  .depth-card {
    position: relative;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  }

  .depth-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 16px 24px -4px rgba(0, 0, 0, 0.05);
    border-color: var(--border-hover);
  }

  .dark .depth-card {
    background-color: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  }

  .dark .depth-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  }

  /* Glassmorphism Panel with Inset Border Highlight */
  .glass-panel {
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  }

  .dark .glass-panel {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  }

  /* Review Badge Statuses */
  .review-badge-waiting {
    background-color: rgba(241, 245, 249, 0.8);
    color: #475569;
    border: 1px solid #cbd5e1;
  }

  .dark .review-badge-waiting {
    background-color: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
  }

  .review-badge-review {
    background-color: rgba(239, 246, 255, 0.8);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
  }

  .dark .review-badge-review {
    background-color: rgba(23, 37, 84, 0.6);
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.2);
  }

  .review-badge-done {
    background-color: rgba(236, 253, 245, 0.8);
    color: #047857;
    border: 1px solid #a7f3d0;
  }

  .dark .review-badge-done {
    background-color: rgba(6, 78, 59, 0.6);
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.2);
  }