/* ================================================
   Viso PREMIUM THEME
   Clean, modern UI with subtle animations
   ================================================ */

/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
    --viso-primary: #3b82f6;
    --viso-primary-hover: #2563eb;
    --viso-primary-light: rgba(59, 130, 246, 0.08);
    --viso-primary-glow: rgba(59, 130, 246, 0.25);

    --viso-sidebar-bg: #0f172a;
    --viso-sidebar-text: #94a3b8;
    --viso-sidebar-hover: #1e293b;
    --viso-sidebar-active: rgba(59, 130, 246, 0.12);
    --viso-sidebar-width: 240px;
    --viso-sidebar-docked-width: 68px;

    --viso-bg-main: #f8fafc;
    --viso-bg-card: #ffffff;
    --viso-text-main: #1e293b;
    --viso-text-muted: #64748b;
    --viso-border: #e2e8f0;
    --viso-border-light: #f1f5f9;

    --viso-radius: 10px;
    --viso-radius-lg: 14px;
    --viso-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --viso-shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --viso-shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.12), 0 4px 8px -4px rgba(0, 0, 0, 0.06);

    --viso-danger: #ef4444;
    --viso-success: #22c55e;
    --viso-warning: #f59e0b;
    --viso-info: #06b6d4;
}

/* ===========================
   GLOBAL & TYPOGRAPHY
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--viso-bg-main);
    color: var(--viso-text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===========================
   SCROLLBARS
   =========================== */
::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

::-webkit-scrollbar:horizontal {
    height: 0;
}

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

::-webkit-scrollbar-thumb {
    background: var(--viso-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--viso-primary-hover);
}

.viso-scroll::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

.viso-scroll::-webkit-scrollbar:horizontal {
    height: 0;
}

.viso-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.viso-scroll::-webkit-scrollbar-thumb {
    background: var(--viso-primary);
    border-radius: 10px;
}

.viso-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--viso-primary-hover);
}

/* ===========================
   LAYOUT
   =========================== */
.viso-app {
    display: flex;
    height: 100vh;
}

.viso-sidebar {
    width: var(--viso-sidebar-width);
    min-width: var(--viso-sidebar-width);
    max-width: var(--viso-sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1a1f3a 100%);
    color: var(--viso-sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 300;
    /* Ensure it's above everything including main and modas */
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* overflow removed from here to allow floating toggle */
}

.viso-sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    height: calc(100% - 80px - 60px);
    /* Subtract header and footer */
}

.viso-sidebar.docked .viso-sidebar-body {
    overflow-y: auto;
    overflow-x: clip;
}

.viso-sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.viso-sidebar.docked .viso-sidebar-header {
    padding: 0;
    justify-content: center;
}

#sidebarLock {
    transition: all 0.2s ease;
}

#sidebarLock.locked i {
    color: var(--viso-primary);
    opacity: 1 !important;
}

.viso-sidebar.docked #sidebarLock {
    display: none;
}

/* Sidebar Toggle - Standardized external position on border edge */
.viso-sidebar-toggle {
    position: absolute !important;
    right: -12px !important;
    /* Centered on border edge */
    left: auto !important;
    top: 24px !important;
    width: 24px !important;
    height: 24px !important;
    background: var(--viso-sidebar-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 310 !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2) !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    background: var(--viso-sidebar-hover) !important;
}

.viso-sidebar.docked .viso-sidebar-toggle {
    right: -12px !important;
    /* Keep it on the same spot relative to border */
    top: 24px !important;
}

.viso-sidebar.docked .viso-brand-text span {
    display: none;
}

.viso-sidebar.docked .viso-brand-text img {
    margin: 0 !important;
}

.viso-sidebar.docked {
    width: var(--viso-sidebar-docked-width);
    min-width: var(--viso-sidebar-docked-width);
    max-width: var(--viso-sidebar-docked-width);
}

.viso-main {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--viso-bg-main);
    margin-left: var(--viso-sidebar-width) !important;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-docked .viso-main,
.viso-sidebar.docked+.viso-main {
    margin-left: var(--viso-sidebar-docked-width) !important;
}

/* ===========================
   HEADER / NAVBAR
   =========================== */
.viso-header {
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--viso-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.viso-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.viso-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.viso-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--viso-text-dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viso-header-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.2s ease;
    border: 2px solid transparent !important;
    background: transparent;
}

.viso-header-profile:hover {
    background: var(--viso-primary-light);
    border-color: var(--viso-primary) !important;
}

.viso-header-profile::after {
    display: none !important; /* Hide bootstrap caret */
}

.viso-profile-dropdown {
    border: 1px solid var(--viso-border);
    border-radius: 12px;
    box-shadow: var(--viso-shadow-lg);
    padding: 8px;
    min-width: 200px;
    margin-top: 10px;
}

.viso-profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--viso-text-main);
}

.viso-profile-dropdown .dropdown-item:hover {
    background: var(--viso-primary-light);
    color: var(--viso-primary);
}

.viso-profile-dropdown .dropdown-divider {
    margin: 8px 0;
    border-color: var(--viso-border-light);
}

/* ===========================
   LOGO
   =========================== */
.viso-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.quick-add-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--viso-primary), #4f46e5);
    border-radius: 16px;
    /* Curvy square/squircle look */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 22px;
    /* Lift it above the dock line */
}

.quick-add-btn i {
    font-size: 20px !important;
    margin-bottom: 0 !important;
}

.quick-add-btn:active {
    transform: scale(0.9) translateY(2px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.viso-dock-item.quick-add {
    max-width: 20%;
    z-index: 10;
}

/* ===========================
   SIDEBAR ITEMS
   =========================== */
.viso-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 2px 0.75rem;
    border-radius: 10px;
    position: relative;
    white-space: nowrap;
    color: var(--viso-sidebar-text);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease, transform 0.15s ease;
    border: none;
    background: transparent;
    width: calc(100% - 1rem);
    text-align: left;
    cursor: pointer;
}

.viso-sidebar-item:hover {
    background-color: var(--viso-sidebar-hover);
    color: #e2e8f0;
}

.viso-sidebar-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
    color: var(--viso-primary);
    border-left: 3px solid var(--viso-primary);
}

.viso-sidebar-item-light {
    color: #475569 !important;
    background: transparent;
}

.viso-sidebar-item-light:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
    color: var(--viso-primary) !important;
}

.viso-sidebar-item-light.active {
    background-color: rgba(59, 130, 246, 0.08) !important;
    color: var(--viso-primary) !important;
    font-weight: 700 !important;
}

.viso-sidebar-item i {
    width: 18px;
    height: 18px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viso-sidebar.docked .viso-sidebar-item {
    justify-content: center;
    padding: 0.625rem 0;
    gap: 0;
    position: relative;
}

.viso-sidebar.docked .viso-sidebar-item>span:not(.viso-sidebar-tooltip) {
    display: none;
}

.viso-sidebar.docked .viso-sidebar-section-title {
    text-align: center;
    padding: 1.25rem 0 0.5rem;
    font-size: 0;
}

.viso-sidebar.docked .viso-sidebar-section-title::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

.viso-sidebar.docked .viso-brand-text {
    display: none;
}

.viso-brand-text-only {
    color: var(--viso-sidebar-text);
}

.viso-sidebar-item.active .viso-brand-text-only {
    color: var(--viso-primary);
}

.viso-sidebar-expanded-children {
    display: none !important;
}

/* Sidebar Title Icon Button (Replacement for Overlay Plus) */
.viso-sidebar-icon-btn {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
}

.viso-sidebar-icon-btn:hover {
    background: var(--viso-primary);
    transform: scale(1.1);
}

.viso-sidebar-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.viso-sidebar.docked .viso-sidebar-badge {
    display: none;
}

.viso-sidebar.docked .viso-sidebar-section-title {
    position: relative;
    padding: 1.25rem 0 0.75rem;
    /* Increased bottom padding */
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
    /* Added margin for extra gap */
}

.viso-sidebar.docked .viso-sidebar-icon-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    /* Subtle default */
    box-shadow: none;
    z-index: 20;
    margin-top: 4px;
    /* Tiny adjustment for visual centering */
}

.viso-sidebar.docked .viso-sidebar-icon-btn:hover {
    background: var(--viso-primary);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.viso-sidebar.docked .viso-sidebar-section-title span {
    display: none;
}

.viso-sidebar.docked .viso-sidebar-section-title::after {
    display: none;
    /* Hide the divider line to favor the plus button */
}

/* Ensure no wrapper conflicts with centering */
.viso-sidebar-item-wrapper {
    position: relative;
    width: 100%;
}

/* Docked Text Viewer / Submenu on Hover - Refined Premium Style */
.viso-sidebar-tooltip {
    position: fixed;
    left: 20px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 3000;
    display: none;
    white-space: nowrap;
    width: auto;
    min-width: 160px;
    transform: translateX(-5px) scale(0.98);
    visibility: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Invisible bridge to prevent tooltip from closing when moving mouse across the gap */
.viso-sidebar-tooltip::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 30px;
    height: 100%;
    background: transparent;
}

.viso-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ffffff !important;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0.1px;
}

.viso-tooltip-header:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.viso-tooltip-header i {
    color: var(--viso-primary);
    font-size: 14px;
}

.viso-sidebar-item:hover .viso-sidebar-tooltip,
.viso-sidebar-tooltip:hover {
    opacity: 1 !important;
    transform: translateX(10px) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto;
}

.viso-sidebar-child-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.viso-sidebar-child-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--viso-primary);
}

.viso-sidebar-child-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--viso-primary);
}

.viso-sidebar-expanded-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    transition: all 0.2s ease;
}

.viso-sidebar.docked .viso-sidebar-expanded-children {
    display: none;
}

.viso-sidebar-section-title {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    padding: 1rem 1rem 0.5rem;
    cursor: default;
    transition: color 0.15s;
}

.viso-sidebar-section-title:hover {
    color: rgba(255, 255, 255, 0.6);
}

.viso-project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.viso-project-dot.highlighted {
    box-shadow: 0 0 8px currentColor;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ===========================
   CARDS
   =========================== */
.card {
    border: 0 !important;
    box-shadow: var(--viso-shadow-sm) !important;
    border-radius: var(--viso-radius) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--viso-shadow-md) !important;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--viso-border-light);
    font-weight: 600;
}

/* ===========================
   METRIC CARDS (Dashboard)
   =========================== */
.viso-metric-card {
    background: white;
    border-radius: var(--viso-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--viso-shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.viso-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--viso-radius-lg) var(--viso-radius-lg) 0 0;
}

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

.viso-metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.viso-metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.viso-metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--viso-text-muted);
}

/* Metric color variants */
.viso-metric-danger::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.viso-metric-danger .viso-metric-icon {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.viso-metric-danger .viso-metric-value {
    color: #ef4444;
}

.viso-metric-primary::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.viso-metric-primary .viso-metric-icon {
    background: var(--viso-primary-light);
    color: var(--viso-primary);
}

.viso-metric-primary .viso-metric-value {
    color: var(--viso-primary);
}

.viso-metric-warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.viso-metric-warning .viso-metric-icon {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.viso-metric-warning .viso-metric-value {
    color: #f59e0b;
}

.viso-metric-success::before {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.viso-metric-success .viso-metric-icon {
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
}

.viso-metric-success .viso-metric-value {
    color: #22c55e;
}

/* ===========================
   GRADIENT PROGRESS CARD
   =========================== */
.bg-gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%) !important;
}

.viso-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.viso-progress-ring svg {
    display: block;
}

.viso-progress-ring-text {
    position: absolute;
    font-size: 1rem;
    font-weight: 800;
    color: white;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

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

.btn-light {
    background-color: #f8fafc;
    border-color: var(--viso-border);
    color: var(--viso-text-muted);
}

.btn-light:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

/* ===========================
   BADGES
   =========================== */
.badge {
    font-weight: 500;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    font-size: 0.75em;
}

/* ===========================
   FORMS
   =========================== */
.form-control,
.form-select {
    border-color: var(--viso-border);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--viso-primary);
    box-shadow: 0 0 0 3px var(--viso-primary-light);
}

.form-control-sm {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
}

/* ===========================
   TASK ROW
   =========================== */
.viso-task-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--viso-border-light);
    border-radius: var(--viso-radius);
    box-shadow: var(--viso-shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.viso-task-row:hover {
    box-shadow: var(--viso-shadow-md);
    transform: translateY(-1px);
    border-color: var(--viso-border);
}

.viso-task-row .task-title {
    flex-grow: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

.viso-task-row .task-title.completed {
    text-decoration: line-through;
    color: var(--viso-text-muted);
}


/* ===========================
   SLIDE-OVER MODAL
   =========================== */
.viso-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1050 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.viso-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.viso-slide-over {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    width: 100%;
    max-width: 80vw;
    background: white;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 1100 !important;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.viso-slide-over.show {
    transform: translateX(0);
}

/* ===========================
   PROGRESS
   =========================== */
.progress {
    height: 6px;
    border-radius: 9999px;
    background-color: var(--viso-border-light);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--viso-primary), #6366f1);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #22c55e, #4ade80) !important;
}


/* ===========================
   MODAL OVERRIDES
   =========================== */
.modal-content {
    border-radius: var(--viso-radius-lg) !important;
    border: none !important;
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
}

/* ===========================
   DROPDOWN OVERRIDES
   =========================== */
.dropdown-menu {
    border-radius: var(--viso-radius) !important;
    box-shadow: var(--viso-shadow-lg) !important;
    border: 1px solid var(--viso-border-light) !important;
    padding: 0.375rem !important;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.dropdown-item:hover {
    background-color: var(--viso-bg-main);
}

/* ===========================
   UNIFIED TASK CHAT PANEL
   =========================== */
.viso-task-activity-panel {
    width: 280px;
    min-width: 250px;
}

.viso-task-chat-panel {
    width: 440px;
    min-width: 360px;
    max-width: 500px;
}

/* ── Chat Bubbles ─────────────────────────────────── */
.viso-chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.viso-chat-bubble-wrap.mine {
    align-items: flex-end;
}

.viso-chat-bubble-wrap.theirs {
    align-items: flex-start;
}

.viso-chat-bubble {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    animation: visoFadeIn 0.2s ease both;
}

.viso-chat-bubble-wrap.mine .viso-chat-bubble {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.viso-chat-bubble-wrap.theirs .viso-chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.viso-chat-meta {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Attachment in bubble ─────────────────────────── */
.viso-chat-attach {
    margin-top: 6px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 200px;
}

.viso-chat-attach img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 10px;
    transition: opacity 0.2s;
}

.viso-chat-attach img:hover {
    opacity: 0.92;
}

.viso-chat-attach-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,.06);
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.18s;
    text-decoration: none;
    color: inherit;
}

.viso-chat-bubble-wrap.mine .viso-chat-attach-file {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.viso-chat-attach-file:hover {
    background: rgba(0,0,0,.12);
}

/* ── Drag and Drop ────────────────────────────────── */
.viso-task-chat-panel.drag-over {
    background-color: #f0f7ff !important;
    position: relative;
}

.viso-task-chat-panel.drag-over::after {
    content: 'Drop files here';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 3px dashed var(--viso-primary);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--viso-primary);
    pointer-events: none;
    border-radius: 4px;
}

/* ── Input area icons & send ──────────────────────── */
.viso-chat-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}

.viso-chat-icon-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

#taskChatInput {
    min-height: 42px !important; /* Minimum comfortable height */
}

.viso-chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.viso-chat-send-btn:not([disabled]) {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59,130,246,.3);
}

.viso-chat-send-btn:not([disabled]):hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(59,130,246,.4);
}

/* ── Pending attach preview ───────────────────────── */
#taskPendingAttachBar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
}

#taskPendingAttachBar::-webkit-scrollbar {
    height: 6px;
}
#taskPendingAttachBar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.viso-pending-chip {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--viso-border-light);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.viso-pending-chip img,
.viso-pending-chip video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viso-pending-chip .viso-pending-icon {
    font-size: 24px;
    color: #64748b;
}

.viso-pending-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    border: none;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    z-index: 10;
}
.viso-pending-remove:hover {
    background: #ef4444;
}

.viso-pending-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   UTILITIES
   =========================== */
.viso-cursor-pointer {
    cursor: pointer;
}

.viso-cursor-grab {
    cursor: grab;
}

.viso-transition-all {
    transition: all 0.2s ease;
}

.viso-hover-shadow:hover {
    box-shadow: var(--viso-shadow-md) !important;
}

.viso-hover-bg-light:hover {
    background-color: #f8fafc !important;
}

.viso-hover-text-primary:hover {
    color: var(--viso-primary) !important;
}

.viso-text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.viso-fs-14 {
    font-size: 14px;
}

.viso-fs-13 {
    font-size: 13px;
}

.viso-fs-12 {
    font-size: 12px;
}

.viso-fs-11 {
    font-size: 11px;
}

.viso-fs-10 {
    font-size: 10px;
}

.leading-none {
    line-height: 1 !important;
}

.leading-tight {
    line-height: 1.25 !important;
}

.viso-ls-1 {
    letter-spacing: 0.5px;
}

.viso-gap-05 {
    gap: 0.125rem;
}

.viso-min-w-0 {
    min-width: 0;
}

/* Avatar stack */
.viso-avatar-stack {
    display: flex;
}

.viso-avatar-stack img {
    margin-left: -6px;
}

.viso-avatar-stack img:first-child {
    margin-left: 0;
}

/* Online indicator */
.viso-online-dot {
    width: 10px;
    height: 10px;
    background: var(--viso-success);
    border: 2px solid var(--viso-sidebar-bg);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

/* Task assignee chips in modal */
.viso-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 3px;
    background: #ffffff;
    border: 1px solid var(--viso-border-light);
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--viso-text-dark);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    cursor: pointer;
    min-height: 28px;
    max-height: 28px;
    margin: 2px 0;
}

.viso-assignee-chip:hover {
    border-color: var(--viso-primary);
    background: var(--viso-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(59, 130, 246, 0.15);
}

.viso-assignee-chip.selected {
    border-color: var(--viso-primary);
    background: var(--viso-primary-light);
    color: var(--viso-primary);
    box-shadow: 0 0 0 1px var(--viso-primary), 0 2px 4px rgba(59, 130, 246, 0.08);
}

.viso-assignee-chip .remove-btn {
    cursor: pointer;
    color: var(--viso-text-muted);
    font-size: 11px;
    margin-left: 2px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.viso-assignee-chip:hover .remove-btn {
    color: var(--viso-danger);
    transform: scale(1.1);
}

/* Assignee Selection Popup */
#assigneeSelectionPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    z-index: 2000;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#assigneeSelectionPopup.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#assigneeSelectionPopup .popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--viso-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#assigneeSelectionPopup .popup-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

#assigneeSelectionPopup .popup-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--viso-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Overlapped Expanding Chips */
.viso-assignee-stack {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 8px;
}

.viso-assignee-chip.expanding {
    margin-left: -8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.25s ease 0.1s;
    position: relative;
    z-index: 1;
    cursor: pointer;
    background: white;
    border: 2px solid white;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    justify-content: center;
    overflow: visible; /* Changed to visible to support pseudo-element buffer */
    display: flex;
    align-items: center;
}

/* Smart hit-area buffer to prevent flickering when layout shifts */
.viso-assignee-chip.expanding::after {
    content: '';
    position: absolute;
    inset: -4px -10px;
    z-index: -1;
}

.viso-assignee-chip.expanding:first-child {
    margin-left: 0;
}

.viso-assignee-chip.expanding span:not(.remove-btn) {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.viso-assignee-chip.expanding .remove-btn {
    display: none;
}

.viso-assignee-chip.expanding:hover {
    z-index: 100;
    width: auto;
    padding: 3px 12px 3px 3px;
    margin-left: 0;
    margin-right: 8px;
    border-radius: 99px;
    border-color: var(--viso-primary);
    background: white;
    min-width: unset;
    transition-delay: 0s !important; /* Immediate expansion */
}

.viso-assignee-chip.expanding:hover span:not(.remove-btn) {
    display: inline;
    opacity: 1;
}

.viso-assignee-chip.expanding:hover .remove-btn {
    display: inline-flex;
}

.viso-assignee-initials {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--viso-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.viso-assignee-chip.selection {
    cursor: pointer;
    transition: all 0.2s ease;
}

.viso-assignee-chip.selection.selected {
    border-color: var(--viso-primary);
    background: var(--viso-primary-light);
    color: var(--viso-primary);
    box-shadow: 0 0 0 1px var(--viso-primary);
}

.viso-assignee-chip.selection:hover {
    border-color: var(--viso-primary);
    background: var(--viso-primary-light);
}

/* Subtasks */
.viso-subtask-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.viso-subtask-row:hover {
    background: var(--viso-border-light);
}

.viso-subtask-title {
    font-size: 13px;
    font-weight: 500;
    flex-grow: 1;
    color: var(--viso-text-main);
}

.viso-subtask-title.completed {
    color: var(--viso-text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.viso-fs-13 { font-size: 13px; }

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes visoFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes visoSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes visoScaleIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes visoPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.viso-fade-in {
    animation: visoFadeIn 0.3s ease both;
}

.viso-slide-up {
    animation: visoSlideUp 0.4s ease both;
}

.viso-scale-in {
    animation: visoScaleIn 0.3s ease both;
}

/* Stagger animations */
.viso-task-row,
.viso-kanban-card {
    animation: visoFadeIn 0.3s ease both;
}

.viso-task-row:nth-child(1) {
    animation-delay: 0s;
}

.viso-task-row:nth-child(2) {
    animation-delay: 0.03s;
}

.viso-task-row:nth-child(3) {
    animation-delay: 0.06s;
}

.viso-task-row:nth-child(4) {
    animation-delay: 0.09s;
}

.viso-task-row:nth-child(5) {
    animation-delay: 0.12s;
}

.viso-task-row:nth-child(6) {
    animation-delay: 0.15s;
}

.viso-task-hover-effect {
    transition: all 0.2s ease;
    border-radius: 8px;
}

.viso-task-hover-effect:hover {
    background: var(--viso-primary-light);
    transform: translateX(4px);
}

.viso-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.viso-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.viso-metric-card {
    animation: visoScaleIn 0.4s ease both;
}

.viso-metric-card:nth-child(1) .viso-metric-card {
    animation-delay: 0s;
}

.viso-metric-card:nth-child(2) .viso-metric-card {
    animation-delay: 0.1s;
}

.viso-metric-card:nth-child(3) .viso-metric-card {
    animation-delay: 0.2s;
}

.viso-metric-card:nth-child(4) .viso-metric-card {
    animation-delay: 0.3s;
}

/* ===========================
   PREMIUM UTILITIES
   =========================== */
.bg-gradient-dark {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}

.bg-opacity-05 {
    background-color: rgba(var(--viso-primary-rgb), 0.05) !important;
}

.btn-white {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: var(--viso-text-dark) !important;
}

/* Chat Attachment Grouping */
.viso-chat-attach-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.viso-chat-img-grid {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 260px;
}

.viso-chat-img-grid.count-1 { grid-template-columns: 1fr; }
.viso-chat-img-grid.count-2 { grid-template-columns: 1fr 1fr; }
.viso-chat-img-grid.count-3 { grid-template-columns: 1fr 1fr; }
.viso-chat-img-grid.count-4 { grid-template-columns: 1fr 1fr; }

.viso-chat-img-grid .viso-chat-attach {
    margin-top: 0 !important;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
}

.viso-chat-img-grid.count-1 .viso-chat-attach {
    aspect-ratio: auto;
    max-height: 200px;
}

.viso-chat-img-grid.count-3 .viso-chat-attach:first-child {
    grid-column: span 2;
    aspect-ratio: 2/1;
}

.viso-chat-img-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
}

.btn-white:hover {
    background: var(--viso-primary-light) !important;
    color: var(--viso-primary) !important;
}

.viso-avatar-stack {
    display: flex;
    align-items: center;
}

.viso-avatar-stack img {
    margin-right: -8px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.viso-avatar-stack img:hover {
    transform: translateY(-4px) scale(1.1);
    z-index: 10;
}

.viso-slide-shimmer {
    animation: visoFadeIn 0.5s ease-out;
}

.viso-task-hover-effect {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.viso-task-hover-effect:hover {
    background: white !important;
    border-color: var(--viso-primary-light) !important;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.viso-main {
    padding-top: 0 !important;
    /* Removed fixed padding-top as header is sticky and takes up space in the flow */
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .viso-app {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    .viso-sidebar,
    .viso-sidebar-toggle {
        position: fixed !important;
        height: 100vh !important;
        z-index: 500 !important;
        transform: translateX(calc(-100% + 8px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none !important;
        /* Remove blurry shadow */
        border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .viso-header {
        padding: 0 12px !important;
        /* Mobile header margin */
    }

    .viso-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Disable docked (mini) state on mobile to prevent layout breakage */
    .viso-sidebar.docked {
        width: var(--viso-sidebar-width) !important;
        min-width: var(--viso-sidebar-width) !important;
    }

    .viso-sidebar.docked .viso-brand-text span,
    .viso-sidebar.docked .viso-sidebar-item span:not(.viso-sidebar-tooltip),
    .viso-sidebar.docked .sidebar-footer div {
        display: block !important;
    }

    .viso-sidebar.docked .viso-sidebar-header {
        justify-content: space-between !important;
    }

    .viso-sidebar.docked .viso-sidebar-toggle {
        right: -16px !important;
        /* Move it slightly ahead/outside */
        top: 24px !important;
        background: var(--viso-primary) !important;
        /* Make it pop on mobile */
        border: none !important;
        box-shadow: 0 4px 12px rgba(var(--viso-primary-rgb), 0.3) !important;
    }

    .viso-main {
        margin-left: 0 !important;
        padding-bottom: 96px !important;
        /* Space for dock + credit */
    }

    .viso-slide-over {
        max-width: 100%;
    }

    .viso-main {
        margin-left: 0 !important;
        padding-top: 60px !important;
        /* Space for fixed header */
        padding-bottom: 96px !important;
        /* Space for dock + credit */
        min-height: calc(100vh - 156px) !important;
        display: block !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        /* PREVENT HORIZONTAL BODY SCROLL */
        height: auto !important;
        width: 100vw !important;
    }

    .viso-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        padding: 0 16px !important;
        z-index: 100 !important;
        overflow: visible !important;
        /* ALLOW DROPDOWNS */
        background: #ffffff !important;
        border-bottom: 2px solid rgba(0, 0, 0, 0.05) !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .viso-app {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        width: 100vw !important;
    }

    /* Local Horizontal Scrolling for Boards - STRICT CONTAINMENT */
    .viso-main .viso-board-wrapper {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        display: block !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
        position: relative;
    }

    /* Inner scroll container inside wrapper */
    .viso-board-wrapper>.viso-scroll {
        width: max-content !important;
        min-width: 100% !important;
        display: block !important;
    }

    /* Prevent tables from pushing layout */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* Force Natural Scrolling for all main containers on mobile */
    .viso-main .h-100,
    .viso-main .overflow-hidden,
    .viso-main .viso-scroll {
        height: auto !important;
        overflow: visible !important;
        max-height: none !important;
    }

    .viso-mobile-nav-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        z-index: 200 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Move Offcanvas above Fixed Header and Dock */
    .offcanvas {
        z-index: 1000 !important;
    }

    .offcanvas-backdrop {
        z-index: 950 !important;
    }

    .viso-mobile-nav-container>* {
        pointer-events: auto;
        /* Re-enable for children */
    }

    .viso-mobile-dock {
        height: 64px;
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        display: flex;
        align-items: center;
        padding: 0;
        margin: 0 !important;
    }

    .viso-mobile-credit {
        height: 20px;
        background: #f8fafc;
        border-top: 1px solid rgba(0, 0, 0, 0.03);
        font-size: 8px;
        color: #94a3b8;
        display: flex;
        align-items: center;
        justify-content: center;
        letter-spacing: 0.2px;
    }

    .viso-dock-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #64748b;
        text-decoration: none !important;
        font-size: 8.5px;
        /* Slightly smaller to fit */
        font-weight: 600;
        transition: all 0.2s ease;
        flex: 1;
        padding: 4px 0;
        min-width: 0;
        max-width: 20%;
        /* Evenly distribute 5 items */
    }

    .viso-dock-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .viso-dock-item.active {
        color: var(--viso-primary);
    }

    .viso-dock-item.quick-add {
        position: relative;
        top: -14px;
        z-index: 10;
    }

    .quick-add-btn {
        width: 44px;
        height: 44px;
        background: var(--viso-primary);
        color: white;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 16px rgba(var(--viso-primary-rgb), 0.4);
        transform: rotate(45deg);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .quick-add-btn i {
        transform: rotate(-45deg);
        margin-bottom: 0;
        font-size: 20px;
    }

    .viso-header-plus-btn {
        width: 30px;
        height: 30px;
        background: var(--viso-primary);
        color: white;
        border: none;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        transform: rotate(45deg);
        transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        cursor: pointer;
        padding: 0;
        margin-right: 15px;
        /* Gap from avatar */
    }

    .viso-header-plus-btn i {
        transform: rotate(-45deg);
        font-size: 14px;
        margin: 0 !important;
    }

    .viso-header-plus-btn:active {
        transform: rotate(45deg) scale(0.9);
    }

    .viso-mobile-menu-offcanvas {
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        min-height: 60vh !important;
        max-height: 90vh !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        z-index: 1001 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
    }

    .offcanvas-backdrop.show {
        z-index: 1050;
        /* Between dock and offcanvas */
    }

    .viso-mobile-menu-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px 0 40px 0;
    }

    .viso-mobile-menu-section {
        padding: 0 16px;
    }

    .viso-mobile-menu-items-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    @media (min-width: 576px) {
        .viso-mobile-menu-items-grid {
            grid-template-columns: repeat(6, 1fr);
        }
    }

    .viso-mobile-menu-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        border-radius: 12px;
        padding: 12px 4px;
        /* Slightly tighter padding */
        color: #1e293b;
        font-size: 10px;
        /* Slightly smaller for better fit */
        font-weight: 600;
        text-decoration: none !important;
        transition: all 0.2s ease;
        text-align: center;
        gap: 6px;
        min-width: 0;
    }

    .viso-mobile-menu-item span {
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 4px;
    }

    .viso-mobile-menu-item i {
        font-size: 24px;
        color: var(--viso-primary);
    }

    .viso-mobile-menu-item.active {
        background: var(--viso-primary-light);
        border: 1px solid var(--viso-primary);
        color: var(--viso-primary);
    }
}

/* ===========================
   RESPONSIVE TASK SLIDE-OVER
   =========================== */
@media (max-width: 768px) {
    .viso-task-chat-panel,
    .viso-task-activity-panel {
        position: absolute;
        top: 60px; /* Below mobile header (60px) */
        left: 0;
        right: 0;
        bottom: 84px; /* Above mobile dock (64px) + credit (20px) */
        width: 100% !important;
        min-width: 100% !important;
        z-index: 2000;
        background: white;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(100%);
        border-left: none !important;
        display: flex !important; /* Force flex in JS but hidden via transform */
    }

    #taskSlideOver.mobile-comments-active .viso-task-chat-panel,
    #taskSlideOver.mobile-activity-active .viso-task-activity-panel {
        transform: translateX(0);
        pointer-events: auto;
    }
    
    /* Hide by default on mobile if not "shown" */
    .viso-task-chat-panel:not(.show),
    .viso-task-activity-panel:not(.show) {
        pointer-events: none;
    }

    #taskChatToggle.active,
    #taskActivityToggle.active {
        color: var(--viso-primary) !important;
        background: var(--viso-primary-light) !important;
    }
}

@media (min-width: 769px) {
    .viso-task-chat-panel,
    .viso-task-activity-panel {
        transform: none !important;
        pointer-events: auto !important;
        position: relative !important;
        top: 0 !important;
    }
}

/* ===========================
   CALENDAR DOTS & GRID
   =========================== */
.viso-calendar-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 2px white;
    cursor: pointer;
}

.viso-calendar-dot:hover {
    transform: scale(1.5);
    z-index: 10;
}

.viso-month-day {
    min-height: 120px;
    background-color: white;
}

.viso-month-day.other-month {
    background-color: #f8fafc;
    opacity: 0.6;
}

.viso-month-day.drop-target {
    background-color: var(--viso-primary-light) !important;
    border: 2px dashed var(--viso-primary) !important;
}

.dragging-dot {
    opacity: 0.5;
    transform: scale(0.8);
}

@media (max-width: 576px) {
    .d-mobile-none {
        display: none !important;
    }

    .table-responsive {
        border-radius: var(--viso-radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .viso-main .card-body {
        padding: 1rem !important;
    }

    .viso-header-profile {
        padding: 4px !important;
    }
}

.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--viso-primary);
    border-radius: 10px;
}

/* ===========================
   TASK CONTEXT MENU
   =========================== */
.viso-task-context-menu {
    position: absolute;
    z-index: 10000;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: visoFadeIn 0.15s ease-out;
}

@keyframes visoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.viso-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--viso-text-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
}

.viso-context-item:hover {
    background: var(--viso-primary-light);
    color: var(--viso-primary);
}

.viso-context-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.viso-context-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 6px 0;
}

.viso-context-submenu {
    display: none;
    position: absolute;
    top: -6px;
    left: 100%;
    min-width: 160px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin-left: 2px;
    z-index: 10001;
}

.viso-context-item.has-submenu:hover>.viso-context-submenu,
.viso-context-item.has-submenu.mobile-active>.viso-context-submenu {
    display: block;
    animation: visoSlideRight 0.2s ease-out;
}

@keyframes visoSlideRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.viso-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.viso-task-actions-btn {
    transition: all 0.2s;
    border: none !important;
    background: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viso-task-actions-btn i {
    text-decoration: none !important;
}

/* Increased hit area (5px all around) without shifting layout */
.viso-task-actions-btn::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
}

.viso-task-actions-btn:hover {
    color: var(--viso-primary) !important;
}

.viso-task-row:hover .viso-task-actions-btn,
.viso-kanban-card:hover .viso-task-actions-btn,
.viso-backlog-card:hover .viso-task-actions-btn {
    opacity: 1 !important;
}



/* ===========================
   UI COLOR REFINEMENTS
   =========================== */
:root {
    --viso-text-dark: #1e293b;
}

.text-dark {
    color: var(--viso-text-dark) !important;
}

.text-muted {
    color: var(--viso-text-muted) !important;
}

/* Offcanvas mobile full width */
.offcanvas.offcanvas-end {
    width: min(100%, 900px);
}

/* @media (max-width: 768px) {
    .offcanvas.viso-mobile-full-width {
        width: 100% !important;
    }
} */