/* TickTick-inspired CSS */
:root {
    --primary: #4772fa;
    --primary-hover: #3d63d9;
    --theme-color: var(--primary);
    --accent: var(--primary);
    --accent-subtle: rgba(71, 114, 250, 0.1);
    --accent-lighter: rgba(71, 114, 250, 0.05);
    --accent-medium: rgba(71, 114, 250, 0.15);
    --accent-shadow: rgba(71, 114, 250, 0.3);
    --bg-main: #ffffff;
    --bg-primary: #ffffff;
    --bg-sidebar: #fafafa;
    --bg-hover: #f5f5f5;
    --bg-active: #f0f0f0;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --priority-high: #eb4d3d;
    --priority-medium: #ffa940;
    --priority-low: #4772fa;
    --priority-none: #bfbfbf;
    --success: #52c41a;
    --danger: #eb4d3d;
    --warning: #faad14;
    --today: #4772fa;
    --overdue: #eb4d3d;
    --tag-bg: #f0f0f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --sidebar-width: 260px;
    --panel-width: 360px;
    
    /* Z-index scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-max: 900;
}

/* Dark Mode Theme */
body.dark-mode {
    --primary: #6b8cff;
    --primary-hover: #5a7ae6;
    --theme-color: var(--primary);
    --accent: var(--primary);
    --accent-subtle: rgba(107, 140, 255, 0.15);
    --accent-lighter: rgba(107, 140, 255, 0.08);
    --accent-medium: rgba(107, 140, 255, 0.2);
    --accent-shadow: rgba(107, 140, 255, 0.4);
    --bg-main: #1a1a1a;
    --bg-primary: #1a1a1a;
    --bg-sidebar: #252525;
    --bg-hover: #3a3a3a;
    --bg-active: #3a3a3a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #323232;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #404040;
    --border-light: #353535;
    --tag-bg: #404040;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

body.dark-mode .sidebar-header {
    background: #323232;
}

body.dark-mode .main-header {
    background: #323232;
}

body.dark-mode .sidebar-nav {
    background: #2a2a2a;
}

body.dark-mode .modal-content {
    background: #252525;
    border-color: #404040;
}

body.dark-mode .task-panel {
    background: #252525;
    border-color: #404040;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #323232;
    border-color: #404040;
    color: #ffffff;
}

body.dark-mode .task-item {
    background: #2a2a2a !important;
    border-color: #404040;
}

body.dark-mode .kanban-card {
    background: #2a2a2a !important;
    border-color: #404040;
}

body.dark-mode .add-task-btn-inline {
    border-color: #505050;
}

body.dark-mode .search-box input {
    background: #323232;
    border-color: #404040;
    color: #ffffff;
}

body.dark-mode .search-box input::placeholder {
    color: #808080;
}

body.dark-mode .toast {
    background: #404040;
    color: #ffffff;
}

/* Light text for dark theme backgrounds */
.sidebar-header.light-text,
.sidebar-header.light-text .team-name,
.sidebar-header.light-text .user-profile,
.sidebar-header.light-text i {
    color: #ffffff;
}

.sidebar-header.light-text .team-name {
    color: #ffffff;
}

.main-header.light-text,
.main-header.light-text h1,
.main-header.light-text .header-actions button,
.main-header.light-text > i,
.main-header.light-text .header-btn i {
    color: #ffffff;
}

/* Ensure dropdown items keep their proper colors even in light-text mode */
.main-header.light-text .header-dropdown .dropdown-item {
    color: var(--text-primary);
}

.main-header.light-text .header-dropdown .dropdown-item i {
    color: var(--text-secondary);
}

.main-header.light-text .header-dropdown .dropdown-item.danger {
    color: #eb4d3d;
}

.main-header.light-text .header-dropdown .dropdown-item.danger i {
    color: #eb4d3d;
}

.main-header.light-text .header-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.main-header.light-text .view-toggle {
    background: rgba(255, 255, 255, 0.2);
}

.main-header.light-text .view-btn {
    color: rgba(255, 255, 255, 0.7);
}

.main-header.light-text .view-btn:hover {
    color: #ffffff;
}

.main-header.light-text .view-btn.active {
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    box-shadow: none;
}

/* Light text styles for sidebar nav (dark themes) */
.sidebar-nav.light-text .nav-item {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-nav.light-text .nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-nav.light-text .nav-item.active {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav.light-text .nav-icon {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav.light-text .nav-item.active .nav-icon,
.sidebar-nav.light-text .nav-item.active {
    color: #ffffff;
}

.sidebar-nav.light-text .today-icon {
    color: #ffffff;
}

.sidebar-nav.light-text .badge {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav.light-text .section-title {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav.light-text .edit-list-btn,
.sidebar-nav.light-text .nav-item-actions button {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav.light-text .edit-list-btn:hover,
.sidebar-nav.light-text .nav-item-actions button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-nav.light-text .add-list-btn {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-nav.light-text .add-list-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Light text styles for search box (dark themes) */
.search-box.light-text input {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.search-box.light-text input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box.light-text input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-box.light-text i {
    color: rgba(255, 255, 255, 0.5);
}

/* Global hidden class */
.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-main);
    line-height: 1.5;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: var(--z-max);
}

.loading-screen.hidden {
    display: none;
}

.loading-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    filter: brightness(0) invert(1);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: var(--z-toast);
}

.login-screen.hidden {
    display: none;
}

.login-container {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

/* Invite Banner */
.invite-banner {
    background: linear-gradient(135deg, #4772fa 0%, #6c5ce7 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-size: 14px;
}

.invite-banner i {
    font-size: 20px;
    opacity: 0.9;
}

.invite-banner strong {
    color: white;
}

.invite-banner.hidden {
    display: none;
}

.login-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-header h1 i {
    margin-right: 8px;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn.primary {
    background: var(--primary);
    color: white;
}

.auth-btn.primary:hover {
    background: var(--primary-hover);
}

.auth-btn.secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.auth-btn.secondary:hover {
    background: var(--border-color);
}

.auth-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: #dc2626;
    font-size: 13px;
}

.auth-error.hidden {
    display: none;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-tertiary);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 16px;
    font-size: 13px;
}

.offline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.offline-btn:hover {
    background: var(--border-color);
}

.login-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Team Selection Screen */
.team-select-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: var(--z-toast);
}

.team-select-screen.hidden {
    display: none;
}

.team-select-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.team-select-header {
    margin-bottom: 24px;
}

.team-select-header .auth-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.team-select-header h1 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.team-select-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.team-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.team-list-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.team-list-item.owner {
    background: linear-gradient(135deg, rgba(71, 114, 250, 0.08) 0%, rgba(108, 92, 231, 0.08) 100%);
}

.team-list-item.owner:hover {
    background: linear-gradient(135deg, rgba(71, 114, 250, 0.15) 0%, rgba(108, 92, 231, 0.15) 100%);
}

.team-list-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-hover);
}

.team-list-info {
    flex: 1;
    min-width: 0;
}

.team-list-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-list-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-list-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.team-list-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
}

.team-select-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.team-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.team-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--accent-lighter);
}

.team-action-btn.create {
    border-style: dashed;
}

.team-action-btn.join {
    border-style: solid;
    border-color: var(--border-light);
}

.team-select-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.team-signout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.team-signout-btn:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

.team-list-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-tertiary);
}

.team-list-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.team-list-empty p {
    font-size: 14px;
}

/* Switch Workspace Button */
.switch-workspace-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.switch-workspace-btn:hover {
    background: var(--primary);
    color: white;
}

.switch-workspace-btn i {
    font-size: 14px;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: 200px;
    max-width: 400px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

/* Hide mobile sidebar close button on desktop */
.mobile-sidebar-close {
    display: none;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: var(--z-dropdown);
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary);
    opacity: 0.3;
}

.sidebar.resizing {
    user-select: none;
}

body.sidebar-resizing {
    cursor: col-resize !important;
    user-select: none;
}

/* Old sidebar-header removed - using new definition below */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
}

.user-profile:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-img.hidden {
    display: none;
}

.user-dropdown {
    position: fixed;
    top: 60px;
    left: 16px;
    width: 600px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 80px);
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    z-index: var(--z-popover);
    overflow-y: auto;
}
.user-dropdown.hidden {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.danger {
    color: #eb4d3d;
}

.dropdown-item.danger:hover {
    background: rgba(235, 77, 61, 0.1);
}

.dropdown-item.danger i {
    color: #eb4d3d;
}

.dropdown-item i {
    color: var(--text-secondary);
    width: 16px;
}

.dropdown-section {
    padding: 12px 16px;
}

.dropdown-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

/* Header Dropdown Menus */
.header-dropdown-wrapper {
    position: relative;
}

.header-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    padding: 8px 0;
}

.header-dropdown.hidden {
    display: none;
}

.header-dropdown .dropdown-label {
    padding: 8px 16px 4px;
    margin-bottom: 0;
}

.header-dropdown .dropdown-item {
    padding: 10px 16px;
    position: relative;
}

.header-dropdown .dropdown-item .sort-check,
.header-dropdown .dropdown-item .direction-check,
.header-dropdown .dropdown-item .toggle-check {
    margin-left: auto;
    color: var(--primary);
    opacity: 0;
    font-size: 12px;
}

.header-dropdown .dropdown-item.active .sort-check,
.header-dropdown .dropdown-item.active .direction-check,
.header-dropdown .dropdown-item.active .toggle-check {
    opacity: 1;
}

.header-dropdown .dropdown-divider {
    margin: 8px 0;
}

/* Compact view density */
.task-sections.compact .task-item {
    padding: 8px 16px;
}

.task-sections.compact .task-title {
    font-size: 13px;
}

.task-sections.compact .task-meta {
    font-size: 11px;
}

/* Task description - hidden by default, shown in comfortable view */
.task-description {
    display: none;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

/* Markdown styles in descriptions */
.task-description strong {
    font-weight: 600;
    color: var(--text-primary);
}

.task-description em {
    font-style: italic;
}

.task-description del {
    text-decoration: line-through;
    opacity: 0.7;
}

.task-description code {
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.task-description a {
    color: var(--primary);
    text-decoration: none;
}

.task-description a:hover {
    text-decoration: underline;
}

/* Show description in comfortable view (when NOT compact) */
.task-sections:not(.compact) .task-description {
    display: -webkit-box;
}

.task-item.completed .task-description {
    opacity: 0.5;
}

/* Kanban description - comfortable view */
.kanban-card .task-description {
    display: none;
}

.kanban-board:not(.compact) .kanban-card .task-description {
    display: -webkit-box;
    max-width: 100%;
}

.kanban-board.compact .kanban-card {
    padding: 10px 12px;
}

.kanban-board.compact .kanban-card-title {
    font-size: 13px;
}

.kanban-board.compact .task-description {
    display: none;
}

/* Completed Divider */
.completed-divider {
    display: flex;
    align-items: center;
    padding: 16px 20px 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.completed-divider.clickable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.completed-divider.clickable:hover {
    color: var(--text-secondary);
}

.completed-divider .collapse-icon {
    font-size: 10px;
    margin-right: 6px;
    transition: transform 0.2s;
}

.completed-divider::before {
    content: '';
    flex: 0;
    height: 1px;
    background: var(--border-color);
    margin-right: 0;
}

.completed-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin-left: 12px;
}

/* Hidden Tasks Divider */
.hidden-tasks-divider {
    display: flex;
    align-items: center;
    padding: 16px 20px 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.hidden-tasks-divider.clickable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.hidden-tasks-divider.clickable:hover {
    color: var(--text-secondary);
}

.hidden-tasks-divider .collapse-icon {
    font-size: 10px;
    margin-right: 6px;
    transition: transform 0.2s;
}

.hidden-tasks-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin-left: 12px;
}

.hidden-tasks-wrapper {
    opacity: 0.7;
}

.team-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-code-row code {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    user-select: all;
}

.copy-btn {
    padding: 8px 10px;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
}

.join-team-row {
    display: flex;
    gap: 8px;
}

.join-team-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-main);
    color: var(--text-primary);
}

.join-team-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.join-btn {
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.join-btn:hover {
    background: var(--primary-hover);
}

.user-name {
    font-weight: 500;
    flex: 1;
}

.user-profile i {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Search Box */
.search-box {
    padding: 8px 16px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-main);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 5px;
    cursor: pointer;
    transition: background 0.15s;
    margin: 2px 8px;
    border-radius: var(--radius);
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    background: var(--theme-active-bg, var(--bg-active));
    color: var(--theme-color);
}

.nav-item.active .nav-icon {
    color: var(--theme-color);
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.nav-item-left > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drag handle for reordering lists */
.drag-handle {
    opacity: 0;
    cursor: grab;
    color: var(--text-tertiary);
    font-size: 10px;
    padding: 2px;
    margin-left: 0px;
    margin-right: -8px;
    transition: opacity 0.15s;
}

.nav-item:hover .drag-handle {
    opacity: 0.5;
}

.drag-handle:hover {
    opacity: 1 !important;
    color: var(--text-secondary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* List drag states */
.nav-item.dragging {
    opacity: 0.5;
    background: var(--bg-hover);
}

.nav-item.drag-over {
    border-top: 2px solid var(--primary);
    margin-top: -2px;
}

/* Drag placeholder for lists */
.nav-item.drag-placeholder {
    background: var(--primary);
    opacity: 0.3;
    border-radius: 8px;
    margin: 2px 0;
    border: 2px dashed var(--primary);
    min-height: 40px;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.today-icon {
    color: var(--theme-color, var(--today));
}

.nav-item .badge {
    font-size: 12px;
    color: var(--text-tertiary);
    min-width: 20px;
    text-align: right;
}

.nav-item-right {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-item-right .badge {
    transition: opacity 0.15s;
}

.nav-item:hover .nav-item-right .badge {
    opacity: 0;
}

.edit-list-btn {
    opacity: 0;
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    transition: all 0.15s;
}

.nav-item:hover .edit-list-btn {
    opacity: 1;
}

.edit-list-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

/* Member item actions */
.nav-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.nav-item:hover .nav-item-actions {
    opacity: 1;
}

.nav-item-actions button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    transition: all 0.15s;
}

.nav-item-actions button:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.nav-item-actions .delete-member-btn:hover {
    color: var(--danger);
}

.member-avatar.small {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

input#memberEmail {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    font-size: 14px !important;
    background: var(--bg-main) !important;
    color: var(--text-primary) !important;
}

.member-item .nav-item-left {
    flex: 1;
    min-width: 0;
}

/* Nav Sections */
.nav-section {
    margin-top: 0px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
    transition: background 0.15s;
}

.section-header:hover {
    background: var(--bg-hover);
}

.section-header:active {
    background: var(--bg-tertiary);
}

.section-header .section-chevron {
    font-size: 10px;
    transition: transform 0.2s;
    cursor: pointer;
}

.section-header.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.section-header .add-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.section-header:hover .add-btn {
    opacity: 1;
}

.add-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.collapsible.collapsed {
    display: none;
}

/* List items with icons */
.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-icon {
    font-size: 22px;
}

.list-icon-img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}

/* Tag items */
.tag-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-main);
}

/* Main Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-icon {
    font-size: 20px;
}

.view-icon-img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle {
    display: flex;
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    padding: 2px;
}

.view-btn {
    padding: 6px 10px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-main);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.header-btn {
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* User Avatar Button in Header */
.user-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--accent-shadow);
}

.user-avatar-btn .user-avatar-initial {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.user-avatar-btn .user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-btn .user-avatar-img.hidden {
    display: none;
}

.user-menu-wrapper {
    position: relative;
}

.user-menu {
    right: 0;
    left: auto;
    min-width: 240px;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.user-menu-header .user-avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-menu-header .user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-menu-header .user-avatar-img.hidden {
    display: none;
}

.user-menu-info {
    flex: 1;
    min-width: 0;
}

.user-menu-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-menu-email {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notifications */
.notifications-wrapper {
    position: relative;
}

.notifications-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    transition: all 0.15s;
}

.notifications-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge.hidden {
    display: none;
}

.notifications-dropdown {
    right: 0;
    left: auto;
    width: 360px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.notifications-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.notifications-actions {
    display: flex;
    gap: 4px;
}

.mark-all-read-btn,
.clear-notifications-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.mark-all-read-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.clear-notifications-btn:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.notifications-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.notifications-empty p {
    font-size: 13px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: var(--accent-lighter);
}

.notification-item.unread:hover {
    background: var(--accent-light);
}

.notification-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-text strong {
    font-weight: 600;
}

.notification-task {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
}

/* Add Task Bar */
.add-task-bar {
    padding: 8px 24px;
    border-bottom: 1px solid var(--border-color);
}

.add-task-btn-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

.add-task-btn-inline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--accent-lighter);
}

.add-task-btn-inline i {
    font-size: 14px;
}

/* Bulk Action Bar */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-bottom: 1px solid var(--border-light);
}

.bulk-action-bar.hidden {
    display: none;
}

.bulk-action-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-select-all-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulk-select-all-btn:hover {
    opacity: 0.8;
}

.bulk-count {
    font-size: 14px;
    font-weight: 500;
}

.bulk-action-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    background: transparent;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-action-btn:hover {
    background: rgba(255,255,255,0.1);
}

.bulk-action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Bulk Select Mode - Task Items */
.task-item .bulk-checkbox {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.bulk-select-mode .task-item .bulk-checkbox {
    display: flex;
}

.bulk-select-mode .task-item .check-btn {
    display: none;
}

.task-item .bulk-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.task-item.bulk-selected {
    background: var(--accent-lighter);
}

/* Kanban bulk select */
.kanban-card .bulk-checkbox {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.bulk-select-mode .kanban-card {
    position: relative;
}

.bulk-select-mode .kanban-card .bulk-checkbox {
    display: flex;
}

.kanban-card .bulk-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.kanban-card.bulk-selected {
    outline: 2px solid var(--primary);
}

/* Inline Task Input */
.inline-task-input {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-sidebar);
}

.inline-task-input.hidden {
    display: none;
}

.task-input-row {
    margin-bottom: 12px;
}

.task-input-row input,
.task-input-row textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: none;
}

.task-input-row input:focus,
.task-input-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.task-input-row.secondary textarea {
    min-height: 60px;
}

.task-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-input-left {
    display: flex;
    gap: 8px;
}

/* Task Input Options Row */
.task-input-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.input-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.input-option label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-option label i {
    font-size: 12px;
}

.input-option select,
.input-option input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.input-option select:hover,
.input-option input[type="date"]:hover {
    border-color: var(--primary);
}

.input-option select:focus,
.input-option input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.input-option.tags-option {
    flex: 1;
    min-width: 200px;
}

/* Type toggle switch */
.input-option.type-toggle {
    min-width: auto;
}

.input-option.type-toggle > label {
    display: none;
}

.type-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.type-label.active {
    color: var(--primary);
    font-weight: 500;
}

.type-label i {
    font-size: 12px;
}

.type-switch {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.type-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.type-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    border-radius: 22px;
    transition: all 0.2s;
}

.type-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.type-switch input:checked + .type-slider:before {
    transform: translateX(18px);
}

/* Hide task-only fields when note is selected */
.inline-task-input.note-mode .task-only-field {
    display: none;
}

.tags-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tags-input-wrapper select {
    min-width: 120px;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.selected-tags .tag-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
}

.selected-tags .tag-chip .remove-tag {
    cursor: pointer;
    opacity: 0.7;
    font-size: 10px;
}

.selected-tags .tag-chip .remove-tag:hover {
    opacity: 1;
}

/* Assignees multi-select */
.input-option.assignees-option {
    min-width: 200px;
}

.assignees-input-wrapper,
.panel-assignees-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.assignees-input-wrapper select,
.panel-assignees-wrapper select {
    min-width: 140px;
}

.selected-assignees {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.selected-assignees .assignee-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 11px;
    color: white;
    background: var(--primary);
}

.selected-assignees .assignee-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.selected-assignees .assignee-chip .assignee-initial {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
}

.selected-assignees .assignee-chip .remove-assignee {
    cursor: pointer;
    opacity: 0.7;
    font-size: 10px;
    margin-left: 2px;
}

.selected-assignees .assignee-chip .remove-assignee:hover {
    opacity: 1;
}

.selected-assignees .assignee-chip.pending {
    background: #6b7280 !important;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.selected-assignees .assignee-chip .pending-badge {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.input-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.task-input-right {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Task View */
.task-view {
    flex: 1;
    overflow-y: auto;
    padding: 3px 24px 24px;
}

.task-view.hidden {
    display: none;
}

/* Task Sections */
.task-section {
    margin-bottom: 24px;
}

.section-date-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.section-date-header.today {
    color: var(--primary);
}

.section-date-header.overdue {
    color: var(--overdue);
}

/* Task Item */
.task-item {
    display: flex;
    align-items: flex-start;
    padding: 5px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 5px;
    border-left-width: 6px;
}

.task-item:hover {
    background: var(--bg-hover);
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-item.dragging {
    opacity: 0.5;
}

/* Drag placeholder for tasks */
.task-item.drag-placeholder {
    background: var(--primary);
    opacity: 0.2;
    border-radius: 12px;
    margin: 4px 0;
    border: 2px dashed var(--primary);
    min-height: 50px;
}

/* Drag over indicators (fallback) */
.task-item.drag-over-top {
    border-top: 2px solid var(--primary);
    margin-top: -2px;
}

.task-item.drag-over-bottom {
    border-bottom: 2px solid var(--primary);
    margin-bottom: 3px;
}

.check-btn {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s;
}

.check-btn:hover {
    border-color: var(--primary);
}

.check-btn.checked {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.check-btn.priority-high {
    border-color: var(--priority-high);
}

.check-btn.priority-medium {
    border-color: var(--priority-medium);
}

.check-btn.priority-low {
    border-color: var(--priority-low);
}

/* Note icon (shown instead of checkbox for notes) */
.note-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent-color);
}

.note-icon i {
    font-size: 16px;
}

/* Note items - list color border is set via inline style when a list is assigned */

.task-body {
    flex: 1;
    min-width: 0;
}

.task-name {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
    font-weight: 500;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.task-meta-item i {
    font-size: 11px;
}

.task-meta-item.overdue {
    color: var(--overdue);
}

.task-meta-item.today {
    color: var(--primary);
}

.task-meta-item.priority-flag.high {
    color: var(--priority-high);
}

.task-meta-item.priority-flag.medium {
    color: var(--priority-medium);
}

.task-meta-item.priority-flag.low {
    color: var(--priority-low);
}

.task-meta-item.recurring {
    color: var(--primary);
    font-size: 11px;
}

.task-meta-item.recurring i {
    font-size: 10px;
}

.task-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.task-priority-flag {
    font-size: 14px;
}

.task-priority-flag.low {
    color: #4dabf7;
}

.task-priority-flag.medium {
    color: #fcc419;
}

.task-priority-flag.high {
    color: #fa5252;
}

.task-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.task-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.task-list-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--bg-hover);
    border: 1px solid transparent;
}

.task-list-icon {
    font-size: 12px;
}

.task-list-icon-img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
}

.task-list-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignee {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.task-assignees {
    display: flex;
    flex-direction: row-reverse;
}

.task-assignees .task-assignee,
.task-assignees .task-assignee-img {
    margin-left: -8px;
}

.task-assignees .task-assignee:last-child,
.task-assignees .task-assignee-img:last-child {
    margin-left: 0;
}

.task-assignee-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.member-avatar-img {
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar-img.small {
    width: 20px;
    height: 20px;
}

.priority-indicator {
    color: var(--priority-none);
}

.priority-indicator.high {
    color: var(--priority-high);
}

.priority-indicator.medium {
    color: var(--priority-medium);
}

.priority-indicator.low {
    color: var(--priority-low);
}

/* Completed Section */
.completed-section {
    margin-top: 24px;
}

.completed-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    width: 100%;
}

.completed-toggle i {
    font-size: 10px;
    transition: transform 0.2s;
}

.completed-toggle.expanded i {
    transform: rotate(90deg);
}

.completed-count {
    margin-left: auto;
    color: var(--text-tertiary);
}

.completed-tasks {
    margin-top: 8px;
}

.completed-tasks.hidden {
    display: none;
}


/* ==================== */
/* Subtask Accordion */
/* ==================== */

.subtask-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    color: var(--text-tertiary);
    transition: color 0.15s;
    margin-left: 2px;
}

.subtask-toggle:hover {
    color: var(--primary);
}

.subtask-toggle.expanded i {
    transform: rotate(180deg);
}

.subtask-toggle i {
    font-size: 10px;
    transition: transform 0.2s;
}

.subtask-accordion {
    margin-left: 40px;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
}

.subtask-accordion.hidden {
    display: none;
}

.subtask-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.subtask-card:hover {
    background: rgba(255,255,255,0.08);
}

.subtask-card:last-child {
    margin-bottom: 0;
}

.subtask-card .check-btn {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.subtask-card .check-btn i {
    font-size: 8px;
    color: white;
}

.subtask-card .check-btn.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.subtask-card.completed .subtask-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.subtask-title {
    font-size: 13px;
    color: var(--text-primary);
}

/* Kanban Card Wrapper */
.kanban-card-wrapper {
    margin-bottom: 12px;
}

.kanban-card-wrapper .subtask-accordion {
    margin-left: 16px;
    margin-top: 8px;
    margin-bottom: 0;
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
}

/* Kanban View */
.kanban-board {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    height: 100%;
    overflow-x: auto;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 450px;
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 13px;
}

.column-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.column-indicator.todo {
    background: var(--text-tertiary);
}

.column-indicator.in-progress {
    background: var(--primary);
}

.column-indicator.completed {
    background: var(--success);
}

.column-count {
    margin-left: auto;
    background: var(--bg-main);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.kanban-tasks {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.kanban-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: var(--shadow-lg);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.kanban-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.kanban-card-header .task-name {
    flex: 1;
    margin-bottom: 0;
}

.kanban-card-header .task-description {
    margin-top: 0;
}

.kanban-card .task-tags {
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.kanban-card-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-card .task-list-badge {
    padding: 2px 6px;
    font-size: 11px;
}

.kanban-card .task-list-icon-img {
    width: 12px;
    height: 12px;
}

.kanban-card .task-assignee {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.kanban-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin: 8px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 13px;
    transition: all 0.2s;
}

.kanban-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.kanban-tasks.drag-over {
    background: var(--accent-subtle);
}

/* Detail Panel */

/* ==================== */
/* Detail Panel - Improved */
/* ==================== */

.detail-panel {
    width: var(--panel-width);
    background: var(--bg-main);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.detail-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.panel-title-input {
    flex: 1;
    border: none;
    font-size: 16px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 4px;
    background: transparent;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    line-height: 1.4;
    min-height: 28px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.panel-title-input:focus {
    outline: none;
    background: var(--bg-hover);
}

.panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 6px;
    border-radius: 4px;
}

.panel-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Description Section */
.description-section {
    margin-bottom: 16px;
}

.description-section .panel-textarea {
    width: 100%;
    min-height: 60px;
    border: none;
    border-radius: var(--radius);
    padding: 8px 0;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    background: transparent;
    color: var(--text-secondary);
}

.description-section .panel-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.description-section .panel-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Subtasks Section */
.subtasks-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

/* Attachments Section */
.attachments-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.section-header-inline {
    margin-bottom: 8px;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-label i {
    margin-right: 6px;
    opacity: 0.7;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    transition: background 0.15s;
}

.attachment-item:hover {
    background: var(--bg-hover);
}

.attachment-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.attachment-icon.image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.attachment-icon.pdf {
    background: linear-gradient(135deg, #eb4d3d 0%, #c0392b 100%);
    color: white;
}

.attachment-icon.doc {
    background: linear-gradient(135deg, #4772fa 0%, #2980b9 100%);
    color: white;
}

.attachment-icon.file {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.attachment-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.attachment-preview-container {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.attachment-preview-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-tertiary);
    font-size: 8px;
    gap: 2px;
}

.attachment-preview-placeholder i {
    font-size: 12px;
}

.attachment-preview-placeholder:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.attachment-preview.attachment-loading {
    background: var(--bg-tertiary);
    position: relative;
}

.attachment-preview.attachment-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: attachment-spin 0.8s linear infinite;
}

@keyframes attachment-spin {
    to { transform: rotate(360deg); }
}

.attachment-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.attachment-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.attachment-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.attachment-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.attachment-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.attachment-item:hover .attachment-actions {
    opacity: 1;
}

.attachment-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.attachment-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.attachment-action-btn.delete:hover {
    background: rgba(235, 77, 61, 0.1);
    color: var(--danger);
}

.add-attachment-row {
    display: flex;
    align-items: center;
}

.add-attachment-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
}

.add-attachment-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--accent-lighter);
}

.add-attachment-btn i {
    font-size: 12px;
}

/* Attachment preview modal */
.attachment-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.attachment-preview-modal.hidden {
    display: none;
}

.attachment-preview-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.attachment-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.attachment-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.attachment-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Drag and drop styling */
.attachments-section.drag-over {
    background: var(--accent-lighter);
    border-color: var(--primary);
}

.attachments-section.drag-over .add-attachment-btn {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--accent-subtle);
}

.subtasks-list {
    margin-bottom: 4px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 4px;
}

.subtask-item:hover {
    background: var(--bg-hover);
}

.subtask-item .check-btn {
    width: 16px;
    height: 16px;
}

.subtask-item input {
    flex: 1;
    border: none;
    background: none;
    font-size: 13px;
}

.subtask-item input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.subtask-item.completed input {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.subtask-item .delete-subtask {
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
}

.subtask-item:hover .delete-subtask {
    opacity: 1;
}

.add-subtask-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.add-subtask-row i {
    font-size: 11px;
}

.add-subtask-row input {
    flex: 1;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text-primary);
}

.add-subtask-row input::placeholder {
    color: var(--text-tertiary);
}

.add-subtask-row input:focus {
    outline: none;
}

/* Properties Section - Condensed */
.properties-section {
    margin-bottom: 0;
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 4px 12px;
    border: 1px solid var(--border-color);
}

.properties-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    position: relative;
}

.properties-header:hover {
    color: var(--text-primary);
}

.properties-header .properties-chevron {
    font-size: 10px;
    transition: transform 0.2s;
    position: absolute;
    right: 0;
}

.properties-header.collapsed .properties-chevron {
    transform: rotate(-90deg);
}

.properties-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}

.properties-grid.collapsed {
    display: none;
}

.property-row {
    display: flex;
    gap: 8px;
}

.reminder-custom-row {
    margin-top: -4px;
}

.property-item.compact {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.property-item.compact i {
    color: var(--text-tertiary);
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.property-item.compact .property-select,
.property-item.compact .property-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 0;
}

.property-item.compact .property-select:focus,
.property-item.compact .property-input:focus {
    outline: none;
}

.property-item.compact.no-icon {
    padding-left: 10px;
}

/* Priority Row */
.priority-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}



.priority-buttons {
    display: flex;
    gap: 2px;
    flex: 1;
}

.priority-flag {
    padding: 4px 6px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.35;
    transition: all 0.15s;
}

.priority-flag:hover {
    opacity: 0.7;
}

.priority-flag.active {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.priority-flag.none i { color: var(--text-tertiary); }
.priority-flag.low i { color: var(--priority-low); }
.priority-flag.medium i { color: var(--priority-medium); }
.priority-flag.high i { color: var(--priority-high); }

/* Assignees Row */
.assignees-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}

.assignees-row > i {
    color: var(--text-tertiary);
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.panel-assignees-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.panel-assignees-wrapper .selected-assignees {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.panel-assignees-wrapper .property-select {
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    min-width: 80px;
}

/* Tags Row */
.tags-row-compact {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}



.tags-wrapper {
    flex: 1;
    position: relative;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.tags-row:empty {
    display: none;
}

.tags-row:empty + .tag-input-inline {
    margin-top: 0;
}

.panel-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 11px;
}

.panel-tag .remove-tag {
    cursor: pointer;
    color: var(--text-tertiary);
    margin-left: 2px;
    font-size: 10px;
}

.panel-tag .remove-tag:hover {
    color: var(--overdue);
}

.tag-input-inline {
    width: 100%;
    border: none;
    background: none;
    padding: 2px 0;
    font-size: 12px;
    color: var(--text-primary);
}

.tag-input-inline::placeholder {
    color: var(--text-tertiary);
}

.tag-input-inline:focus {
    outline: none;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 150px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    margin-top: 4px;
}

.tag-suggestions.hidden {
    display: none;
}

.tag-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.selected {
    background: var(--bg-hover);
}

.tag-suggestion-item .tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-suggestion-item .tag-name {
    flex: 1;
    font-size: 12px;
}

/* Panel Footer */
.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
}

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

.delete-btn:hover {
    background: var(--bg-hover);
    color: var(--overdue);
}

.watch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
}

.watch-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.watch-btn.watching {
    color: var(--primary);
}

.watch-btn.watching i {
    font-weight: 900;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.watchers-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.watchers-display:empty {
    display: none;
}

.watcher-avatars {
    display: flex;
    align-items: center;
}

.watcher-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
    margin-left: -6px;
    border: 2px solid var(--bg-main);
    cursor: default;
}

.watcher-avatar:first-child {
    margin-left: 0;
}

.watcher-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.watcher-count {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.footer-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s;
}

.footer-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.footer-icon-btn.delete:hover {
    color: var(--overdue);
}

/* Activity item styles */
.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.activity-entry:last-child {
    border-bottom: none;
}

.activity-entry .activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 12px;
    flex-shrink: 0;
}

.activity-entry.created .activity-icon {
    background: rgba(71, 114, 250, 0.15);
    color: var(--primary);
}

.activity-entry.comment .activity-icon {
    background: rgba(71, 114, 250, 0.15);
    color: var(--primary);
}

.activity-entry .activity-content {
    flex: 1;
    min-width: 0;
}

.activity-entry .activity-text {
    line-height: 1.4;
}

.activity-entry .activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-entry .activity-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.activity-entry .comment-text {
    background: var(--bg-tertiary);
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 6px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}



/* Modals */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: var(--bg-main);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header .btn-switch-workspace {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-header .btn-switch-workspace:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Task Detail Modal */
.task-detail-modal-content {
    max-width: 550px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* New Task/Note Modal */
.new-task-modal-content {
    max-width: 480px;
    width: 95%;
}

.new-task-modal-content .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.new-task-modal-body {
    padding: 20px;
}

.new-task-modal-body .form-group {
    margin-bottom: 16px;
}

.new-task-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.new-task-modal-body .form-group > label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.new-task-modal-body .form-group > label i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
}

.new-task-title-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    color: var(--text-primary);
}

.new-task-title-input:focus {
    outline: none;
    border-color: var(--primary);
}

.new-task-title-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.new-task-modal-body textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
    min-height: 60px;
}

.new-task-modal-body textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.new-task-modal-body textarea::placeholder {
    color: var(--text-tertiary);
}

.new-task-modal-body select,
.new-task-modal-body input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    color: var(--text-primary);
    cursor: pointer;
}

.new-task-modal-body select:focus,
.new-task-modal-body input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
}

.type-toggle-row {
    display: flex;
    justify-content: center;
    padding: 12px 0;
    margin: 0 0 16px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
    min-width: 0;
}

.new-task-modal-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.new-task-modal-content .modal-footer .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.new-task-modal-content .modal-footer .btn-text {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.new-task-modal-content .modal-footer .btn-text:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.new-task-modal-content .modal-footer .btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
    font-weight: 500;
}

.new-task-modal-content .modal-footer .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Assignees and tags in new task modal */
.new-task-modal-body .assignees-input-wrapper,
.new-task-modal-body .tags-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.new-task-modal-body .assignees-input-wrapper select,
.new-task-modal-body .tags-input-wrapper select {
    flex: 1;
    min-width: 140px;
}

.new-task-modal-body .selected-assignees,
.new-task-modal-body .selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.new-task-modal-body .assignee-chip,
.new-task-modal-body .tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
    background: var(--primary);
}

.new-task-modal-body .assignee-chip i,
.new-task-modal-body .tag-chip i {
    cursor: pointer;
    opacity: 0.7;
    font-size: 10px;
}

.new-task-modal-body .assignee-chip i:hover,
.new-task-modal-body .tag-chip i:hover {
    opacity: 1;
}

/* Hide task-only fields in modal when note is selected */
.new-task-modal-content.note-mode .task-only-modal-field {
    display: none;
}

.task-detail-modal-content .panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.task-detail-modal-content .panel-body {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
}

.task-detail-modal-content .panel-footer {
    padding: 4px 20px;
    border-top: 1px solid var(--border-light);
}

.task-detail-modal-content .panel-title-input {
    font-size: 18px;
}

.task-detail-modal-content .panel-textarea {
    min-height: 80px;
    height: auto;
    overflow: hidden;
}

/* Note mode styling for detail modal/panel */
.task-detail-modal-content.note-mode,
#detailPanel.note-mode {
    border-left: 4px solid var(--primary);
}

.note-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.task-detail-modal-content.note-mode .panel-title-input,
#detailPanel.note-mode .panel-title-input {
    color: var(--primary);
}

.task-detail-modal-content.note-mode .description-section,
#detailPanel.note-mode .description-section {
    flex: 1;
}

.task-detail-modal-content.note-mode .panel-textarea,
#detailPanel.note-mode .panel-textarea {
    min-height: 150px;
}

/* Form Elements */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
}

.form-group label.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Theme color picker */
.theme-color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.theme-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-preset {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.theme-preset:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-preset.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent-shadow);
}

.theme-preset[data-theme="none"] {
    color: var(--text-tertiary);
    font-size: 18px;
}

.theme-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.theme-swatch.dark-swatch {
    background: linear-gradient(135deg, #323232 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.theme-custom-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-custom-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.theme-custom-row input[type="color"] {
    width: 50px;
    height: 32px;
    padding: 2px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-main);
}

.theme-custom-row input[type="color"]:hover {
    border-color: var(--primary);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-main);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    background: var(--bg-main);
    color: var(--text-primary);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

/* Icon Type Toggle */
.icon-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.type-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: var(--primary);
}

.type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--primary);
}

.icon-btn.selected {
    border-color: var(--primary);
    background: var(--bg-active);
}

/* Image Upload */
.image-upload {
    margin-top: 12px;
}

.image-upload.hidden {
    display: none;
}

.upload-area {
    width: 100%;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
}

.upload-placeholder i {
    font-size: 24px;
}

.upload-placeholder span {
    font-size: 13px;
}

.upload-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.8;
}

#uploadPreview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#uploadPreview.hidden {
    display: none;
}

.remove-btn {
    margin-top: 8px;
    padding: 6px 12px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
}

.remove-btn.hidden {
    display: none;
}

/* Avatar Upload */
.avatar-upload-area {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    margin-bottom: 8px;
}

.avatar-upload-area:hover {
    border-color: var(--primary);
}

.avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 8px;
}

.avatar-placeholder i {
    font-size: 20px;
}

.avatar-placeholder span {
    font-size: 10px;
    line-height: 1.2;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview.hidden {
    display: none;
}

/* Color Grid */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.color-custom {
    flex-shrink: 0;
}

.color-custom input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

.color-custom input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-custom input[type="color"]::-webkit-color-swatch {
    border-radius: 50%;
    border: none;
}

.color-btn {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.selected {
    border-color: var(--text-primary);
}

/* Custom Color Row (for tag and member modals) */
.custom-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.custom-color-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.color-picker,
input[type="color"].color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border-radius: 50%;
    border: none;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.modal-footer .footer-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-delete {
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(235, 77, 61, 0.1);
}

.btn-delete.hidden {
    display: none;
}

.btn-cancel {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-cancel:hover {
    color: var(--text-primary);
}

.btn-save {
    padding: 8px 20px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}

.btn-save:hover {
    background: var(--primary-hover);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-main);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 4px 0;
    z-index: var(--z-popover);
}

.context-menu.hidden {
    display: none;
}

.context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
}

.context-item:hover {
    background: var(--bg-hover);
}

.context-item.delete {
    color: var(--overdue);
}

.context-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--z-toast);
    animation: slideUp 0.3s ease;
}

/* Notification Prompt */
.notification-prompt {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--z-toast);
    animation: slideUp 0.3s ease;
}

.notification-prompt i {
    font-size: 18px;
}

.notification-prompt span {
    flex: 1;
    font-size: 14px;
}

.notification-prompt .btn-enable {
    background: var(--bg-primary);
    color: var(--primary);
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}

.notification-prompt .btn-enable:hover {
    background: var(--bg-secondary);
}

.notification-prompt .btn-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px;
}

.notification-prompt .btn-dismiss:hover {
    color: white;
}

/* In-app Notification */
.in-app-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-toast);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
    cursor: pointer;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.in-app-notification .notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.in-app-notification .notification-content > i {
    color: var(--primary);
    font-size: 20px;
    margin-top: 2px;
}

.in-app-notification .notification-text {
    flex: 1;
}

.in-app-notification .notification-text strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.in-app-notification .notification-text p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.in-app-notification .notification-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
}

.in-app-notification .notification-close:hover {
    color: var(--text-primary);
}

.toast.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.toast-undo {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.toast-undo.hidden {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}

.empty-state-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.empty-state-btn i {
    font-size: 14px;
    margin-bottom: 0;
    opacity: 1;
}

.empty-state-hint {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.empty-state-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.skeleton-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-title {
    height: 16px;
    width: 70%;
}

.skeleton-meta {
    height: 12px;
    width: 40%;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}

.skeleton-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.skeleton-text {
    height: 14px;
    flex: 1;
}

/* Date Quick Picks Dropdown */
.date-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-quick-trigger {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-quick-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.date-quick-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    min-width: 120px;
    padding: 4px 0;
}

.date-quick-dropdown.hidden {
    display: none;
}

.date-quick-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.date-quick-btn:hover {
    background: var(--bg-hover);
}

.date-quick-btn.date-clear-btn {
    color: var(--danger);
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 8px;
}

/* Template Styles */
.template-item {
    cursor: pointer;
}

.template-item:hover {
    background: var(--bg-hover);
}

.template-item .nav-item-left i {
    color: var(--primary);
}

#templateModal .modal-container {
    position: relative;
    background: var(--bg-main);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.template-props {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.empty-list-message {
    padding: 10px 16px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-style: italic;
}

/* App Logo */
.app-logo {
    padding: 20px 20px 10px;
    display: flex;
    justify-content: center;
}

.logo-img {
    height: 50px;
    width: auto;
}
.auth-logo {
    height: 80px;
    width: auto;
    margin-bottom: 20px;
}

/* Team Modal Footer */
.team-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.team-modal-footer .footer-left {
    display: flex;
    gap: 8px;
}

.team-modal-footer .footer-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-switch-workspace {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-switch-workspace:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-switch-workspace i {
    font-size: 14px;
}

.btn-danger.hidden {
    display: none !important;
}

/* ==================== Team Modal Styles ==================== */
.team-modal-content {
    max-width: 820px;
}

.team-modal-header-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.team-logo-edit {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border: 2px solid var(--border-color);
    transition: border-color 0.2s;
}

.team-logo-edit:hover {
    border-color: var(--primary);
}

.team-logo-edit img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-logo-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.team-logo-edit:hover .team-logo-edit-overlay {
    opacity: 1;
}

.team-name-edit {
    flex: 1;
}

.team-name-edit input {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
}

.team-name-edit input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Invite Code Display */
.invite-code-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-sidebar);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.invite-code-display code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.invite-code-display .copy-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.invite-code-display .copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Invite Email Input */
.invite-email-input {
    display: flex;
    gap: 8px;
}

.invite-email-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
}

.invite-email-input input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Pending Invites */
.pending-invites {
    margin-top: 12px;
}

.pending-invites-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pending-invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.pending-invite-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pending-invite-email {
    font-size: 13px;
    color: var(--text-primary);
}

.pending-invite-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.pending-invite-cancel {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.pending-invite-cancel:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Short Code Input */
.short-code-input {
    display: flex;
    gap: 8px;
}

.short-code-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.short-code-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-save-small {
    padding: 10px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-small:hover {
    background: var(--primary-hover);
}

.btn-invite {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-invite:hover {
    background: var(--primary-hover);
}

.btn-invite:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Email Task Instructions */
.email-task-instructions {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.email-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.email-task-row:first-child {
    padding-top: 0;
}

.email-task-row:last-child {
    padding-bottom: 0;
}

.email-task-row + .email-task-row {
    border-top: 1px solid var(--border-color);
}

.email-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 55px;
}

.email-task-row code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
}

.email-task-row .copy-btn {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.email-task-row .copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Form Hints */
.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Team Users List */
.team-users-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-sidebar);
}

.team-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.team-user-item:last-child {
    border-bottom: none;
}

.team-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.team-user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.team-user-info {
    flex: 1;
    min-width: 0;
}

.team-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-user-email {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-user-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.team-user-badge.owner {
    background: rgba(250, 173, 20, 0.15);
    color: #d48806;
}

.team-user-badge.member {
    background: var(--accent-subtle);
    color: var(--primary);
}

/* Team User Roles */
.team-user-role {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.team-user-role.owner {
    background: rgba(250, 173, 20, 0.15);
    color: #d48806;
}

.team-user-role.owner i {
    color: #faad14;
}

.team-user-role.admin {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

.team-user-role.admin i {
    color: #8b5cf6;
}

.team-user-role.member {
    background: var(--bg-hover);
    color: var(--text-tertiary);
}

.team-user-role-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    margin-left: 8px;
    flex-shrink: 0;
}

.team-user-role-toggle:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

/* Team Role Info */
.team-role-info {
    background: var(--bg-sidebar);
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.owner {
    background: rgba(250, 173, 20, 0.15);
    color: #d48806;
}

.role-badge.owner i {
    color: #faad14;
}

.role-badge.member {
    background: var(--accent-subtle);
    color: var(--primary);
}

.team-role-info .form-hint {
    margin-top: 8px;
}

/* User Count Badge */
.user-count {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Team Modal Footer Improvements */
.team-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.team-modal-footer .btn-danger {
    padding: 8px 14px;
    font-size: 13px;
}

.team-modal-footer .footer-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-danger.hidden {
    display: none !important;
}

/* Empty State for Team Users */
.team-users-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.team-users-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ==================== Sidebar Header & Teams Dropdown ==================== */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
}

.team-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
    flex: 1;
    min-width: 0;
}

.team-header-main:hover {
    background: var(--bg-hover);
}

.team-header-chevron {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.team-header-main:hover .team-header-chevron {
    color: var(--text-secondary);
}

.team-header-settings {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.team-header-settings:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.team-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.team-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Workspace Dropdown */
.workspace-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 8px;
    right: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    max-height: 320px;
    display: flex;
    flex-direction: column;
}

.workspace-dropdown.hidden {
    display: none;
}

.workspace-dropdown-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.workspace-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.workspace-dropdown-item:hover {
    background: var(--bg-hover);
}

.workspace-dropdown-item.active {
    background: var(--accent-subtle);
}

.workspace-dropdown-item .workspace-logo {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.workspace-dropdown-item .workspace-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-dropdown-item .workspace-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
}

.workspace-dropdown-item.active .workspace-check {
    color: var(--accent);
    font-size: 12px;
}

.workspace-dropdown-actions {
    padding: 6px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workspace-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s;
    width: 100%;
    text-align: left;
}

.workspace-dropdown-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.workspace-dropdown-btn i {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.workspace-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Danger Zone */
.danger-zone {
    border: 1px solid #f8717140;
    border-radius: var(--radius);
    padding: 16px !important;
    margin-top: 20px;
    background: #f8717108;
}

.danger-zone label {
    color: #e53e3e !important;
}

.danger-zone label i {
    color: #e53e3e;
}

.danger-hint {
    color: var(--text-secondary) !important;
    margin-bottom: 12px;
}

.btn-delete-workspace {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #e53e3e;
    background: transparent;
    color: #e53e3e;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-workspace:hover {
    background: #e53e3e;
    color: white;
}

.btn-delete-workspace i {
    font-size: 12px;
}

.header-settings {
    font-size: 14px;
    color: var(--text-tertiary);
    transition: color 0.2s;
    margin-left: auto;
}

.team-header:hover .header-settings {
    color: var(--text-secondary);
}

input#teamModalLogoInput {
    display: none;
}

/* Keep old classes for backwards compatibility */
.teams-dropdown.hidden {
    display: none;
}

input#teamModalLogoInput {
    display: none;
}

.teams-dropdown .dropdown-section {
    padding: 12px;
}

.teams-dropdown .dropdown-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.teams-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

/* Teams List */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.team-item:hover {
    background: var(--bg-hover);
}

.team-item.active {
    background: var(--accent-subtle);
}

.team-item-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.team-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-item-check {
    font-size: 12px;
    color: var(--primary);
    opacity: 0;
}

.team-item.active .team-item-check {
    opacity: 1;
}

.team-settings-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
    border-radius: 4px;
    font-size: 14px;
}

.team-item:hover .team-settings-btn {
    opacity: 0.7;
}

.team-settings-btn:hover {
    opacity: 1 !important;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Create Team Button */
.create-team-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.create-team-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--accent-lighter);
}

.create-team-btn i {
    font-size: 12px;
}

/* Join Team Row - styles defined earlier, this section intentionally left empty to avoid duplicates */

/* User Section */
.user-section {
    background: var(--bg-sidebar);
    border-radius: 4px;
    margin: 8px;
    padding: 12px !important;
}

.user-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-info-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-info-email {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sign-out-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.sign-out-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(235, 77, 61, 0.05);
}

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-max);
    animation: pwaSlideUp 0.3s ease;
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pwa-logo {
    width: 40px;
    height: 40px;
}

.pwa-text {
    display: flex;
    flex-direction: column;
}

.pwa-text strong {
    font-size: 14px;
    color: var(--text-primary);
}

.pwa-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.pwa-install-prompt .btn-primary {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install-prompt .btn-primary:hover {
    background: var(--primary-hover);
}

.pwa-install-prompt .btn-dismiss {
    padding: 6px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
}

.pwa-install-prompt .btn-dismiss:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pwa-install-prompt.hidden {
    display: none;
}

/* Email Instructions Box */
.email-list-addresses {
    margin-top: 8px;
}

.email-instructions-box {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
}

.email-instruction-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.email-instruction-row .email-label {
    color: var(--text-tertiary);
    font-size: 13px;
    min-width: 60px;
}

.email-instruction-row code {
    font-size: 13px;
    color: var(--primary);
    background: transparent;
    padding: 0;
}

.email-instruction-hint {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.email-instruction-hint code {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.email-tags-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.email-tags-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    font-weight: 500;
}

.email-tag-row {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-tag-row code {
    background: var(--bg-tertiary);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.email-example {
    margin: 16px 0 0 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .sidebar,
    .main-header,
    .add-task-bar,
    .bulk-action-bar,
    .inline-task-input,
    .task-panel,
    .modal,
    .toast-container,
    .loading-screen,
    .login-screen,
    #kanbanView,
    .view-toggle,
    .header-dropdown-wrapper,
    .notification-prompt,
    .invite-banner {
        display: none !important;
    }
    
    /* Reset app container layout */
    .app-container {
        display: block !important;
        grid-template-columns: none !important;
    }
    
    /* Main content takes full width */
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        height: auto !important;
    }
    
    /* Print header */
    .task-sections::before {
        content: attr(data-print-title);
        display: block;
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }
    
    /* Task list styling for print */
    .task-sections {
        padding: 20px !important;
    }
    
    .task-item {
        border: 1px solid #ddd !important;
        margin-bottom: 8px !important;
        padding: 12px 16px !important;
        page-break-inside: avoid;
        border-left-width: 4px !important;
    }
    
    .task-item.completed {
        opacity: 0.6;
    }
    
    .task-item.completed .task-name {
        text-decoration: line-through;
    }
    
    /* Show descriptions in print */
    .task-description {
        display: block !important;
        color: #666 !important;
    }
    
    /* Task meta */
    .task-meta-item {
        color: #666 !important;
    }
    
    .task-meta-item.overdue {
        color: #dc3545 !important;
    }
    
    /* Tags */
    .task-tag {
        border: 1px solid currentColor !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    /* Priority colors - force print */
    .check-btn.priority-high {
        border-color: #eb4d3d !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .check-btn.priority-medium {
        border-color: #ffa940 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .check-btn.priority-low {
        border-color: #4772fa !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    /* List badges */
    .task-list-badge {
        border: 1px solid #ddd !important;
    }
    
    /* Section headers */
    .section-date-header {
        font-weight: 600 !important;
        margin: 16px 0 8px 0 !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #ddd !important;
    }
    
    .section-date-header.overdue {
        color: #dc3545 !important;
    }
    
    .section-date-header.today {
        color: #4772fa !important;
    }
    
    /* Completed divider */
    .completed-divider {
        margin: 20px 0 10px 0 !important;
        padding: 8px 0 !important;
        border-top: 1px dashed #999 !important;
    }
    
    /* Hide bulk checkboxes */
    .bulk-checkbox {
        display: none !important;
    }
    
    /* Subtasks */
    .subtask-accordion {
        display: block !important;
        margin-left: 20px;
        border-left: 2px solid #ddd;
        padding-left: 12px;
    }
    
    .subtask-accordion.hidden {
        display: block !important;
    }
    
    .subtask-card {
        padding: 6px 0;
    }
    
    .subtask-toggle {
        display: none !important;
    }
    
    /* Page settings */
    @page {
        margin: 0.5in;
        size: auto;
    }
    
    body {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet and below */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
        --panel-width: 320px;
    }
}

/* Mobile devices */
@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --panel-width: 100%;
    }
    
    /* Team Select Screen - mobile */
    .team-select-container {
        padding: 24px;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .team-select-header .auth-logo {
        width: 48px;
        height: 48px;
    }
    
    .team-select-header h1 {
        font-size: 20px;
    }
    
    .team-list-item {
        padding: 14px;
    }
    
    .team-list-logo {
        width: 40px;
        height: 40px;
    }
    
    .team-list-name {
        font-size: 15px;
    }
    
    /* App container - stack vertically on mobile */
    .app-container {
        flex-direction: column;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }
    
    /* Sidebar - collapsible on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: var(--z-modal);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: none;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open .sidebar-header {
        padding-right: 60px;
    }
    
    .sidebar-resize-handle {
        display: none;
    }
    
    /* Mobile sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: var(--z-modal-backdrop);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Main content */
    .main-content {
        width: 100%;
        flex: 1;
        overflow: auto;
    }
    
    /* Mobile header adjustments */
    .main-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: var(--z-dropdown);
        background: var(--bg-main);
    }
    
    .main-header h1 {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }
    
    .main-header .header-left {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    /* Mobile sidebar close button */
    .mobile-sidebar-close {
        display: none;
    }
    
    .sidebar.open .mobile-sidebar-close {
        display: flex;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        background: var(--bg-hover);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        color: var(--text-primary);
        font-size: 18px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: var(--z-popover);
    }
    
    .mobile-sidebar-close:active {
        background: var(--bg-secondary);
        transform: scale(0.95);
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        color: var(--text-primary);
        font-size: 20px;
        cursor: pointer;
        border-radius: var(--radius);
        margin-right: 8px;
    }
    
    .mobile-menu-btn:hover {
        background: var(--bg-hover);
    }
    
    /* Task list adjustments */
    .task-list {
        padding: 8px 12px;
    }
    
    .task-card {
        padding: 12px;
    }
    
    .task-title {
        font-size: 14px;
    }
    
    .task-meta {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    /* Detail panel - full screen on mobile */
    .detail-panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        z-index: var(--z-popover);
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .detail-panel:not(.hidden) {
        transform: translateX(0);
    }
    
    .panel-header {
        position: sticky;
        top: 0;
        background: var(--bg-main);
        z-index: 10;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    .task-detail-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    /* Form adjustments */
    .form-group label {
        font-size: 12px;
    }
    
    .form-input, .form-select, .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }
    
    /* Quick add */
    .quick-add-container {
        padding: 12px;
    }
    
    .quick-add-input {
        font-size: 16px;
    }
    
    /* Kanban adjustments */
    .kanban-board {
        padding: 12px;
        gap: 12px;
    }
    
    .kanban-column {
        min-width: 260px;
        max-width: 300px;
    }
    
    /* User menu */
    .user-dropdown {
        right: 8px;
        left: 8px;
        width: auto;
    }
    
    /* Header actions */
    .header-actions {
        gap: 4px;
    }
    
    .header-actions button {
        padding: 8px;
        font-size: 14px;
    }
    
    .header-actions button span {
        display: none;
    }
    
    /* View filters */
    .filter-dropdown {
        right: 0;
        left: auto;
    }
    
    /* Toast positioning */
    .toast {
        bottom: 20px;
        left: 16px;
        right: 16px;
        max-width: none;
        transform: none;
    }
    
    /* Teams dropdown */
    #teamsDropdown {
        max-height: 60vh;
    }
    
    /* Sidebar sections scrollable */
    .nav-sections {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    /* Hide main nav items on mobile - REMOVED, show all nav */
    /* .main-nav {
        display: none;
    } */
    
    /* Ensure Lists and Tags sections are visible on mobile */
    .nav-section {
        display: block !important;
    }
    
    .nav-section .nav-list {
        display: block;
    }
    
    /* Allow collapsible sections to hide when collapsed */
    .nav-section .nav-list.collapsible.collapsed,
    .nav-section .collapsible.collapsed {
        display: none !important;
    }

    /* Hide Kanban toggle on mobile */
    .view-toggle {
        display: none;
    }
    
    /* Mobile card style for list view tasks */
    .task-item {
        background: var(--bg-main);
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        border: 1px solid var(--border-light);
        border-left: 4px solid var(--primary);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* Hide drag handle on mobile */
    .task-item .drag-handle {
        display: none !important;
    }
    
    .task-item:active {
        background: var(--bg-hover);
    }
    
    .task-item .task-body {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .task-item .task-name {
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
    }
    
    .task-item .task-description {
        display: -webkit-box !important;
        font-size: 13px;
        color: var(--text-secondary);
        line-height: 1.4;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .task-item .task-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        margin-top: 4px;
    }
    
    .task-item .task-meta-item {
        font-size: 12px;
        padding: 3px 8px;
        background: var(--bg-tertiary);
        border-radius: 4px;
    }
    
    .task-item .task-meta-item.overdue {
        background: rgba(235, 77, 61, 0.1);
        color: var(--priority-high);
    }
    
    .task-item .task-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 6px;
    }
    
    .task-item .task-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .task-item .task-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid var(--border-light);
    }
    
    .task-item .task-assignees {
        display: flex;
        gap: 4px;
    }
    
    .task-item .task-assignee {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .task-item .task-list-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .task-item .check-btn {
        position: absolute;
        top: 14px;
        right: 14px;
    }
    
    .task-item {
        position: relative;
        padding-right: 44px;
    }

    .task-card:active {
        background: var(--bg-hover);
    }

    /* Hide task-right on mobile - we show it differently in the card */
    .task-right {
        display: none;
    }
    
    /* Show assignees in mobile cards */
    .task-assignees-mobile {
        display: flex;
        gap: 4px;
        margin-left: auto;
    }
    
    .task-assignees-mobile .task-assignee {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    /* Task list container */
    .task-list {
        padding: 12px;
        background: var(--bg-secondary);
    }
    
    /* Section headers */
    .section-date-header {
        font-size: 13px;
        padding: 8px 4px;
        margin-top: 16px;
    }
    
    .section-date-header:first-child {
        margin-top: 0;
    }
    
    /* Quick add on mobile */
    .quick-add-container {
        padding: 12px;
        background: var(--bg-main);
        border-bottom: 1px solid var(--border-light);
        position: sticky;
        top: 56px;
        z-index: var(--z-sticky);
    }
    
    .quick-add-input {
        font-size: 16px;
        padding: 12px;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .footer-right {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .modal-footer .footer-right button {
        flex: 1;
    }
    
    .btn-delete {
        width: 100%;
    }
    
    /* Kanban single column */
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        min-width: 100%;
        max-width: 100%;
    }
    
    /* Date picker */
    .flatpickr-calendar {
        width: 100% !important;
        max-width: 320px;
    }
}

/* Hide mobile menu button on desktop */
@media screen and (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .sidebar {
        transform: none !important;
    }
    
    /* Hide mobile-only elements on desktop */
    .task-assignees-mobile {
        display: none;
    }
}

/* Assign to Me Button */
.assign-to-me-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.assign-to-me-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.assign-to-me-btn i {
    font-size: 11px;
}

/* Duplicate Button */
.duplicate-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.duplicate-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Convert Type Button */
.convert-type-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.convert-type-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-color);
}

.convert-type-btn.text-btn:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--accent-color);
}

/* Text Button Style */
.text-btn {
    width: auto;
    height: auto;
    padding: 6px 10px;
    font-size: 12px;
    gap: 6px;
}

.delete-btn.text-btn:hover {
    background: rgba(235, 77, 61, 0.1);
    color: var(--danger);
}

/* Comments Section */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.comments-section .section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.comments-section .section-header h4 i {
    color: var(--text-tertiary);
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.empty-comments {
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

img.comment-avatar {
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    resize: none;
    min-height: 36px;
    max-height: 100px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-submit-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.comment-submit-btn:hover {
    background: var(--primary-dark);
}

/* Activity Log */
.activity-section {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.activity-list {
    padding: 0 12px 12px;
}

.empty-activity {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
}

.activity-item:hover {
    background: var(--bg-hover);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.activity-item i.fa-check-circle {
    color: var(--success);
}

.activity-item i.fa-plus-circle {
    color: var(--primary);
}

.activity-item i.fa-comment {
    color: var(--primary);
}

.activity-item i.fa-trash {
    color: var(--danger);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.activity-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Calendar View */
#calendarView {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.calendar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    min-width: 180px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.calendar-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.calendar-today-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.calendar-today-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.calendar-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.calendar-day {
    background: var(--bg-primary);
    padding: 4px 6px;
    min-height: 80px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.other-month {
    background: var(--bg-secondary);
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-tertiary);
}

.calendar-day.today .calendar-day-number {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.has-overdue .calendar-day-number {
    color: var(--danger);
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-day-tasks {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-task {
    font-size: 11px;
    padding: 2px 4px;
    background: var(--bg-secondary);
    border-radius: 3px;
    border-left: 3px solid var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-task:hover {
    background: var(--bg-hover);
}

.calendar-task.completed {
    text-decoration: line-through;
    opacity: 0.6;
}

.calendar-more {
    font-size: 10px;
    color: var(--text-tertiary);
    padding: 2px 4px;
}

/* Calendar responsive */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .calendar-day-number {
        font-size: 11px;
    }
    
    .calendar-task {
        font-size: 10px;
        padding: 1px 2px;
    }
    
    .calendar-title {
        font-size: 16px;
        min-width: auto;
    }
}