:root {

    --navy: #071a33;
    --navy-light: #102b4d;

    --blue: #1976d2;
    --blue-dark: #125da8;
    --blue-light: #eaf4ff;

    --white: #ffffff;

    --text: #172033;
    --muted: #687386;

    --border: #e5eaf0;
    --background: #f6f8fb;

    --green: #1eaa68;
    --orange: #f39c12;
    --red: #e74c3c;

    --shadow-sm:
        0 5px 18px rgba(7, 26, 51, 0.06);

    --shadow:
        0 14px 40px rgba(7, 26, 51, 0.09);

    --shadow-lg:
        0 25px 70px rgba(7, 26, 51, 0.14);

    --radius: 18px;
    --radius-sm: 12px;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    margin: 0;

    font-family:
        "Inter",
        sans-serif;

    color: var(--text);

    background:
        var(--background);
}


button,
input {
    font: inherit;
}


button {
    border: 0;
    cursor: pointer;
}


a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {

    height: 78px;

    position: sticky;

    top: 0;

    z-index: 100;

    display: flex;

    align-items: center;

    padding: 0 32px;

    background:
        rgba(255, 255, 255, 0.94);

    backdrop-filter:
        blur(18px);

    border-bottom:
        1px solid
        rgba(229, 234, 240, 0.9);
}


.brand {

    width: 250px;

    display: flex;

    align-items: center;

    gap: 12px;
}


.logo-mark {

    width: 42px;
    height: 42px;

    display: grid;

    place-items: center;

    border-radius: 13px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--navy-light)
        );

    font-weight: 800;

    box-shadow:
        0 8px 20px
        rgba(25, 118, 210, 0.25);
}


.brand-text {

    display: grid;

    gap: 2px;
}


.brand-text strong {

    font-size: 16px;
}


.brand-text span {

    color: var(--muted);

    font-size: 10px;
}


.topbar-search {

    flex: 1;

    display: flex;

    justify-content: center;
}


.search-trigger {

    width:
        min(540px, 100%);

    height: 44px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        0 15px;

    color: var(--muted);

    background: #f7f9fc;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    text-align: left;

    transition:
        0.2s ease;
}


.search-trigger:hover {

    background: white;

    border-color:
        #cdd6e0;

    box-shadow:
        var(--shadow-sm);
}


.search-icon {

    font-size: 22px;
}


.search-trigger kbd {

    margin-left: auto;

    padding:
        3px 7px;

    border:
        1px solid
        var(--border);

    border-radius: 6px;

    color: var(--muted);

    background: white;

    font-size: 10px;
}


.topbar-actions {

    width: 250px;

    display: flex;

    justify-content: flex-end;
}


.user-menu {

    display: flex;

    align-items: center;

    gap: 10px;
}


.avatar {

    width: 38px;
    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    color: white;

    background:
        var(--navy);

    font-weight: 700;
}


.user-info {

    display: grid;

    gap: 2px;
}


.user-info strong {

    font-size: 12px;
}


.user-info span {

    color: var(--muted);

    font-size: 10px;
}


.icon-button {

    width: 38px;
    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 10px;

    background: #f4f7fa;

    color: var(--text);
}


.mobile-menu-button {

    display: none !important;
}


/* =========================================================
   LAYOUT
========================================================= */

.layout {

    display: flex;

    min-height:
        calc(100vh - 78px);
}


.sidebar {

    width: 250px;

    position: fixed;

    top: 78px;
    bottom: 0;

    padding:
        26px 18px;

    background:
        var(--white);

    border-right:
        1px solid
        var(--border);

    display: flex;

    flex-direction: column;
}


.upload-button,
.primary-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    min-height: 46px;

    padding:
        0 18px;

    border-radius: 12px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            #1769b7
        );

    font-size: 13px;

    font-weight: 700;

    box-shadow:
        0 8px 18px
        rgba(25, 118, 210, 0.18);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.upload-button {

    width: 100%;
}


.upload-button:hover,
.primary-button:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 12px 24px
        rgba(25, 118, 210, 0.24);
}


.new-folder-button {

    width: 100%;

    margin-top: 10px;

    height: 42px;

    border-radius: 11px;

    color: var(--text);

    background:
        var(--blue-light);

    font-size: 12px;

    font-weight: 700;

    transition:
        0.2s ease;
}


.new-folder-button:hover {

    background:
        #dceeff;
}


.main-nav {

    display: grid;

    gap: 5px;

    margin-top: 30px;
}


.nav-item {

    width: 100%;

    height: 43px;

    display: flex;

    align-items: center;

    gap: 12px;

    padding:
        0 13px;

    border-radius: 11px;

    color: var(--muted);

    background: transparent;

    text-align: left;

    font-size: 13px;

    font-weight: 600;

    transition:
        0.2s ease;
}


.nav-item span:first-child {

    width: 20px;

    font-size: 17px;

    text-align: center;
}


.nav-item:hover {

    color: var(--text);

    background:
        #f5f7fa;
}


.nav-item.active {

    color: var(--blue);

    background:
        var(--blue-light);
}


.sidebar-bottom {

    margin-top: auto;
}


.privacy-card {

    display: flex;

    gap: 10px;

    padding: 14px;

    border-radius: 14px;

    background:
        #f7f9fc;

    border:
        1px solid
        var(--border);
}


.privacy-icon {

    width: 27px;
    height: 27px;

    flex-shrink: 0;

    display: grid;

    place-items: center;

    border-radius: 8px;

    color: var(--green);

    background:
        #e9f9f1;

    font-weight: 800;
}


.privacy-card strong {

    display: block;

    margin-bottom: 4px;

    font-size: 11px;
}


.privacy-card p {

    margin: 0;

    color: var(--muted);

    font-size: 9px;

    line-height: 1.5;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {

    width:
        calc(100% - 250px);

    margin-left: 250px;

    padding:
        50px
        clamp(24px, 5vw, 70px)
        70px;
}


.page-heading {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 30px;

    max-width: 1300px;

    margin:
        0 auto
        32px;
}


.eyebrow {

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.5px;

    color: var(--blue);
}


.page-heading h1 {

    margin:
        8px 0;

    font-size:
        clamp(32px, 4vw, 48px);

    letter-spacing: -2px;

    line-height: 1.05;
}


.page-heading p {

    margin: 0;

    color: var(--muted);

    font-size: 14px;
}


.heading-actions {

    display: flex;

    gap: 10px;
}


.secondary-button {

    min-height: 44px;

    padding:
        0 16px;

    border-radius: 11px;

    color: var(--text);

    background: white;

    border:
        1px solid
        var(--border);

    font-size: 12px;

    font-weight: 700;

    transition:
        0.2s ease;
}


.secondary-button:hover {

    border-color:
        #cbd5e1;

    transform:
        translateY(-1px);

    box-shadow:
        var(--shadow-sm);
}


/* =========================================================
   UPLOAD AREA
========================================================= */

.upload-zone {

    max-width: 1300px;

    margin:
        0 auto
        30px;

    min-height: 125px;

    display: flex;

    align-items: center;

    gap: 18px;

    padding:
        24px 28px;

    border-radius: 18px;

    border:
        1.5px dashed
        #bdd2e8;

    background:
        linear-gradient(
            110deg,
            #ffffff,
            #f4f9ff
        );

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.upload-zone:hover,
.upload-zone.dragover {

    border-color:
        var(--blue);

    background:
        #edf7ff;

    transform:
        translateY(-2px);
}


.upload-zone-icon {

    width: 50px;
    height: 50px;

    display: grid;

    place-items: center;

    border-radius: 14px;

    color: var(--blue);

    background:
        var(--blue-light);

    font-size: 24px;

    font-weight: 700;
}


.upload-zone strong {

    display: block;

    margin-bottom: 5px;

    font-size: 14px;
}


.upload-zone p {

    margin: 0;

    color: var(--muted);

    font-size: 12px;
}


.upload-zone-hint {

    margin-left: auto;

    padding:
        7px 10px;

    border-radius: 8px;

    color: var(--muted);

    background: white;

    border:
        1px solid
        var(--border);

    font-size: 10px;
}


/* =========================================================
   TOOLBAR
========================================================= */

.file-toolbar {

    max-width: 1300px;

    margin:
        0 auto
        18px;

    display: flex;

    justify-content: space-between;

    align-items: center;
}


.breadcrumbs {

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

    font-size: 12px;

    font-weight: 600;
}


.breadcrumb {

    color: var(--muted);

    cursor: pointer;
}


.breadcrumb:hover {

    color: var(--blue);
}


.breadcrumb.current {

    color: var(--text);

    cursor: default;
}


.breadcrumb-separator {

    color: #b3bcc8;
}


.toolbar-actions {

    display: flex;

    gap: 5px;
}


.toolbar-button {

    width: 36px;
    height: 36px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    color: var(--muted);

    background: transparent;

    font-size: 17px;
}


.toolbar-button:hover {

    background: white;

    color: var(--text);
}


.toolbar-button.active {

    color: var(--blue);

    background:
        var(--blue-light);
}


/* =========================================================
   FILE AREA
========================================================= */

.file-area {

    max-width: 1300px;

    margin: 0 auto;
}


.grid-view {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(210px, 1fr)
        );

    gap: 14px;
}


.list-view {

    display: grid;

    gap: 8px;
}


.file-card {

    position: relative;

    background: white;

    border:
        1px solid
        var(--border);

    border-radius: 16px;

    padding: 18px;

    min-height: 175px;

    box-shadow:
        0 2px 8px
        rgba(7, 26, 51, 0.025);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;

    animation:
        fadeUp 0.35s ease both;
}


.file-card:hover {

    transform:
        translateY(-3px);

    border-color:
        #d6e0eb;

    box-shadow:
        var(--shadow);
}


.file-card.folder {

    cursor: pointer;
}


.file-card-top {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;
}


.file-icon {

    width: 48px;
    height: 48px;

    display: grid;

    place-items: center;

    border-radius: 13px;

    background:
        var(--blue-light);

    color: var(--blue);

    font-size: 22px;
}


.file-icon.image {

    color: #8e44ad;

    background:
        #f6edfb;
}


.file-icon.document {

    color: #1976d2;

    background:
        #eaf4ff;
}


.file-icon.archive {

    color: #f39c12;

    background:
        #fff6e6;
}


.file-icon.video {

    color: #e74c3c;

    background:
        #fff0ee;
}


.file-icon.folder-icon {

    color: #1976d2;

    background:
        #eaf4ff;
}


.file-actions {

    position: relative;
}


.more-button {

    width: 30px;
    height: 30px;

    display: grid;

    place-items: center;

    border-radius: 8px;

    color: var(--muted);

    background: transparent;

    font-size: 18px;
}


.more-button:hover {

    background:
        #f3f5f8;
}


.file-card-body {

    margin-top: 22px;
}


.file-name {

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 13px;

    font-weight: 700;
}


.file-meta {

    margin-top: 6px;

    color: var(--muted);

    font-size: 10px;
}


.star-button {

    position: absolute;

    right: 17px;

    bottom: 16px;

    color: #b7c0cc;

    background: transparent;

    font-size: 17px;
}


.star-button.starred {

    color: var(--orange);
}


/* =========================================================
   LIST VIEW
========================================================= */

.list-view .file-card {

    min-height: 70px;

    display: flex;

    align-items: center;

    padding:
        12px 16px;
}


.list-view .file-card-top {

    flex-shrink: 0;
}


.list-view .file-card-body {

    flex: 1;

    margin:
        0 20px;
}


.list-view .file-name {

    max-width: 500px;
}


.list-view .file-meta {

    margin-top: 4px;
}


.list-view .star-button {

    position: static;

    margin-right: 10px;
}


/* =========================================================
   EMPTY / LOADING
========================================================= */

.loading-state,
.empty-state {

    min-height: 250px;

    display: grid;

    place-items: center;

    padding: 50px;

    border:
        1px dashed
        var(--border);

    border-radius: 18px;

    color: var(--muted);

    background:
        rgba(255, 255, 255, 0.5);

    font-size: 13px;
}


.empty-state {

    grid-column:
        1 / -1;

    text-align: center;
}


.empty-state strong {

    display: block;

    color: var(--text);

    margin-bottom: 7px;
}


/* =========================================================
   CONTEXT MENU
========================================================= */

.context-menu {

    position: fixed;

    z-index: 1000;

    min-width: 200px;

    padding: 6px;

    background: white;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    box-shadow:
        var(--shadow-lg);
}


.context-menu button {

    width: 100%;

    display: flex;

    align-items: center;

    padding: 10px;

    border-radius: 8px;

    color: var(--text);

    background: transparent;

    text-align: left;

    font-size: 12px;
}


.context-menu button:hover {

    background:
        #f4f7fa;
}


.context-menu button.danger {

    color: var(--red);
}


/* =========================================================
   OVERLAY / MODALS
========================================================= */

.overlay {

    position: fixed;

    inset: 0;

    z-index: 500;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(7, 26, 51, 0.42);

    backdrop-filter:
        blur(7px);

    animation:
        fadeIn 0.2s ease;
}


.overlay.hidden {

    display: none;
}


.modal-card,
.search-panel {

    width:
        min(480px, 100%);

    padding: 28px;

    background: white;

    border:
        1px solid
        var(--border);

    border-radius: 20px;

    box-shadow:
        var(--shadow-lg);

    animation:
        fadeUp 0.25s ease;
}


.search-panel {

    width:
        min(700px, 100%);
}


.modal-header,
.search-panel-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 25px;
}


.modal-header h2,
.search-panel-header h2 {

    margin:
        7px 0 0;

    font-size: 25px;

    letter-spacing: -0.8px;
}


.close-button {

    width: 34px;
    height: 34px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    color: var(--muted);

    background:
        #f5f7fa;

    font-size: 20px;
}


.close-button:hover {

    color: var(--text);

    background:
        #e9edf2;
}


.modal-label {

    display: grid;

    gap: 9px;

    font-size: 13px;

    font-weight: 700;
}


.modal-input {

    width: 100%;

    padding:
        14px 15px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    background:
        #fbfcfe;

    color: var(--text);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.modal-input:focus {

    border-color:
        var(--blue);

    background:
        white;

    box-shadow:
        0 0 0 4px
        rgba(25, 118, 210, 0.10);
}


.modal-actions {

    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 25px;
}


/* =========================================================
   SEARCH
========================================================= */

.search-input {

    width: 100%;

    height: 52px;

    padding:
        0 16px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    outline: none;

    background:
        #f9fafc;

    font-size: 14px;
}


.search-input:focus {

    border-color:
        var(--blue);

    box-shadow:
        0 0 0 4px
        rgba(25, 118, 210, 0.10);
}


.search-results {

    max-height: 400px;

    overflow-y: auto;

    margin-top: 15px;
}


.search-result {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    border-radius: 11px;

    cursor: pointer;
}


.search-result:hover {

    background:
        #f5f8fb;
}


.search-result-icon {

    width: 38px;
    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 10px;

    color: var(--blue);

    background:
        var(--blue-light);
}


.search-result-info {

    min-width: 0;
}


.search-result-name {

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 12px;

    font-weight: 700;
}


.search-result-path {

    margin-top: 3px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   TOAST
========================================================= */

.toast-container {

    position: fixed;

    right: 24px;

    bottom: 24px;

    z-index: 2000;

    display: grid;

    gap: 8px;
}


.toast {

    min-width: 250px;

    padding:
        13px 16px;

    color: var(--text);

    background: white;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    box-shadow:
        var(--shadow-lg);

    font-size: 12px;

    font-weight: 600;

    animation:
        toastIn 0.3s ease;
}


.toast.success {

    border-left:
        4px solid
        var(--green);
}


.toast.error {

    border-left:
        4px solid
        var(--red);
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes fadeUp {

    from {

        opacity: 0;

        transform:
            translateY(12px);
    }

    to {

        opacity: 1;

        transform:
            translateY(0);
    }
}


@keyframes fadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes toastIn {

    from {

        opacity: 0;

        transform:
            translateY(10px);
    }

    to {

        opacity: 1;

        transform:
            translateY(0);
    }
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

    .brand {

        width: 220px;
    }

    .topbar-actions {

        width: 220px;
    }

    .user-info {

        display: none;
    }
}


@media (max-width: 850px) {

    .topbar {

        padding:
            0 18px;
    }

    .brand {

        width: auto;
    }

    .brand-text span {

        display: none;
    }

    .topbar-search {

        margin:
            0 12px;
    }

    .topbar-actions {

        width: auto;
    }

    .sidebar {

        transform:
            translateX(-100%);

        z-index: 300;

        transition:
            transform 0.25s ease;

        box-shadow:
            var(--shadow-lg);
    }

    .sidebar.mobile-open {

        transform:
            translateX(0);
    }

    .mobile-menu-button {

        display: grid !important;

        margin-right: 10px;
    }

    .main-content {

        width: 100%;

        margin-left: 0;

        padding:
            35px
            20px
            50px;
    }

    .page-heading {

        align-items: flex-start;

        flex-direction: column;
    }

    .heading-actions {

        width: 100%;
    }

    .heading-actions button {

        flex: 1;
    }
}


@media (max-width: 600px) {

    .topbar {

        height: 68px;
    }

    .layout {

        min-height:
            calc(100vh - 68px);
    }

    .sidebar {

        top: 68px;
    }

    .topbar-search {

        display: none;
    }

    .page-heading h1 {

        font-size: 34px;
    }

    .upload-zone {

        min-height: 110px;

        padding: 18px;
    }

    .upload-zone-hint {

        display: none;
    }

    .grid-view {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }

    .file-card {

        min-height: 160px;

        padding: 14px;
    }

    .file-icon {

        width: 42px;
        height: 42px;
    }

    .list-view .file-card {

        min-height: 65px;
    }
}


@media (max-width: 430px) {

    .grid-view {

        grid-template-columns:
            1fr;
    }

    .file-card {

        min-height: 145px;
    }

    .heading-actions {

        flex-direction: column;
    }

    .heading-actions button {

        width: 100%;
    }
}
