* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0f766e;
    --primary-hover: #115e59;
    --secondary: #f4f7f9;
    --surface: #ffffff;
    --border: #dbe4ea;
    --text: #1f2937;
    --text-light: #6b7280;
    --shadow: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 18px;
}

body {
    font-family: "Inter", sans-serif;
    background: #eef2f6;
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

button,
input {
    font-family: inherit;
}

.app {
    width: 100%;
    height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
}

.brand-info h1 {
    font-size: 22px;
    font-weight: 700;
}

.brand-info p {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 4px;
}

.search-input {
    width: 320px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 16px;
    outline: none;
    transition: .25s;
}

.search-input:focus {
    border-color: var(--primary);
}

.menu {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.menu button {
    border: none;
    background: #dce6e4;
    color: var(--text);
    padding: 11px 18px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: .25s;
    font-weight: 600;
}

.menu button:hover,
.menu button.active {
    background: var(--primary);
    color: #fff;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: .25s;
}

.btn-back:hover {
    background: var(--primary-hover);
}

.breadcrumb {
    color: var(--text-light);
    font-size: 14px;
}

.main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 20px;
    min-height: 0;
}

.explorer,
.preview {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.explorer-header,
.preview-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.explorer-header h2,
.preview-header h2 {
    font-size: 18px;
}

#totalItem {
    color: var(--text-light);
    font-size: 14px;
}

.file-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.file-card {
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: .25s;
}

.file-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.file-icon {
    font-size: 42px;
    margin-bottom: 16px;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.5;
}

.preview-content {
    flex: 1;
    overflow: hidden;
    background: #eef3f8;
}

.preview-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    color: var(--text-light);
    text-align: center;
    padding: 40px;
}

.preview-icon {
    font-size: 70px;
}

.preview-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.btn-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: #f2f4f7;
    transition: .25s;
}

.btn-close:hover {
    background: #e5e7eb;
}

.loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .65);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.spinner {
    width: 54px;
    height: 54px;
    border: 5px solid #d1d5db;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #c8d0d8;
    border-radius: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1100px) {
    .main {
        grid-template-columns: 1fr;
    }

    .preview {
        display: none;
    }

    .search-input {
        width: 220px;
    }
}