.doc-placeholder {
    color: #ECE5D6;
    opacity: 0.8;
}

.doc-connection-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    opacity: 1;
}

    .doc-connection-error p {
        margin: 0;
        color: #e39a9a;
    }

.doc-content-area {
    min-height: 100%;
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

    .doc-content-area.doc-drop-active {
        border-color: #8D9A8C;
        background: rgba(141, 154, 140, 0.08);
    }

.doc-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.doc-upload-box {
    width: 280px;
    max-width: 85%;
    background: #232F3B;
    border: 1px solid #46586A;
    border-radius: 6px;
    color: #ECE5D6;
    padding: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.doc-upload-filename {
    margin: 0 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-upload-progress-track {
    height: 8px;
    border-radius: 4px;
    background: #1b242d;
    border: 1px solid #46586A;
    overflow: hidden;
}

.doc-upload-progress-fill {
    height: 100%;
    background: #8D9A8C;
    transition: width 0.15s ease;
}

.doc-upload-percent {
    margin: 8px 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
}

.doc-upload-error {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: #6b2b2b;
    color: #ECE5D6;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 40;
}

.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -16px -16px 12px;
    padding: 8px 16px;
    border-bottom: 1px solid #46586A;
}

.doc-toolbar-btn {
    background: #46586A;
    color: #ECE5D6;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

    .doc-toolbar-btn:hover:not(:disabled) {
        background: #56697d;
    }

    .doc-toolbar-btn:disabled {
        opacity: 0.45;
        cursor: default;
    }

.doc-toolbar-spacer {
    flex: 1;
}

.doc-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    color: #ECE5D6;
    border-bottom: 1px solid rgba(70, 88, 106, 0.4);
    border-radius: 4px;
    cursor: default;
    user-select: none;
}

    .doc-item:last-child {
        border-bottom: none;
    }

    .doc-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .doc-item.selected {
        background: rgba(141, 154, 140, 0.35);
    }

    .doc-item[draggable="true"] {
        cursor: grab;
    }

    .doc-item.drop-target {
        outline: 2px dashed #8D9A8C;
        outline-offset: -2px;
        background: rgba(141, 154, 140, 0.2);
    }

.doc-item-icon {
    display: flex;
    flex-shrink: 0;
    opacity: 0.85;
}

.doc-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-preferences-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
}

.doc-preferences-dialog {
    width: 420px;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    background: #232F3B;
    border: 1px solid #46586A;
    border-radius: 6px;
    color: #ECE5D6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.doc-preferences-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-weight: 600;
    border-bottom: 1px solid #46586A;
}

.doc-preferences-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

    .doc-preferences-close:hover {
        background: rgba(255, 255, 255, 0.12);
    }

.doc-preferences-body {
    padding: 14px;
    overflow-y: auto;
}

    .doc-preferences-body h4 {
        margin: 12px 0 6px;
    }

        .doc-preferences-body h4:first-child {
            margin-top: 0;
        }

.doc-connected-as {
    margin-bottom: 8px;
}

.doc-btn {
    display: inline-block;
    background: #46586A;
    color: #ECE5D6;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

    .doc-btn:hover {
        background: #56697d;
    }

    .doc-btn:disabled {
        opacity: 0.5;
        cursor: default;
    }

.doc-btn-primary {
    background: #8D9A8C;
    color: #232F3B;
    font-weight: 600;
    margin-top: 8px;
}

    .doc-btn-primary:hover {
        background: #9dab9c;
    }

.doc-btn-small {
    padding: 3px 8px;
    font-size: 0.75rem;
}

.doc-btn-danger {
    background: #8a3a3a;
}

    .doc-btn-danger:hover {
        background: #a04545;
    }

.doc-confirm-dialog {
    width: 320px;
    max-width: 90%;
    background: #232F3B;
    border: 1px solid #46586A;
    border-radius: 6px;
    color: #ECE5D6;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

    .doc-confirm-dialog p {
        margin: 0 0 14px;
    }

.doc-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.doc-move-dialog {
    width: 380px;
    max-width: 92%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    background: #232F3B;
    border: 1px solid #46586A;
    border-radius: 6px;
    color: #ECE5D6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

    .doc-move-dialog .doc-confirm-actions {
        padding: 10px 14px;
        border-top: 1px solid #46586A;
    }

    .doc-move-dialog .doc-confirm-actions .doc-btn-primary {
        margin-top: 0;
    }

.doc-move-body {
    padding: 10px 14px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 120px;
}

.doc-tree-root,
.doc-tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-tree-children {
    padding-left: 18px;
}

.doc-tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}

    .doc-tree-row:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .doc-tree-row.selected {
        background: rgba(141, 154, 140, 0.35);
    }

.doc-tree-toggle {
    background: transparent;
    border: none;
    color: inherit;
    width: 16px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    text-align: center;
}

.doc-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-tree-empty {
    opacity: 0.6;
    font-size: 0.8rem;
    padding: 3px 4px 3px 20px;
}

.doc-new-folder-input {
    display: block;
    width: 100%;
    background: #1b242d;
    border: 1px solid #46586A;
    border-radius: 4px;
    color: #ECE5D6;
    padding: 6px 8px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.doc-error-text {
    color: #e39a9a;
    font-size: 0.8rem;
    margin: -8px 0 12px !important;
}

.doc-breadcrumbs {
    margin: 10px 0 6px;
    font-size: 0.85rem;
}

.doc-breadcrumb {
    background: transparent;
    border: none;
    color: #ECE5D6;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.doc-folder-select {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    background: #1b242d;
    border: 1px solid #46586A;
    border-radius: 4px;
    color: #ECE5D6;
    padding: 6px 8px;
}

.doc-folder-empty {
    opacity: 0.7;
    font-size: 0.85rem;
    margin: 0 0 10px;
}

.doc-new-folder {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

    .doc-new-folder input {
        flex: 1;
        background: #1b242d;
        border: 1px solid #46586A;
        border-radius: 4px;
        color: #ECE5D6;
        padding: 5px 8px;
    }

.doc-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
}

.doc-preview-dialog {
    width: 640px;
    max-width: 92%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    background: #232F3B;
    border: 1px solid #46586A;
    border-radius: 6px;
    color: #ECE5D6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.doc-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    font-weight: 600;
    border-bottom: 1px solid #46586A;
    overflow: hidden;
}

    .doc-preview-header span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.doc-preview-body {
    padding: 14px;
    overflow: auto;
    text-align: center;
}

.doc-preview-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 4px;
}

.doc-preview-text {
    text-align: left;
    max-height: 60vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #1b242d;
    border: 1px solid #46586A;
    border-radius: 4px;
    padding: 10px;
    margin: 0;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 0.85rem;
}
