/* ============================================
   DSI Helpdesk - Modern Design System
   ============================================ */

/* --- CSS Custom Properties / Design Tokens --- */
:root {
    /* Brand Colors */
    --dsi-primary: #2563eb;
    --dsi-primary-hover: #1d4ed8;
    --dsi-primary-dark: #1e40af;
    --dsi-primary-light: #3b82f6;
    --dsi-primary-50: #eff6ff;
    --dsi-primary-100: #dbeafe;
    --dsi-primary-200: #bfdbfe;

    /* Semantic Colors */
    --dsi-success: #059669;
    --dsi-success-light: #d1fae5;
    --dsi-warning: #d97706;
    --dsi-warning-light: #fef3c7;
    --dsi-danger: #dc2626;
    --dsi-danger-light: #fee2e2;
    --dsi-info: #0891b2;
    --dsi-info-light: #cffafe;

    /* Neutrals */
    --dsi-gray-50: #f9fafb;
    --dsi-gray-100: #f3f4f6;
    --dsi-gray-200: #e5e7eb;
    --dsi-gray-300: #d1d5db;
    --dsi-gray-400: #9ca3af;
    --dsi-gray-500: #6b7280;
    --dsi-gray-600: #4b5563;
    --dsi-gray-700: #374151;
    --dsi-gray-800: #1f2937;
    --dsi-gray-900: #111827;

    /* Typography */
    --dsi-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --dsi-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Spacing */
    --dsi-radius-sm: 0.375rem;
    --dsi-radius-md: 0.5rem;
    --dsi-radius-lg: 0.75rem;
    --dsi-radius-xl: 1rem;
    --dsi-radius-2xl: 1.25rem;

    /* Shadows */
    --dsi-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --dsi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --dsi-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --dsi-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --dsi-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --dsi-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --dsi-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- Global Styles --- */
body {
    font-family: var(--dsi-font-sans);
    background: var(--dsi-gray-50);
    color: var(--dsi-gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navbar --- */
.dsi-navbar {
    background: white;
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
}

.dsi-navbar .navbar-brand {
    font-weight: 700;
    color: var(--dsi-gray-900) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsi-navbar .navbar-brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.dsi-navbar .nav-link {
    color: var(--dsi-gray-600) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--dsi-radius-md);
    transition: var(--dsi-transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dsi-navbar .nav-link:hover,
.dsi-navbar .nav-link.active {
    color: var(--dsi-primary) !important;
    background: var(--dsi-primary-50);
}

.dsi-navbar .nav-link i {
    font-size: 1rem;
}

.dsi-navbar .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.5em;
}

.dsi-navbar .dropdown-menu {
    border: 1px solid var(--dsi-gray-200);
    box-shadow: var(--dsi-shadow-lg);
    border-radius: var(--dsi-radius-lg);
    padding: 0.5rem;
    margin-top: 0.25rem;
}

.dsi-navbar .dropdown-item {
    border-radius: var(--dsi-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dsi-gray-700);
    transition: var(--dsi-transition);
}

.dsi-navbar .dropdown-item:hover {
    background: var(--dsi-primary-50);
    color: var(--dsi-primary);
}

.dsi-navbar .dropdown-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dsi-gray-400);
    font-weight: 600;
    padding: 0.5rem 0.75rem 0.25rem;
}

.dsi-navbar .dropdown-divider {
    margin: 0.25rem 0;
    border-color: var(--dsi-gray-100);
}

/* User avatar pill in navbar */
.dsi-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.5rem;
    border-radius: 2rem;
    background: var(--dsi-gray-100);
    transition: var(--dsi-transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.dsi-user-pill:hover {
    background: var(--dsi-gray-200);
}

.dsi-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dsi-primary), var(--dsi-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.dsi-user-pill .user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--dsi-gray-700);
}

.dsi-user-pill .user-role {
    font-size: 0.6875rem;
    color: var(--dsi-gray-400);
    font-weight: 500;
}


/* --- Page Header --- */
.dsi-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.dsi-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsi-page-header h1 i {
    color: var(--dsi-primary);
}

.dsi-page-header .subtitle {
    font-size: 0.875rem;
    color: var(--dsi-gray-500);
    margin-top: 0.25rem;
}


/* --- Stat Cards --- */
.dsi-stat-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    padding: 1.25rem;
    transition: var(--dsi-transition);
    position: relative;
    overflow: hidden;
}

.dsi-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dsi-shadow-md);
    border-color: transparent;
}

.dsi-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--dsi-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dsi-stat-card .stat-icon.primary {
    background: var(--dsi-primary-100);
    color: var(--dsi-primary);
}

.dsi-stat-card .stat-icon.warning {
    background: var(--dsi-warning-light);
    color: var(--dsi-warning);
}

.dsi-stat-card .stat-icon.success {
    background: var(--dsi-success-light);
    color: var(--dsi-success);
}

.dsi-stat-card .stat-icon.danger {
    background: var(--dsi-danger-light);
    color: var(--dsi-danger);
}

.dsi-stat-card .stat-icon.info {
    background: var(--dsi-info-light);
    color: var(--dsi-info);
}

.dsi-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dsi-stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--dsi-gray-500);
    font-weight: 500;
}

.dsi-stat-card .stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.dsi-stat-card .stat-trend.up { color: var(--dsi-success); }
.dsi-stat-card .stat-trend.down { color: var(--dsi-danger); }


/* --- Cards --- */
.dsi-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    box-shadow: var(--dsi-shadow-xs);
    overflow: hidden;
    transition: var(--dsi-transition);
}

.dsi-card:hover {
    box-shadow: var(--dsi-shadow-sm);
}

.dsi-card .card-header {
    background: white;
    border-bottom: 1px solid var(--dsi-gray-100);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dsi-gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dsi-card .card-header i {
    color: var(--dsi-primary);
    margin-right: 0.5rem;
}

.dsi-card .card-body {
    padding: 1.25rem;
}


/* --- Tables --- */
.dsi-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dsi-table thead th {
    background: var(--dsi-gray-50);
    border-bottom: 2px solid var(--dsi-gray-200);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dsi-gray-500);
    white-space: nowrap;
}

.dsi-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--dsi-gray-100);
    font-size: 0.875rem;
    vertical-align: middle;
    color: var(--dsi-gray-700);
}

.dsi-table tbody tr {
    transition: var(--dsi-transition);
}

.dsi-table tbody tr:hover {
    background: var(--dsi-primary-50);
}

.dsi-table tbody tr:last-child td {
    border-bottom: none;
}


/* --- Status Badges --- */
.dsi-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.dsi-badge-open { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.dsi-badge-in_progress { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.dsi-badge-on_hold { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.dsi-badge-waiting_on_response { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.dsi-badge-resolved { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.dsi-badge-closed { background: var(--dsi-gray-100); color: var(--dsi-gray-600); border: 1px solid var(--dsi-gray-200); }

/* Priority Badges */
.dsi-priority-low { color: var(--dsi-success); }
.dsi-priority-low i { color: var(--dsi-success); }
.dsi-priority-medium { color: var(--dsi-info); }
.dsi-priority-medium i { color: var(--dsi-info); }
.dsi-priority-high { color: #ea580c; }
.dsi-priority-high i { color: #ea580c; }
.dsi-priority-urgent { color: var(--dsi-danger); font-weight: 700; }
.dsi-priority-urgent i { color: var(--dsi-danger); }


/* --- Buttons --- */
.dsi-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--dsi-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--dsi-transition);
    text-decoration: none;
    white-space: nowrap;
}

.dsi-btn-primary {
    background: var(--dsi-primary);
    color: white;
    border-color: var(--dsi-primary);
}

.dsi-btn-primary:hover {
    background: var(--dsi-primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.dsi-btn-outline {
    background: white;
    color: var(--dsi-gray-700);
    border-color: var(--dsi-gray-300);
}

.dsi-btn-outline:hover {
    background: var(--dsi-gray-50);
    color: var(--dsi-gray-900);
    border-color: var(--dsi-gray-400);
}

.dsi-btn-ghost {
    background: transparent;
    color: var(--dsi-gray-600);
    border-color: transparent;
}

.dsi-btn-ghost:hover {
    background: var(--dsi-gray-100);
    color: var(--dsi-gray-900);
}

.dsi-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.dsi-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--dsi-radius-md);
}


/* --- Forms --- */
.dsi-input {
    border: 1.5px solid var(--dsi-gray-300);
    border-radius: var(--dsi-radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: var(--dsi-transition);
    background: white;
    color: var(--dsi-gray-800);
}

.dsi-input:focus {
    outline: none;
    border-color: var(--dsi-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dsi-input::placeholder {
    color: var(--dsi-gray-400);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--dsi-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* --- Flash Messages / Alerts --- */
.dsi-alert {
    border-radius: var(--dsi-radius-lg);
    padding: 0.875rem 1.25rem;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.dsi-alert i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.dsi-alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}

.dsi-alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
}

.dsi-alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
}

.dsi-alert-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
}


/* --- Footer --- */
.dsi-footer {
    background: white;
    border-top: 1px solid var(--dsi-gray-200);
    margin-top: auto;
    padding: 1rem 0;
}

.dsi-footer small {
    color: var(--dsi-gray-400);
    font-size: 0.8125rem;
}


/* --- Ticket View --- */
.dsi-ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--dsi-gray-200);
    margin-bottom: 1.5rem;
}

.dsi-ticket-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dsi-primary);
    letter-spacing: 0.02em;
}

.dsi-ticket-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
    margin: 0.25rem 0 0;
    line-height: 1.3;
}

.dsi-description-box {
    background: var(--dsi-gray-50);
    border-left: 3px solid var(--dsi-primary);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--dsi-radius-md) var(--dsi-radius-md) 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--dsi-gray-700);
}

.dsi-resolution-box {
    background: #f0fdf4;
    border-left: 3px solid var(--dsi-success);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--dsi-radius-md) var(--dsi-radius-md) 0;
}


/* --- Sidebar Metadata --- */
.dsi-meta-item {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--dsi-gray-100);
}

.dsi-meta-item:last-child {
    border-bottom: none;
}

.dsi-meta-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dsi-gray-400);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dsi-meta-value {
    font-size: 0.875rem;
    color: var(--dsi-gray-700);
    font-weight: 500;
}


/* --- Comments / Activity Feed --- */
.dsi-comment {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
}

.dsi-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.dsi-comment-bubble {
    flex: 1;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    padding: 0.875rem 1rem;
    position: relative;
}

.dsi-comment-bubble.internal {
    background: #fffbeb;
    border-color: #fde68a;
}

.dsi-comment-bubble.internal::before {
    content: 'Internal Note';
    position: absolute;
    top: -0.5rem;
    left: 0.75rem;
    background: #f59e0b;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
}

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

.dsi-comment-author {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--dsi-gray-800);
}

.dsi-comment-time {
    font-size: 0.75rem;
    color: var(--dsi-gray-400);
}

.dsi-comment-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--dsi-gray-700);
}


/* --- Activity Timeline --- */
.dsi-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    font-size: 0.8125rem;
    color: var(--dsi-gray-600);
}

.dsi-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dsi-gray-300);
    margin-top: 0.375rem;
    flex-shrink: 0;
}

.dsi-timeline-dot.created { background: var(--dsi-primary); }
.dsi-timeline-dot.status { background: #f59e0b; }
.dsi-timeline-dot.assigned { background: #8b5cf6; }
.dsi-timeline-dot.comment { background: var(--dsi-success); }
.dsi-timeline-dot.priority { background: #ea580c; }


/* --- Filter Bar --- */
.dsi-filter-bar {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.dsi-search-input {
    border: 1.5px solid var(--dsi-gray-200);
    border-radius: 2rem;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-size: 0.875rem;
    width: 100%;
    transition: var(--dsi-transition);
    background: var(--dsi-gray-50);
}

.dsi-search-input:focus {
    outline: none;
    border-color: var(--dsi-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.dsi-search-wrapper {
    position: relative;
}

.dsi-search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dsi-gray-400);
    font-size: 0.875rem;
}


/* --- Filter Bubbles (Active Filters) --- */
.dsi-filter-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--dsi-primary-100);
    color: var(--dsi-primary-dark);
    border: 1px solid var(--dsi-primary-200);
}

.dsi-filter-bubble .remove-filter {
    cursor: pointer;
    opacity: 0.6;
    transition: var(--dsi-transition);
    font-size: 0.65rem;
}

.dsi-filter-bubble .remove-filter:hover {
    opacity: 1;
}


/* --- Tabs --- */
.dsi-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--dsi-gray-200);
    margin-bottom: 1.5rem;
}

.dsi-tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dsi-gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--dsi-transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.dsi-tab:hover {
    color: var(--dsi-gray-700);
}

.dsi-tab.active {
    color: var(--dsi-primary);
    border-bottom-color: var(--dsi-primary);
    font-weight: 600;
}

.dsi-tab .badge {
    font-size: 0.65rem;
    padding: 0.15em 0.5em;
    border-radius: 2rem;
}


/* --- Empty States --- */
.dsi-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.dsi-empty-state i {
    font-size: 3rem;
    color: var(--dsi-gray-300);
    margin-bottom: 1rem;
}

.dsi-empty-state h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dsi-gray-500);
    margin-bottom: 0.5rem;
}

.dsi-empty-state p {
    font-size: 0.875rem;
    color: var(--dsi-gray-400);
}


/* --- Pagination --- */
.dsi-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
}

.dsi-pagination .page-link {
    border-radius: var(--dsi-radius-md);
    border: 1px solid var(--dsi-gray-200);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dsi-gray-600);
    padding: 0.375rem 0.75rem;
    transition: var(--dsi-transition);
}

.dsi-pagination .page-link:hover {
    background: var(--dsi-primary-50);
    color: var(--dsi-primary);
    border-color: var(--dsi-primary-200);
}

.dsi-pagination .page-item.active .page-link {
    background: var(--dsi-primary);
    border-color: var(--dsi-primary);
    color: white;
}


/* --- Login Page --- */
.dsi-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dsi-gray-50) 0%, var(--dsi-primary-50) 50%, var(--dsi-gray-100) 100%);
}

.dsi-login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-2xl);
    padding: 2.5rem;
    box-shadow: var(--dsi-shadow-xl);
}

.dsi-login-card .login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.dsi-login-card .login-logo img {
    height: 56px;
    width: auto;
    filter: none;
}

.dsi-login-card .login-title {
    text-align: center;
    color: var(--dsi-gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dsi-login-card .login-subtitle {
    text-align: center;
    color: var(--dsi-gray-500);
    font-size: 0.8125rem;
    margin-bottom: 2rem;
}

.dsi-login-card label {
    color: var(--dsi-gray-700);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.dsi-login-card .form-control {
    background: white;
    border: 1.5px solid var(--dsi-gray-300);
    color: var(--dsi-gray-800);
    border-radius: var(--dsi-radius-md);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--dsi-transition);
}

.dsi-login-card .form-control:focus {
    background: white;
    border-color: var(--dsi-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    color: var(--dsi-gray-900);
}

.dsi-login-card .form-control::placeholder {
    color: var(--dsi-gray-400);
}

.dsi-login-card .form-text {
    color: var(--dsi-gray-400);
    font-size: 0.75rem;
}

.dsi-login-card .form-check-label {
    color: var(--dsi-gray-600);
    font-size: 0.8125rem;
}

.dsi-login-card .form-check-input {
    border-color: var(--dsi-gray-300);
}

.dsi-login-card .form-check-input:checked {
    background-color: var(--dsi-primary);
    border-color: var(--dsi-primary);
}

.dsi-login-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--dsi-primary);
    border: none;
    border-radius: var(--dsi-radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--dsi-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dsi-login-btn:hover {
    background: var(--dsi-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.dsi-login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--dsi-gray-400);
    font-size: 0.75rem;
}

.dsi-login-divider::before,
.dsi-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--dsi-gray-200);
}

.dsi-login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.dsi-login-footer a {
    color: var(--dsi-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: var(--dsi-transition);
}

.dsi-login-footer a:hover {
    color: var(--dsi-primary-hover);
}

.dsi-login-footer .text-muted {
    color: var(--dsi-gray-400) !important;
    font-size: 0.75rem;
}


/* --- Dashboard Specific --- */
.dsi-chart-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    overflow: hidden;
}

.dsi-chart-card .chart-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--dsi-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dsi-chart-card .chart-header h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dsi-gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsi-chart-card .chart-header h5 i {
    color: var(--dsi-primary);
}

.dsi-chart-card .chart-body {
    padding: 1.25rem;
}

/* Status bar chart items */
.dsi-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.dsi-status-bar .status-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dsi-gray-600);
    min-width: 120px;
}

.dsi-status-bar .status-bar-track {
    flex: 1;
    height: 8px;
    background: var(--dsi-gray-100);
    border-radius: 4px;
    overflow: hidden;
}

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

.dsi-status-bar .status-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--dsi-gray-800);
    min-width: 30px;
    text-align: right;
}


/* --- Managed Client Cards --- */
.dsi-client-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    padding: 1rem;
    transition: var(--dsi-transition);
    border-left: 4px solid transparent;
}

.dsi-client-card:hover {
    box-shadow: var(--dsi-shadow-md);
    transform: translateY(-1px);
}


/* --- Admin Panel --- */
.dsi-admin-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    overflow: hidden;
    transition: var(--dsi-transition);
}

.dsi-admin-card:hover {
    box-shadow: var(--dsi-shadow-md);
    transform: translateY(-2px);
}

.dsi-admin-card .admin-card-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dsi-admin-card .admin-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--dsi-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.dsi-admin-card .admin-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dsi-gray-800);
    margin: 0;
}

.dsi-admin-card .admin-card-body {
    padding: 0 1.25rem 1.25rem;
}


/* --- Profile/Settings --- */
.dsi-settings-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.dsi-settings-card .settings-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--dsi-gray-100);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dsi-settings-card .settings-header i {
    color: var(--dsi-primary);
    font-size: 1.1rem;
}

.dsi-settings-card .settings-header h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dsi-gray-800);
    margin: 0;
}

.dsi-settings-card .settings-body {
    padding: 1.5rem;
}

/* Notification toggle */
.dsi-toggle-box {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    transition: var(--dsi-transition);
    cursor: pointer;
}

.dsi-toggle-box:hover {
    border-color: var(--dsi-primary-200);
    background: var(--dsi-primary-50);
}

.dsi-toggle-box .form-check-input:checked ~ .form-check-label {
    color: var(--dsi-primary);
}


/* --- Quick Actions Grid --- */
.dsi-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.dsi-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    text-decoration: none;
    color: var(--dsi-gray-700);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--dsi-transition);
}

.dsi-quick-action-btn:hover {
    border-color: var(--dsi-primary-200);
    background: var(--dsi-primary-50);
    color: var(--dsi-primary);
    transform: translateY(-2px);
    box-shadow: var(--dsi-shadow-md);
}

.dsi-quick-action-btn i {
    font-size: 1.5rem;
}


/* --- SLA Indicator --- */
.dsi-sla-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.dsi-sla-indicator.on-track { color: var(--dsi-success); }
.dsi-sla-indicator.at-risk { color: var(--dsi-warning); }
.dsi-sla-indicator.breached { color: var(--dsi-danger); }


/* --- Overview/Reports --- */
.dsi-metric-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    padding: 1.5rem;
    text-align: center;
}

.dsi-metric-card .metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem;
}

.dsi-metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dsi-metric-card .metric-label {
    font-size: 0.8125rem;
    color: var(--dsi-gray-500);
    font-weight: 500;
}


/* --- Utility Classes --- */
.dsi-animate-in {
    animation: dsi-fade-in 0.3s ease-out;
}

@keyframes dsi-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dsi-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dsi-divider {
    height: 1px;
    background: var(--dsi-gray-200);
    margin: 1rem 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--dsi-gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dsi-gray-400);
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .dsi-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dsi-stat-card .stat-value {
        font-size: 1.5rem;
    }

    .dsi-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .dsi-login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}


/* ==========================================================================
   PROJECT MANAGEMENT MODULE
   ========================================================================== */

/* Project / Phase / Task Status Badges */
.dsi-badge-planning   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.dsi-badge-active      { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.dsi-badge-completed   { background: var(--dsi-gray-100); color: var(--dsi-gray-600); border: 1px solid var(--dsi-gray-200); }
.dsi-badge-cancelled   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.dsi-badge-todo        { background: var(--dsi-gray-100); color: var(--dsi-gray-600); border: 1px solid var(--dsi-gray-200); }
.dsi-badge-in_review   { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.dsi-badge-pending     { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.dsi-badge-skipped     { background: var(--dsi-gray-100); color: var(--dsi-gray-500); border: 1px solid var(--dsi-gray-200); }

/* Project Detail Header */
.dsi-project-header {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--dsi-shadow-xs);
}

.dsi-project-header .project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
    margin: 0;
}

.dsi-project-header .project-meta {
    font-size: 0.8125rem;
    color: var(--dsi-gray-500);
    margin-top: 0.25rem;
}

/* Phase Cards */
.dsi-phase-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--dsi-transition);
}

.dsi-phase-card:hover { box-shadow: var(--dsi-shadow-sm); }

.dsi-phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: var(--dsi-gray-50);
    border-bottom: 1px solid var(--dsi-gray-100);
    cursor: pointer;
    gap: 0.75rem;
}

.dsi-phase-header:hover { background: var(--dsi-primary-50); }

.dsi-phase-header .phase-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dsi-gray-800);
}

.dsi-phase-body { padding: 0; }

.dsi-milestone-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--dsi-warning);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Task Rows (inside <table>) */
.dsi-task-row {
    font-size: 0.875rem;
    transition: var(--dsi-transition);
    vertical-align: middle;
}

.dsi-task-row td { vertical-align: middle; padding: 0.625rem 0.5rem; }
.dsi-task-row:last-child td { border-bottom: none; }
.dsi-task-row:hover { background: var(--dsi-primary-50); }
.dsi-task-row .task-name { font-weight: 500; color: var(--dsi-gray-700); }

.dsi-task-row .task-meta {
    font-size: 0.75rem;
    color: var(--dsi-gray-400);
    margin-top: 0.125rem;
}

/* Task table full width */
.dsi-phase-body .table { width: 100%; table-layout: auto; }
.dsi-phase-body .table th { white-space: nowrap; }

/* Progress Bars */
.dsi-progress-bar {
    height: 6px;
    background: var(--dsi-gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.dsi-progress-fill {
    height: 100%;
    background: var(--dsi-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.dsi-progress-fill.complete { background: var(--dsi-success); }

/* Budget Summary */
.dsi-budget-summary {
    padding: 1rem;
    background: var(--dsi-gray-50);
    border-radius: var(--dsi-radius-md);
}

.dsi-budget-summary .budget-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
}

.dsi-budget-summary .budget-label {
    font-size: 0.75rem;
    color: var(--dsi-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* ==========================================================================
   PORTFOLIO & BILLING
   ========================================================================== */

/* Portfolio cards */
.dsi-portfolio-card {
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    background: #fff;
    transition: box-shadow 0.2s ease;
}
.dsi-portfolio-card:hover {
    box-shadow: var(--dsi-shadow-md);
}
.dsi-portfolio-card .card-header {
    border-bottom: 2px solid var(--dsi-gray-100);
    background: transparent;
}
.dsi-portfolio-bar {
    height: 12px;
    background: var(--dsi-gray-100);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}
.dsi-portfolio-bar-spent {
    background: var(--dsi-primary);
    transition: width 0.5s ease;
}
.dsi-portfolio-bar-realized {
    background: var(--dsi-primary);
    opacity: 0.35;
    transition: width 0.5s ease;
}
.dsi-portfolio-bar-unrealized {
    background: var(--dsi-gray-200);
    transition: width 0.5s ease;
}
.dsi-portfolio-kpi {
    text-align: center;
    padding: 0.75rem 0.5rem;
}
.dsi-portfolio-kpi .kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dsi-gray-900);
}
.dsi-portfolio-kpi .kpi-label {
    font-size: 0.7rem;
    color: var(--dsi-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

/* Billing rate badge in time entry */
.dsi-rate-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--dsi-radius-sm);
    background: var(--dsi-primary);
    color: #fff;
    opacity: 0.85;
}

/* ==========================================================================
   KANBAN BOARD
   ========================================================================== */

.dsi-kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
    -webkit-overflow-scrolling: touch;
}

.dsi-kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    background: var(--dsi-gray-50);
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 320px);
}

.dsi-kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--dsi-gray-200);
    background: white;
    border-radius: var(--dsi-radius-lg) var(--dsi-radius-lg) 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.dsi-kanban-column-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--dsi-gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsi-kanban-count {
    font-size: 0.7rem;
    min-width: 20px;
    text-align: center;
}

.dsi-kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dsi-kanban-dot-todo        { background: var(--dsi-gray-400); }
.dsi-kanban-dot-in_progress { background: #d97706; }
.dsi-kanban-dot-in_review   { background: #7c3aed; }
.dsi-kanban-dot-completed   { background: var(--dsi-success); }

.dsi-kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 60px;
}

.dsi-kanban-card {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-md);
    padding: 0.75rem;
    cursor: grab;
    transition: var(--dsi-transition);
    box-shadow: var(--dsi-shadow-xs);
}

.dsi-kanban-card:hover {
    box-shadow: var(--dsi-shadow-md);
    border-color: var(--dsi-primary-light);
}

.dsi-kanban-card:active {
    cursor: grabbing;
}

.dsi-kanban-card .card-task-name {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--dsi-gray-800);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.dsi-kanban-card .card-phase-name {
    font-size: 0.6875rem;
    color: var(--dsi-gray-400);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dsi-kanban-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dsi-kanban-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dsi-primary), var(--dsi-primary-dark));
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dsi-kanban-avatar.unassigned {
    background: var(--dsi-gray-300);
    color: var(--dsi-gray-500);
}

.dsi-kanban-due {
    font-size: 0.6875rem;
    color: var(--dsi-gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dsi-kanban-due.overdue {
    color: var(--dsi-danger);
    font-weight: 600;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--dsi-primary-50) !important;
    border: 2px dashed var(--dsi-primary) !important;
}

.sortable-chosen {
    box-shadow: var(--dsi-shadow-lg) !important;
    transform: rotate(2deg);
}

.sortable-drag {
    box-shadow: var(--dsi-shadow-xl) !important;
}

.dsi-kanban-empty {
    text-align: center;
    padding: 1.5rem 0.75rem;
    color: var(--dsi-gray-400);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .dsi-kanban-column {
        flex: 0 0 260px;
        min-width: 260px;
    }
}

/* ------------------------------------------------------------------ */
/* Gantt Chart                                                         */
/* ------------------------------------------------------------------ */
#ganttContainer { min-height: 300px; }
#ganttContainer .gantt { font-family: 'Inter', sans-serif; }
#ganttContainer .gantt .bar-wrapper .bar { rx: 4; ry: 4; }
#ganttContainer .gantt .bar-wrapper .bar.critical-path { fill: #ef4444 !important; }
#ganttContainer .gantt .bar-wrapper .bar.critical-path .bar-progress { fill: #dc2626 !important; }
#ganttContainer .gantt .bar-wrapper .bar-completed .bar { opacity: 0.6; }
#ganttContainer .gantt .bar-wrapper .bar-urgent .bar { fill: #ef4444; }
#ganttContainer .gantt .bar-wrapper .bar-high .bar { fill: #f97316; }

/* ------------------------------------------------------------------ */
/* Right-Click Context Menu                                             */
/* ------------------------------------------------------------------ */
.dsi-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 200px;
    max-width: 280px;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-md);
    box-shadow: var(--dsi-shadow-xl);
    padding: 0.375rem 0;
    display: none;
    font-size: 0.8125rem;
}

.dsi-context-menu.show {
    display: block;
    animation: dsiCtxFadeIn 0.12s ease-out;
}

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

.dsi-context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    color: var(--dsi-gray-700);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.4;
    border-radius: 0;
    transition: background 0.1s ease;
    position: relative;
    white-space: nowrap;
}

.dsi-context-menu-item:hover {
    background: var(--dsi-primary-50);
    color: var(--dsi-primary);
}

.dsi-context-menu-item.danger { color: var(--dsi-danger); }
.dsi-context-menu-item.danger:hover { background: #fef2f2; color: var(--dsi-danger); }

.dsi-context-menu-item i {
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.dsi-context-menu-divider {
    height: 1px;
    background: var(--dsi-gray-200);
    margin: 0.25rem 0;
}

.dsi-context-menu-label {
    padding: 0.25rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--dsi-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    pointer-events: none;
}

/* Submenu container */
.dsi-context-submenu { position: relative; }

.dsi-context-submenu > .dsi-context-menu-item::after {
    content: '\F285';
    font-family: 'bootstrap-icons';
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--dsi-gray-400);
}

.dsi-context-submenu-panel {
    display: none;
    position: absolute;
    top: -0.375rem;
    left: 100%;
    min-width: 160px;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-md);
    box-shadow: var(--dsi-shadow-xl);
    padding: 0.375rem 0;
    z-index: 10001;
}

.dsi-context-submenu:hover > .dsi-context-submenu-panel {
    display: block;
}

.dsi-context-submenu-panel.flip-left {
    left: auto;
    right: 100%;
}

.dsi-context-submenu-panel .dsi-context-menu-item {
    padding: 0.375rem 0.75rem;
}

/* Active indicator dot */
.ctx-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dsi-primary);
    margin-left: auto;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Workload View                                                       */
/* ------------------------------------------------------------------ */
.dsi-workload-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dsi-primary), var(--dsi-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* =====================================================================
   Task Comments
   ===================================================================== */
.task-comment { border-radius: var(--dsi-radius-md); }
.task-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dsi-primary), var(--dsi-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.task-comment-content {
    background: var(--dsi-gray-50);
    padding: 0.5rem 0.75rem;
    border-radius: var(--dsi-radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* =====================================================================
   Activity Timeline
   ===================================================================== */
.task-activity-item { font-size: 0.875rem; }
.task-activity-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =====================================================================
   Task Filter Bar (Project Detail)
   ===================================================================== */
#taskFilterBar {
    background: var(--dsi-gray-50);
    padding: 0.75rem;
    border-radius: var(--dsi-radius-md);
    border: 1px solid var(--dsi-gray-200);
    margin-bottom: 1rem;
}

/* =====================================================================
   Calendar Overrides
   ===================================================================== */
.fc .fc-event {
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.8rem;
    cursor: pointer;
}
.fc .fc-toolbar-title { font-size: 1.1rem; }
.fc .fc-button {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* =====================================================================
   Subtask Indent
   ===================================================================== */
.subtask-row { padding-left: 2rem; }

/* =====================================================================
   Bulk Action Toolbar
   ===================================================================== */
.dsi-bulk-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    background: var(--dsi-gray-800);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: dsiBulkSlideUp 0.3s ease-out;
}

@keyframes dsiBulkSlideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.dsi-bulk-toolbar .form-select {
    background-color: var(--dsi-gray-700);
    color: #fff;
    border-color: var(--dsi-gray-600);
    font-size: 0.8rem;
}

.dsi-bulk-toolbar .form-select:focus {
    border-color: var(--dsi-primary);
    box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.25);
}

.dsi-bulk-toolbar .form-select option {
    background: var(--dsi-gray-800);
    color: #fff;
}

.dsi-task-checkbox {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}

/* =====================================================================
   Drag-and-Drop Reordering
   ===================================================================== */
.dsi-drag-handle {
    cursor: grab;
    color: var(--dsi-gray-300);
    text-align: center;
    user-select: none;
    transition: color 0.15s ease;
}

.dsi-drag-handle:hover {
    color: var(--dsi-primary);
}

.dsi-drag-handle:active {
    cursor: grabbing;
}

.dsi-drag-ghost {
    opacity: 0.4;
    background: var(--dsi-primary-50) !important;
}

.dsi-drag-chosen {
    background: var(--dsi-primary-50) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.dsi-drag-active {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =====================================================================
   Subtask Hierarchy
   ===================================================================== */
.dsi-subtask-row {
    background-color: var(--dsi-gray-50);
}

.dsi-subtask-row[data-depth="2"],
.dsi-subtask-row[data-depth="3"],
.dsi-subtask-row[data-depth="4"] {
    background-color: #f5f6f8;
}

.dsi-subtask-row:hover {
    background-color: #f0f4ff;
}

.dsi-subtask-icon {
    color: var(--dsi-gray-400);
    margin-right: 0.35rem;
    font-size: 0.85em;
}

.dsi-subtask-toggle {
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-right: 0.25rem;
    color: var(--dsi-gray-500);
    font-size: 0.85em;
}

.dsi-subtask-toggle:hover {
    color: var(--dsi-primary);
}

.dsi-subtask-toggle.collapsed {
    transform: rotate(-90deg);
}

.dsi-subtask-count {
    font-size: 0.75em;
    color: var(--dsi-gray-400);
    margin-left: 0.35rem;
    font-weight: 400;
}

/* Kanban card subtask indicator */
.dsi-kanban-subtasks {
    font-size: 0.7rem;
    color: var(--dsi-gray-500);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--dsi-gray-200);
}

.dsi-kanban-subtasks i {
    margin-right: 0.25rem;
}

/* =====================================================================
   Color Legend Panel
   ===================================================================== */
.dsi-color-legend {
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--dsi-shadow-sm);
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 0 2rem;
    align-items: start;
}
.dsi-legend-header {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.dsi-legend-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.dsi-legend-title {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dsi-gray-500);
    margin-bottom: 0.15rem;
}
.dsi-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--dsi-gray-700);
}
.dsi-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .dsi-color-legend {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 1.5rem;
    }
}

/* =====================================================================
   Day Calculator Badges
   ===================================================================== */
.dsi-day-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.25rem;
    white-space: nowrap;
    display: inline-block;
}
.dsi-day-overdue {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
}
.dsi-day-today {
    background: #fefce8;
    color: #ca8a04;
    font-weight: 600;
}
.dsi-day-soon {
    background: #fff7ed;
    color: #ea580c;
}
.dsi-day-normal {
    background: var(--dsi-gray-100);
    color: var(--dsi-gray-500);
}

/* =====================================================================
   Task-Level Progress Bars
   ===================================================================== */
.dsi-task-progress {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.dsi-task-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--dsi-gray-200);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}
.dsi-task-progress-fill {
    height: 100%;
    background: var(--dsi-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.dsi-task-progress-fill.complete {
    background: var(--dsi-success);
}
.dsi-task-progress-fill.almost {
    background: #8b5cf6;
}
.dsi-task-progress-label {
    font-size: 0.65rem;
    color: var(--dsi-gray-500);
    min-width: 28px;
    text-align: right;
}

/* Editable progress — clickable indicator */
.dsi-progress-editable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 3px;
    margin: -2px -3px;
    transition: background 0.15s;
}
.dsi-progress-editable:hover {
    background: var(--dsi-gray-100);
}

/* Lock icon for auto-calculated (parent tasks) */
.dsi-progress-lock {
    font-size: 0.55rem;
    color: var(--dsi-gray-400);
    margin-left: 2px;
}

/* Pencil icon for manually-set progress */
.dsi-progress-manual {
    font-size: 0.5rem;
    color: var(--dsi-primary);
    margin-left: 2px;
    opacity: 0.6;
}
.dsi-progress-editable:hover .dsi-progress-manual {
    opacity: 1;
}

/* Inline slider dropdown */
.dsi-progress-slider {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: white;
    border: 1px solid var(--dsi-gray-200);
    border-radius: var(--dsi-radius-md);
    box-shadow: var(--dsi-shadow-lg);
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 160px;
    white-space: nowrap;
}

/* Custom range slider */
.dsi-progress-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--dsi-gray-200);
    outline: none;
    cursor: pointer;
    flex: 1;
}
.dsi-progress-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--range-color, var(--dsi-primary));
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}
.dsi-progress-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.dsi-progress-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--range-color, var(--dsi-primary));
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.dsi-progress-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}
.dsi-progress-range::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--dsi-gray-200);
}

/* Slider value label */
.dsi-progress-slider-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--dsi-gray-700);
    min-width: 30px;
    text-align: right;
}

/* Reset button */
.dsi-progress-reset-btn {
    background: none;
    border: 1px solid var(--dsi-gray-200);
    border-radius: 4px;
    padding: 1px 4px;
    color: var(--dsi-gray-500);
    font-size: 0.65rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
}
.dsi-progress-reset-btn:hover {
    background: var(--dsi-gray-100);
    color: var(--dsi-danger);
    border-color: var(--dsi-danger);
}

/* =====================================================================
   Timeline Combo View
   ===================================================================== */
.dsi-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 220px);
}
.dsi-timeline-gantt {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
}
.dsi-timeline-gantt .card-body {
    max-height: 100%;
}
.dsi-timeline-divider {
    height: 8px;
    background: var(--dsi-gray-100);
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dsi-gray-400);
    border: 1px solid var(--dsi-gray-200);
    border-radius: 4px;
    margin: 2px 0;
    flex-shrink: 0;
}
.dsi-timeline-divider:hover {
    background: var(--dsi-gray-200);
}
.dsi-timeline-list {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
}
.dsi-timeline-row {
    cursor: pointer;
    transition: background 0.15s;
}
.dsi-timeline-row:hover {
    background: #f0f4ff;
}
.dsi-timeline-highlight {
    background: #e0edff !important;
}
#timelineGanttContainer {
    min-height: 200px;
}

@media (max-width: 768px) {
    .dsi-timeline-container {
        height: auto;
    }
    .dsi-timeline-gantt {
        min-height: 150px;
        max-height: 40vh;
    }
}

/* =====================================================================
   Print Styles
   ===================================================================== */
@media print {
    /* Hide interactive elements */
    .dsi-navbar, nav.navbar, .chatbot-trigger, .chatbot-window,
    .dsi-bulk-toolbar, .dsi-filter-bar, #taskFilterBar,
    .btn, button, .dropdown, footer, .chatbot-fab,
    #viewTabs, #boardPhaseFilter, .dsi-drag-handle,
    .dsi-task-checkbox, .modal, .modal-backdrop,
    #dsiContextMenu { display: none !important; }

    /* Clean card styles */
    .card, .dsi-card { box-shadow: none !important; border: 1px solid #ddd !important; }
    .card-header { background: #f8f9fa !important; }

    /* Typography */
    body { font-size: 11pt !important; color: #000 !important; background: #fff !important; }
    .dsi-page-header h1 { font-size: 16pt !important; }

    /* Layout */
    .container, .container-fluid { max-width: 100% !important; padding: 0 !important; }
    .col-md-4, .col-md-6, .col-md-8 { flex: 0 0 auto; width: auto; }

    /* Tables */
    .table { font-size: 9pt !important; }
    .table th, .table td { padding: 4px 6px !important; }

    /* Progress bars visible in print */
    .dsi-progress-bar { border: 1px solid #ddd; }

    /* Page breaks */
    .dsi-phase-card { page-break-inside: avoid; }
    .card { page-break-inside: avoid; }
}

/* =====================================================================
   Mobile Responsiveness
   ===================================================================== */

/* Large tablets (992px) */
@media (max-width: 992px) {
    .dsi-kanban-column { min-width: 240px; }
    .dsi-page-header { flex-direction: column; gap: 0.75rem; }
    .dsi-page-header > div:last-child { align-self: flex-start; }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    .dsi-kanban-board { gap: 0.75rem; }
    .dsi-kanban-column { min-width: 220px; }

    /* Stack filter inputs */
    #taskFilterBar .row > div { flex: 0 0 50%; max-width: 50%; }
    #taskFilterBar .col-md-3 { flex: 0 0 100%; max-width: 100%; }

    /* Stat cards smaller */
    .dsi-stat-card .stat-value,
    .dsi-project-header .fs-3 { font-size: 1.5rem !important; }

    /* Tabs wrap */
    .dsi-tabs { flex-wrap: wrap; gap: 0.25rem; }
    .dsi-tab { font-size: 0.8rem; padding: 0.4rem 0.8rem; }

    /* Modal full-width */
    .modal-dialog { max-width: 95%; margin: 0.5rem auto; }
    .modal-lg { max-width: 95%; }
}

/* Small mobile (576px) */
@media (max-width: 576px) {
    /* Stack filter bar vertically */
    #taskFilterBar .row > div { flex: 0 0 100%; max-width: 100%; }

    /* Hide less important columns */
    .dsi-phase-body .table th:nth-child(n+6),
    .dsi-phase-body .table td:nth-child(n+6) { display: none; }

    /* Phase header compact */
    .dsi-phase-header { flex-wrap: wrap; padding: 0.5rem 0.75rem; }
    .dsi-phase-header .d-flex.gap-1 { width: 100%; margin-top: 0.5rem; }

    /* Full-width buttons */
    .btn-group-sm .btn { padding: 0.25rem 0.4rem; font-size: 0.75rem; }

    /* Bulk toolbar responsive */
    .dsi-bulk-toolbar { bottom: 12px; padding: 0.5rem 0.75rem; border-radius: 16px; width: calc(100% - 24px); }
    .dsi-bulk-toolbar .form-select { width: 100px !important; font-size: 0.75rem; }

    /* Project header compact */
    .dsi-project-header .row { flex-direction: column; }
    .dsi-project-header .col-md-4 { margin-top: 1rem; }

    /* Kanban scrollable */
    .dsi-kanban-board { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dsi-kanban-column { min-width: 260px; }

    /* Modal full-screen on mobile */
    .modal-dialog, .modal-lg { max-width: 100%; margin: 0; height: 100%; }
    .modal-content { border-radius: 0; min-height: 100vh; }

    /* Larger touch targets */
    .dsi-task-checkbox { width: 1.25rem; height: 1.25rem; }
    .dsi-drag-handle { padding: 0.5rem; }
    .dsi-kanban-card { padding: 0.75rem; }
    .form-select, .form-control, .btn { min-height: 44px; }

    /* Page header compact */
    .dsi-page-header h1 { font-size: 1.25rem; }
    .dsi-page-header .btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }

    /* Touch optimization */
    * { touch-action: manipulation; }
}

/* Floating Action Button (mobile only) */
.dsi-fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dsi-primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    font-size: 1.5rem;
    z-index: 8000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.dsi-fab:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5); }
.dsi-fab:active { transform: scale(0.95); }

.dsi-fab-menu {
    display: none;
    position: fixed;
    bottom: 144px;
    right: 20px;
    z-index: 8000;
    flex-direction: column;
    gap: 0.5rem;
}

.dsi-fab-menu.show { display: flex; }

.dsi-fab-action {
    background: var(--dsi-gray-800);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
}

.dsi-fab-action:hover { background: var(--dsi-primary); }

@media (max-width: 768px) {
    .dsi-fab { display: flex; align-items: center; justify-content: center; }
}
