:root {
    --primary-blue: #2563EB;
    --primary-hover: #1D4ED8;
    --danger-red: #DC2626;
    --danger-bg: #FEE2E2;
    --success-green: #10B981;
    --success-bg: #D1FAE5;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-body: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;
    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Icons (using text fallback or SVGs in HTML) */

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-new-task {
    background-color: var(--primary-blue);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    display: block;
    border: none;
    width: 100%;
}

.btn-new-task:hover {
    background-color: var(--primary-hover);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background-color: #EFF6FF;
    color: var(--primary-blue);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Area in Main Content */
.main-header {
    background-color: var(--bg-white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: #F3F4F6;
}

/* Dashboard Specifics */
.dashboard-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    color: var(--text-muted);
}

.filter-chip.active {
    background-color: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.filter-chip .count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 0 0.4rem;
    margin-left: 0.4rem;
    font-size: 0.75rem;
}

.filter-chip:not(.active) .count {
    background: #E5E7EB;
    color: var(--text-muted);
}

.search-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.search-container input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
}

/* Task Cards */
.task-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-left: 4px solid transparent;
    /* Potential priority indicator */
}

.task-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #E0E7FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-blue);
}

.task-info {
    flex: 1;
}

.task-meta-top {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.task-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-danger {
    background: var(--danger-bg);
    color: var(--danger-red);
}

.tag-neutral {
    background: #F3F4F6;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.tag-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--danger-red);
    font-weight: 500;
}

.progress-section {
    margin-top: 1rem;
}

.progress-bar-bg {
    height: 6px;
    background: #F3F4F6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--danger-red);
    border-radius: 3px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal / Create Task Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    /* Ensure it fits on screen vertically */
    overflow-y: auto;
    /* Scroll if too tall */
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Form Elements */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

.form-input:focus {
    outline: 2px solid var(--primary-blue);
    border-color: transparent;
}

/* Chat */
.chat-container {
    display: flex;
    height: 100%;
    background: white;
}

.chat-list {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-item:hover,
.chat-item.active {
    background: #EFF6FF;
}

.chat-avatar-icon {
    width: 36px;
    height: 36px;
    background: #DBEAFE;
    color: var(--primary-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FCFCFD;
}

.chat-box-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-input-wrapper {
    background: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input-row {
    background: #F3F4F6;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-input-field {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    padding: 0.5rem;
    font-size: 0.95rem;
}

.btn-send {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-bubble {
    max-width: 60%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message-bubble.other {
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0;
}

.message-bubble.mine {
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 0;
    /* align-self: flex-end; Removed, handled by row */
}

/* Zalo-like Message Layout */
.message-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: flex-start;
    width: 100%;
}

.message-row.mine {
    flex-direction: row-reverse;
}

.message-row.other {
    flex-direction: row;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 5px;
    /* Slight offset if aligns top */
}

.message-content-wrapper {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Allow shrinking */
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    /* Smoother radius */
    background: #F0F2F5;
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
    /* Fit wrapper */
    width: fit-content;
    /* Don't stretch full width unless needed */
}

.message-row.mine .message-bubble {
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 0;
}


.message-sender-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #555;
    margin-left: 0.5rem;
    /* Indent slightly */
}

.message-row.mine .message-sender-name {
    display: none;
    /* Usually don't show own name */
}


/* Fix for Dropdown/Select Scroll Issues */
.dropdown-menu,
.dropdown-content,
.select-items,
.select-dropdown,
[class*="dropdown-list"],
.custom-select-options,
.select2-container,
.select2-dropdown {
    z-index: 99999 !important;
}

.select2-dropdown {
    max-height: 250px !important;
    overflow-y: auto !important;
}

/* Ensure modal contents allow overflow if needed, or handle z-index properly */
.modal-card {
    overflow-y: auto;
    /* Ensure the modal itself scrolls */
}

/* If using a specific library class for the group selection, target it here */
.group-select-dropdown {
    max-height: 200px;
    overflow-y: auto;
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F3F4F6;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.875rem;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: var(--danger-bg);
    color: var(--danger-red);
    border: 1px solid #FECACA;
}


/* Chat Mobile Optimization */
@media (max-width: 768px) {
    .chat-layout-wrapper {
        position: relative;
    }

    .chat-list {
        width: 100%;
        display: flex;
        /* Default show list */
    }

    .chat-box {
        display: none;
        /* Default hide box */
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: white;
        z-index: 20;
    }

    /* When Chat Active (controlled via JS class or inline style override) */
    .chat-box.active {
        display: flex;
    }

    .chat-list.hidden {
        display: none;
    }

    .btn-back-mobile {
        display: block !important;
        margin-right: 0.5rem;
        background: none;
        border: none;
        color: var(--primary-blue);
        cursor: pointer;
    }
}

.btn-back-mobile {
    display: none;
}

.login-card {
    padding: 1.5rem;
    box-shadow: none;
    background: transparent;
}

.login-container {
    background: white;
    align-items: flex-start;
    padding-top: 3rem;
}

.login-header h1 {
    font-size: 1.75rem;
}

/* Dashboard Mobile Responsiveness - BOTTOM NAV LAYOUT */
@media (max-width: 768px) {

    .sidebar,
    .btn-outline.mobile-only,
    #sidebarOverlay {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Adjust main header for mobile */
    .main-header {
        padding: 0.75rem 1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    /* Adjust dashboard content padding */
    .dashboard-content {
        padding: 1rem;
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* Bottom Navigation Styles */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6B7280;
    font-size: 0.7rem;
    gap: 0.2rem;
}

.bottom-nav .nav-item.active {
    color: var(--primary-blue);
}

.bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
}

.bottom-nav .nav-item-fab {
    position: relative;
    top: -1.5rem;
}


.bottom-nav .fab-circle {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
    border: 4px solid white;
}

/* Modal Mobile Adjustments */
@media (max-width: 768px) {
    .modal-card {
        padding: 1.5rem;
        width: 95%;
    }
}

/* Task Detail Component Styles (Extracted) */
.task-detail-user-line {
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.transfer-btn-styled {
    position: absolute;
    top: -18px;
    right: 0;
    background: #F3F4F6;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #4B5563;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.transfer-dropdown-styled {
    display: none;
    position: absolute;
    top: 2.5rem;
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 200px;
}

.task-detail-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.description-box {
    background: #F9FAFB;
    padding: 0.25rem;
    border-radius: 0.75rem;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.comment-bubble {
    background: #F0F2F5;
    padding: 0.4rem 0.65rem;
    border-radius: 16px;
    position: relative;
    display: inline-block;
    width: auto;
    min-width: 60px;
}

.reaction-summary {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: white;
    border-radius: 10px;
    padding: 1px 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1px;
    font-size: 0.6rem;
    z-index: 10;
    border: 1px solid #E5E7EB;
}

.reaction-picker {
    display: none;
    flex-direction: row;
    position: absolute;
    bottom: calc(100% + 5px);
    left: -10px;
    background: white;
    border-radius: 20px;
    padding: 4px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    gap: 4px;
    z-index: 1000;
    align-items: center;
    border: 1px solid #E5E7EB;
}

/* Modal Layout & Components */
.modal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.modal-col-left {
    flex: 3;
    min-width: 300px;
    border-right: 1px solid #E5E7EB;
    padding-right: 1rem;
    position: relative;
}

.modal-col-right {
    flex: 2;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
}

.user-info-text {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.2;
}

.user-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.transfer-select {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
}

.transfer-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.btn-transfer-submit {
    flex: 1;
    padding: 0.4rem;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-transfer-cancel {
    flex: 1;
    padding: 0.4rem;
    background: #6B7280;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.tags-container {
    margin-bottom: 2rem;
}

.assignee-box {
    background: white;
    border: 1px solid #E5E7EB;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.assignee-label {
    color: #6B7280;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.assignee-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #F9FAFB;
    border-radius: 0.5rem;
}

.assignee-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.action-row-modal {
    /* margin-top: 2rem; */
    display: flex;
    gap: 0.75rem;
}

.btn-update-compact {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid #DBEAFE;
    background: #EFF6FF;
    color: #1E40AF;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-complete-compact {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: #10B981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.update-panel {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 0.5rem;
    border: 1px solid #E5E7EB;
}

.form-label-sm {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #374151;
}

.comments-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.comments-count-badge {
    background: #F3F4F6;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6B7280;
}

.comments-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    max-height: 500px;
}

.comment-input-area {
    border-top: 1px solid #E5E7EB;
    padding-top: 0.5rem;
    margin-top: auto;
}

.comment-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding-bottom: 2px;
}

.comment-textarea-styled {
    padding-right: 2.2rem;
    resize: none;
    border-radius: 18px;
    min-height: 36px;
    max-height: 150px;
    padding-top: 8px;
    font-size: 0.9rem;
    background: #F0F2F5;
    border: none;
    display: block;
    overflow-y: hidden;
    margin-bottom: 0;
}

.comment-send-btn {
    background: none;
    color: var(--primary-blue);
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.assignees-followers-section {
    display: flex;
    flex-direction: column;
    /* gap: 1rem; */
    /* padding: 0 0;  */
    border-bottom: 1px solid var(--border-color);
}

.header-modal {
    width: 800px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

#commentInput-main {
    /* padding-right: 2.2rem; */
    resize: none;
    border-radius: 5px;
    min-height: 36px;
    max-height: 150px;
    padding: 5px 5px;
    font-size: 0.9rem;
    background: #F0F2F5;
    border: none;
    display: block;
    overflow-y: hidden;
    margin-bottom: 0;
    width: 100%;
}

#div_text_comment {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: #F0F2F5;
    /* border-radius: 18px;  */
    padding-right: 0.5rem;
    justify-content: space-between;
}

/* Chat Mobile Fixes - Appended */
@media (max-width: 768px) {
    .chat-layout-wrapper {
        position: relative;
        height: calc(100vh - 65px) !important;
        /* Force height to fit above nav */
        display: flex;
        flex-direction: column;
    }

    .chat-list {
        width: 100%;
        display: flex;
        /* Default show list */
    }

    .chat-box {
        display: none;
        /* Default hide box */
        width: 100%;
        height: 100vh !important;
        /* Full viewport height */
        position: fixed;
        /* Fixed to cover screen */
        top: 0;
        left: 0;
        bottom: 0;
        background: white;
        z-index: 900;
        flex-direction: column;
    }

    /* When Chat Active */
    .chat-box.active {
        display: flex;
    }

    .chat-list.hidden {
        display: none;
    }

    /* Ensure input is visible - now at bottom since nav is hidden */
    .chat-input-wrapper {
        position: fixed !important;
        bottom: 20px !important;
        /* Increased padding from bottom */
        left: 10px !important;
        /* Add left padding */
        right: 10px !important;
        /* Add right padding */
        width: auto !important;
        /* Auto width with padding */
        z-index: 2000 !important;
        padding: 0 !important;
        /* Remove padding to let form handle it */
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        /* Stack preview above input */
        align-items: stretch;
        gap: 0;
    }

    .chat-input-row {
        background: white !important;
        padding: 10px !important;
        border-radius: 8px;
        border: 1px solid #ddd;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 80px !important;
        /* Space for input only (no nav) */
    }

    /* Fix Message Bubbles on Mobile */
    .message-content-wrapper {
        max-width: 85%;
        /* Increase width for mobile */
    }

    .message-row {
        gap: 5px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    /* Fix Member Name visibility in Mobile Sidebar */
    .chat-info-sidebar span {
        color: #333 !important;
        /* Force dark color */
        display: inline-block;
        font-size: 0.9rem;
    }

    /* Close button visibility */
    .btn-back-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-right: 0.5rem;
        background: none;
        border: none;
        color: var(--primary-blue);
        cursor: pointer;
        z-index: 9999 !important;
        /* Ensure it's clickable */
        position: relative;
        padding: 8px;
    }
}