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

html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #8B0000 0%, #5a0000 100%);
    color: #333;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 23px;
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #8B0000 0%, #5a0000 100%);
    color: white;
    padding: 30px 30px 0 30px;
    text-align: left;
    position: relative;
}

/* Navigation Bar */
.top-navbar {
    background: #2c2c2c;
    border-bottom: 2px solid #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 30px -30px 0 -30px;
}

.nav-items {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    max-width: 100%;
    padding: 0 30px;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

#navManageUsers .nav-icon {
    position: relative;
    top: 2px;
}

.nav-item:hover {
    color: #fff;
    background-color: #3a3a3a;
}

.nav-item.active {
    color: #fff;
    border-bottom-color: #fff;
    background-color: #444;
}

.header-branding {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.header-logo {
    height: 60px;
    width: 60px;
    object-fit: contain;
}

.login-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.login-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
}

header h1 {
    font-size: 23px;
    margin-bottom: 15px;
    font-weight: 700;
    margin: 0;
}

.header-branding h1 {
    margin-bottom: 0;
}

.status {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 1.1em;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #51cf66;
    animation: none;
}

#statusText {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

main {
    padding: 0;
    display: flex;
    flex: 1;
    min-height: 0;
}

.main-layout {
    display: flex;
    width: 100%;
    gap: 0;
    height: 100%;
    position: relative;
    align-items: stretch; /* Ensure children stretch to full height */
}

#projectsView {
    display: flex;
}

#projectsView .right-panel {
    flex: 1;
    min-width: 300px;
}

#taskEditPanel {
    width: 500px;
    min-width: 400px;
    max-width: 800px;
    flex-shrink: 0;
}

#taskEditPanel.expanded {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}

.task-panel-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.task-panel-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e9ecef;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
}

.drop-zone {
    flex: 1;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    color: #555;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #3b82f6;
    background: #f0f6ff;
}

#taskEditSplitter {
    display: none;
    width: 4px;
    background: #e9ecef;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s ease;
    z-index: 10;
    align-self: stretch;
    min-height: 100%;
}

#taskEditSplitter:hover {
    background: #8B0000;
}

#taskEditSplitter.dragging {
    background: #8B0000;
    cursor: col-resize;
}

.splitter {
    width: 4px;
    background: #e9ecef;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s ease;
    z-index: 10;
    align-self: stretch; /* Make splitter extend full height */
    min-height: 100%; /* Ensure it spans full height */
}

.splitter:hover {
    background: #8B0000;
}

.splitter.dragging {
    background: #8B0000;
    cursor: col-resize;
}

/* Ensure both splitters extend to top and match styling */
#projectsSplitter {
    align-self: stretch;
    height: 100%;
}

#taskDetailSplitter {
    position: absolute;
    top: 0;
    bottom: 0;
    height: 100%;
    z-index: 10;
    /* The splitter will be positioned by JavaScript, but we ensure it extends full height */
}

.left-panel, .right-panel {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-panel {
    width: 350px;
    min-width: 300px;
    border-right: none; /* Remove border, splitter handles the visual separation */
    background: #f8f9fa;
    overflow: hidden; /* Changed from overflow-y: auto to prevent scrollbar issues */
    display: flex;
    flex-direction: column;
}

/* When inside Splitter, allow flexible width */
#projectsSplitterContainer .left-panel {
    width: 100% !important;
    min-width: 300px;
    max-width: none;
    flex: 0 1 auto;
}

/* Ensure projects container can expand */
#projectsSplitterContainer .left-panel #projectsContainer {
    width: 100%;
    max-width: none;
}

#projectsLeftPanel {
    padding: 0; /* Remove padding so splitter can extend to top */
    display: flex;
    flex-direction: column;
}

#projectsLeftPanel .panel-header {
    padding: 20px 20px 15px 20px; /* Add padding back to header */
    flex-shrink: 0;
}

#projectsLeftPanel #projectsDataGridContainer {
    flex: 1;
    padding: 0 20px 20px 20px; /* Add padding to container */
    overflow: hidden;
}

/* Task DataGrid row selection highlighting */
.tasks-data-grid .dx-row-selected {
    background-color: rgba(102, 126, 234, 0.2) !important;
}

.tasks-data-grid .dx-row-selected td {
    background-color: rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.tasks-data-grid .dx-row:hover {
    background-color: rgba(102, 126, 234, 0.08) !important;
}

.tasks-data-grid .dx-row-selected:hover {
    background-color: rgba(102, 126, 234, 0.25) !important;
}

.tasks-data-grid .dx-row-selected.dx-state-hover {
    background-color: rgba(102, 126, 234, 0.25) !important;
}

.projects-data-grid,
.tasks-data-grid {
    height: 100%;
}

.tasks-grid-wrapper {
    min-height: 0;
}


#projectsRightPanel {
    flex: 1;
    min-width: 300px;
    padding: 0; /* Remove padding so splitter can extend to top */
}

.right-panel {
    flex: 1;
    background: white;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#projectsRightPanel > .panel-header {
    padding: 20px 20px 15px 20px; /* Add padding to header */
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B0000;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    background: white;
}

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

.panel-header h2 {
    font-size: 1.5em;
    margin: 0;
    color: #333;
}

.panel-header h2.sortable-header {
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.panel-header h2.sortable-header:hover {
    color: #8B0000;
}

.panel-header h2.sortable-header .sort-indicator {
    font-size: 0.7em;
    color: #8B0000;
    min-width: 15px;
    display: inline-block;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

#oldFoldersConfig {
    display: flex;
    align-items: center;
    gap: 10px;
}

#oldFoldersConfig label {
    font-size: 0.9em;
    color: #666;
}

#oldFoldersConfig input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    margin-left: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.filter-container {
    margin-bottom: 15px;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    background: white;
}

.filter-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #8B0000;
    color: white;
}

.btn-primary:hover {
    background: #6a0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    border-radius: 8px;
}

.btn-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.btn-cancel.btn-icon svg {
    padding-top: 1px;
    padding-bottom: 1px;
    width: 12px;
    overflow: visible;
    box-sizing: content-box;
}

.btn-cancel.btn-icon svg path {
    box-sizing: content-box;
}

.btn-cancel.btn-icon svg,
.btn-cancel.btn-icon svg path {
    fill: #ffffff !important;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.buckets-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 8px;
}

.projects-fallback-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.projects-fallback-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.projects-fallback-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.projects-fallback-item-all {
    background: #f1f5f9;
    font-weight: 600;
}

.projects-fallback-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.projects-fallback-desc {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.projects-fallback-team-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 6px 0;
}

.team-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
    color: #8B0000;
    background: #fff5f5;
    border: 1px solid #f3c1c1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-badge-empty {
    color: #666;
    background: #f1f5f9;
    border-color: #e2e8f0;
    font-weight: 500;
}

.projects-fallback-meta {
    color: #777;
    font-size: 0.85em;
}

.files-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    width: 100%;
    padding-bottom: 0;
    margin-bottom: 0;
    position: relative;
}

.bucket-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bucket-card:hover {
    border-color: #8B0000;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.bucket-card.active {
    background: #8B0000;
    border-color: #8B0000;
    color: white;
}

.bucket-card.active h3,
.bucket-card.active p {
    color: white;
}

.bucket-card.special {
    background: linear-gradient(135deg, #ffd43b 0%, #ffa94d 100%);
    border-color: #ffd43b;
    font-weight: 600;
}

.bucket-card.special h3 {
    color: #333;
}

.bucket-card.special.active {
    background: #8B0000;
    border-color: #8B0000;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

.bucket-card.special.active h3,
.bucket-card.special.active p {
    color: white;
}

.bucket-card.special:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.file-card, .folder-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.file-card:hover, .folder-card:hover {
    border-color: #8B0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.folder-card {
    cursor: pointer;
    background: #fff9e6;
    border-color: #ffd43b;
}

.folder-card:hover {
    border-color: #ffd43b;
    background: #fff3bf;
}

.folder-icon, .file-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.file-card h3, .folder-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1em;
    word-break: break-all;
    width: 100%;
}

.file-card p, .folder-card p {
    color: #666;
    font-size: 0.85em;
    margin: 3px 0;
}

.bucket-card h3 {
    color: #8B0000;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.bucket-card p {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.file-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
    word-break: break-all;
}

.file-card p {
    color: #666;
    font-size: 0.85em;
    margin: 5px 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1em;
}

.error {
    background: #ffe0e0;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    padding: 15px;
    color: #c92a2a;
    margin-top: 20px;
}

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

#breadcrumbContainer {
    flex-shrink: 0;
    margin-bottom: 15px;
    position: relative;
    z-index: 50;
    background: white;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
}

.breadcrumb-item {
    color: #8B0000;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.breadcrumb-item:hover {
    background: #e7f0ff;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
    cursor: default;
    font-weight: 600;
}

.breadcrumb-item.active:hover {
    background: transparent;
    text-decoration: none;
}

.breadcrumb-separator {
    color: #999;
    margin: 0 2px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 1em;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.btn-confirm-delete {
    background: #ff6b6b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-confirm-delete:hover {
    background: #ff5252;
}

.btn-confirm-delete:active {
    transform: scale(0.98);
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #51cf66;
}

.toast.error {
    border-left-color: #ff6b6b;
}

.toast.info {
    border-left-color: #667eea;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #333;
    font-size: 0.95em;
}

.toast-message {
    margin: 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

.files-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    font-size: 0.9em;
}

.files-table thead {
    background: #f8f9fa;
}

.files-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #8B0000;
    white-space: nowrap;
    user-select: none;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 100;
}

.files-table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.files-table th.sortable:hover {
    background-color: #e7f0ff;
}

.files-table th.sortable:active {
    background-color: #d0e0ff;
}

.sort-indicator {
    margin-left: 5px;
    color: #8B0000;
    font-size: 0.9em;
    display: inline-block;
    min-width: 15px;
}

.files-table th:first-child {
    width: 50px;
    text-align: center;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 120;
    background: #f8f9fa;
}

.files-table th:first-child .select-all-dropdown {
    z-index: 300;
    position: relative;
}

.files-table th:first-child .select-all-menu {
    z-index: 300;
    position: absolute;
}

.files-table th:first-child input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.select-all-dropdown {
    position: relative;
    display: inline-block;
    z-index: 300;
}

.select-all-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.select-all-btn:hover {
    background: #f0f0f0;
    border-color: #8B0000;
}

.select-all-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 300;
    min-width: 220px;
    margin-top: 4px;
}

.select-all-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0;
}

.select-all-option:last-child {
    border-bottom: none;
}

.select-all-option:hover {
    background-color: #f8f9fa;
}

.select-all-option:active {
    background-color: #e7f0ff;
}

.files-table td:first-child {
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 10;
    background: inherit;
}

.files-table td:first-child input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.files-table tbody tr.selected {
    background-color: #e7f0ff;
}

.files-table tbody tr.selected:hover {
    background-color: #d0e0ff;
}

.files-table tbody tr.deleting {
    background-color: #fff3e0;
    opacity: 0.6;
    transition: opacity 0.3s ease-out;
}

.files-table tbody tr.deleting td {
    color: #666;
}

.files-table tbody tr.deleting:hover {
    background-color: #ffe0b2;
}

.files-table tbody tr.selected td:first-child,
.files-table tbody tr.selected:hover td:first-child {
    background-color: #e7f0ff;
}

.files-table tbody tr.folder-row td:first-child {
    background-color: #fff9e6;
}

.files-table tbody tr.folder-row.selected td:first-child,
.files-table tbody tr.folder-row.selected:hover td:first-child {
    background-color: #e7f0ff;
}

.files-table th:nth-child(2) {
    width: 60px;
    text-align: center;
    padding-right: 8px;
    position: sticky;
    top: 0;
    left: 50px;
    z-index: 120;
    background: #f8f9fa;
}

.files-table td:nth-child(2) {
    padding-right: 8px;
    position: sticky;
    left: 50px;
    z-index: 10;
    background: inherit;
}

.files-table tbody tr.selected td:nth-child(2),
.files-table tbody tr.selected:hover td:nth-child(2) {
    background-color: #e7f0ff;
}

.files-table tbody tr.folder-row td:nth-child(2) {
    background-color: #fff9e6;
}

.files-table tbody tr.folder-row.selected td:nth-child(2),
.files-table tbody tr.folder-row.selected:hover td:nth-child(2) {
    background-color: #e7f0ff;
}

.files-table th:nth-child(3) {
    min-width: 300px;
    padding-left: 8px;
    position: sticky;
    top: 0;
    left: 110px;
    z-index: 120;
    background: #f8f9fa;
}

.files-table td:nth-child(3) {
    padding-left: 8px;
    position: sticky;
    left: 110px;
    z-index: 10;
    background: inherit;
}

.files-table tbody tr.selected td:nth-child(3),
.files-table tbody tr.selected:hover td:nth-child(3) {
    background-color: #e7f0ff;
}

.files-table tbody tr.folder-row td:nth-child(3) {
    background-color: #fff9e6;
}

.files-table tbody tr.folder-row.selected td:nth-child(3),
.files-table tbody tr.folder-row.selected:hover td:nth-child(3) {
    background-color: #e7f0ff;
}

.files-table th:nth-child(4) {
    width: 120px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
}

.files-table th:nth-child(5) {
    width: 180px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
}

.files-table th:nth-child(6) {
    width: 200px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
}

.files-table th:nth-child(7) {
    width: 80px;
    text-align: right;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
}

.files-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 1;
}

.files-table tbody tr:hover {
    background-color: #f8f9fa;
}

.files-table tbody tr.folder-row {
    cursor: pointer;
    background-color: #fff9e6;
}

.files-table tbody tr.folder-row:hover {
    background-color: #fff3bf;
}

.files-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.files-table td:first-child {
    text-align: center;
}

.files-table .folder-icon,
.files-table .file-icon {
    font-size: 1.5em;
    display: inline-block;
}

.files-table .file-name {
    word-break: break-all;
    max-width: 400px;
}

.files-table .file-id {
    font-family: monospace;
    font-size: 0.85em;
    color: #666;
    cursor: help;
}

.files-table td:last-child {
    text-align: right;
}

.btn-delete {
    background: unset;
    background-color: unset;
    color: currentColor;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: unset;
    transform: scale(1.1);
    opacity: 0.8;
}

.btn-delete:active {
    transform: scale(0.95);
}

.btn-delete svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-complete {
    background: unset;
    background-color: unset;
    color: #51cf66;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-complete:hover {
    background: unset;
    transform: scale(1.1);
    opacity: 0.8;
    color: #40c057;
}

.btn-complete:active {
    transform: scale(0.95);
}

.btn-complete svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-download {
    background: transparent;
    color: inherit;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download svg {
    display: block;
    background: transparent;
}

.btn-download:hover {
    background: transparent;
    transform: scale(1.1);
    opacity: 0.8;
}

.btn-download:active {
    transform: scale(0.95);
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

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

.batch-actions-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #667eea;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    flex-shrink: 0;
    width: 100%;
}

.selected-count {
    color: #8B0000;
    font-weight: 600;
    font-size: 1em;
}

/* Hamburger Menu */
.hamburger-menu {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: 15px;
    align-self: center;
}

.user-info-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85em;
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.hamburger-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.2s ease;
    cursor: pointer;
    height: auto;
    min-height: auto;
    width: auto;
}

.hamburger-btn:hover {
    color: #fff;
    background-color: #3a3a3a;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hamburger-btn span {
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger-btn.active {
    color: #fff;
    border-bottom-color: #fff;
    background-color: #444;
}

.hamburger-btn.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.user-info-inside {
    font-size: 1em;
    color: inherit;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
    letter-spacing: 0.3px;
}

.user-info-vertical {
    font-size: 0.85em;
    color: white;
    font-weight: 500;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    white-space: nowrap;
    display: inline-block;
}

.hamburger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 201;
    overflow: hidden;
}

.hamburger-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hamburger-dropdown .menu-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95em;
}

.hamburger-dropdown .menu-item:last-child {
    border-bottom: none;
}

.hamburger-dropdown .menu-item:hover {
    background: #f8f9fa;
}

.hamburger-dropdown .menu-item.danger {
    color: #dc3545;
}

.hamburger-dropdown .menu-item.danger:hover {
    background: #fff5f5;
}

/* Task Table Styles */
.tasks-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
    font-size: 0.9em;
    table-layout: auto;
}

.tasks-table thead {
    background: #f8f9fa;
}

.tasks-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #8B0000;
    white-space: nowrap;
    user-select: none;
    background: #f8f9fa;
    vertical-align: top;
}

.tasks-table thead tr.filter-row {
    position: sticky;
    top: 0;
    z-index: 150;
    background: #e7f0ff;
}

.tasks-table thead tr.header-row {
    position: sticky;
    top: 45px;
    z-index: 100;
}

.tasks-table thead tr.filter-row th {
    padding: 12px 15px;
    background: #e7f0ff;
    border-bottom: 1px solid #8B0000;
    border-top: 2px solid #8B0000;
    vertical-align: top;
}

.tasks-table thead tr.header-row th {
    position: relative;
    vertical-align: top;
}

.tasks-table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tasks-table th.sortable:hover {
    background-color: #e7f0ff;
}

.tasks-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.tasks-table tbody tr:hover {
    background-color: #f8f9fa;
}

.tasks-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Filter input styles */
.filter-cell {
    padding: 12px 15px !important;
}

.table-filter-input,
.table-filter-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85em;
    box-sizing: border-box;
    background: white;
}

.table-filter-input:focus,
.table-filter-select:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.1);
}

.btn-clear-filters {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-clear-filters:hover {
    background: #c82333;
}

/* Tag Input Styles */
.tag-input-container {
    position: relative;
    width: 100%;
    min-height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    cursor: text;
}

.tag-input-container:focus-within {
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e7f0ff;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background: #d0e0ff;
}

.tag-remove {
    color: #666;
    font-size: 1.2em;
    line-height: 1;
    font-weight: bold;
    margin-left: 4px;
    cursor: pointer;
}

.tag-remove:hover {
    color: #dc3545;
}

.tag-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    padding: 4px 8px;
    font-size: 0.95em;
    background: transparent;
}

.tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.tag-dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.tag-dropdown-item:last-child {
    border-bottom: none;
}

.tag-dropdown-item:hover {
    background-color: #f8f9fa;
}

.tag-dropdown-item:active {
    background-color: #e7f0ff;
}

