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

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: #f8fafc;
        height: 100vh;
        overflow: hidden;
        color: #334155;
        line-height: 1.6;
    }

    /* Main Layout */
    .doc-manager-container {
        display: flex;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        position: relative;
    }

    /* Mobile Hamburger Button */
    .mobile-menu-toggle {
        display: none;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1000;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        border: none;
        border-radius: 12px;
        color: white;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        transition: all 0.3s ease;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    /* Sidebar Overlay for Mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
    }

    /* Left Sidebar */
    .left-sidebar {
        width: 300px;
        background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
        border-right: 1px solid #e2e8f0;
        display: flex;
        flex-direction: column;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        transition: transform 0.3s ease;
        overflow-y: auto;-webkit-overflow-scrolling: touch;
    }

    .sidebar-header {
        padding: 12px 18px;
        border-bottom: 1px solid #e2e8f0;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        position: relative;
        flex-shrink: 0;
    }

    .sidebar-close {
        display: none;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        color: white;
        cursor: pointer;
        font-size: 16px;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .sidebar-title {
        font-size: 18px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .sidebar-subtitle {
        font-size: 12px;
        opacity: 0.8;
    }

    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        min-height: 0;
        display: flex;
        flex-direction: column;-webkit-overflow-scrolling: touch;
    }

    .sidebar-sections {
        flex: 1;
    }

    .sidebar-footer {
        margin-top: 20px;
        padding-top: 16px;
        border-top: 1px solid #e2e8f0;
        text-align: center;
        flex-shrink: 0;
    }

    .copyright-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        color: #64748b;
        text-decoration: none;
        transition: all 0.3s ease;
        padding: 6px 12px;
        border-radius: 6px;
    }

    .copyright-link:hover {
        color: #6366f1;
        background: #f8fafc;
        text-decoration: none;
    }
    .sidebar-section {
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Action Buttons */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
    }

    .action-btn {
        width: 100%;
        padding: 12px 16px;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        text-align: left;
    }

    .action-btn-primary {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

    .action-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    }

    .action-btn-secondary {
        background: #f8fafc;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

    .action-btn-secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

    /* Groups List */
    .groups-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .group-item:hover {
        background: #f1f5f9;
    }

    .group-item.active {
        background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        color: #1e40af;
        font-weight: 600;
    }

    .group-color {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        flex-shrink: 0;
    }
.group-item {
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    position: relative;
}

.group-info {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.group-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.group-count {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
    position: absolute;
    right: 14px;
    transition: all 0.3s ease;
    opacity: 1;
}

.group-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    position: absolute;
    right: 14px;
    transition: all 0.3s ease;
    background: white;
    padding: 2px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Khi hover group item: ẩn count, hiện actions */
.group-item:hover .group-count {
    opacity: 0;
    pointer-events: none;
}

.group-item:hover .group-actions {
    opacity: 1;
    pointer-events: auto;
}

.group-action-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
}

.group-action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
}

.group-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.group-action-btn:hover {
    transform: scale(1.1);
}
    /* Enhanced Statistics Section */
    .stats-section {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 16px;
        margin-top: 16px;
    }

    .stats-title {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .stat-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px;
        background: white;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex-shrink: 0;
    }

    .stat-icon.text {
        background: #dbeafe;
        color: #1e40af;
    }

    .stat-icon.code {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .stat-icon.image {
        background: #fef3c7;
        color: #92400e;
    }

    .stat-icon.file {
        background: #dcfce7;
        color: #166534;
    }

    .stat-info {
        flex: 1;
        min-width: 0;
    }

    .stat-number {
        font-size: 18px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1;
    }

    .stat-label {
        font-size: 11px;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .storage-stats {
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
    }

    .storage-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        font-size: 12px;
    }

    .storage-label {
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .storage-value {
        font-weight: 600;
        color: #374151;
    }

    .largest-file {
        text-align: right;
    }

    .largest-file .file-name {
        font-weight: 600;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }

    .largest-file .file-size {
        font-size: 10px;
        color: #64748b;
    }

    /* Office Support Notice */
    .office-support-notice {
        background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        border: 1px solid #93c5fd;
        border-radius: 8px;
        padding: 12px;
        margin-top: 12px;
        font-size: 11px;
        color: #1e40af;
    }

    .office-support-notice .notice-title {
        font-weight: 600;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .office-support-notice .notice-features {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 6px;
    }

    .office-support-notice .feature-tag {
        background: rgba(30, 64, 175, 0.1);
        color: #1e40af;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 500;
    }

    /* File Preview Styles */
    .file-preview {
        margin-top: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
        background: white;
    }

    .file-preview-item {
        padding: 0;
    }

    .preview-header {
        background: #f8fafc;
        padding: 12px 16px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .preview-title {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .preview-remove {
        width: 24px;
        height: 24px;
        border: none;
        border-radius: 50%;
        background: #fee2e2;
        color: #dc2626;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: all 0.2s ease;
    }

    .preview-remove:hover {
        background: #fecaca;
        transform: scale(1.1);
    }

    .image-preview-container {
        padding: 16px;
        text-align: center;
    }

    .preview-image {
        max-width: 100%;
        max-height: 200px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .file-preview-container {
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .file-icon-large {
        width: 48px;
        height: 48px;
        background: #6366f1;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        flex-shrink: 0;
    }

    .file-details {
        flex: 1;
        min-width: 0;
    }

    .file-name {
        font-weight: 600;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 4px;
    }

    .file-meta,
    .file-details {
        display: flex;
        gap: 8px;
        font-size: 12px;
        color: #64748b;flex-direction: column;
    }
.btn:not([class*=outline]) {
    border-color: #e3e3e3;
}
    .file-size,
    .file-type {
        padding: 2px 6px;
        background: #f1f5f9;
        border-radius: 4px;width: fit-content;
    }

    .file-error {
        padding: 12px 16px;
        background: #fee2e2;
        color: #dc2626;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Current File Display */
    .current-file-display {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
    }

    .file-preview-container {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .file-icon {
        width: 40px;
        height: 40px;
        background: #6366f1;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 16px;
        flex-shrink: 0;
    }

    .file-actions {
        margin-left: auto;
    }

    .no-file-text {
        color: #64748b;
        font-style: italic;
        padding: 20px;
        text-align: center;
        background: #f8fafc;
        border: 1px dashed #cbd5e1;
        border-radius: 8px;
    }

    /* Right Content Area */
    .right-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        background: white;
        overflow: hidden;
        position: relative;
    }

    /* Content Header */
    .content-header {
        padding: 16px 20px;
        border-bottom: 1px solid #e2e8f0;
        background: white;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 80px;
        z-index: 90;
        position: relative;
        flex-wrap: wrap;
        gap: 12px;
    }

    .content-title {
        font-size: 20px;
        font-weight: 700;
        color: #1e293b;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    .content-actions {
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
    }

    .search-box {
        position: relative;
        min-width: 300px;
        flex: 1;
        max-width: 400px;
    }

    .search-input {
        width: 100%;
        padding: 10px 16px 10px 40px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        background: #f8fafc;
        transition: all 0.3s ease;
    }

    .search-input:focus {
        outline: none;
        border-color: #6366f1;
        background: white;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 14px;
    }

    .btn-action {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
    }

    /* Tabs System */
    .tabs-container {
        display: none;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        padding: 0 5px;
        z-index: 80;
        position: relative;
    }

    .tabs-container.active {
        display: block;
    }

    .tabs-list {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 8px 0 0 0;
    }

    .tab-item {
        padding: 8px 16px;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px 8px 0 0;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
        max-width: 200px;
    }

    .tab-item:hover {
        background: #f1f5f9;
    }

    .tab-item.active {
        background: #6366f1;
        color: white;
        border-color: #6366f1;
    }

    .tab-title {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab-close {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: currentColor;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        opacity: 0.7;
    }

    .tab-close:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.3);
    }

    /* Filter Controls */
    .filter-controls {
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        padding: 12px 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        position: relative;
        z-index: 85;margin-bottom: 10px;
    }

    .filter-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .filter-label {
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        white-space: nowrap;
    }

    .filter-select,
    .filter-input {
        padding: 6px 10px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        font-size: 13px;
        background: white;
        min-width: 120px;
        transition: all 0.2s ease;
    }

    .filter-input {
        min-width: 140px;
    }

    .filter-select:focus,
    .filter-input:focus {
        outline: none;
        border-color: #6366f1;
        box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
    }

    .filter-actions {
        margin-left: auto;
        display: flex;
        gap: 8px;
    }

    .filter-info {
        background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        border: 1px solid #93c5fd;
        color: #1e40af;
        padding: 8px 20px;
        font-size: 12px;
        display: none;
        position: sticky;
        top: 0;
        z-index: 84;
        flex-shrink: 0;    margin-bottom: 10px;
    }

    .filter-result-info {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 500;
    }

    /* Editor Toolbar - Optimized for Mobile */
    .editor-toolbar {
        padding: 12px 20px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0px;
        flex-shrink: 0;
        z-index: 70;
        position: relative;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        min-height: auto;    margin-bottom: 10px;
    }
    .main-content {
        flex: 1;
        overflow: hidden;
        position: relative;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
    }

    /* Document List View */
    .document-list-view {
        flex: 1;
        overflow-y: auto;
        padding: 24px;
        height: 100%;
        min-height: 0;display: flex;
    flex-direction: column;
    }

    /* When tabs are active, document list shares space with editor */
    .tabs-container.active + .main-content .document-list-view {
        border-top: 1px solid #e2e8f0;
        flex: 1;
        height: auto;
    }

    .documents-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }

    .document-card {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 20px;
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }

    .document-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        border-color: #6366f1;
    }

    .document-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--doc-color, #6366f1);
    }

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

    .document-title {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 4px;
        line-height: 1.4;
    }

    .document-type {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .document-type.text {
        background: #dbeafe;
        color: #1e40af;
    }

    .document-type.file {
        background: #dcfce7;
        color: #166534;
    }

    .document-type.image {
        background: #fef3c7;
        color: #92400e;
    }

    .document-type.code {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .document-description {
        color: #64748b;
        font-size: 14px;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .document-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px solid #f1f5f9;
        font-size: 12px;
        color: #64748b;
    }

    .document-actions {
        display: flex;
        gap: 6px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .document-card:hover .document-actions {
        opacity: 1;
    }

    .doc-action-btn {
        width: 28px;
        height: 28px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: all 0.2s ease;
    }

    .doc-action-btn.edit {
        background: #dbeafe;
        color: #1e40af;
    }

    .doc-action-btn.delete {
        background: #fee2e2;
        color: #dc2626;
    }

    .doc-action-btn:hover {
        transform: scale(1.1);
    }

    /* Editor View */
    .editor-view {
        display: none;
        height: 100%;
        flex-direction: column;
        overflow: hidden;
        flex: 1;
        min-height: 0;
    }

    .editor-view.active {
        display: flex !important;
        height: 100% !important;
        overflow: hidden !important;
        flex: 1 !important;
    }

    .editor-toolbar {
        padding: 16px 24px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0px;
        flex-shrink: 0;
        z-index: 70;
        position: relative;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .editor-info {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        min-width: 0;
    }

    .editor-title-info {
        flex: 1;
        min-width: 0;
    }

    .last-updated-info {
        font-size: 11px;
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 4px;
        margin-top: 2px;
        transition: all 0.3s ease;
    }

    .last-updated-pulse {
        animation: pulseGlow 1s ease-in-out;
        color: #10b981 !important;
    }

    @keyframes pulseGlow {
        0% { 
            color: #64748b;
            transform: scale(1);
        }
        50% { 
            color: #10b981;
            transform: scale(1.05);
        }
        100% { 
            color: #10b981;
            transform: scale(1);
        }
    }

    .editor-title {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .editor-type-badge {
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        flex-shrink: 0;
        background: white;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .editor-type-badge.text {
        background: #dbeafe;
        color: #1e40af;
        border-color: #bfdbfe;
    }

    .editor-type-badge.code {
        background: #f3e8ff;
        color: #6b21a8;
        border-color: #e9d5ff;
    }

    .editor-controls {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
    }

    .editor-control-group {
        display: flex;
        gap: 4px;
        align-items: center;
        padding: 4px;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .editor-status {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 12px;
        background: white;
        border: 1px solid #e2e8f0;
    }

    .editor-status.saved {
        color: #059669;
        background: #ecfdf5;
        border-color: #a7f3d0;
    }

    .editor-status.saving {
        color: #d97706;
        background: #fffbeb;
        border-color: #fde68a;
    }

    .editor-status.error {
        color: #dc2626;
        background: #fef2f2;
        border-color: #fca5a5;
    }

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

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

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

    /* CKEditor specific styles */
    .editor-content {
        flex: 1;
        border: none;
        border-radius: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .ck-editor {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border: none !important;
        border-radius: 0 !important;
        height: 100% !important;
    }

    .ck-toolbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 60 !important;
        background: white !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-radius: 0 !important;
        flex-shrink: 0 !important;
        padding: 8px 12px !important;
    }

    .ck.ck-toolbar>.ck-toolbar__items {
        flex-flow: row !important;
        flex-grow: 1;
        overflow-x: auto;
    }

    .ck-editor__main {
        flex: 1 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .ck-editor__editable {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        max-height: calc(100vh - 200px) !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 20px 24px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        padding-bottom: 50px !important;
        scroll-behavior: smooth !important;
    }

    .ck-editor__editable:focus {
        outline: none !important;
    }

    .ck-editor__editable::after {
        content: '';
        display: block;
        height: 1px;
        width: 100%;
    }

    .tabs-container.active + .main-content .editor-container {
        height: calc(100% - 0px);
        flex: 1;
    }

    .tabs-container.active + .main-content .ck-editor__editable {
        max-height: calc(100vh - 280px) !important;
    }

    .editor-view.active ~ .document-list-view {
        display: none !important;
    }

    .ck-editor__editable::-webkit-scrollbar {
        width: 8px !important;
    }

    .ck-editor__editable::-webkit-scrollbar-track {
        background: #f1f5f9 !important;
        border-radius: 4px !important;
    }

    .ck-editor__editable::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 4px !important;
    }

    .ck-editor__editable::-webkit-scrollbar-thumb:hover {
        background: #94a3b8 !important;
    }

    .editor-container .ck-editor {
        height: 100% !important;
    }

    .tab-item.unsaved {
        background: #000;
        border-color: #fff;
    }

    .tab-item.unsaved .tab-title::after {
        content: " •";
        color: #f59e0b;
        font-weight: bold;
    }

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

    .form-label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        color: #374151;
        font-size: 14px;
    }

    .form-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.3s ease;
        background: #f8fafc;
    }

    .form-input:focus {
        outline: none;
        border-color: #6366f1;
        background: white;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .form-select {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        background: white;
        cursor: pointer;
    }

    /* Upload Area */
    .upload-area {
        border: 2px dashed #d1d5db;
        border-radius: 8px;
        padding: 40px 20px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        background: #f9fafb;
        margin: 0 24px;
    }

    .upload-area:hover {
        border-color: #6366f1;
        background: #f0f9ff;
    }

    .upload-area.dragover {
        border-color: #6366f1;
        background: #dbeafe;
    }

    .upload-icon {
        font-size: 32px;
        color: #9ca3af;
        margin-bottom: 12px;
    }

    .upload-text {
        color: #6b7280;
        font-size: 14px;
        margin-bottom: 4px;
    }

    .upload-hint {
        color: #9ca3af;
        font-size: 12px;
    }

    .file-input {
        display: none;
    }

    /* Empty State */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        text-align: center;
        color: #64748b;
        padding: 40px;
    }

    .empty-state-icon {
        font-size: 48px;
        margin-bottom: 16px;
        color: #cbd5e1;
    }

    .empty-state-title {
        font-size: 18px;
        font-weight: 600;
        color: #475569;
        margin-bottom: 8px;
    }

    .empty-state-text {
        font-size: 14px;
        margin-bottom: 20px;
    }

    /* Button Styles */
    .btn {
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
    }

    .btn-primary {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    }

    .btn-secondary {
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

    .btn-secondary:hover {
        background: #e2e8f0;
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
    }

    .btn-danger {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
    }

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

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

    .modal-content {
        background: white;
        margin: 5% auto;
        padding: 0;
        border-radius: 12px;
        width: 90%;
        max-width: 600px;
        max-height: 80vh;
        overflow: hidden;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        animation: modalSlideIn 0.3s ease;
    }

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

    .modal-header {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-title {
        font-size: 18px;
        font-weight: 600;
        margin: 0;
    }

    .modal-close {
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s ease;
    }

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .modal-body {
        padding: 20px;
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Notification */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10001;
        max-width: 400px;
        padding: 16px 20px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        animation: slideInRight 0.3s ease;
    }

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

    .notification.success {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0;
    }

    .notification.error {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fca5a5;
    }

    /* Loading */
    .loading {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px;
    }

    .loading-spinner {
        width: 32px;
        height: 32px;
        border: 3px solid #e2e8f0;
        border-top: 3px solid #6366f1;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* Custom Scrollbar */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* Fallback notice styling */
    .fallback-notice {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        border: 1px solid #f59e0b;
        color: #92400e;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 13px;
        margin: 0 24px 12px 24px;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    }

    /* Responsive Styles */
    @media (min-width: 769px) {
        .ck-editor__editable {
            padding: 24px 32px !important;
            padding-bottom: 60px !important;
        }
    }

    @media (max-width: 768px) and (min-width: 641px) {
        .left-sidebar {
            width: 240px;
        }
        
        .search-box {
            min-width: 200px;
        }
        
        .documents-grid {
            grid-template-columns: 1fr;
        }
        
        .form-group {
            padding: 0 16px;
        }
        
        .upload-area {
            margin: 0 16px;
        }

        .ck-editor__editable {
            padding: 20px 24px !important;
            padding-bottom: 50px !important;
        }
    }

    /* Mobile Styles */
    @media (max-width: 768px) {
        /* Show mobile hamburger menu */
        .mobile-menu-toggle {
            display: flex;
        }

        /* Hide sidebar by default on mobile */
    .left-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height */
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto; /* Đảm bảo có thể scroll */
        overflow-x: hidden;
    }
        /* Show sidebar when active */
        .left-sidebar.active {
            transform: translateX(0);
        }

        /* Show overlay when sidebar is active */
        .sidebar-overlay.active {
            display: block;
        }

        /* Show close button in sidebar on mobile */
        .sidebar-close {
            display: flex;
        }

        /* Adjust right content to use full width */
        .right-content {
            width: 100%;
            margin-left: 0;
        }

        /* Mobile Content Header - Fixed Layout */
        .content-header {
            padding: 12px 16px;
            padding-left: 70px; /* Space for hamburger menu */
            min-height: auto;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
        }

        .content-title {
            font-size: 16px;
            order: 1;
        }

        .content-actions {
            order: 2;
            width: 100%;
            justify-content: space-between;
            align-items: center;
            flex-wrap: nowrap;
        }

        .search-box {
            min-width: 0;
            flex: 1;
            max-width: none;
            margin-right: 12px;
        }

        .search-input {
            font-size: 16px; /* Prevent zoom on iOS */
            padding: 10px 12px 10px 36px;
        }

        .btn-action {
            flex-shrink: 0;
            gap: 6px;
        }

        .btn {
            padding: 8px 12px;
            font-size: 12px;
        }

        /* Mobile Filter Controls */
        .filter-controls {
            padding: 8px 16px;
            flex-direction: column;
            align-items: stretch;
            gap: 8px;
        }

        .filter-group {
            width: 100%;
            justify-content: space-between;
        }

        .filter-select,
        .filter-input {
            min-width: 0;
            flex: 1;
            max-width: 150px;
        }

        .filter-actions {
            margin-left: 0;
            justify-content: center;
            margin-top: 8px;
        }

        .filter-info {
            margin: 0 16px;
            padding: 6px 12px;
            font-size: 11px;
        }

        .editor-info {
            width: 100%;
            order: 1;
            margin-bottom: 4px;
            align-items: flex-start;
            gap: 4px;
        }

        .editor-title-info {
            width: 100%;
        }

        .last-updated-info {
            font-size: 10px;
        }

        .editor-title {
            font-size: 14px;
        }

        .editor-controls {
            width: 100%;
            order: 2;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 6px;
        }

        .editor-control-group {
            flex: 1;
            min-width: fit-content;
            justify-content: center;
        }

        .editor-status {
            order: 3;
            margin-top: 4px;
        }

        .btn-sm {
            padding: 6px 10px;
            font-size: 11px;
        }

        /* Other mobile adjustments */
        .documents-grid {
            grid-template-columns: 1fr;
        }
        
        .form-group {
            padding: 0 16px;
        }
        
        .upload-area {
            margin: 0 16px;
        }

        /* Mobile sidebar content adjustments */
        .sidebar-sections {
            flex: 1;
        }
    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        min-height: 0;
        display: flex;
        flex-direction: column;
        /* Đảm bảo content có thể scroll và footer luôn ở đáy */
        height: calc(100vh - 80px); /* Trừ đi header height */
    }
    .sidebar-sections {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .sidebar-footer {
        margin-top: auto; /* Đẩy footer xuống đáy */
        padding-top: 16px;
        border-top: 1px solid #e2e8f0;
        text-align: center;
        flex-shrink: 0;
        background: inherit; /* Đảm bảo có background */
        position: sticky;
        bottom: 0;
    }
    .logout-btn,
    .change-password-btn {
        width: 100%;
        padding: 10px 12px; /* Tăng padding cho dễ nhấn */
        margin-bottom: 8px;
        font-size: 13px; /* Tăng font size */
        min-height: 40px; /* Đảm bảo height tối thiểu */
    }      
  .copyright-link {
            font-size: 10px;
            padding: 4px 8px;
        }
        .action-buttons {
            gap: 10px;
        }

        .action-btn {
            padding: 14px 16px;
            font-size: 15px;
        }

        .group-item {
            padding: 14px 16px;
            font-size: 15px;
        }

        .stats-grid {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 640px) {
        .mobile-menu-toggle {
            top: 15px;
            left: 15px;
            width: 40px;
            height: 40px;
            font-size: 16px;
        }

        .content-header {
            padding-left: 65px;
        }

        .content-title {
            font-size: 15px;
        }

        .search-input {
            padding: 8px 10px 8px 32px;
        }

        .search-icon {
            left: 10px;
            font-size: 12px;
        }

        .filter-controls {
            padding: 6px 12px;
        }

        .filter-group {
            font-size: 11px;
        }

        .filter-select,
        .filter-input {
            font-size: 12px;
            padding: 4px 8px;
            max-width: 120px;
        }

        .editor-toolbar {
            padding: 10px 12px;display: flex;
        flex-direction: column;
        }

        .editor-info {
            gap: 8px;
        }

        .editor-title {
            font-size: 13px;
        }

        .editor-type-badge {
            padding: 3px 8px;
            font-size: 10px;
        }

        .last-updated-info {
            font-size: 9px;
        }
    }

    @media (max-width: 480px) {
        .left-sidebar {
            width: 260px;
        }

        .content-header {
            padding: 10px 12px;
            padding-left: 60px;
        }

        .modal-content {
            width: 95%;
            margin: 10% auto;
        }

        .sidebar-content {
            padding: 12px;
        }

        .action-btn {
            padding: 12px 14px;
        }

        .editor-toolbar {
            padding: 8px 12px;
        }

        .editor-controls {
            gap: 4px;
        }

        .editor-control-group {
            padding: 2px;
        }

        .ck-editor__editable {
            padding: 12px 16px !important;
            padding-bottom: 100px !important;
        }
    }

    @media (max-width: 768px) and (orientation: landscape) {
        .mobile-menu-toggle {
            top: 10px;
            left: 10px;
        }

        .content-header {
            padding: 8px 12px;
            padding-left: 60px;
            flex-direction: row;
            align-items: center;
        }

        .content-actions {
            width: auto;
            flex: 1;
            margin-left: 16px;
        }

        .editor-toolbar {
            padding: 8px 16px;
            flex-wrap: nowrap;
        }

        .editor-info {
            width: auto;
            margin-bottom: 0;
        }

        .editor-controls {
            width: auto;
            flex-wrap: nowrap;
        }

        .ck-editor__editable {
            padding-bottom: 60px !important;
        }
    }
/* CKEditor Content Styling - Fix formatting display */
.ck-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #374151 !important;
}

.ck-content h1 {
    font-size: 2em !important;
    font-weight: bold !important;
    margin: 1em 0 0.5em 0 !important;
    color: #1e293b !important;
}

.ck-content h2 {
    font-size: 1.5em !important;
    font-weight: bold !important;
    margin: 0.8em 0 0.4em 0 !important;
    color: #1e293b !important;
}

.ck-content h3 {
    font-size: 1.25em !important;
    font-weight: bold !important;
    margin: 0.6em 0 0.3em 0 !important;
    color: #1e293b !important;
}

.ck-content h4, .ck-content h5, .ck-content h6 {
    font-size: 1.1em !important;
    font-weight: bold !important;
    margin: 0.5em 0 0.25em 0 !important;
    color: #1e293b !important;
}

.ck-content p {
    margin: 0 0 1em 0 !important;
}

.ck-content strong {
    font-weight: bold !important;
    color: #1e293b !important;
}

.ck-content em {
    font-style: italic !important;
}

.ck-content u {
    text-decoration: underline !important;
}

.ck-content s {
    text-decoration: line-through !important;
}

.ck-content code {
    background: #f1f5f9 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9em !important;
    color: #6366f1 !important;
}

.ck-content blockquote {
    border-left: 4px solid #6366f1 !important;
    margin: 1em 0 !important;
    padding: 0 0 0 1em !important;
    font-style: italic !important;
    color: #64748b !important;
}

.ck-content ul, .ck-content ol {
    margin: 1em 0 !important;
    padding-left: 2em !important;
}

.ck-content li {
    margin: 0.5em 0 !important;
}

.ck-content a {
    color: #6366f1 !important;
    text-decoration: underline !important;
}

.ck-content a:hover {
    color: #4f46e5 !important;
}

/* Table styling */
.ck-content table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1em 0 !important;
}

.ck-content table td, .ck-content table th {
    border: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
}

.ck-content table th {
    background: #f8fafc !important;
    font-weight: bold !important;
}

/* Code block styling */
.ck-content pre {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    overflow-x: auto !important;
    margin: 1em 0 !important;
}

.ck-content pre code {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: #374151 !important;
}

/* Fix for toolbar button active states */
.ck-toolbar .ck-button.ck-on {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.ck-toolbar .ck-button:hover {
    background: #f1f5f9 !important;
}

/* Enhanced editor content padding and spacing */
.ck-editor__editable {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Fix color picker active state in CKEditor toolbar */
.ck .ck-color-selector .ck-color-grid__tile.ck-on {
    border: 2px solid #1e40af !important;
}

/* Authentication Styles */
.doc-manager-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.doc-manager-login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: loginSlideIn 0.5s ease;
}
#login-username,#login-password {padding-left:40px}
@keyframes loginSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.login-subtitle {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

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

.input-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 14px;
    z-index: 2;
}

.input-group .form-input {
    padding-left: 10px;
    padding-right: 40px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle:hover {
    color: #374151;
}

.form-actions {
    margin: 24px 0 16px 0;
}

.btn-login {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
}

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid #fca5a5;
    margin-top: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.login-note {
    color: #64748b;
    font-size: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Auth Buttons in Sidebar */
.logout-btn,
.change-password-btn {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.change-password-btn:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Form hints */
.form-hint {
    color: #64748b;
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

/* Change password modal adjustments */
#change-password-modal .input-group {
    position: relative;
}

#change-password-modal .password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile responsive for auth */
@media (max-width: 480px) {
    .doc-manager-login-container {
        padding: 24px;
        margin: 20px;
    }
    
    .login-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .login-title {
        font-size: 20px;
    }
}

/* Search Results Styles */
.search-section {
    margin-bottom: 32px;
}

.search-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.search-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.group-search-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.group-search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--group-color, #6366f1);
}

.group-search-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--group-color, #6366f1);
}

.group-search-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.group-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.group-search-info {
    flex: 1;
    min-width: 0;
}

.group-search-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.group-search-match {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.group-search-description {
    margin-top: 12px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.group-search-actions {
    flex-shrink: 0;
}

.document-search-card .document-search-match {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.document-filename {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 12px;
    font-style: italic;
}

.search-highlight {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

.search-result-info {
    color: #0c4a6e;
    font-weight: 500;
}

.search-result-info .btn {
    font-size: 11px;
    padding: 4px 8px;
}

/* Mobile responsive for search */
@media (max-width: 768px) {
    .search-groups-grid {
        grid-template-columns: 1fr;
    }
    
    .search-section-header {
        font-size: 14px;
    }
    
    .group-search-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .group-search-actions {
        align-self: flex-end;
    }
}
.doc-action-btn.clone {
    background: #f0f9ff;
    color: #0284c7;
}

.doc-action-btn.clone:hover {
    background: #e0f2fe;
    color: #0369a1;
}

/* Adjust document actions spacing for 3 buttons */
.document-actions {
    display: flex;
    gap: 4px; /* Giảm gap cho 3 buttons */
    opacity: 0;
    transition: opacity 0.3s ease;
    background: white;
    padding: 2px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive for 3 buttons */
@media (max-width: 768px) {
    .document-actions {
        gap: 2px;
    }
    
    .doc-action-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}




/* CKEDITOR SOURCE VIEW - FIX HEIGHT EXPANSION */
html body [class*="ck-source-editing"] textarea {
    overflow: scroll !important;
    overflow-y: scroll !important;
    overflow-x: auto !important;
    height: calc(93vh - 250px) !important; /* Thay đổi từ auto thành fixed height */
    min-height: 300px !important;
    max-height: calc(100vh - 250px) !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    scroll-behavior: smooth !important;
    resize: vertical !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    padding: 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #374151 !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    touch-action: pan-y !important;
    flex: 1 !important; /* Thêm để expand trong flex container */
}
/* Document Group Info in Editor */
.document-group-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.group-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .document-group-info {
        gap: 4px;
    }
    
    .group-indicator {
        width: 6px;
        height: 6px;
    }
    
    .document-group-info span {
        font-size: 10px !important;
    }
}

