<style>
        :root{
            --bg0:#070b14;
            --bg1:#0b1224;
            --glass: rgba(255,255,255,.08);
            --glass2: rgba(255,255,255,.06);
            --border: rgba(255,255,255,.10);
            --text:#e8eefc;
            --muted:#aeb8d6;
            --accent:#2aa9ff;
            --accent2:#f59e0b;
            --danger:#ef4444;
            --success:#22c55e;
        }

        body{
            min-height:100vh;
            background:
                radial-gradient(1200px 600px at 50% 20%, rgba(42,169,255,.22), transparent 60%),
                radial-gradient(900px 500px at 80% 90%, rgba(245,158,11,.12), transparent 55%),
                linear-gradient(180deg, var(--bg0), var(--bg1));
            color: var(--text);
        }

        .app-shell{ display:flex; min-height:100vh; }

        /* Sidebar */
        .sidebar{
            width: 270px;
            padding: 18px 14px;
            border-right: 1px solid var(--border);
            background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
            backdrop-filter: blur(10px);
        }
        .brand{
            display:flex; align-items:center; gap:10px;
            font-weight:700; letter-spacing:.3px;
            padding: 10px 10px 16px;
        }
        .brand .logo{
            width:34px; height:34px; border-radius:10px;
            background: radial-gradient(circle at 30% 30%, rgba(42,169,255,.9), rgba(42,169,255,.15));
            border:1px solid var(--border);
            display:flex; align-items:center; justify-content:center;
        }
        .nav-link{
            color: var(--muted);
            border-radius: 12px;
            padding: 10px 12px;
        }
        .nav-link:hover{ color: var(--text); background: rgba(255,255,255,.06); }
        .nav-link.active{ color: var(--text); background: rgba(42,169,255,.12); border: 1px solid rgba(42,169,255,.25); }

        .subnav{
            margin-left: 10px;
            border-left: 1px solid rgba(255,255,255,.08);
            padding-left: 10px;
        }

        /* Main area */
        .main{
            flex:1;
            padding: 18px 18px 28px;
        }

        /* Topbar */
        .topbar{
            display:flex; align-items:center; gap:12px;
            padding: 12px 12px;
            border: 1px solid var(--border);
            background: rgba(255,255,255,.06);
            border-radius: 16px;
            backdrop-filter: blur(12px);
        }
        .topbar .search{
            flex:1;
        }
        .input-glass{
            background: rgba(255,255,255,.06) !important;
            border: 1px solid rgba(255,255,255,.10) !important;
            color: var(--text) !important;
        }
        .input-glass::placeholder{ color: rgba(232,238,252,.55); }

/* ------------------------------------------------------------ */
/* Modals (match page glass/dark theme)                          */
/* ------------------------------------------------------------ */
.ns-modal .modal-content{
    background: rgba(12,18,34,.98);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    color: var(--text);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 70px rgba(0,0,0,.55);
}
.ns-modal .modal-header,
.ns-modal .modal-footer{
    border-color: rgba(255,255,255,.10) !important;
    background: rgba(255,255,255,.02);
}
.ns-modal .modal-body{
    background: rgba(255,255,255,.01);
}
.ns-modal .modal-title{ color: rgba(232,238,252,.95); }
.ns-modal .form-label{ color: rgba(232,238,252,.72); }
.ns-modal .form-control,
.ns-modal .form-select{
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    color: var(--text) !important;
}
.ns-modal .form-control::placeholder{ color: rgba(232,238,252,.50); }
.ns-modal .form-select option{ background: #0b1224; color: var(--text); }
.ns-modal .form-check-label{ color: rgba(232,238,252,.78); }
.ns-modal .form-check-input{
    background-color: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.18);
}
.ns-modal .form-check-input:checked{
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Accordion inside modals */
.ns-modal .accordion-item{
    background: rgba(255,255,255,.03) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
}
.ns-modal .accordion-button{
    background: rgba(255,255,255,.04) !important;
    color: var(--text);
    box-shadow: none !important;
}
.ns-modal .accordion-button:not(.collapsed){
    background: rgba(42,169,255,.10) !important;
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.ns-modal .accordion-button::after{
    filter: invert(1);
    opacity: .85;
}
.ns-modal .accordion-body{
    background: rgba(255,255,255,.02);
}
.ns-modal .helptext{
    color: rgba(232,238,252,.55);
    font-size: 12px;
}
/* Header */
        .group-header{
            margin-top: 16px;
            padding: 18px 18px;
            border: 1px solid var(--border);
            background: rgba(255,255,255,.05);
            border-radius: 18px;
            backdrop-filter: blur(12px);
        }
        .chip{
            display:inline-flex;
            align-items:center;
            gap:8px;
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 12px;
            border: 1px solid var(--border);
            background: rgba(255,255,255,.06);
            color: var(--text);
        }
        .chip-backlog{ background: rgba(255,255,255,.06); }
        .chip-active{ background: rgba(42,169,255,.10); border-color: rgba(42,169,255,.22); }
        .chip-blocked{ background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.22); }
        .chip-completed{ background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.22); }

        /* Board */
        .board{
            margin-top: 14px;
            display: flex; /* Changed from Grid to Flex */
            gap: 14px;
            align-items: stretch; /* Make sure all columns are the same height */
            width: 100%;
        }
        @media (max-width: 1200px){
            .board{ flex-wrap: wrap; }
        }
        @media (max-width: 768px){
            .board{ flex-direction: column; }
            
            .sidebar {
                width: 300px; /* Offcanvas width on mobile */
                border-right: none;
            }

            /* Topbar Mobile Layout */
            .topbar { 
                flex-wrap: wrap; 
                gap: 8px; 
                padding: 10px;
            }
            .topbar .search { 
                order: 10; 
                flex: 1 1 100%; 
                margin-top: 4px; 
            }
            .project-picker-wrap { 
                min-width: 0 !important; 
                flex: 1 1 auto; 
            }
            #projectPickerLabel { 
                max-width: 130px; 
                overflow: hidden; 
                text-overflow: ellipsis; 
                white-space: nowrap; 
                display: inline-block; 
                vertical-align: bottom; 
            }
        }

        .col-card{
            border: 1px solid rgba(255,255,255,.10);
            border-radius: 18px;
            background: rgba(255,255,255,.05);
            backdrop-filter: blur(12px);
            padding: 12px;
            min-height: 520px;
            flex: 1; /* This stretches the column to fill space! */
            min-width: 250px; /* Prevents columns from getting too thin */
            display: flex;
            flex-direction: column;
        }
        .col-title{
            display:flex; align-items:baseline; justify-content:space-between;
            padding: 6px 6px 10px;
            flex: 0 0 auto; /* Stop title from stretching vertically */
        }
        .col-title .hint{ color: rgba(232,238,252,.55); font-size:12px; }

        .col-drop {
            flex-grow: 1; /* Ensure dropzone fills the rest of the column's vertical space */
            min-height: 200px;
            padding-bottom: 50px; /* Space at the bottom to easily drop tasks into */
            transition: background-color 0.2s ease;
        }

        /* Task cards */
        .task-card{
            border: 1px solid rgba(255,255,255,.10);
            background: rgba(255,255,255,.06);
            border-radius: 16px;
            padding: 12px;
            cursor:pointer;
            transition: transform .12s ease, border-color .12s ease, background .12s ease;
        }
        .task-card:hover{
            transform: translateY(-2px);
            border-color: rgba(42,169,255,.25);
            background: rgba(255,255,255,.08);
        }
        .task-meta{
            display:flex; align-items:center; justify-content:space-between;
            gap: 10px;
            margin-top: 8px;
        }
        .muted{ color: rgba(232,238,252,.62); }

        .avatar{
            width:28px; height:28px; border-radius: 999px;
            display:inline-flex; align-items:center; justify-content:center;
            font-weight:700; font-size: 12px;
            border: 1px solid rgba(255,255,255,.14);
            background: rgba(255,255,255,.06);
        }
        .avatar-stack{ display:flex; }
        .avatar-stack .avatar{ margin-left:-8px; }
        .avatar-stack .avatar:first-child{ margin-left:0; }

        .mini{
            display:inline-flex; align-items:center; gap:6px;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(255,255,255,.12);
            background: rgba(0,0,0,.18);
            font-size: 12px;
        }
/* Subtasks (nested under parent task cards) */
.subtasks{
    margin-top:10px;
    padding-top:10px;
    border-top: 1px dashed rgba(255,255,255,.12);
    display:flex;
    flex-direction:column;
    gap:6px;
}
.subtasks .sub-h{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    font-size:12px;
    font-weight:800;
    color: rgba(232,238,252,.70);
}
.subtask-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:6px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    cursor:pointer;
    transition: border-color .12s ease, background .12s ease;
}
.subtask-item:hover{
    border-color: rgba(42,169,255,.22);
    background: rgba(255,255,255,.07);
}
.subtask-left{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
}
.subtask-indent{
    opacity:.55;
    font-weight:900;
    flex:0 0 auto;
}
.subtask-name{
    font-weight:500;
    font-size:13px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.subtask-right{
    display:flex;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
}
.subtask-mini{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:3px 8px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.18);
    font-size:12px;
}
.subtask-more{
    margin-top:4px;
    font-size:12px;
    font-weight:800;
    color: rgba(232,238,252,.70);
    cursor:pointer;
    align-self:flex-start;
}
.subtask-more:hover{
    color: rgba(232,238,252,.92);
    text-decoration: underline;
}

.subtasks .sub-list{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.subtasks .sub-list.scrollable{
    max-height:220px;
    overflow:auto;
    padding-right:4px;
}
.subtask-item.subtask-inline{
    cursor: default;
}
.subtask-checkbox{
    width:16px;
    height:16px;
    margin:0;
}
.subtask-name.subtask-open{
    cursor:pointer;
}
.subtask-name.subtask-open:hover{
    text-decoration: underline;
    color: rgba(232,238,252,.92);
}
.subtask-item.is-complete{
    opacity:.72;
}

        
/* Subtasks expand/collapse toggle */
.subtasks-toggle{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.18);
    color: rgba(232,238,252,.82);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.subtasks-toggle:hover{
    border-color: rgba(42,169,255,.25);
    background: rgba(255,255,255,.06);
    color: rgba(232,238,252,.92);
}

/* Files list */
.file-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    cursor:pointer;
    transition: border-color .12s ease, background .12s ease;
}
.file-item:hover{
    border-color: rgba(42,169,255,.22);
    background: rgba(255,255,255,.07);
}
.file-thumb{
    width:44px;
    height:44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.18);
    flex: 0 0 auto;
}
.file-icon{
    width:44px;
    height:44px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.18);
    flex: 0 0 auto;
    font-size: 20px;
    color: rgba(232,238,252,.88);
}
.file-meta{
    min-width:0;
    flex: 1 1 auto;
}
.file-name{
    font-weight: 900;
    font-size: 14px;
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
}
.file-sub{
    display:flex;
    gap:8px;
    flex-wrap: wrap;
    margin-top:4px;
    color: rgba(232,238,252,.65);
    font-size: 12px;
}
.file-actions{
    flex: 0 0 auto;
    display:flex;
    align-items:center;
    gap:8px;
}
.progress{
            height: 8px;
            background: rgba(255,255,255,.10);
        }
        .progress-bar{ background: linear-gradient(90deg, rgba(42,169,255,.9), rgba(42,169,255,.35)); }

        /* Offcanvas */
		.offcanvas-dark{
            background:
                radial-gradient(900px 500px at 50% 0%, rgba(42,169,255,.14), transparent 55%),
                linear-gradient(180deg, rgba(10,14,28,.98), rgba(8,11,22,.98));
            color: var(--text);
            border-left: 1px solid rgba(255,255,255,.12);
        }

        /* --- ADD THIS TO WIDEN THE DRAWER --- */
        #taskDrawer {
            width: 700px !important; 
            max-width: 95vw; /* Keeps it responsive on mobile */
        }
        .offcanvas-dark{
            background:
                radial-gradient(900px 500px at 50% 0%, rgba(42,169,255,.14), transparent 55%),
                linear-gradient(180deg, rgba(10,14,28,.98), rgba(8,11,22,.98));
            color: var(--text);
            border-left: 1px solid rgba(255,255,255,.12);
        }
        .tab-pane{
            padding-top: 12px;
        }
        .kv{
            display:flex; justify-content:space-between; gap:12px;
            padding: 10px 0;
            border-bottom: 1px solid rgba(255,255,255,.08);
        }
        .kv:last-child{ border-bottom:none; }
        .badge-soft{
            border: 1px solid rgba(255,255,255,.12);
            background: rgba(255,255,255,.06);
            color: var(--text);
        }
		
		/* Task drawer header actions */
#taskDrawer .btn-ellipsis{
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}

#taskDrawer .btn-ellipsis:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.28);
}

/* ------------------------------------------------------------
   Project Picker (grouped display_primary / display_secondary)
------------------------------------------------------------ */
.project-picker-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.pp-primary{
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    border-radius: 18px;
    overflow:hidden;
}
.pp-primary-h{
    padding: 10px 12px;
    background: rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.08);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.pp-primary-title{
    font-weight: 900;
    letter-spacing: .2px;
}
.pp-count{
    font-size: 12px;
    opacity: .8;
}
.pp-secondary{
    padding: 10px 12px 12px 12px;
}
.pp-secondary + .pp-secondary{
    border-top: 1px solid rgba(255,255,255,.08);
}
.pp-secondary-title{
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(232,238,252,.65);
    margin-bottom: 8px;
}
.pp-items{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.pp-item{
    width:100%;
    text-align:left;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 16px;
    transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.pp-item:hover{
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.16);
    transform: translateY(-1px);
}
.pp-item.active{
    background: rgba(42,169,255,.16);
    border-color: rgba(42,169,255,.35);
}
.pp-item .nm{
    font-weight: 900;
    line-height: 1.2;
}
.pp-item .meta{
    font-size: 12px;
    color: rgba(232,238,252,.62);
    margin-top: 2px;
}
.pp-item .chip-mini{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    font-size: 11px;
    color: rgba(232,238,252,.75);
}
    
/* Context switch button (App/Operation) */
.ctx-btn{ max-width:520px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ctx-btn .ctx-label{ font-size:11px; letter-spacing:.18em; text-transform:uppercase; opacity:.75; margin-right:6px; }
.ctx-btn .ctx-value{ display:inline-block; max-width:150px; overflow:hidden; text-overflow:ellipsis; vertical-align:bottom; }
@media (max-width: 1200px){
  .ctx-btn{ max-width:340px; }
  .ctx-btn .ctx-value{ max-width:95px; }
}
@media (max-width: 900px){
  .ctx-btn{ max-width:260px; }
  .ctx-btn .ctx-value{ max-width:70px; }
}


/* ============================================================
   Dropdown portal (fix dropdown behind content in header)
   ============================================================ */
.dropdown-menu.ns-dropdown-portal{
  position:absolute !important;
  z-index:3000 !important;
}

.col-drop.drag-over {
    background: rgba(42, 169, 255, 0.1);
    border: 2px dashed rgba(42, 169, 255, 0.4);
    border-radius: 8px;
    min-height: 100px; /* Ensure empty columns are droppable */
}

/* Ensure the drop zone fills the column and is always clickable */
.task-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px; /* Ensure column has height */
}

/* The actual container tasks live in */
.col-drop {
    flex-grow: 1;
    min-height: 200px; /* Target area for empty columns */
    padding-bottom: 100px; /* Extra padding at bottom to catch drops */
    transition: background-color 0.2s ease;
}

/* Visual feedback when dragging over a column */
.col-drop.drag-over {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* Ensure the drop zone fills the column and is always clickable */
.task-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px; /* Ensure column has height */
}

/* The actual container tasks live in */
.col-drop {
    flex-grow: 1;
    min-height: 200px; /* Target area for empty columns */
    padding-bottom: 100px; /* Extra padding at bottom to catch drops */
    transition: background-color 0.2s ease;
}

/* Visual feedback when dragging over a column */
.col-drop.drag-over {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* --- NEW: Interactive Pop-out Effect --- */
.task-action-item {
    cursor: pointer;
    color: #60a5fa !important; /* Action Blue */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease; /* Bouncy spring effect */
    display: inline-block; /* Required for transform */
    position: relative;
    z-index: 1;
}

.task-action-item:hover {
    transform: scale(1.15); /* Pop out by 15% */
    filter: brightness(1.2) drop-shadow(0 4px 6px rgba(96, 165, 250, 0.3)); /* Glow */
    z-index: 10;
}

/* ... (Keep existing CSS) ... */

/* --- Quick Filter Toolbar --- */
.quick-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.q-group {
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 15px;
}
.q-group:last-child { border-right: none; }

.q-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    margin-right: 4px;
}

.q-input-date {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.q-btn-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.q-btn-toggle:hover { border-color: var(--text); color: var(--text); }
.q-btn-toggle.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
/* Specific colors for status toggles */
.q-btn-toggle[data-status="complete"].active { background: var(--success); border-color: var(--success); }
.q-btn-toggle[data-status="blocked"].active { background: var(--danger); border-color: var(--danger); }


.q-view-switch .btn {
    border-color: rgba(255,255,255,.12);
    color: var(--muted);
    background: rgba(255,255,255,.04);
}
.q-view-switch .btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,.22);
    background: rgba(255,255,255,.08);
}
.q-view-switch .btn.active {
    color: var(--text);
    background: rgba(42,169,255,.14);
    border-color: rgba(42,169,255,.28);
}

.table-view-wrap {
    margin-top: 14px;
}
.table-view-card {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    backdrop-filter: blur(12px);
    padding: 14px;
}
#taskTableView {
    margin-bottom: 0 !important;
}
#taskTableView thead th {
    border-bottom-color: rgba(255,255,255,.12) !important;
    color: rgba(232,238,252,.78);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
#taskTableView tbody td {
    border-top-color: rgba(255,255,255,.08) !important;
    vertical-align: middle;
}
#taskTableView tbody tr:hover > * {
    background: rgba(255,255,255,.06) !important;
}
#taskTableView_wrapper .dataTables_length,
#taskTableView_wrapper .dataTables_info,
#taskTableView_wrapper .dataTables_paginate {
    color: rgba(232,238,252,.75) !important;
}
#taskTableView_wrapper .form-select,
#taskTableView_wrapper .form-control {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    color: var(--text) !important;
}
#taskTableView_wrapper .paginate_button .page-link {
    background: rgba(255,255,255,.04) !important;
    border-color: rgba(255,255,255,.10) !important;
    color: var(--text) !important;
}
#taskTableView_wrapper .paginate_button.active .page-link {
    background: rgba(42,169,255,.18) !important;
    border-color: rgba(42,169,255,.35) !important;
}
.q-select {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 4px 24px 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* --- Fix: Dropdown Z-Index & Position --- */
.dropdown-menu {
    z-index: 9999 !important; /* Force on top of everything */
    background: rgba(18, 25, 38, 0.95) !important; /* Solid-ish dark background */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Ensure the top header bar itself allows dropdowns to spill over */
header, .navbar, .d-flex {
    overflow: visible !important; 
}

/* Ensure the Topbar sits ABOVE the content/filter bar below it */
.topbar {
    position: relative;         /* Required for z-index to work */
    z-index: 1030 !important;   /* Bootstrap sticky header standard is 1020 */
    overflow: visible !important; /* Allow dropdowns to spill out */
}

/* Ensure the dropdown itself is on top */
.dropdown-menu {
    z-index: 1050 !important;
}

/* Pinned Popup (Click State) */
        #pinnedTooltip {
            position: fixed;
            background-color: #1a2234;
            border: 1px solid rgba(66, 153, 225, 0.5);
            color: #e8eefc;
            border-radius: 8px;
            padding: 0;
            box-shadow: 0 8px 30px rgba(0,0,0,0.8);
            z-index: 1070;
            display: none;
            pointer-events: auto;
            max-width: 300px;
        }
        
        /* Highlight Row Animation */
        table.dataTable tbody tr.highlight-row {
            background-color: rgba(42, 169, 255, 0.2) !important;
            transition: background-color 0.5s ease;
        }
		
		
	/* ------------------------------------------------------------
   Project Pulse (summary dashboard)
   ------------------------------------------------------------ */
.pulse-kpi{
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  min-height: 110px;
}
.pulse-kpi:before{
  content:"";
  position:absolute;
  inset:-40px -60px auto auto;
  width:220px; height:220px;
  background: radial-gradient(circle at 30% 30%, rgba(42,169,255,.22), transparent 60%);
  transform: rotate(10deg);
  pointer-events:none;
}
.pulse-kpi .kpi-label{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: rgba(232,238,252,.62);
  display:flex;
  align-items:center;
  gap:8px;
}
.pulse-kpi .kpi-value{
  font-size:30px;
  font-weight:800;
  letter-spacing:.02em;
  margin-top:6px;
  line-height:1.05;
}
.pulse-kpi .kpi-sub{
  margin-top:6px;
  font-size:12px;
  color: rgba(232,238,252,.70);
  display:flex;
  align-items:center;
  gap:8px;
}
.pulse-dot{
  width:10px; height:10px;
  border-radius:99px;
  display:inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}
.pulse-dot.dot-ok{ background:#22c55e; }
.pulse-dot.dot-warn{ background:#f59e0b; }
.pulse-dot.dot-bad{ background:#ef4444; }

.pulse-list{ display:flex; flex-direction:column; gap:10px; }

.pulse-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
}
.pulse-row .title{
  font-weight:700;
  color: rgba(232,238,252,.92);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pulse-row .meta{
  font-size:12px;
  color: rgba(232,238,252,.60);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pulse-row .right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
}
.pulse-bar{
  height:8px;
  width:120px;
  background: rgba(255,255,255,0.08);
  border-radius:99px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.10);
}
.pulse-bar > span{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(42,169,255,0.95), rgba(245,158,11,0.85));
}

.pulse-skel{ opacity:.9; }
.pulse-skel .ph{
  height:12px;
  border-radius:99px;
  background: rgba(255,255,255,0.08);
  overflow:hidden;
  position:relative;
}
.pulse-skel .ph:after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  transform: translateX(-100%);
  animation: pulseShimmer 1.15s infinite;
}
@keyframes pulseShimmer{
  0%{ transform: translateX(-100%); }
  100%{ transform: translateX(100%); }
}



/* ============================================================
   Inline Subtask Create (Task Card +)
   ============================================================ */
.subtask-create{
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,.12);
}
.subtask-create .input-group-text{
    background: rgba(0,0,0,.18) !important;
    border-color: rgba(255,255,255,.12) !important;
    color: rgba(232,238,252,.75) !important;
}
.subtask-create .form-control{
    background: rgba(0,0,0,.18) !important;
    border-color: rgba(255,255,255,.12) !important;
    color: var(--text) !important;
}
.subtask-create .form-control::placeholder{ color: rgba(232,238,252,.45); }
.subtask-create .btn{
    border-color: rgba(255,255,255,.14) !important;
}
.subtask-create-hint{
    font-size: 11px;
    color: rgba(232,238,252,.6);
}

/* ============================================================
   Markdown Preview Styles
   ============================================================ */
.markdown-preview {
    font-size: 14px;
    line-height: 1.6;
}
.markdown-preview h1, 
.markdown-preview h2, 
.markdown-preview h3 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--accent, #2aa9ff);
}
.markdown-preview h1 { font-size: 2em; }
.markdown-preview h2 { font-size: 1.5em; }
.markdown-preview h3 { font-size: 1.25em; }

.markdown-preview p {
    margin-bottom: 16px;
}

/* Fix Lists (Often hidden by CSS resets) */
.markdown-preview ul, 
.markdown-preview ol {
    padding-left: 2em;
    margin-bottom: 16px;
}
.markdown-preview ul { list-style-type: disc !important; }
.markdown-preview ol { list-style-type: decimal !important; }
.markdown-preview li { margin-bottom: 4px; }

/* Blockquotes */
.markdown-preview blockquote {
    padding: 10px 15px;
    margin: 0 0 16px 0;
    border-left: 4px solid var(--accent, #2aa9ff);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 4px 4px 0;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   Fix for Mermaid Diagram Scaling inside Modals
   ============================================================ */
/* Force all text inside the SVG to be light */
.markdown-preview .mermaid svg text,
.markdown-preview .mermaid svg .messageText,
.markdown-preview .mermaid svg .labelText,
.markdown-preview .mermaid svg .edgeLabel {
    fill: var(--text, #e8eefc) !important;
    color: var(--text, #e8eefc) !important;
}

/* Style the shapes (nodes) to look like glass pills */
.markdown-preview .mermaid svg .node rect,
.markdown-preview .mermaid svg .node circle,
.markdown-preview .mermaid svg .node polygon,
.markdown-preview .mermaid svg .node path {
    fill: rgba(42, 169, 255, 0.15) !important; 
    stroke: var(--accent, #2aa9ff) !important;
    stroke-width: 1.5px !important;
}

/* Make markdown preview fill the modal width */
#filePreviewBody .markdown-preview{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Style the large grouping boxes (subgraphs) */
.markdown-preview .mermaid svg .cluster rect {
    fill: rgba(255, 255, 255, 0.03) !important;
    stroke: rgba(255, 255, 255, 0.2) !important;
    stroke-width: 1px !important;
    rx: 8px !important; /* Round the corners */
}

/* Force connecting lines and arrows to be visible */
.markdown-preview .mermaid svg .edgePath .path,
.markdown-preview .mermaid svg .flowchart-link {
    stroke: var(--muted, #aeb8d6) !important;
    stroke-width: 1.5px !important;
}
.markdown-preview .mermaid svg marker path {
    fill: var(--muted, #aeb8d6) !important;
    stroke: none !important;
}

/* Fix backgrounds on text labels that sit on top of lines */
.markdown-preview .mermaid svg .edgeLabel rect {
    fill: var(--bg1, #0b1224) !important;
    opacity: 0.9 !important;
}

/* Code Blocks */
.markdown-preview code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #f87171;
}
.markdown-preview pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.markdown-preview pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Tables */
.markdown-preview table {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
}
.markdown-preview th, 
.markdown-preview td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
}
.markdown-preview th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
}


/* Gantt / timeline view */
.gantt-view-wrap {
    margin-top: 14px;
}
.gantt-view-card {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    backdrop-filter: blur(12px);
    padding: 14px;
    overflow: hidden;
}
.gantt-view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.gantt-view-title {
    font-weight: 800;
    letter-spacing: .01em;
}
.gantt-view-subtitle {
    color: rgba(232,238,252,.62);
    font-size: 13px;
    margin-top: 2px;
}
.gantt-view-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.gantt-scale-switch .btn {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(232,238,252,.82);
}
.gantt-scale-switch .btn:hover,
.gantt-scale-switch .btn.active {
    background: rgba(42,169,255,.14);
    border-color: rgba(42,169,255,.35);
    color: #fff;
}

.gantt-stack-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(232,238,252,.82);
}
.gantt-stack-switch .form-check-input {
    margin: 0;
    float: none;
    background-color: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.16);
    cursor: pointer;
}
.gantt-stack-switch .form-check-input:checked {
    background-color: rgba(42,169,255,.92);
    border-color: rgba(42,169,255,.92);
}
.gantt-stack-switch .form-check-label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.gantt-view-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.gantt-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: rgba(232,238,252,.80);
    font-size: 12px;
}
.gantt-legend-pill i { font-size: 10px; }
.gantt-legend-pill.is-backlog i { color: rgba(255,255,255,.76); }
.gantt-legend-pill.is-active i { color: rgba(42,169,255,.95); }
.gantt-legend-pill.is-blocked i { color: rgba(239,68,68,.95); }
.gantt-legend-pill.is-complete i { color: rgba(34,197,94,.95); }
.gantt-empty-state {
    border: 1px dashed rgba(255,255,255,.14);
    border-radius: 16px;
    padding: 18px;
    color: rgba(232,238,252,.72);
    background: rgba(255,255,255,.03);
    margin-bottom: 12px;
}
.gantt-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 16px;
}
#taskGanttView {
    width: 100%;
    min-height: 560px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
    overflow: hidden;
}
#taskGanttView .vis-timeline {
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
}
#taskGanttView .vis-panel,
#taskGanttView .vis-labelset,
#taskGanttView .vis-label,
#taskGanttView .vis-time-axis,
#taskGanttView .vis-foreground,
#taskGanttView .vis-background {
    background: transparent;
    border-color: rgba(255,255,255,.06) !important;
}
#taskGanttView .vis-label {
    color: rgba(232,238,252,.80);
}
#taskGanttView .vis-text,
#taskGanttView .vis-label .vis-inner {
    color: rgba(232,238,252,.80);
}
#taskGanttView .vis-grid.vis-vertical {
    border-left-color: rgba(255,255,255,.06) !important;
}
#taskGanttView .vis-grid.vis-minor,
#taskGanttView .vis-grid.vis-major {
    border-color: rgba(255,255,255,.06) !important;
}
#taskGanttView .vis-current-time {
    background-color: rgba(42,169,255,.75);
    width: 2px;
}
#taskGanttView .vis-item {
    border-width: 1px;
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    box-shadow: none;
    cursor: grab;
}
#taskGanttView .vis-item.vis-selected {
    cursor: grab;
}
#taskGanttView .vis-drag-center,
#taskGanttView .vis-drag-left,
#taskGanttView .vis-drag-right {
    cursor: ew-resize !important;
}
#taskGanttView .vis-item.vis-range {
    overflow: visible;
}
#taskGanttView .vis-item.vis-range .vis-item-content {
    padding-left: 14px;
    padding-right: 14px;
}
#taskGanttView .vis-item .vis-drag-left,
#taskGanttView .vis-item .vis-drag-right {
    width: 12px !important;
    min-width: 12px;
    top: -1px;
    bottom: -1px;
    opacity: 0;
    z-index: 4;
    transition: opacity .15s ease, background .15s ease;
}
#taskGanttView .vis-item.vis-range:hover .vis-drag-left,
#taskGanttView .vis-item.vis-range:hover .vis-drag-right,
#taskGanttView .vis-item.vis-selected.vis-range .vis-drag-left,
#taskGanttView .vis-item.vis-selected.vis-range .vis-drag-right {
    opacity: .92;
    background: rgba(255,255,255,.10);
}
#taskGanttView .vis-item.vis-range:hover .vis-drag-left,
#taskGanttView .vis-item.vis-selected.vis-range .vis-drag-left {
    border-right: 1px solid rgba(255,255,255,.20);
}
#taskGanttView .vis-item.vis-range:hover .vis-drag-right,
#taskGanttView .vis-item.vis-selected.vis-range .vis-drag-right {
    border-left: 1px solid rgba(255,255,255,.20);
}
#ganttViewWrap.is-gantt-saving #taskGanttView {
    opacity: .72;
}
#taskGanttView .vis-item .vis-item-content {
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#taskGanttView .gantt-item-label {
    font-weight: 700;
    white-space: nowrap;
}
#taskGanttView .gantt-item-meta {
    opacity: .75;
    font-size: 11px;
    font-weight: 600;
}
#taskGanttView .vis-item.gantt-backlog {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.22);
}
#taskGanttView .vis-item.gantt-active {
    background: rgba(42,169,255,.22);
    border-color: rgba(42,169,255,.38);
}
#taskGanttView .vis-item.gantt-blocked {
    background: rgba(239,68,68,.24);
    border-color: rgba(239,68,68,.42);
}
#taskGanttView .vis-item.gantt-complete {
    background: rgba(34,197,94,.22);
    border-color: rgba(34,197,94,.38);
}
#taskGanttView .vis-item.vis-selected {
    box-shadow: 0 0 0 2px rgba(255,255,255,.18);
}
#taskGanttView .vis-item.vis-box {
    border-radius: 999px;
}
#taskGanttView .vis-item.vis-range .vis-item-content {
    overflow: hidden;
    text-overflow: ellipsis;
}


</style>
