/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: light only;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-width: 1400px;
    color: #333;
    color-scheme: light only;
    overflow-x: auto;
}

/* Login page specific styles - no scrollbars, always centered */
body.login-page {
    min-width: auto;
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100%;
    height: 100vh;
}

/* Auth Styles - Modern Professional Design */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
}

/* Background decorative elements */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.auth-bg-shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.auth-bg-shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -50px;
    left: -50px;
    animation-delay: 5s;
}

.auth-bg-shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.auth-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
    box-sizing: border-box;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.login-logo-wrapper:hover {
    transform: translateY(-4px) scale(1.05);
}

.login-logo {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    /* Logo shows in original colors on desktop */
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
}

.auth-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    background: #f3f4f6;
    padding: 6px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 14px;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-form {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group label i {
    color: #667eea;
    font-size: 13px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
    color: #667eea;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-label-row label {
    margin-bottom: 0;
}

/* Make task IDs in modal form smaller */
.form-label-row .task-id-link {
    font-size: 12px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #111827;
    font-family: 'Inter', sans-serif;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: #d1d5db;
}

.readonly-field {
    padding: 12px 0;
    color: #333;
    font-size: 16px;
    font-weight: 400;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-auth-submit {
    margin-top: 8px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    width: auto;
}

.btn-danger:hover {
    background: #c82333;
}

.message {
    margin-top: 24px;
    padding: 14px 18px;
    border-radius: 12px;
    text-align: center;
    display: none;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

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

.message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
    display: block;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
    display: block;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: #f8f7fa;
}

.dashboard-header {
    background: linear-gradient(135deg, #4c63d2 0%, #5a3d7a 100%);
    padding: 12px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #f8f8f8;
    border-radius: 50%;
    padding: 8px;
    flex-shrink: 0;
}

.dashboard-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: translateY(-2px);
}

.dashboard-header h1 {
    color: #ffffff;
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.user-info strong {
    color: #ffffff;
    font-weight: 600;
}

.profile-icon {
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 10px;
}

.profile-icon i {
    font-size: 18px;
}

.profile-icon:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.logout-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ff6b6b;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.logout-icon:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff5252;
    border-color: rgba(255, 107, 107, 0.4);
}

.dashboard-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px;
    background: transparent;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 8px;
}

.nav-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.nav-btn i {
    font-size: 18px;
}

.nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn-icon {
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 6px;
}

.project-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    padding: 4px 8px;
    background: transparent;
}

.project-filter-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    font-weight: 500;
}

.project-filter-select {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 150px;
    transition: all 0.3s;
}

.project-filter-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.project-filter-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.project-filter-select option {
    background: #4c63d2;
    color: #ffffff;
}

.project-filter-select option.current-week {
    background: #667eea;
    font-weight: bold;
    color: #ffffff;
}

.dashboard-main {
    padding: 30px;
    padding-top: 74px; /* Reduced to bring content closer to header */
    margin: 0 auto;
    background: #f8f7fa; /* Very subtle lavender-tinted background */
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Chat view specific styling - override for centering */
#chatView.view-section.active {
    display: flex !important;
    justify-content: center;
    width: 100%;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: sticky;
    top: 74px; /* Position right below dashboard header with no gap */
    background: #f8f7fa; /* Match dashboard background */
    z-index: 50;
    padding: 10px 0;
    margin-top: 0;
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-header h2 {
    color: #333;
    font-size: 28px;
}

.view-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-header-left .project-filter {
    margin-left: 0;
}

.view-header-left .project-filter-label {
    color: #555;
    font-size: 16px;
}

.view-header-left .project-filter-select {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.view-header-left .project-filter-select:hover {
    border-color: #667eea;
    background: white;
}

.view-header-left .project-filter-select:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.view-header-left .project-filter-select option {
    background: white;
    color: #333;
}

/* Status filter group - visually groups Backlog, Dropped, and Completed */
.status-filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-filter-group .kanban-toggle-label {
    margin: 0;
}

.view-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.kanban-column-toggles {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-right: 10px;
}

.kanban-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.kanban-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.kanban-toggle-label span {
    font-weight: 500;
}

.view-actions .btn-primary {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 5px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
}

.task-view {
    display: none;
}

.task-view.active {
    display: block;
}

/* Table styles have been moved to css/table.css */

/* Kanban Styles */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.kanban-column {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /* Height based on viewport - header (90px) - dashboard padding (60px) - view header (60px) - margins (40px) */
    height: calc(100vh - 250px);
    /* Minimum height: 2 cards (~240px) + header (~50px) + padding (30px) + gap (10px) */
    min-height: 330px;
    max-height: calc(100vh - 250px);
}

/* Light background colors for each kanban column based on status */
.kanban-column[data-status="Backlog"] {
    background: #DBDBDB !important;
}

.kanban-column[data-status="To Do"] {
    background: #C4D6E3 !important;
}

.kanban-column[data-status="In progress"] {
    background: #DED9B5 !important;
}

.kanban-column[data-status="Completed"] {
    background: #C6DCC6 !important;
}

.kanban-column[data-status="Dropped"] {
    background: #E3C8C8 !important;
}

.kanban-column h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
    font-size: 18px;
    flex-shrink: 0;
}

.kanban-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0; /* Important for flex scrolling */
    /* Smooth scrolling */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.kanban-tasks::-webkit-scrollbar {
    width: 12px;
}

.kanban-tasks::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 8px 8px 0; /* Rounded on the right side to match column */
}

.kanban-tasks::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 0 8px 8px 0; /* Rounded on the right side to match column */
    border: 2px solid transparent; /* Creates space between scrollbar and edge */
}

.kanban-tasks::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.kanban-tasks::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.kanban-task {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.kanban-task:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kanban-task .task-id {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 4px;
}

.kanban-task h4 {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.kanban-task p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.kanban-task .task-meta {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.kanban-task .task-meta div {
    margin-bottom: 4px;
}

/* Completed task collapse/expand styles */
.kanban-task-completed {
    position: relative;
}

.kanban-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.kanban-task-main {
    flex: 1;
    min-width: 0;
}

.kanban-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
    margin-top: -4px;
}

.kanban-toggle-btn:hover {
    color: #333;
}

.kanban-toggle-btn .fas {
    transition: transform 0.3s ease;
}

.task-client-collapsed {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.task-client-collapsed div {
    margin-bottom: 0;
}

.task-meta-expandable {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.kanban-task .task-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Confirmation modals (delete, confirm, alert) should appear above other modals */
#deleteModal.modal,
#confirmModal.modal,
#alertModal.modal {
    z-index: 2000 !important;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    /* Firefox scrollbar styling for modals */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

/* Custom scrollbar styling for modals to maintain rounded corners */
.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 10px 10px 0; /* Rounded on the right side */
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 0 10px 10px 0; /* Rounded on the right side */
    border: 2px solid white; /* Creates space between scrollbar and edge */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.modal-content::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* Task modal (create/edit) - wider than other modals */
#taskModal .modal-content {
    max-width: 800px;
    padding: 20px;
}

#taskModal .modal-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

#taskModal .modal-header h2 {
    font-size: 20px;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

#taskModal .task-mode-label {
    font-size: 12px;
    font-weight: normal;
    font-style: italic;
    margin-left: 4px;
}

#taskModal .task-mode-label.task-mode-edit {
    color: #dc3545; /* Red for editing mode */
}

#taskModal .task-mode-label.task-mode-view {
    color: #0d6efd; /* Blue for view mode */
}

#taskModal #taskEditModeBtn {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#taskModal #taskEditingInfo {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 13px;
}

#taskModal #taskEditingInfo i {
    margin-right: 8px;
}

#taskModal .form-group {
    margin-bottom: 12px;
}

#taskModal .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

#taskModal .markdown-label {
    font-size: 11px;
    color: #666;
    font-style: italic;
    cursor: default;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    border: 1px solid #ddd;
    margin-left: auto; /* Push to extreme right */
}

#taskModal .markdown-label:hover {
    background-color: #e0e0e0;
}

#taskModal .form-group input,
#taskModal .form-group textarea,
#taskModal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

#taskModal .form-group textarea {
    min-height: 80px;
}

#taskModal #taskDescription {
    min-height: 120px;
    height: 120px;
}

#taskModal .task-description-view {
    min-height: 120px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 12px;
}

#taskModal .task-description-view h1,
#taskModal .task-description-view h2,
#taskModal .task-description-view h3,
#taskModal .task-description-view h4,
#taskModal .task-description-view h5,
#taskModal .task-description-view h6 {
    margin: 12px 0 8px 0;
    font-weight: 600;
    color: #333;
}

#taskModal .task-description-view h1 { font-size: 1.25em; }
#taskModal .task-description-view h2 { font-size: 1.15em; }
#taskModal .task-description-view h3 { font-size: 1.05em; }
#taskModal .task-description-view h4 { font-size: 1em; }
#taskModal .task-description-view h5 { font-size: 0.95em; }
#taskModal .task-description-view h6 { font-size: 0.9em; }

#taskModal .task-description-view p {
    margin: 8px 0;
    font-size: 12px;
}

#taskModal .task-description-view ul,
#taskModal .task-description-view ol {
    margin: 8px 0;
    padding-left: 24px;
    font-size: 12px;
}

#taskModal .task-description-view li {
    margin: 4px 0;
    font-size: 12px;
}

#taskModal .task-description-view code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

#taskModal .task-description-view pre {
    background-color: #f4f4f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

#taskModal .task-description-view pre code {
    background-color: transparent;
    padding: 0;
}

#taskModal .task-description-view blockquote {
    border-left: 4px solid #ddd;
    padding-left: 16px;
    margin: 8px 0;
    color: #666;
    font-style: italic;
    font-size: 12px;
}

#taskModal .task-description-view a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 12px;
}

#taskModal .task-description-view a:hover {
    text-decoration: underline;
}

#taskModal .task-description-view table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}

#taskModal .task-description-view table th,
#taskModal .task-description-view table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 12px;
}

#taskModal .task-description-view table th {
    background-color: #f4f4f4;
    font-weight: 600;
    font-size: 12px;
}

/* Status dropdown styling */
#taskModal #taskStatus {
    transition: background-color 0.2s, color 0.2s;
}

#taskModal #taskStatus.status-backlog {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

#taskModal #taskStatus.status-todo {
    background-color: #cfe2ff !important;
    color: #084298 !important;
}

#taskModal #taskStatus.status-inprogress {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

#taskModal #taskStatus.status-completed {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

#taskModal #taskStatus.status-dropped {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

#taskModal .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#taskModal .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#taskModal .readonly-field {
    padding: 8px 0;
    font-size: 13px;
    display: inline-block;
    width: 100%;
}

/* User modal - similar sizing to task modal */
#userModal .modal-content {
    max-width: 800px;
    padding: 20px;
}

#userModal .modal-header {
    margin-bottom: 15px;
}

#userModal h2 {
    font-size: 20px;
}

#userModal .form-group {
    margin-bottom: 12px;
}

#userModal .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

#userModal .form-group input,
#userModal .form-group textarea,
#userModal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

#userModal .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#userModal .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#userModal .form-group small {
    font-size: 11px;
}

/* User modal form rows with specific column widths */
#userModal .form-row {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

#userModal .user-row-1 {
    grid-template-columns: 2fr 6fr 2fr;
}

#userModal .user-row-2 {
    grid-template-columns: 2fr 6fr 2fr;
}

#userModal .user-row-3 {
    grid-template-columns: 6fr 2fr 2fr;
}

/* Permissions section styles */
.permissions-container {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-top: 10px;
}

.permission-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.permission-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Permissions grid - 3 columns per row */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.permissions-grid .permission-item {
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    padding-right: 15px;
}

.permissions-grid .permission-item:nth-child(3n) {
    border-right: none;
    padding-right: 0;
}

.permissions-grid .permission-item:nth-last-child(-n+3) {
    border-bottom: none;
    padding-bottom: 0;
}

.permission-header {
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.permission-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    user-select: none;
}

.permission-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.permission-checkbox span {
    font-weight: normal;
}

.permission-checkbox:hover {
    color: #667eea;
}

/* Project modal - similar sizing to task modal */
#projectModal .modal-content {
    max-width: 800px;
    padding: 20px;
}

#projectModal .modal-header {
    margin-bottom: 15px;
}

#projectModal h2 {
    font-size: 20px;
}

#projectModal .form-group {
    margin-bottom: 12px;
}

#projectModal .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

#projectModal .form-group input,
#projectModal .form-group textarea,
#projectModal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

#projectModal .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#projectModal .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#projectModal .form-group small {
    font-size: 11px;
}

/* Client modal - similar sizing to task modal */
#clientModal .modal-content {
    max-width: 800px;
    padding: 20px;
}

#clientModal .modal-header {
    margin-bottom: 15px;
}

#clientModal h2 {
    font-size: 20px;
}

#clientModal .form-group {
    margin-bottom: 12px;
}

#clientModal .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

#clientModal .form-group input,
#clientModal .form-group textarea,
#clientModal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

#clientModal .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#clientModal .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Profile modal - similar sizing to task modal */
#profileModal .modal-content {
    max-width: 500px;
    padding: 20px;
}

#profileModal .modal-header {
    margin-bottom: 15px;
}

#profileModal h2 {
    font-size: 20px;
}

#profileModal .form-group {
    margin-bottom: 12px;
}

#profileModal .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

#profileModal .form-group input,
#profileModal .form-group textarea,
#profileModal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

#profileModal .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#profileModal .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

#profileModal .form-group small {
    font-size: 11px;
}

#taskModal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* 3-column layout for specific rows in task modal */
#taskModal .form-row:has(.form-group:nth-child(3)) {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Title and Project in same row with 70:30 ratio */
#taskModal .task-title-project-row {
    grid-template-columns: 70% 30%;
}

#taskModal .modal-actions {
    margin-top: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

#taskModal #taskNotesGroup {
    padding-top: 20px;
    margin-top: 0;
}

.modal-content h2 {
    margin-bottom: 25px;
    margin-top: 0;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.modal-actions-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-delete {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-delete:hover {
    background: #fee;
    color: #c82333;
}

.modal-actions .btn,
.modal-actions .btn-primary {
    width: auto;
    min-width: 80px;
    padding: 12px 24px;
}

.modal-confirm {
    max-width: 320px;
    text-align: center;
    padding: 20px;
}

.modal-confirm h2 {
    margin-bottom: 10px;
    margin-top: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.modal-confirm p {
    margin-bottom: 16px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    padding: 0;
}

.modal-confirm .modal-actions {
    justify-content: center;
    margin-bottom: 0;
    margin-top: 16px;
    padding-bottom: 0;
    border-bottom: none;
    gap: 8px;
}

.modal-confirm .modal-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 70px;
}

/* Settings Styles */
.settings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.settings-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-controls input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.settings-controls .btn-primary {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.settings-list {
    list-style: none;
}

.settings-list li {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-list li:last-child {
    border-bottom: none;
}

/* File upload styles */
#taskFilesContainer {
    margin-top: 10px;
}

.files-list {
    margin-bottom: 15px;
    min-height: 40px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.file-icon {
    font-size: 20px;
    margin-right: 10px;
}

.file-name {
    flex: 1;
    color: #007bff;
    text-decoration: none;
    margin-right: 10px;
    word-break: break-word;
}

.file-name:hover {
    text-decoration: underline;
}

.file-size {
    color: #666;
    font-size: 0.9em;
    margin-right: 10px;
}

.btn-delete-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-delete-file:hover {
    background: #c82333;
}

.file-upload-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-upload-hint {
    font-size: 0.85em;
    color: #666;
}

.no-files {
    color: #999;
    font-style: italic;
    padding: 10px;
}

/* Notes/Comments Styles */
.notes-container {
    margin-top: 10px;
}

.note-input {
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.note-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.note-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.note-input .btn-inline {
    width: auto;
    padding: 6px 16px;
    font-size: 13px;
    align-self: flex-end;
    margin-top: 0;
}

.notes-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.notes-empty {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.notes-error {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
    margin-bottom: 10px;
}

.note-item {
    margin-bottom: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.note-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.note-item.note-deleted {
    opacity: 0.6;
    background: #f8f9fa;
}

.note-item.note-reply {
    margin-left: 30px;
    border-left: 3px solid #667eea;
    padding-left: 15px;
}

.note-content {
    position: relative;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.note-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.note-time {
    color: #666;
    font-size: 12px;
}

.note-edited {
    color: #999;
    font-size: 11px;
    font-style: italic;
}

.note-actions {
    display: flex;
    gap: 5px;
}

.note-action-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.note-action-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.note-action-btn i {
    font-size: 12px;
}

.note-parent-deleted {
    color: #999;
    font-size: 11px;
    font-style: italic;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.note-text {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.note-text p {
    margin: 0 0 8px 0;
}

.note-text p:last-child {
    margin-bottom: 0;
}

.note-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.note-text pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

.note-text pre code {
    background: none;
    padding: 0;
}

.note-deleted-text {
    color: #999;
    font-style: italic;
}

.note-reply-section {
    margin-top: 8px;
}

.note-reply-btn {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.note-reply-btn:hover {
    background: #f0f0f0;
    color: #5568d3;
}

.note-reply-btn i {
    font-size: 11px;
}

.note-replies {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.note-reply-form {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.note-reply-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-reply-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
}

.note-reply-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.note-reply-actions {
    display: flex;
    gap: 8px;
}

.note-edit-form {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.note-edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.note-edit-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.note-edit-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Table controls, search, and pagination styles have been moved to css/table.css */

/* Responsive - Desktop smaller screens */
@media (max-width: 1400px) and (min-width: 769px) {
    /* Ensure login page doesn't show scrollbars on smaller desktop screens */
    body.login-page {
        min-width: auto;
        overflow-x: hidden;
        overflow-y: hidden;
    }
    
    .auth-container {
        padding: 20px;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }
    
    .auth-box {
        max-width: 480px;
        width: calc(100% - 40px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Remove min-width constraint on mobile for login screen */
    body {
        min-width: auto;
        overflow-x: hidden;
    }
    
    /* Auth/Login screen mobile styles - Modern full-screen design */
    .auth-container {
        padding: 0;
        min-height: 100vh;
        height: 100vh;
        align-items: center;
        justify-content: center;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        overflow: hidden;
    }
    
    .auth-background {
        display: block; /* Show subtle background on mobile */
    }
    
    .auth-bg-shape {
        opacity: 0.05; /* More subtle on mobile */
    }
    
    .auth-box {
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        border: none;
        padding: 24px 20px;
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .auth-header {
        margin-bottom: 32px;
        text-align: center;
    }
    
    .login-logo-wrapper {
        width: 90px;
        height: 90px;
        margin: 0 auto 24px;
        padding: 14px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    .login-logo {
        /* Logo shows in original colors on mobile - white background makes it visible */
        filter: none;
    }
    
    .auth-title {
        font-size: 32px;
        margin-bottom: 8px;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        -webkit-text-fill-color: white;
        background: none;
    }
    
    .auth-subtitle {
        font-size: 14px;
        padding: 0;
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    }
    
    .auth-tabs {
        margin-bottom: 32px;
        gap: 10px;
        padding: 6px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border-radius: 14px;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 15px;
        color: rgba(255, 255, 255, 0.8);
    }
    
    .tab-btn:hover {
        color: white;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .tab-btn.active {
        background: rgba(255, 255, 255, 0.95);
        color: #667eea;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .tab-btn span {
        display: inline; /* Show text on mobile */
    }
    
    .tab-btn i {
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 22px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
        color: rgba(255, 255, 255, 0.95);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    .form-group label i {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 16px 18px 16px 50px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #111827;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: #9ca3af;
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        background: white;
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.3);
    }
    
    .input-icon {
        left: 18px;
        font-size: 16px;
        color: #667eea;
    }
    
    .input-wrapper:focus-within .input-icon {
        color: #667eea;
    }
    
    .btn {
        padding: 16px 24px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 14px;
    }
    
    .btn-primary {
        padding: 16px 24px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.4);
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
        border-color: rgba(255, 255, 255, 0.7);
        transform: translateY(-2px);
        box-shadow: 0 8px 35px rgba(102, 126, 234, 0.5);
    }
    
    .message {
        margin-top: 24px;
        padding: 14px 18px;
        font-size: 14px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .message.success {
        background: rgba(16, 185, 129, 0.95);
        color: white;
        border: 2px solid rgba(16, 185, 129, 0.8);
    }
    
    .message.error {
        background: rgba(239, 68, 68, 0.95);
        color: white;
        border: 2px solid rgba(239, 68, 68, 0.8);
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .kanban-column {
        /* Adjust height for mobile - account for smaller header */
        height: calc(100vh - 200px);
        min-height: 330px;
        max-height: calc(100vh - 200px);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Table responsive styles have been moved to css/table.css */
    
    .settings-container {
        grid-template-columns: 1fr;
    }
    
    /* Table pagination and controls responsive styles have been moved to css/table.css */
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .auth-container {
        padding-top: max(32px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .auth-box {
        padding: 20px 16px;
    }
    
    .auth-header {
        margin-bottom: 28px;
    }
    
    .login-logo-wrapper {
        width: 80px;
        height: 80px;
        padding: 12px;
        border-radius: 18px;
    }
    
    .auth-title {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .auth-subtitle {
        font-size: 13px;
    }
    
    .auth-tabs {
        margin-bottom: 28px;
        gap: 8px;
        padding: 5px;
    }
    
    .tab-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .btn {
        padding: 11px 18px;
    }
}

/* Add after .modal-content h2 styles */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    margin-top: 0;
}

.modal-header h2 {
    margin: 0;
    flex: 1;
}

.task-id-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.task-id-text {
    cursor: pointer;
    user-select: all;
}

.task-id-text:hover {
    color: #007bff;
}

.btn-copy-link {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: #666;
    transition: color 0.2s;
}

.btn-copy-link:hover {
    color: #007bff;
}

/* Make task IDs in list view clickable */
.task-id-link {
    cursor: pointer;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    user-select: all;
    transition: color 0.2s;
}

.task-id-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Make task IDs in kanban view clickable with smaller font */
.kanban-task .task-id-link {
    font-size: 11px;
    margin-bottom: 8px;
    display: block;
}

/* Make task IDs in modal header smaller */
.modal-header .task-id-link {
    font-size: 20px;
    color: #007bff;
}

.modal-header .task-id-link:hover {
    color: #0056b3;
}

/* Make task IDs in kanban view clickable */
.kanban-task .task-id {
    cursor: pointer;
    color: #007bff;
    user-select: all;
    transition: color 0.2s;
}

.kanban-task .task-id:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Gantt View Styles */
.gantt-resolution-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gantt-resolution-buttons {
    display: flex;
    gap: 4px;
    background: white;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.gantt-resolution-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.gantt-resolution-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.gantt-resolution-btn.active {
    background: #667eea;
    color: white;
}

.gantt-chart-container {
    margin-top: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    min-height: 280px;
    height: calc(100vh - 240px);
    max-height: calc(100vh - 240px);
    display: flex;
    flex-direction: column;
}

.gantt-chart {
    display: flex;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.gantt-label-column {
    width: 220px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: #f8f9ff;
    flex: 0 0 220px;
    min-height: 0;
    overflow: hidden;
}

.gantt-label-header {
    padding: 6px 10px;
    font-weight: 600;
    color: #333;
    font-size: 11px;
    border-bottom: 1px solid #e5e7eb;
    background: #ecf0ff;
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 28px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.gantt-label-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.gantt-label-item {
    padding: 4px 10px;
    border-bottom: 1px solid #eceff7;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.gantt-label-item:hover {
    background: #edf1ff;
}

.gantt-label-item.no-schedule .gantt-task-code {
    color: #999;
}

.gantt-task-text {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}

.gantt-task-code {
    font-weight: 600;
    color: #4f46e5;
    font-size: 10px;
    flex-shrink: 0;
}

.gantt-task-title {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-warning-icon {
    color: #9ca3af;
    font-size: 11px;
    flex-shrink: 0;
}

.gantt-timeline-column {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gantt-timeline-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

.gantt-time-scale {
    display: grid;
    background: #ecf0ff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    min-width: max-content;
}

.gantt-time-slot {
    padding: 5px 8px;
    border-left: 1px solid #e5e7eb;
    white-space: nowrap;
    text-align: center;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gantt-track-list {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    min-width: max-content;
}

.gantt-row-track {
    display: grid;
    align-items: center;
    min-height: 32px;
    border-bottom: 1px solid #f1f1f3;
    padding: 4px 0;
    position: relative;
    min-width: max-content;
}

.gantt-row-track:last-child {
    border-bottom: none;
}

.gantt-track-placeholder {
    font-size: 9px;
    color: #9ca3af;
    padding: 0 8px;
}

.gantt-bar {
    position: relative;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    color: white;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s, opacity 0.15s;
}

.gantt-bar:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.gantt-bar .gantt-bar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.gantt-bar.missing-start::before,
.gantt-bar.missing-end::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    pointer-events: none;
}

.gantt-bar.missing-start::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.65), transparent);
}

.gantt-bar.missing-end::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.65), transparent);
}

.gantt-bar.status-backlog {
    background: #6c757d;
}

.gantt-bar.status-to-do {
    background: #17a2b8;
}

.gantt-bar.status-in-progress {
    background: #ffc107;
    color: #333;
}

.gantt-bar.status-completed {
    background: #28a745;
}

.gantt-bar.status-dropped {
    background: #dc3545;
}

.gantt-bar.status-default {
    background: #667eea;
}

.gantt-empty-state {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    background: white;
}

.gantt-chart-container.empty .gantt-chart {
    display: none;
}

.gantt-chart-container.empty .gantt-empty-state {
    display: flex;
}

.gantt-label-list::-webkit-scrollbar,
.gantt-timeline-body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.gantt-label-list::-webkit-scrollbar-track,
.gantt-timeline-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.gantt-label-list::-webkit-scrollbar-thumb,
.gantt-timeline-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.gantt-label-list::-webkit-scrollbar-thumb:hover,
.gantt-timeline-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
.gantt-label-list,
.gantt-timeline-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) #f1f1f1;
}

@media (max-width: 1024px) {
    .gantt-chart-container {
        max-height: none;
    }
    
    .gantt-chart {
        flex-direction: column;
    }
    
    .gantt-label-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 220px;
        height: auto;
    }
    
    .gantt-timeline-column {
        min-height: 300px;
        height: auto;
    }
}

@media (max-width: 768px) {
    .gantt-resolution-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .gantt-resolution-buttons {
        width: 100%;
    }
    
    .gantt-resolution-btn {
        flex: 1;
    }
}

/* Calendar View Styles */
.calendar-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    gap: 10px;
    position: relative;
}

.calendar-controls h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
}

.calendar-controls .btn-secondary {
    width: auto;
    padding: 8px 16px;
    position: relative;
    z-index: 1;
}

.calendar-nav-btn {
    background: #764ba2 !important;
    color: white !important;
    border: none;
}

.calendar-nav-btn:hover {
    background: #5a3a7a !important;
    color: white !important;
}

.calendar-task-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.calendar-task-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}

/* Task filter options (All Tasks / My Tasks) in top filter section */
.task-filter-options {
    display: flex;
    align-items: center;
    gap: 20px;
}

.task-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}

.calendar-task-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #764ba2;
}

.calendar-task-option span {
    font-weight: 500;
}

.task-filter-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #764ba2;
}

.task-filter-option span {
    font-weight: 500;
}

.calendar-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.calendar-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    margin-left: auto;
}

.calendar-view-toggles {
    display: flex;
    gap: 5px;
}

.calendar-view-btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.calendar-view-btn.active {
    background: #667eea;
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-grid-month {
    grid-template-columns: repeat(7, 1fr);
}

.calendar-grid-week {
    grid-template-columns: repeat(7, 1fr);
}

.calendar-grid-day {
    grid-template-columns: 1fr;
    max-width: calc(100% / 7 * 2);
    margin: 0 auto;
}

.calendar-day-header {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day:not(.empty):hover {
    background: #f5f5f5;
}

.calendar-day-week {
    min-height: 200px;
}

.calendar-day-day {
    min-height: 400px;
}

.calendar-day.empty {
    background: #f5f5f5;
    min-height: 120px;
}

.calendar-day.today {
    background: #e8f4f8;
}

.calendar-day.today .calendar-day-number {
    color: #667eea;
    font-weight: 600;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.calendar-day-tasks {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow-y: auto;
    max-height: 100px;
    align-content: flex-start;
}

.calendar-day-week .calendar-day-tasks {
    max-height: 180px;
}

.calendar-day-day .calendar-day-tasks {
    max-height: 380px;
    flex-direction: column;
    flex-wrap: nowrap;
}

.calendar-task {
    background: #667eea;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 4px;
    margin-bottom: 4px;
}

.calendar-day-day .calendar-task {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
    padding-bottom: 8px;
    white-space: normal;
    background: transparent !important;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-day-day .calendar-task:last-child {
    border-bottom: none;
}

.calendar-task:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calendar-day-day .calendar-task:hover {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.calendar-day-day .calendar-task:hover .calendar-task-code {
    transform: none !important;
    box-shadow: none !important;
}

/* Keep status colors on hover - no visual change */
.calendar-day-day .calendar-task.task-status-backlog:hover .calendar-task-code {
    background: #6c757d !important;
}

.calendar-day-day .calendar-task.task-status-to-do:hover .calendar-task-code {
    background: #17a2b8 !important;
}

.calendar-day-day .calendar-task.task-status-in-progress:hover .calendar-task-code {
    background: #ffc107 !important;
}

.calendar-day-day .calendar-task.task-status-completed:hover .calendar-task-code {
    background: #28a745 !important;
}

.calendar-day-day .calendar-task.task-status-dropped:hover .calendar-task-code {
    background: #dc3545 !important;
}

.calendar-day-day .calendar-task:hover .calendar-task-code {
    background: #667eea !important;
}

.calendar-day-day .calendar-task:hover .calendar-task-title  {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}
/* */

.calendar-task-code {
    font-weight: 600;
    font-size: 11px;
}

.calendar-day-day .calendar-task-code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    background: #667eea;
    font-size: 13px;
    font-weight: 600;
}

.calendar-task-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-day-day .calendar-task-content {
    background: transparent !important;
}

.calendar-task-title {
    font-weight: 400;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
    background: transparent !important;
}

.calendar-day-day .calendar-task-title {
    font-size: 14px;
    background: transparent !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* Task status colors */
.calendar-task.task-status-backlog {
    background: #6c757d;
}

.calendar-task.task-status-to-do {
    background: #17a2b8;
}

.calendar-task.task-status-in-progress {
    background: #ffc107;
    color: #333;
}

.calendar-task.task-status-completed {
    background: #28a745;
}

.calendar-task.task-status-dropped {
    background: #dc3545;
}

/* In day view, remove status colors from task container */
.calendar-day-day .calendar-task.task-status-backlog,
.calendar-day-day .calendar-task.task-status-to-do,
.calendar-day-day .calendar-task.task-status-in-progress,
.calendar-day-day .calendar-task.task-status-completed,
.calendar-day-day .calendar-task.task-status-dropped {
    background: transparent !important;
    color: #333 !important;
}

/* In day view, apply status colors only to task ID */
.calendar-day-day .calendar-task.task-status-backlog .calendar-task-code {
    background: #6c757d;
    color: white;
}

.calendar-day-day .calendar-task.task-status-to-do .calendar-task-code {
    background: #17a2b8;
    color: white;
}

.calendar-day-day .calendar-task.task-status-in-progress .calendar-task-code {
    background: #ffc107;
    color: #333;
}

.calendar-day-day .calendar-task.task-status-completed .calendar-task-code {
    background: #28a745;
    color: white;
}

.calendar-day-day .calendar-task.task-status-dropped .calendar-task-code {
    background: #dc3545;
    color: white;
}


/* Task span indicators */
.calendar-task.task-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-task.task-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.calendar-task.task-middle {
    border-radius: 0;
}

/* Responsive calendar */
@media (max-width: 768px) {
    .calendar-controls {
        flex-wrap: wrap;
    }
    
    .calendar-controls h3 {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .calendar-view-toggles {
        order: 2;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-day-week {
        min-height: 120px;
    }
    
    .calendar-day-day {
        min-height: 300px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    .calendar-task {
        font-size: 9px;
        padding: 2px 4px;
        margin-right: 2px;
        margin-bottom: 2px;
    }
    
    .calendar-task-code {
        font-size: 9px;
    }
    
    .calendar-day-tasks {
        max-height: 60px;
    }
    
    .calendar-day-week .calendar-day-tasks {
        max-height: 100px;
    }
    
    .calendar-day-day .calendar-day-tasks {
        max-height: 280px;
    }
}

/* FontAwesome icon adjustments */
.fas, .far {
    display: inline-block;
    vertical-align: middle;
}

.logout-icon .fas {
    font-size: 18px;
}

.close .fas {
    font-size: 20px;
}

.btn-delete-file .fas {
    font-size: 14px;
}

.file-icon {
    font-size: 20px;
    display: inline-block;
}

/* ============================================
   WARNING BADGES
   ============================================ */

.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    margin-right: 4px;
    font-size: 12px;
    vertical-align: middle;
    line-height: 1;
    font-weight: bold;
    font-family: 'Inter', sans-serif;
}

.warning-badge-orange {
    color: #ff8c00;
}

.warning-badge-red {
    color: #dc3545;
}

.warning-badge .fas {
    font-size: 12px;
    vertical-align: middle;
}

/* Vi Module Styles */
.vi-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 150px); /* Adjust based on header and padding */
    min-height: 600px;
    margin-top: 30px;
}

.vi-history-section {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.vi-history-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.vi-history-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.vi-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.vi-history-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.vi-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.vi-history-item:hover {
    background: #f8f9fa;
}

.vi-history-item-content {
    flex: 1;
    min-width: 0;
}

.vi-history-item-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vi-history-item-date {
    font-size: 11px;
    color: #999;
}

.vi-history-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
    opacity: 0;
}

.vi-history-item:hover .vi-history-delete-btn {
    opacity: 1;
}

.vi-history-delete-btn:hover {
    background: #fee;
    color: #dc3545;
}

.vi-chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
    min-width: 400px;
}

.vi-actions-section {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.vi-actions-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.vi-actions-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.vi-actions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.vi-actions-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.vi-message-system {
    margin-bottom: 12px;
}

.vi-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vi-message-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.vi-chat-header {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vi-chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vi-chat-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vi-chat-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-style: italic;
}

.vi-thinking-spinner {
    color: #8b5cf6;
    font-size: 16px;
}

.vi-save-btn,
.vi-clear-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.vi-save-btn:hover,
.vi-clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.vi-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.vi-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.vi-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    background: #8b5cf6;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.5;
    align-self: flex-start;
}

.vi-user-badge-display {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    background: #2563eb;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.5;
    align-self: flex-start;
}

.vi-message-text {
    flex: 1;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
}

.vi-message-text > *:first-child {
    margin-top: 0;
}


/* Markdown styling for Vi messages */
.vi-message-text h1,
.vi-message-text h2,
.vi-message-text h3,
.vi-message-text h4,
.vi-message-text h5,
.vi-message-text h6 {
    margin: 12px 0 8px 0;
    font-weight: 600;
    color: #333;
}

.vi-message-text h1 { font-size: 1.5em; }
.vi-message-text h2 { font-size: 1.3em; }
.vi-message-text h3 { font-size: 1.1em; }

.vi-message-text p {
    margin: 8px 0;
}

.vi-message-text ul,
.vi-message-text ol {
    margin: 8px 0;
    padding-left: 24px;
}

.vi-message-text li {
    margin: 4px 0;
}

.vi-message-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.vi-message-text pre {
    background: #f4f4f4;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    border-left: 3px solid #8b5cf6;
}

.vi-message-text pre code {
    background: transparent;
    padding: 0;
    color: #333;
    font-size: 0.9em;
}

.vi-message-text blockquote {
    border-left: 3px solid #8b5cf6;
    padding-left: 12px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.vi-message-text strong {
    font-weight: 600;
    color: #333;
}

.vi-message-text em {
    font-style: italic;
}

.vi-message-text a {
    color: #8b5cf6;
    text-decoration: none;
}

.vi-message-text a:hover {
    text-decoration: underline;
}

.vi-message-text table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.vi-message-text th,
.vi-message-text td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.vi-message-text th {
    background: #f8f9fa;
    font-weight: 600;
}

.vi-message-text hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

.vi-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: block;
    cursor: text;
    position: relative;
}

.vi-input-box {
    position: relative;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    min-height: 50px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    cursor: text;
}

.vi-input-textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    color: #333;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 120px;
    min-height: 24px;
    padding: 0;
    margin: 0;
}

.vi-input-textarea::placeholder {
    color: #999;
}

.vi-input-textarea:focus {
    outline: none;
}

.vi-input-textarea:disabled {
    color: #999;
    cursor: not-allowed;
}

.vi-send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #bfdbfe;
    color: #2563eb;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.vi-send-btn:hover:not(:disabled) {
    background: #93c5fd;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.3);
}

.vi-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.vi-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.vi-send-btn i {
    font-size: 16px;
}

/* Chat Styles - Matching Vi Module */
.chat-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 150px); /* Adjust based on header and padding */
    min-height: 600px;
    margin: 30px auto 0;
    max-width: 1120px; /* 300px + 20px + 500px + 20px + 300px = 1140px, but use 1120px for tighter fit */
    width: 100%;
}

.chat-rooms-section {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.chat-rooms-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    box-sizing: border-box;
}

.chat-rooms-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    line-height: 1.5;
}

.chat-rooms-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.chat-room-item:hover {
    background: #f8f9fa;
}

.chat-room-item.active {
    background: #dbeafe;
    color: #333;
}

.chat-room-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.chat-room-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
}

.chat-room-item.active .chat-room-icon {
    background: #93c5fd;
    color: white;
}

.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-room-item.has-unread .chat-room-name {
    font-weight: 600;
}

/* Chat icon glow animation */
.nav-btn[data-route="chat"].has-unread-messages {
    animation: chatGlow 2s ease-in-out infinite;
}

@keyframes chatGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(96, 165, 250, 0);
    }
    50% {
        box-shadow: 0 0 12px rgba(96, 165, 250, 0.8), 0 0 20px rgba(96, 165, 250, 0.6);
    }
}

.chat-room-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
    opacity: 0.3;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-room-item:hover .chat-room-delete-btn {
    opacity: 1;
}

.chat-room-delete-btn:hover {
    background: #fee;
    color: #dc3545;
}

.chat-room-item.active .chat-room-delete-btn {
    color: #999;
}

.chat-room-item.active .chat-room-delete-btn:hover {
    background: #fee;
    color: #dc3545;
}

.chat-room-name {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-item.active .chat-room-name {
    color: #333;
}

.chat-room-type {
    font-size: 11px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-item.active .chat-room-type {
    color: #666;
}

.chat-main-section {
    flex: 0 0 500px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
    max-width: 500px;
}

.chat-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    box-sizing: border-box;
}

.chat-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.5;
}

.chat-header-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    line-height: 1.5;
    min-height: 18px;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.chat-action-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

.chat-message.own-message {
    justify-content: flex-start;
}

.chat-message.other-message {
    justify-content: flex-end;
}

.chat-message-content {
    max-width: 70%;
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.own-message .chat-message-content {
    background: #dbeafe;
    color: #333;
}

.chat-message.other-message .chat-message-content {
    background: #f0f0f0;
    color: #333;
}

.chat-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 4px;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 4px;
}

.chat-message-deleted-text {
    font-style: italic;
    color: #9ca3af;
    opacity: 0.7;
}

.chat-message.deleted-message {
    opacity: 0.7;
}

.chat-message-delete {
    color: #ef4444;
}

.chat-message-delete:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.chat-message-reply {
    background: rgba(96, 165, 250, 0.18);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.chat-message-reply-author {
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 2px;
}

.chat-message-reply-text {
    color: #1f2937;
    font-size: 13px;
}

.chat-message-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.chat-message-action {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.chat-message-action:hover {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.mention-tag {
    background: #dbeafe;
    color: #1e3a8a;
    padding: 0 6px;
    border-radius: 4px;
    font-weight: 600;
}

.mention-suggestions {
    position: absolute;
    bottom: 70px;
    left: 20px;
    width: 260px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    z-index: 50;
}

.mention-suggestions.hidden {
    display: none;
}

.mention-suggestion-item {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mention-suggestion-item:hover,
.mention-suggestion-item.active {
    background: #eff6ff;
}

.mention-suggestion-item strong {
    font-weight: 600;
    color: #111827;
}

.mention-suggestion-item span {
    font-size: 12px;
    color: #6b7280;
}

.chat-message-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 8px;
}

.chat-message-time {
    font-size: 11px;
    color: #999;
}

.chat-message.own-message .chat-message-time {
    color: #999;
}

.chat-message.other-message .chat-message-time {
    color: #999;
}

.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: block;
    cursor: text;
    position: relative;
}

.chat-reply-preview-container {
    margin-bottom: 10px;
}

.chat-reply-preview-container.hidden {
    display: none;
}

.chat-reply-preview {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: fadeIn 0.2s ease;
}

.chat-reply-preview .reply-content {
    max-width: 90%;
}

.chat-reply-preview .reply-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.chat-reply-preview .reply-message {
    font-size: 13px;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.chat-reply-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
}

.chat-reply-close:hover {
    color: #111827;
}

.chat-input-box {
    position: relative;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    min-height: 50px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    cursor: text;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    color: #333;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 120px;
    min-height: 24px;
}

.chat-input:disabled {
    color: #999;
    cursor: not-allowed;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #bfdbfe;
    color: #2563eb;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: #93c5fd;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.3);
}

.chat-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.chat-send-btn i {
    font-size: 16px;
}

.chat-empty-state {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 13px;
}

.chat-saved-section {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.chat-saved-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    height: 60px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.chat-saved-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
}

.chat-saved-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-saved-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.chat-saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.chat-member-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-member-action-btn.add {
    background: #dbeafe;
    color: #1d4ed8;
}

.chat-member-action-btn.add:hover {
    background: #bfdbfe;
}

.chat-member-action-btn.remove {
    background: #fee2e2;
    color: #b91c1c;
}

.chat-member-action-btn.remove:hover {
    background: #fecaca;
}

.modal-subtitle {
    font-size: 13px;
    color: #4b5563;
    margin: -8px 0 12px;
}

.chat-saved-item:hover {
    background: #f8f9fa;
}

.chat-saved-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.chat-saved-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
    opacity: 0;
}

.chat-saved-item:hover .chat-saved-delete-btn {
    opacity: 1;
}

.chat-saved-delete-btn:hover {
    background: #fee;
    color: #dc3545;
}

.chat-saved-item-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.chat-saved-item-room {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-saved-item-date {
    font-size: 11px;
    color: #999;
}

.chat-users-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    margin-top: 4px;
}

#newRoomModal .form-group {
    margin-bottom: 12px;
}

#newRoomModal .form-group:last-of-type {
    margin-bottom: 20px;
}

.chat-users-list .chat-user-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-users-list .chat-user-checkbox:hover {
    background: #f8f9fa;
}

.chat-users-list .chat-user-checkbox input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.chat-users-list .chat-user-checkbox span {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

