html, body {
    margin: 0;
    padding: 0;
    font-family: Segoe UI, Arial, sans-serif;
    height: 100%;
}

button,
input {
    font: inherit;
}

.explorer-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}

.pane {
    width: 50%;
    box-sizing: border-box;
    padding: 12px;
    overflow: auto;
    position: relative;
}

.pane-left {
    border-right: 1px solid #d0d0d0;
    background: #fbfbfb;
}

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

.pane-header-stacked {
    align-items: flex-start;
}

.pane-toolbar {
    display: flex;
    gap: 8px;
}

.selected-path {
    color: #666;
    font-size: 14px;
}

.folder-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.folder-actions input {
    flex: 1;
}

.tree-root,
.tree-root ul {
    list-style: none;
    margin: 0;
    padding-left: 18px;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tree-toggle,
.tree-toggle-placeholder {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.tree-node {
    display: block;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    user-select: none;
}

    .tree-node:hover {
        background: #f2f2f2;
    }

    .tree-node.selected,
    .tree-node.selected:hover {
        background: #000000;
        color: #ffffff;
    }

.tree-node-label {
    display: inline-block;
    width: 100%;
}

.message {
    margin-bottom: 12px;
    padding: 8px;
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    border-radius: 4px;
}

.breadcrumbs {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.breadcrumb-link,
.link-button {
    background: none;
    border: none;
    color: #0f62fe;
    cursor: pointer;
    padding: 0;
}

.breadcrumb-sep {
    color: #666;
}

.upload-panel {
    margin-bottom: 12px;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 2px dashed #b8c2cc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
}

.upload-dropzone small {
    color: #666;
}

.upload-dropzone.dragover,
.dragover .upload-dropzone {
    background: #eef6ff;
    border-color: #0f62fe;
}

.hidden-input {
    display: none;
}

.upload-queue,
.upload-results {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.upload-card-header,
.upload-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.upload-card-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.progress-bar-shell {
    margin-top: 8px;
    height: 10px;
    background: #eef1f4;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #0f62fe;
    transition: width 0.15s ease-out;
}

.upload-card-complete .progress-bar-fill {
    background: #067647;
}

.upload-card-error .progress-bar-fill {
    background: #b42318;
}

.upload-result {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.upload-result-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.upload-result-warning {
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: #b54708;
}

.section-title {
    font-weight: 600;
    margin: 18px 0 10px;
}

.empty-state {
    color: #666;
    padding: 12px;
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.folder-card {
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 92px;
}

.folder-card:hover,
.content-row:hover {
    background: #fafcff;
}

.folder-card-selected {
    border-color: #0f62fe;
    box-shadow: inset 0 0 0 1px #0f62fe;
}

.folder-card-icon {
    font-size: 24px;
}

.folder-card-name {
    word-break: break-word;
}

.inline-rename-input {
    width: 100%;
    box-sizing: border-box;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.content-table th,
.content-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #ececec;
    text-align: left;
    vertical-align: middle;
}

.content-table th {
    background: #f7f7f7;
    position: sticky;
    top: 0;
}

.preview-cell {
    width: 64px;
}

.table-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: block;
}

.file-icon {
    font-size: 24px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.delete-button,
.danger,
.danger-menu {
    background: #b42318;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.context-menu {
    position: fixed;
    min-width: 180px;
    background: #fff;
    border: 1px solid #d9d9d9;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    border-radius: 8px;
    padding: 6px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.context-menu button {
    text-align: left;
    border: none;
    background: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.context-menu button:hover {
    background: #f3f6fb;
}

.context-menu .danger-menu:hover {
    background: #fee4e2;
    color: #b42318;
}

.image-preview-large {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    margin: 0 auto;
}

.file-name-cell {
    cursor: context-menu;
    white-space: nowrap;
}

.file-table-wrapper {
    margin-top: 12px;
    border: 1px solid #000;
    background: #fff;
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

    .explorer-table thead th {
        background: #111;
        color: #fff;
        font-weight: 600;
        text-align: left;
        padding: 10px 12px;
        font-size: 14px;
        border-right: 1px dotted #666;
        border-bottom: 1px solid #000;
    }

        .explorer-table thead th:last-child {
            border-right: none;
        }

    .explorer-table tbody tr {
        border-top: 1px solid #000;
    }

        .explorer-table tbody tr:last-child {
            border-bottom: 1px solid #000;
        }

    .explorer-table tbody td {
        padding: 10px 12px;
        font-size: 14px;
        vertical-align: middle;
        border-right: 1px dotted #b5b5b5;
        background: #fff;
    }

        .explorer-table tbody td:last-child {
            border-right: none;
        }

    .explorer-table tbody tr:hover td {
        background: #f5f5f5;
    }

.icon-col {
    width: 44px;
}

.size-col {
    width: 110px;
}

.icon-cell {
    text-align: center;
    width: 44px;
}

.file-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

.file-name-cell {
    cursor: context-menu;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date-cell {
    white-space: nowrap;
    width: 180px;
}

.type-cell {
    white-space: nowrap;
    width: 150px;
}

.size-cell {
    white-space: nowrap;
    text-align: right;
    width: 110px;
}

.empty-row {
    text-align: center;
    padding: 16px;
    color: #666;
}

.icon-button {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
}

.icon-button:hover {
    background: #f3f4f6;
}

.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-url-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.preview-url {
    font-size: 13px;
    color: #0f62fe;
    white-space: nowrap;
    overflow: hidden;
    font-size: 16px;
    font-weight:bolder;
    text-overflow: ellipsis;
}

.preview-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.preview-modal {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.small-dialog {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    width: 320px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.small-dialog h4 {
    margin: 0;
    font-size: 16px;
}

.small-dialog input {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.dialog-path {
    font-size: 13px;
    color: #555;
    word-break: break-all;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.dialog-actions button {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.dialog-actions button:hover {
    background: #e5e5e5;
}

button.danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

button.danger:hover {
    background: #b91c1c;
}

.icon-button {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
}

.icon-button:hover {
    background: #f3f4f6;
}

.image-preview-large {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preview-modal,
.small-dialog {
    animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
}

.login-card {
    width: 360px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

    .login-card h2 {
        margin-top: 0;
        margin-bottom: 16px;
    }

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .login-form input {
        padding: 8px 10px;
        border: 1px solid #cfcfcf;
        border-radius: 4px;
        font-size: 14px;
    }

    .login-form button {
        margin-top: 8px;
        padding: 8px 12px;
        border: 1px solid #111;
        background: #111;
        color: #fff;
        border-radius: 4px;
        cursor: pointer;
    }

        .login-form button:hover {
            background: #222;
        }

.login-error {
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid #f5c2c7;
    background: #f8d7da;
    color: #842029;
    border-radius: 4px;
}

.explorer-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-topbar {
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #111;
    color: #fff;
    border-bottom: 1px solid #000;
    box-sizing: border-box;
}

.app-topbar-user {
    font-size: 14px;
}

.logout-icon-button {
    border: 1px solid #444;
    background: #1b1b1b;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .logout-icon-button:hover {
        background: #2a2a2a;
    }

.explorer-page {
    display: flex;
    height: calc(100vh - 48px);
    overflow: hidden;
}