:root {
    --bg: #f4efe7;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --text: #15202b;
    --muted: #617182;
    --line: rgba(21, 32, 43, 0.08);
    --brand: #0d6b61;
    --brand-dark: #08463f;
    --accent: #f28f3b;
    --shadow: 0 24px 70px rgba(21, 32, 43, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(242, 143, 59, 0.18), transparent 24%),
        radial-gradient(circle at right center, rgba(13, 107, 97, 0.14), transparent 20%),
        linear-gradient(180deg, #fdf8f2 0%, var(--bg) 100%);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
}

.fileup-navbar {
    background: linear-gradient(135deg, rgba(8, 70, 63, 0.96), rgba(13, 107, 97, 0.94));
    box-shadow: 0 12px 30px rgba(8, 70, 63, 0.18);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #ffd1a6);
    color: #1d160d;
    font-weight: 800;
    font-size: 1.35rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.76);
    padding: 0.75rem 1rem;
    border-radius: 999px;
    transition: 0.25s ease;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.panel-card,
.viewer-card,
.empty-state {
    background: var(--surface);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 800;
    color: var(--accent);
}

.drop-zone {
    border: 2px dashed rgba(13, 107, 97, 0.28);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(13, 107, 97, 0.06), rgba(242, 143, 59, 0.08));
    padding: 1rem;
    transition: 0.25s ease;
    cursor: pointer;
}

.drop-zone.is-dragging {
    transform: translateY(-2px) scale(1.01);
    border-color: var(--brand);
    background: linear-gradient(135deg, rgba(13, 107, 97, 0.12), rgba(242, 143, 59, 0.12));
}

.drop-zone-inner {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    border-radius: calc(var(--radius-lg) - 6px);
    background: rgba(255, 255, 255, 0.74);
}

.drop-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--brand), #46aa9c);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.btn-fileup,
.btn-fileup-outline:hover {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border: none;
    color: #fff;
    box-shadow: 0 10px 20px rgba(8, 70, 63, 0.18);
}

.btn-fileup:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn-fileup-outline {
    border: 1px solid rgba(13, 107, 97, 0.24);
    color: var(--brand-dark);
    background: rgba(13, 107, 97, 0.04);
}

.selected-files {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
}

.selected-files .list-group-item {
    background: transparent;
    border-color: var(--line);
    padding-inline: 0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
}

.filter-pill.active,
.filter-pill:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.file-gallery .col-6 {
    display: flex;
}

.file-card {
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 16px 40px rgba(21, 32, 43, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(21, 32, 43, 0.14);
}

.file-preview {
    display: block;
    width: 100%;
    height: 132px;
    border: 0;
    padding: 0;
    background: #f7f2ea;
    overflow: hidden;
}

.file-preview-button {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    outline: none;
}

.file-preview img,
.file-preview video,
.viewer-image,
.viewer-video,
.viewer-embed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
    background: #f7f2ea;
}

.file-icon-preview {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.file-icon-tile {
    width: 86px;
    height: 86px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.file-icon-ext {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.file-icon-name {
    font-size: 0.72rem;
    opacity: 0.92;
}

.file-theme-word .file-icon-tile {
    background: linear-gradient(135deg, #1f5eff, #163e96);
}

.file-theme-excel .file-icon-tile {
    background: linear-gradient(135deg, #1f8f53, #0f5e36);
}

.file-theme-slides .file-icon-tile {
    background: linear-gradient(135deg, #ef7b2d, #b45711);
}

.file-theme-pdf .file-icon-tile {
    background: linear-gradient(135deg, #e03a3a, #8f1f1f);
}

.file-theme-audio .file-icon-tile {
    background: linear-gradient(135deg, #7f56d9, #4338ca);
}

.file-theme-video .file-icon-tile {
    background: linear-gradient(135deg, #0f766e, #155e75);
}

.file-theme-image .file-icon-tile {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.file-theme-archive .file-icon-tile {
    background: linear-gradient(135deg, #64748b, #334155);
}

.file-theme-file .file-icon-tile {
    background: linear-gradient(135deg, #475569, #1e293b);
}

.file-card-body {
    padding: 0.72rem;
}

.file-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.file-type-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--brand-dark);
    background: rgba(13, 107, 97, 0.1);
}

.file-name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.05rem;
}

.file-meta-line {
    min-height: 1rem;
    font-size: 0.74rem;
}

.file-card-actions .btn {
    flex: 1 1 0;
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.38rem 0.45rem;
}

.file-preview-modal .modal-content {
    border: 0;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.file-preview-modal .modal-header,
.file-preview-modal .modal-footer {
    border: 0;
    padding: 1.2rem 1.4rem;
}

.modal-preview-stage {
    min-height: 320px;
    border-radius: 24px;
    background: #f8f4ed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.modal-preview-stage .modal-preview-image,
.modal-preview-stage .modal-preview-video {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    border: 0;
    object-fit: contain;
    background: transparent;
    display: block;
    margin: 0 auto;
}

.modal-preview-stage .modal-preview-frame {
    width: 100%;
    height: 70vh;
    border: 0;
    background: #fff;
}

.modal-audio-preview,
.modal-doc-preview,
.viewer-audio {
    width: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem;
}

.modal-doc-preview h3,
.viewer-fallback h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-doc-preview p,
.viewer-fallback p {
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.modal-file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-file-info span {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(13, 107, 97, 0.08);
    color: var(--brand-dark);
    font-size: 0.88rem;
}

.viewer-frame {
    min-height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(21, 32, 43, 0.04);
}

.viewer-image,
.viewer-video,
.viewer-embed {
    min-height: 500px;
    object-fit: contain;
    background: #f7f7f7;
}

.viewer-text {
    margin: 0;
    min-height: 500px;
    padding: 1.5rem;
    overflow: auto;
    background: #fff;
    color: #1d2c3a;
    font-size: 0.95rem;
    line-height: 1.6;
}

.viewer-fallback,
.empty-state {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
}

.file-meta {
    display: grid;
    gap: 1rem;
}

.file-meta div {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.file-meta dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.file-meta dd {
    margin: 0;
    font-weight: 600;
}

.soft-alert {
    border-radius: 18px;
    border: none;
}

@media (max-width: 991.98px) {
    .panel-card,
    .viewer-card,
    .empty-state {
        padding: 1.35rem;
    }

    .drop-zone-inner {
        min-height: 220px;
        padding: 1rem;
    }

    .file-preview {
        height: 120px;
    }

    .modal-preview-stage {
        min-height: 280px;
    }

    .modal-preview-stage .modal-preview-image,
    .modal-preview-stage .modal-preview-video,
    .modal-preview-stage .modal-preview-frame {
        max-height: 50vh;
        height: 50vh;
    }
}

@media (max-width: 575.98px) {
    .filter-row {
        gap: 0.55rem;
    }

    .filter-pill {
        width: 100%;
        justify-content: center;
    }

    .file-preview {
        height: 108px;
    }

    .file-icon-tile {
        width: 72px;
        height: 72px;
        border-radius: 20px;
    }

    .file-name {
        font-size: 0.78rem;
    }
}
