/* CSS Variables for consistent theming */
:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #1a1a2e;
    --accent-blue: #00d4ff;
    --primary-blue: #0066cc;
    --dark-blue: #003d7a;
    --text-white: #ffffff;
    --text-gray: #cccccc;
    --text-light: #aaaaaa;
    --success-green: #00ff88;
    --warning-yellow: #ffaa00;
    --error-red: #ff4444;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Priority colors */
    --priority-1: #ff4444;
    --priority-2: #ff8844;
    --priority-3: #ffaa00;
    --priority-4: #88ff44;
    --priority-5: #00ff88;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
    overflow-x: hidden;
    overscroll-behavior: none;
    background-color: #0a0a0a;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: var(--text-white);
    min-height: 100vh;
    height: 100%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    /* Safe area for phones with notches/dynamic islands */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, var(--primary-blue) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--accent-blue) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, var(--dark-blue) 0%, transparent 50%);
    opacity: 0.3;
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-10px) translateY(-5px); }
    50% { transform: translateX(10px) translateY(-10px); }
    75% { transform: translateX(-5px) translateY(5px); }
}

/* App Header */
.app-header {
    position: relative;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}

.desktop-actions {
    display: none; /* All actions moved to hamburger menu */
    gap: 15px;
    align-items: center;
}

/* Refresh Button */
.refresh-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-white);
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.refresh-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(239, 68, 68, 0.5);
    transition: none;
    z-index: 0;
}

.refresh-btn.long-pressing::before {
    width: 100%;
    transition: width 2s linear;
}

.refresh-btn.long-press-complete {
    background: rgba(239, 68, 68, 0.8);
    border-color: #ef4444;
}

.refresh-btn span {
    position: relative;
    z-index: 1;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.refresh-btn.refreshing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Wider refresh button on mobile for visible fill animation */
@media (max-width: 768px) {
    .refresh-btn {
        padding: 8px 24px;
        min-width: 60px;
    }
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-white);
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger-btn.active {
    background: var(--primary-blue);
}

/* Hamburger Container - positions dropdown relative to button */
.hamburger-container {
    position: relative;
}

/* Mobile Dropdown Menu */
.mobile-menu {
    display: none;
    position: fixed;
    background: rgba(30, 30, 40, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px;
    min-width: 180px;
    z-index: 999999;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item:active {
    background: var(--primary-blue);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 8px 0;
}

.mobile-menu-item.mobile-menu-danger {
    color: #ef4444;
}

.mobile-menu-item.mobile-menu-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Desktop-only elements (hidden on mobile) */
.desktop-only {
    display: flex;
}

.app-title {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--accent-blue);
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

/* Title Section with Refresh Indicator */
.title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Version Display */
.version-display {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.7rem;
    color: var(--text-light);
    opacity: 0.6;
    cursor: default;
}

.version-text {
    font-family: monospace;
}

/* Connection Status Indicator */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: default;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Online state - subtle green */
.connection-status.online,
.connection-status:has(.connection-dot.online) {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.connection-dot.online {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Offline state - subtle amber/red */
.connection-status.offline,
.connection-status:has(.connection-dot.offline) {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.connection-dot.offline {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
    animation: pulse-offline 1s infinite;
}

@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Reconnecting state */
.connection-status.reconnecting,
.connection-status:has(.connection-dot.reconnecting) {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.connection-dot.reconnecting {
    background: #3b82f6;
    animation: pulse-reconnecting 0.5s infinite;
}

@keyframes pulse-reconnecting {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

.connection-text {
    display: inline;
}

/* Connection status on small screens - keep text visible now that profile moved to hamburger */
@media (max-width: 480px) {
    .connection-status {
        padding: 6px 10px;
    }
}

/* Username Display */
.username-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.username-label {
    font-size: 1rem;
}

.username-text {
    color: var(--text-white);
    font-weight: 500;
}

.username-change-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 5px;
    transition: all 0.3s ease;
}

.username-change-btn:hover {
    color: var(--accent-blue);
    transform: scale(1.1);
}

/* Lock Indicators */
.lock-indicator {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--error-red);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--error-red);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 68, 68, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 68, 68, 0.5); }
}

.lock-indicator-small {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--error-red);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--error-red);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.person-card.locked,
.task-item.locked,
.team-card.locked {
    opacity: 0.75;
    border-color: var(--error-red);
}

.person-card.locked:hover,
.task-item.locked:hover,
.team-card.locked:hover {
    transform: none;
    cursor: not-allowed;
}

.btn-icon-only:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-white);
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Modal No-Close (for username modal) */
.modal.modal-no-close {
    pointer-events: auto;
}

.modal.modal-no-close .modal-content {
    pointer-events: auto;
}

/* Navigation Container */
.navigation-container {
    position: relative;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

/* Search Container */
.search-container {
    padding: 15px 40px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--glass-border);
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 1.1rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.search-clear {
    position: absolute;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.search-results-count {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
}

/* Hide filtered people */
.person-card.search-hidden {
    display: none !important;
}

.team-card .person-card.search-hidden {
    display: none !important;
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    padding: 15px 40px 10px;
    gap: 10px;
    position: relative;
    z-index: 100;
}

.view-btn {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border-color: var(--accent-blue);
}

.view-btn.active {
    background: var(--primary-blue);
    color: var(--text-white);
    border-color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0, 102, 204, 0.3);
}

.view-btn.disabled,
.view-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* View More Dropdown (Mobile) */
.view-more-container {
    position: relative;
    display: none;
    z-index: 99999;
}

.view-more-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.more-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.view-more-btn.open .more-arrow {
    transform: rotate(180deg);
}

.view-more-dropdown {
    display: none;
    position: fixed;
    background: rgba(30, 30, 40, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 5px;
    min-width: 140px;
    z-index: 999999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.view-more-dropdown.show {
    display: block;
}

.view-more-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.view-more-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.view-more-item.active {
    background: var(--primary-blue);
    color: var(--text-white);
}

.view-more-item .task-count-badge {
    position: static;
    margin-left: 8px;
}

/* Desktop: hide More menu, show all buttons */
.view-btn-desktop {
    display: inline-flex;
}

/* Mobile: show More menu, hide desktop-only buttons */
@media (max-width: 768px) {
    .view-btn-desktop {
        display: none !important;
    }

    .view-more-container {
        display: block;
    }
}

/* Unread Badge (for chat view button) */
.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-red);
    color: var(--text-white);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* Tab Navigation */
.tab-navigation {
    padding: 0 40px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) rgba(0, 0, 0, 0.3);
}

.tab-navigation::-webkit-scrollbar {
    height: 6px;
}

.tab-navigation::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.tab-navigation::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

.tab {
    padding: 15px 25px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.tab-close {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.tab-close:hover {
    color: var(--error-red);
}

/* Closed case tab styling */
.tab.tab-closed {
    opacity: 0.7;
    background: rgba(255, 165, 0, 0.1);
}

.tab.tab-closed.active {
    background: rgba(255, 165, 0, 0.2);
    border-bottom-color: #ffb347;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    min-height: calc(100vh - 200px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.5s ease-out;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* People Grid */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Teams Container */
.teams-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    animation: fadeIn 0.5s ease-out;
}

/* ==================== MY TASKS CONTAINER ==================== */

.my-tasks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.5s ease-out;
}

.my-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.my-tasks-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent-blue);
    margin: 0;
}

.my-tasks-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: var(--text-white);
    border-color: var(--primary-blue);
}

.my-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-task-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
}

.my-task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.my-task-card.completed {
    opacity: 0.6;
}

.my-task-card.completed .my-task-name {
    text-decoration: line-through;
    color: var(--text-gray);
}

.my-task-checkbox {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.my-task-checkbox:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.my-task-checkbox.checked {
    background: var(--success-green);
    border-color: var(--success-green);
}

.my-task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.my-task-content {
    flex: 1;
    min-width: 0;
}

.my-task-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 6px;
    word-wrap: break-word;
}

.my-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.my-task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-task-priority {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.my-task-priority.priority-1 {
    background: rgba(255, 59, 48, 0.2);
    color: #ff6b6b;
}

.my-task-priority.priority-2 {
    background: rgba(255, 149, 0, 0.2);
    color: #ffa94d;
}

.my-task-priority.priority-3 {
    background: rgba(255, 204, 0, 0.2);
    color: #ffd43b;
}

.my-task-priority.priority-4 {
    background: rgba(52, 199, 89, 0.2);
    color: #69db7c;
}

.my-task-priority.priority-5 {
    background: rgba(88, 86, 214, 0.2);
    color: #9775fa;
}

.my-task-description {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 8px;
    line-height: 1.4;
}

.my-tasks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.my-tasks-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.my-tasks-empty p {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* My Tasks - Person Card Style */
.my-tasks-card {
    max-width: 100%;
    margin: 0 auto;
}

.my-tasks-card .person-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.my-tasks-card .tasks-container {
    max-height: none;
    overflow: visible;
}

.my-tasks-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.my-tasks-items .task-item {
    margin-bottom: 0;
}

.my-tasks-items .no-tasks {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* Task summary badge */
.task-summary-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-blue);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* Completed tasks in My Tasks view */
.my-tasks-items .task-item.completed {
    opacity: 0.6;
    order: 1; /* Push to bottom with flexbox */
}

.my-tasks-items .task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-gray);
}

.my-tasks-items .task-item.completed:hover {
    opacity: 0.8;
}

/* Mobile responsiveness for groups */
@media (max-width: 600px) {
    .my-tasks-group-header {
        padding: 12px 15px;
    }

    .my-tasks-group-title .group-name {
        font-size: 1rem;
    }

    .my-tasks-group-team {
        padding-left: 0;
    }

    .my-tasks-group-items {
        padding: 8px;
    }
}

/* Task count badge (similar to unread badge) */
.task-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-blue);
    color: var(--text-white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ==================== CHAT CONTAINER (NEW) ==================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.chat-header {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
}

.chat-header h2 {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent-blue);
    margin: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-gray);
}

.chat-empty-state .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.chat-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.chat-empty-state p {
    font-size: 1rem;
    color: var(--text-light);
}

.chat-date-separator {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.85rem;
    margin: 15px 0;
    position: relative;
}

.chat-date-separator::before,
.chat-date-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--glass-border);
}

.chat-date-separator::before {
    left: 0;
}

.chat-date-separator::after {
    right: 0;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    animation: slideUp 0.3s ease-out;
}

.chat-message.own-message {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    word-wrap: break-word;
}

.chat-message.own-message .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 18px 18px 4px 18px;
}

.chat-message:not(.own-message) .message-bubble {
    border-radius: 18px 18px 18px 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-blue);
}

.message-role {
    font-size: 0.75rem;
    color: var(--text-gray);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.message-text {
    color: var(--text-white);
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.message-timestamp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.chat-message.own-message .message-timestamp {
    text-align: right;
}

/* Message sync status badges - NEW */
.message-status {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.message-status:empty {
    display: none;
}

/* Edited message indicator */
.message-edited {
    font-size: 0.7rem;
    font-style: italic;
    opacity: 0.7;
    margin-left: 4px;
}

/* Pending message styling (optional) */
.chat-message.pending .message-bubble {
    opacity: 0.85;
}

.chat-input-container {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.chat-input::placeholder {
    color: var(--text-light);
}

.chat-send-btn {
    padding: 12px 24px;
    background: var(--primary-blue);
    border: none;
    border-radius: 20px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Team Card */
.team-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 0;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.team-card.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 
        0 0 30px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.team-header {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.team-header:hover {
    background: rgba(0, 0, 0, 0.4);
}

.team-info {
    flex: 1;
}

.team-info h3 {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent-blue);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-collapse-icon {
    font-size: 1rem;
    color: var(--text-gray);
    transition: transform 0.3s ease;
}

.team-card.collapsed .team-collapse-icon {
    transform: rotate(-90deg);
}

.team-reports-to {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-top: 5px;
}

.team-reports-to strong {
    color: var(--text-white);
}

.team-actions {
    display: flex;
    gap: 8px;
}

.team-members-container {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.team-card.collapsed .team-members-container {
    display: none;
}

.team-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

/* Person Card */
.person-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.person-card[draggable="true"] {
    cursor: grab;
}

.person-card[draggable="true"]:active {
    cursor: grabbing;
}

.person-card.add-person-card {
    background: rgba(0, 102, 204, 0.1);
    border: 2px dashed var(--primary-blue);
    cursor: pointer;
    padding: 20px;
}

.person-card.add-person-card:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--accent-blue);
    transform: translateY(-5px) scale(1.02);
}

.person-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.person-card.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 
        0 0 30px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.person-card.dragging-person {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.person-card.in-team {
    background: rgba(255, 255, 255, 0.08);
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    gap: 10px;
}

.person-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.person-info h3 {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-white);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-role {
    display: inline-block;
    background: var(--primary-blue);
    color: var(--text-white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Person Badges Container */
.person-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Case Agent Badge */
.case-agent-badge {
    display: inline-block;
    background: #dc2626;
    color: var(--text-white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Case Agent Button (Admin only) */
.btn-case-agent {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-case-agent:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--text-white);
}

.btn-case-agent.active {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
    color: #eab308;
}

.btn-case-agent.active:hover {
    background: rgba(234, 179, 8, 0.3);
}

.btn-case-agent.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-case-agent.disabled:hover {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-gray);
}

/* Highlight card when person is case agent */
.person-card.is-case-agent {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.15);
}

/* Contact Info and Actions */
.contact-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.phone-display {
    color: var(--text-gray);
    font-size: 0.9rem;
    white-space: nowrap;
}

.contact-actions {
    display: flex;
    gap: 6px;
}

.contact-btn {
    text-decoration: none;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    border-color: var(--accent-blue);
}

.contact-btn:active {
    transform: scale(0.95);
}

/* Email Display */
.email-info {
    margin-top: 4px;
    width: 100%;
}

.email-btn {
    color: var(--text-gray);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.email-btn:hover {
    color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-blue);
}

.task-count-badge {
    display: inline-block;
    background: var(--warning-yellow);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.person-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon-only {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border-color: var(--accent-blue);
}

.btn-icon-only.btn-danger:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    color: var(--text-white);
}

.btn-icon-only.btn-warning {
    background: transparent;
    color: #ef4444 !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    -webkit-text-fill-color: #ef4444;
}

.btn-icon-only.btn-warning:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: var(--text-white);
}

/* Tasks Container */
.tasks-container {
    margin-top: 15px;
}

.task-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: move;
}

.task-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(5px);
}

.task-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-name,
.task-item.completed .task-description {
    text-decoration: line-through;
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.task-content {
    flex: 1;
}

.task-name {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 5px;
}

.task-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.priority-badge.priority-1 {
    background: var(--priority-1);
    color: var(--text-white);
}

.priority-badge.priority-2 {
    background: var(--priority-2);
    color: var(--text-white);
}

.priority-badge.priority-3 {
    background: var(--priority-3);
    color: var(--primary-dark);
}

.priority-badge.priority-4 {
    background: var(--priority-4);
    color: var(--primary-dark);
}

.priority-badge.priority-5 {
    background: var(--priority-5);
    color: var(--primary-dark);
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.task-notes-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-notes-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.task-notes {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid var(--accent-blue);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.task-notes.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.task-notes-content {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.add-task-btn {
    width: 100%;
    padding: 12px;
    background: rgba(0, 102, 204, 0.2);
    border: 1px dashed var(--primary-blue);
    border-radius: 8px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-task-btn:hover {
    background: rgba(0, 102, 204, 0.3);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-warning {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-blue);
}

.btn-danger {
    background: var(--error-red);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #ff6666;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.btn-warning {
    background: #f59e0b;
    color: var(--text-white);
}

.btn-warning:hover {
    background: #fbbf24;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-content.modal-medium {
    max-width: 500px;
}

.modal-content.modal-large {
    max-width: 800px;
}

/* ==================== CONFLICT RESOLUTION MODAL ==================== */

.conflict-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
}

.conflict-version {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid transparent;
}

.conflict-version.your-version {
    border-color: rgba(59, 130, 246, 0.5);
}

.conflict-version.server-version {
    border-color: rgba(251, 191, 36, 0.5);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.version-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-badge.your {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.version-badge.server {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.version-time {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.version-content {
    font-size: 0.9rem;
    line-height: 1.6;
}

.version-content .field {
    margin-bottom: 8px;
}

.version-content .field-label {
    color: var(--text-gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-content .field-value {
    color: var(--text-white);
    margin-top: 2px;
}

.version-content .field-value.changed {
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid #fbbf24;
}

.conflict-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.conflict-divider span {
    background: var(--glass-border);
    color: var(--text-gray);
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive conflict modal */
@media (max-width: 768px) {
    .conflict-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .conflict-divider {
        padding: 10px 0;
    }

    .conflict-divider span {
        padding: 6px 20px;
        border-radius: 12px;
    }

    .modal-content.modal-large {
        max-width: 95%;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent-blue);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--error-red);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Roles Management Modal Styles */
.roles-section {
    margin-bottom: 20px;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.role-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
}

.role-name {
    color: var(--text-white);
    font-size: 0.95rem;
    font-weight: 500;
}

.role-delete-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.role-delete-btn:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    color: var(--text-white);
}

.role-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.8rem;
    font-style: italic;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-section {
    margin-top: 30px;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-white);
    margin-bottom: 15px;
}

.person-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-remove {
    width: 40px;
    height: 40px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 15px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .title-section {
        justify-content: center;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }

    .desktop-actions {
        display: none;
    }

    .desktop-only {
        display: none !important;
    }

    .hamburger-btn {
        display: flex;
    }

    .app-title {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Position version between title and buttons on mobile */
    .header-actions {
        flex-wrap: wrap;
    }

    .version-display {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }

    .username-display {
        justify-content: center;
    }
    
    .toast-container {
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .view-toggle {
        padding: 10px 10px;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
    }

    .view-toggle::-webkit-scrollbar {
        display: none;
    }

    .view-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tab-navigation {
        padding: 0 20px;
    }
    
    .search-container {
        padding: 15px 20px;
    }
    
    .search-wrapper {
        max-width: 100%;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .people-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 5px;
    }

    .team-members-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .teams-container {
        padding: 0 5px;
    }
    
    .person-input-group {
        grid-template-columns: 1fr;
    }
    
    .btn-remove {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .role-input-group {
        flex-direction: column;
    }
    
    .role-input-group .form-input {
        width: 100%;
    }
    
    .chat-container {
        height: calc(100vh - 250px);
    }
    
    .message-bubble {
        max-width: 85%;
    }

    /* Ensure cards don't overflow on mobile */
    .person-card {
        max-width: 100%;
        box-sizing: border-box;
        padding: 15px;
        margin: 0;
    }

    .team-card {
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    .main-content {
        overflow-x: hidden;
        padding-left: 15px;
        padding-right: 15px;
    }

    .person-header {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 15px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .task-item {
        padding: 12px;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .message-bubble {
        max-width: 90%;
    }

    /* People view - smaller cards */
    .person-card {
        padding: 12px;
    }

    .person-header {
        gap: 8px;
    }

    .person-info h3 {
        font-size: 1rem;
    }

    .person-actions {
        align-self: flex-start;
    }

    .person-role {
        font-size: 0.8rem;
    }

    .people-grid {
        padding: 0 2px;
    }

    .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Team view - fit container */
    .team-card {
        margin: 0;
    }

    .team-header {
        padding: 12px 15px;
    }

    .team-header h3 {
        font-size: 1rem;
    }

    .team-members-container {
        padding: 12px;
    }

    .teams-container {
        padding: 0 2px;
    }

    /* In-team person cards */
    .person-card.in-team {
        padding: 10px;
    }

    .person-card.in-team .person-info h3 {
        font-size: 0.9rem;
    }
}

/* ==================== PHOTO ATTACHMENTS (v3.3.0) ==================== */

/* Photo Button in Chat Input */
.chat-photo-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-gray);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.chat-photo-btn:hover {
    background: var(--primary-blue);
    color: var(--text-white);
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.chat-photo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Photo Source Selection Menu */
.photo-source-menu {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1000;
    min-width: 200px;
    animation: menuSlideUp 0.2s ease;
}

@keyframes menuSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-source-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.photo-source-option:hover {
    background: rgba(99, 102, 241, 0.2);
}

.photo-source-option:active {
    background: rgba(99, 102, 241, 0.3);
}

.photo-source-option:first-child {
    border-bottom: 1px solid var(--glass-border);
}

.photo-source-icon {
    font-size: 1.4rem;
}

/* Photo Preview Container (before sending) */
.photo-preview-container {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.photo-preview-container::-webkit-scrollbar {
    height: 6px;
}

.photo-preview-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.photo-preview-container::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    transition: all 0.3s ease;
}

.photo-preview-item:hover {
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.photo-preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error-red);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.2s ease;
}

.photo-preview-remove:hover {
    opacity: 1;
    transform: scale(1.1);
}

.photo-preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--text-white);
    font-size: 0.7rem;
    padding: 4px 6px;
    text-align: center;
}

/* Photo Thumbnails in Messages */
.message-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-width: 100%;
}

.photo-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Photo Delete Button (on thumbnails) */
.photo-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
}

.photo-thumbnail:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    transform: scale(1.1);
}

/* Photo Pending Indicator (for offline uploads) */
.photo-pending-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--warning-yellow);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 1;
}

/* Encrypted Photo Loading Placeholder */
.photo-encrypted .photo-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.9) 0%, rgba(20, 20, 35, 0.95) 100%);
    color: var(--text-muted);
    font-size: 0.75rem;
    z-index: 1;
}

.photo-lock-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    animation: pulse 2s infinite;
}

.photo-loading-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

/* Lightbox Loading Indicator */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
    z-index: 10;
}

.lightbox-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lightbox-loading-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Photo Lightbox Modal */
.photo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2500;
    animation: fadeIn 0.3s ease-out;
}

.photo-lightbox.show {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    transform: scale(1.1);
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 120px;
    max-width: 100%;
    max-height: 100%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-nav:hover:not(:disabled) {
    background: var(--primary-blue);
    border-color: var(--accent-blue);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lightbox-caption {
    color: var(--text-white);
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
    word-wrap: break-word;
}

.lightbox-counter {
    color: var(--text-gray);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

/* Responsive Design for Photos */
@media (max-width: 768px) {
    .message-photos {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    
    .photo-preview-item {
        width: 80px;
        height: 80px;
    }
    
    .lightbox-image-container {
        padding: 80px 20px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        top: 15px;
        right: 15px;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .message-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .photo-preview-container {
        padding: 10px 15px;
    }
    
    .photo-preview-item {
        width: 70px;
        height: 70px;
    }
    
    .chat-photo-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .lightbox-image-container {
        padding: 60px 10px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        top: 10px;
        right: 10px;
    }
}

/* Loading State for Photo Uploads */
.photo-uploading {
    position: relative;
    opacity: 0.6;
}

.photo-uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Photo Grid - Special Layouts */
.message-photos.has-one-photo {
    grid-template-columns: 1fr;
    max-width: 300px;
}

.message-photos.has-two-photos {
    grid-template-columns: repeat(2, 1fr);
    max-width: 300px;
}

.message-photos.has-three-photos {
    grid-template-columns: repeat(3, 1fr);
    max-width: 300px;
}

.message-photos.has-four-photos {
    grid-template-columns: repeat(2, 1fr);
    max-width: 300px;
}

/* Ensure photos don't break message bubble layout */
.chat-message.own-message .message-photos {
    margin-left: auto;
}

.chat-message:not(.own-message) .message-photos {
    margin-right: auto;
}

/* ==================== END PHOTO ATTACHMENTS ==================== */

/* ==================== CHAT CONTEXT MENU (Long-press) ==================== */

.context-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2999;
    background: transparent;
}

.chat-context-menu {
    position: fixed;
    z-index: 3000;
    background: rgba(30, 30, 45, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 6px;
    min-width: 150px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.15s ease-out;
}

.chat-context-menu.show {
    opacity: 1;
    transform: scale(1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-white);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: left;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

.context-menu-delete {
    color: var(--error-red);
}

.context-menu-delete:hover {
    background: rgba(255, 82, 82, 0.15);
}

.context-menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Touch feedback on messages */
.chat-message {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.chat-message.own-message:active {
    transform: scale(0.98);
}

/* ==================== END CHAT CONTEXT MENU ==================== */

/* Roster Management Styles */
.roster-modal-content {
  padding: 10px 0;
}

.roster-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
}

.roster-people-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.roster-person-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.roster-person-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.roster-person-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-person-role {
  font-size: 0.875rem;
  color: var(--text-gray);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.sync-status.recent {
  color: var(--success-color);
  border-color: var(--success-color);
}

.sync-status.normal {
  color: var(--text-light);
}

.sync-status.stale {
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.sync-status.offline {
  color: var(--error-color);
  border-color: var(--error-color);
}

.sync-icon {
  font-size: 1rem;
  line-height: 1;
}

.sync-text {
  line-height: 1;
  white-space: nowrap;
}

/* Storage Indicator Styles */
.storage-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.storage-indicator:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.storage-indicator.warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.storage-indicator.critical {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.storage-icon {
  font-size: 1.1rem;
}

.storage-text {
  font-weight: 500;
}

/* Storage Modal Styles */
.storage-modal-content {
  padding: 20px;
}

.storage-stats {
  margin: 20px 0;
  padding: 15px;
  background: var(--background);
  border-radius: 8px;
}

.storage-stat {
  margin: 10px 0;
  font-size: 0.95rem;
}

.storage-progress {
  width: 100%;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.storage-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s ease;
}

.storage-indicator.warning .storage-progress-bar {
  background: linear-gradient(90deg, #FFC107, #FFD54F);
}

.storage-indicator.critical .storage-progress-bar {
  background: linear-gradient(90deg, #F44336, #E57373);
}

.storage-breakdown {
  margin: 20px 0;
  padding: 15px;
  background: var(--surface);
  border-radius: 8px;
}

.storage-breakdown h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.storage-breakdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.storage-breakdown li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.storage-breakdown li:last-child {
  border-bottom: none;
}

.storage-actions {
  margin-top: 20px;
  text-align: center;
}

/* ==================== ADMIN PANEL (v3.4.0) ==================== */

.admin-container {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-height: calc(100vh - 300px);
}

.admin-header {
  padding: 25px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--glass-border);
}

.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-title-row h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent-blue);
  margin: 0;
}

.admin-close-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.admin-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 15px 20px;
  min-width: 120px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.stat-card .stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.stat-card .stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-top: 5px;
}

.stat-card.stat-pending {
  border-color: var(--warning-yellow);
}

.stat-card.stat-pending .stat-value {
  color: var(--warning-yellow);
}

.stat-card.stat-active {
  border-color: var(--success-green);
}

.stat-card.stat-active .stat-value {
  color: var(--success-green);
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 5px;
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
  overflow-x: auto;
}

.admin-tab {
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-gray);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.admin-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
  border-color: var(--accent-blue);
}

.admin-tab.active {
  background: var(--primary-blue);
  color: var(--text-white);
  border-color: var(--primary-blue);
}

.tab-badge {
  background: var(--error-red);
  color: var(--text-white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.admin-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.3);
}

/* Admin Search */
.admin-search {
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.15);
}

.admin-search .form-input {
  max-width: 500px;
  border-radius: 25px;
  padding-left: 20px;
}

/* Admin Content */
.admin-content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
}

.admin-tab-content {
  animation: fadeIn 0.3s ease-out;
}

/* User Grid */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* User Card */
.user-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.user-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: var(--accent-blue);
}

.user-card.user-locked {
  border-color: var(--error-red);
  opacity: 0.8;
}

.user-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-white);
  flex-shrink: 0;
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--text-white);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-white);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-size: 0.85rem;
  color: var(--text-gray);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.meta-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
}

.user-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.status-pending {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning-yellow);
  border: 1px solid var(--warning-yellow);
}

.status-badge.status-approved,
.status-badge.status-active {
  background: rgba(0, 255, 136, 0.15);
  color: var(--success-green);
  border: 1px solid var(--success-green);
}

.status-badge.status-inactive {
  background: rgba(150, 150, 150, 0.2);
  color: var(--text-gray);
  border: 1px solid var(--text-gray);
}

.status-badge.status-locked,
.status-badge.status-rejected {
  background: rgba(255, 68, 68, 0.15);
  color: var(--error-red);
  border: 1px solid var(--error-red);
}

/* Role Badges */
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.role-badge.role-super-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
}

.role-badge.role-admin {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning-yellow);
  border: 1px solid var(--warning-yellow);
}

.role-badge.role-user {
  background: rgba(0, 102, 204, 0.2);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

/* User Card Actions */
.user-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--glass-border);
}

.user-card-actions .btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  flex: 1;
  min-width: 100px;
  justify-content: center;
}

/* Admin Empty State */
.admin-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-gray);
}

.admin-empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.admin-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--text-white);
}

.admin-empty-state p {
  font-size: 1rem;
  color: var(--text-light);
}

/* User Detail Modal */
.user-detail {
  padding: 10px 0;
}

.user-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.user-detail-info h3 {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-white);
  margin: 0 0 5px 0;
}

.user-detail-info p {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin: 0;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.detail-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 15px;
}

.detail-item label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item span {
  font-size: 0.95rem;
  color: var(--text-white);
}

/* Temp Password Display */
.temp-password-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.temp-password-display code {
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  color: var(--accent-blue);
  letter-spacing: 2px;
  font-weight: 600;
}

/* Admin Panel Responsive */
@media (max-width: 768px) {
  .admin-header {
    padding: 20px;
  }

  .admin-title-row {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .admin-stats {
    width: 100%;
    justify-content: space-between;
  }

  .stat-card {
    flex: 1;
    min-width: 90px;
    padding: 12px;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .admin-tabs {
    padding: 10px 20px;
  }

  .admin-tab {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .admin-content {
    padding: 20px;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .user-detail-header {
    flex-direction: column;
    text-align: center;
  }
}

/* User Detail Modal Footer - Handle multiple buttons */
#userDetailFooter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px;
}

#userDetailFooter button {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  #userDetailFooter {
    flex-direction: column;
  }

  #userDetailFooter button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .admin-header {
    padding: 15px;
  }

  .admin-title-row h2 {
    font-size: 1.2rem;
  }

  .stat-card {
    min-width: 80px;
    padding: 10px;
  }

  .stat-card .stat-value {
    font-size: 1.3rem;
  }

  .stat-card .stat-label {
    font-size: 0.75rem;
  }

  .admin-tabs {
    padding: 10px 15px;
  }

  .admin-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .admin-content {
    padding: 15px;
  }

  .user-card {
    padding: 15px;
  }

  .user-card-actions {
    flex-direction: column;
  }

  .user-card-actions .btn-sm {
    width: 100%;
  }

  .temp-password-display {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }

  .temp-password-display code {
    font-size: 1.2rem;
  }
}

/* ==================== END ADMIN PANEL ==================== */

/* ==================== HIERARCHY VIEW ==================== */

/* Container Layout */
.hierarchy-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    animation: fadeIn 0.5s ease-out;
}

.hierarchy-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.hierarchy-main {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

/* Pool Sidebar */
.hierarchy-pool {
    width: 220px;
    min-width: 200px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

.hierarchy-pool h3 {
    margin-bottom: 15px;
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.pool-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pool-cards .hierarchy-card {
    width: 100%;
}

/* Drop zone styling for pool */
.hierarchy-pool.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

/* Chart Area */
.hierarchy-chart {
    flex: 1;
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: auto;
    padding: 20px;
}

.hierarchy-levels {
    display: flex;
    flex-direction: column;
    gap: 60px;
    position: relative;
    z-index: 1;
    min-height: 100%;
}

/* Level Row */
.hierarchy-level-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hierarchy-level-label {
    min-width: 60px;
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
}

.hierarchy-level-sections {
    display: flex;
    gap: 10px;
    flex: 1;
}

.hierarchy-level-sections.has-multiple {
    gap: 15px;
}

.hierarchy-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 10px 15px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    flex: 1;
    min-width: 150px;
}

.hierarchy-section.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.hierarchy-section.has-cards {
    border-style: solid;
    border-color: var(--glass-border);
}

/* Presentation mode - hide outlines */
.hierarchy-container.outlines-hidden .hierarchy-section {
    border-color: transparent;
    background: transparent;
}

.hierarchy-container.outlines-hidden .hierarchy-level-label {
    opacity: 0;
}

.hierarchy-container.outlines-hidden .hierarchy-level-actions {
    opacity: 0;
}

.hierarchy-container.outlines-hidden .hierarchy-pool {
    opacity: 0.3;
}

.hierarchy-container.outlines-hidden .hierarchy-toolbar {
    opacity: 0.5;
}

.hierarchy-container.outlines-hidden:hover .hierarchy-toolbar {
    opacity: 1;
}

/* Viewer mode - read-only for non-admin users on mobile */
.hierarchy-container.viewer-mode .hierarchy-pool {
    display: none;
}

.hierarchy-container.viewer-mode .hierarchy-toolbar {
    display: none;
}

.hierarchy-container.viewer-mode .hierarchy-level-actions {
    display: none;
}

.hierarchy-container.viewer-mode .hierarchy-level-label {
    display: none;
}

.hierarchy-container.viewer-mode .hierarchy-chart {
    border: none;
    background: transparent;
}

.hierarchy-container.viewer-mode .hierarchy-card {
    cursor: default;
}

.hierarchy-container.viewer-mode .draw-mode-indicator {
    display: none;
}

/* Legacy support for non-sectioned levels */
.hierarchy-level {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 60px;
    padding: 10px 15px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    flex: 1;
}

.hierarchy-level-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hierarchy-level-actions .btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hierarchy-level-actions .btn-icon:hover {
    background: var(--accent-blue);
    color: var(--primary-dark);
    border-color: var(--accent-blue);
}

.hierarchy-level.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.hierarchy-level.has-cards {
    border-style: solid;
    border-color: var(--glass-border);
}

.hierarchy-level-empty {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-style: italic;
}

/* Compact Card */
.hierarchy-card {
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 140px;
    max-width: 180px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.hierarchy-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.hierarchy-card:active {
    cursor: grabbing;
}

.hierarchy-card .card-name {
    font-weight: 500;
    color: var(--text-white);
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-card .card-role {
    font-size: 0.75rem;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-card .task-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary-blue);
    color: var(--text-white);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}

.hierarchy-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.hierarchy-card.selected {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue);
    background: rgba(0, 212, 255, 0.15);
}

.hierarchy-card.connected {
    animation: connectionPulse 0.5s ease;
}

@keyframes connectionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* SVG Lines */
.hierarchy-lines {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    /* Width and height set dynamically by JS to match scroll area */
}

.connection-line {
    fill: none;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}

.connection-line.vertical {
    stroke: var(--accent-blue);
}

.connection-line.horizontal {
    stroke: var(--warning-yellow);
    stroke-dasharray: 5, 5;
}

/* Draw Mode */
.draw-mode-indicator {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.draw-mode-indicator .draw-mode-text {
    color: var(--accent-blue);
    font-weight: 500;
}

.draw-mode-indicator .btn-sm {
    background: var(--accent-blue);
    color: var(--primary-dark);
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.draw-mode-indicator .btn-sm:hover {
    background: var(--text-white);
}

/* Draw mode active state */
.hierarchy-container.draw-mode .hierarchy-card {
    cursor: pointer;
}

.hierarchy-container.draw-mode .hierarchy-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Empty state for hierarchy */
.hierarchy-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-gray);
    text-align: center;
}

.hierarchy-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.hierarchy-empty-state p {
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hierarchy-container {
        height: calc(100vh - 280px);
    }

    .hierarchy-main {
        flex-direction: column;
    }

    .hierarchy-pool {
        width: 100%;
        min-width: unset;
        max-height: 150px;
    }

    .pool-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pool-cards .hierarchy-card {
        width: auto;
        min-width: 120px;
        flex: 0 0 auto;
    }

    .hierarchy-chart {
        flex: 1;
        min-height: 300px;
        padding: 10px;
        overflow-x: auto;
        overflow-y: auto;
    }

    .hierarchy-levels {
        min-width: min-content;
        padding-right: 10px;
    }

    .hierarchy-level-wrapper {
        flex-wrap: nowrap;
    }

    .hierarchy-level-sections {
        flex-wrap: nowrap;
        justify-content: center;
        overflow-x: visible;
    }

    .hierarchy-section {
        min-width: 90px;
        flex: 0 0 auto;
        padding: 8px 10px;
        justify-content: center;
    }

    .hierarchy-level-label {
        min-width: 45px;
        font-size: 0.7rem;
        padding: 0 5px;
    }

    .hierarchy-level {
        padding: 8px;
        min-height: 50px;
    }

    .hierarchy-level-actions {
        flex-direction: row;
        gap: 2px;
    }

    .hierarchy-card {
        min-width: 100px;
        max-width: 140px;
        padding: 6px 10px;
    }

    .hierarchy-card .card-name {
        font-size: 0.85rem;
    }

    .hierarchy-card .card-role {
        font-size: 0.7rem;
    }

    .draw-mode-indicator {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .hierarchy-toolbar {
        justify-content: center;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .hierarchy-chart {
        padding: 8px;
    }

    .hierarchy-section {
        min-width: 90px;
        padding: 6px 8px;
        gap: 6px;
    }

    .hierarchy-card {
        min-width: 85px;
        max-width: 120px;
        padding: 5px 8px;
    }

    .hierarchy-card .card-name {
        font-size: 0.8rem;
    }

    .hierarchy-card .card-role {
        font-size: 0.65rem;
    }

    .hierarchy-level-label {
        min-width: 40px;
        font-size: 0.65rem;
    }

    .hierarchy-toolbar {
        gap: 5px;
    }

    .hierarchy-toolbar button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hierarchy-container {
        height: calc(100vh - 120px);
    }

    .hierarchy-pool {
        max-height: 100px;
    }
}

/* ==================== END HIERARCHY VIEW ==================== */

/* ==================== CASE AGENT BRIEF VIEW ==================== */

.brief-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-width: 900px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.brief-header {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
}

.brief-header h2 {
    font-size: 1.4rem;
    font-weight: 400;
    color: #dc2626;
    margin: 0;
}

.brief-entries {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brief-entries::-webkit-scrollbar {
    width: 8px;
}

.brief-entries::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.brief-entries::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

.brief-entry {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-left: 4px solid #dc2626;
    border-radius: 12px;
    padding: 15px 20px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brief-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brief-entry-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brief-entry-author {
    font-weight: 500;
    color: #dc2626;
    font-size: 0.95rem;
}

.brief-entry-time {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.brief-entry-content {
    color: var(--text-white);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.brief-entry-delete {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-gray);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.brief-entry-delete:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    color: var(--text-white);
}

.brief-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.brief-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.brief-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* Brief Input Area */
.brief-input-area {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
}

.brief-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brief-textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    transition: border-color 0.3s ease;
}

.brief-textarea:focus {
    outline: none;
    border-color: #dc2626;
}

.brief-textarea::placeholder {
    color: var(--text-gray);
}

.brief-input-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.brief-mic-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-gray);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brief-mic-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
    color: #dc2626;
}

.brief-mic-btn.recording {
    background: rgba(220, 38, 38, 0.3);
    border-color: #dc2626;
    color: #dc2626;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

#briefSendBtn {
    background: #dc2626;
    border-color: #dc2626;
}

#briefSendBtn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Brief Unread Badge */
#briefUnreadBadge {
    width: 10px;
    height: 10px;
    background: #dc2626;
    border-radius: 50%;
    margin-left: 6px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brief-container {
        height: calc(100vh - 180px);
        border-radius: 12px;
        margin: 0 10px;
    }

    .brief-header {
        padding: 15px 20px;
    }

    .brief-header h2 {
        font-size: 1.2rem;
    }

    .brief-entries {
        padding: 15px;
    }

    .brief-entry {
        padding: 12px 15px;
    }

    .brief-input-area {
        padding: 12px 15px;
    }

    .brief-textarea {
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .brief-container {
        height: calc(100vh - 160px);
        margin: 0 5px;
    }

    .brief-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .brief-entry-delete {
        align-self: flex-end;
        margin-top: -30px;
    }
}

/* ==================== END CASE AGENT BRIEF VIEW ==================== */

/* ==================== ARCHIVE VIEW ==================== */

.archive-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.archive-header {
    margin-bottom: 20px;
}

.archive-header h2 {
    color: var(--text-white);
    margin: 0 0 5px 0;
}

.archive-subtitle {
    color: var(--text-gray);
    margin: 0;
    font-size: 0.9rem;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.archive-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
    transform: translateX(4px);
}

.archive-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.archive-card-name {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.archive-card-date {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.archive-card-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.archive-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.archive-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.archive-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.archive-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Tab name with inline icons */
.tab-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tab-icon {
    font-size: 0.8rem;
    opacity: 0.5;
    transition: all 0.2s ease;
}

/* Close case icon (clickable) */
.tab-close-case {
    cursor: pointer;
    filter: grayscale(100%);
}

.tab-close-case:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
}

.tab.active .tab-close-case {
    opacity: 0.7;
}

/* Closed case indicator - clickable to manage access */
.tab-closed-icon {
    filter: none;
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-closed-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Case Closed Banner */
.case-closed-banner {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 100, 0, 0.1));
    border: 1px solid rgba(255, 165, 0, 0.4);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.case-closed-banner-text {
    color: #ffb347;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.case-closed-banner .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Manage Access Modal */
.access-instruction {
    color: var(--text-gray);
    margin-bottom: 15px;
}

.access-expiration-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.access-expiration-select label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.access-expiration-select select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-white);
    font-size: 0.9rem;
}

.access-user-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.access-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.access-user-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.access-user-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.access-user-item label {
    flex: 1;
    cursor: pointer;
    color: var(--text-white);
}

.access-user-item .user-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.access-user-item .user-status.active {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.access-user-item .user-status.former {
    background: rgba(158, 158, 158, 0.2);
    color: #bdbdbd;
}

.modal-warning {
    color: #ffb347;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.9rem;
    margin: 10px 0;
}

/* Session Expiry Warning */
#sessionExpiryCountdown.expiry-critical {
    color: #ef4444 !important;
    animation: pulseWarning 1s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.modal-info {
    color: #64b5f6;
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.9rem;
    margin: 10px 0;
}

/* Archive card action buttons */
.archive-card .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Reopen button for admins */
.reopen-case-btn {
    background: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
}

.reopen-case-btn:hover {
    background: rgba(33, 150, 243, 0.2);
}

/* Access expires badge */
.access-expires-badge {
    font-size: 0.75rem;
    color: var(--text-gray);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==================== END ARCHIVE VIEW ==================== */

/* ==================== REPORT VIEW ==================== */

.report-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px;
    width: 100%;
}

.report-toolbar {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 10;
}

.report-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.report-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
}

.report-header-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(156, 39, 176, 0.1));
    border-color: rgba(33, 150, 243, 0.3);
}

.report-title {
    font-size: 2rem;
    color: var(--text-white);
    margin: 0 0 20px;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.report-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-meta-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-meta-value {
    font-size: 1rem;
    color: var(--text-white);
}

.report-section-title {
    font-size: 1.4rem;
    color: var(--text-white);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.report-subsection-title {
    font-size: 1rem;
    color: var(--text-light);
    margin: 20px 0 15px;
}

.report-subsection-title:first-of-type {
    margin-top: 0;
}

.report-empty {
    color: var(--text-gray);
    font-style: italic;
}

/* Report Stats */
.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.report-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.report-stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.report-stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-top: 5px;
}

/* Report Roster */
.report-roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.report-roster-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid var(--primary-blue);
}

.report-roster-card.former {
    opacity: 0.7;
    border-left-color: var(--text-gray);
}

.report-roster-name {
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-roster-role {
    font-size: 0.9rem;
    color: var(--text-light);
}

.report-roster-detail {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-top: 5px;
}

.report-roster-detail.removed {
    color: #ef9a9a;
}

.report-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-radius: 4px;
}

/* Report Hierarchy */
.report-hierarchy {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-hierarchy-level {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-hierarchy-level-label {
    font-size: 0.8rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-hierarchy-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.report-hierarchy-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    min-width: 150px;
}

.report-hierarchy-name {
    font-weight: 600;
    color: var(--text-white);
}

.report-hierarchy-role {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Report Tasks */
.report-tasks {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-task {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid var(--text-gray);
}

.report-task.completed {
    border-left-color: var(--success-green);
    opacity: 0.85;
}

.report-task-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.report-task-status {
    font-size: 1.1rem;
    line-height: 1;
}

.report-task.completed .report-task-status {
    color: var(--success-green);
}

.report-task-name {
    font-weight: 600;
    color: var(--text-white);
    flex: 1;
}

.report-task.completed .report-task-name {
    text-decoration: line-through;
    opacity: 0.8;
}

.report-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.report-task-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.report-task-notes {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Report Messages */
.report-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
}

.report-message {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 15px;
}

.report-message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.report-message-author {
    font-weight: 600;
    color: var(--primary-blue);
}

.report-message-role {
    font-size: 0.75rem;
    color: var(--text-gray);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.report-message-time {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-left: auto;
}

.report-message-text {
    color: var(--text-light);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Report Brief */
.report-briefs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-brief-entry {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid var(--primary-blue);
}

.report-brief-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.report-brief-author {
    font-weight: 600;
    color: var(--primary-blue);
}

.report-brief-date {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.report-brief-content {
    color: var(--text-light);
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Print blocking */
.report-print-block {
    display: none;
}

@media print {
    .report-content,
    .report-toolbar {
        display: none !important;
    }

    .report-print-block {
        display: flex !important;
        justify-content: center;
        align-items: center;
        height: 100vh;
        font-size: 1.5rem;
        color: #333;
    }
}

/* ==================== END REPORT VIEW ==================== */

/* ==================== E2EE / ENCRYPTION STATUS ==================== */

/* Encrypted data placeholder */
.encrypted-data {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 170, 0, 0.15);
    border: 1px solid var(--warning-yellow);
    border-radius: 4px;
    color: var(--warning-yellow);
    font-size: 0.85em;
    font-style: italic;
}

.encrypted-data::before {
    content: '🔒';
    font-size: 0.9em;
}

/* Session expiry banner */
.session-expiry-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.95), rgba(200, 0, 0, 0.95));
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.session-expiry-banner .banner-icon {
    font-size: 1.5rem;
}

.session-expiry-banner .banner-message {
    font-weight: 500;
}

.session-expiry-banner .banner-action {
    background: white;
    color: var(--error-red);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-expiry-banner .banner-action:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

/* E2EE status indicator in header */
.e2ee-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.e2ee-status.active {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.e2ee-status.inactive {
    background: rgba(255, 170, 0, 0.15);
    color: var(--warning-yellow);
    border: 1px solid var(--warning-yellow);
}

.e2ee-status.error {
    background: rgba(255, 68, 68, 0.15);
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

/* ==================== END E2EE / ENCRYPTION STATUS ==================== */