:root {
    color-scheme: dark;
    --bg: #0b0d12;
    --panel: #141821;
    --panel-2: #1b202b;
    --line: #292f3c;
    --text: #f2f4f8;
    --muted: #99a2b3;
    --accent: #6c8cff;
    --accent-2: #8aa2ff;
    --danger: #ff6b7a;
    --success: #50c878;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% -10%, rgba(108, 140, 255, 0.16), transparent 32rem),
        var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 4vw;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 13, 18, 0.82);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand,
.account,
.account form,
.toolbar,
.file-name,
.storage-card > div:first-child,
.upload-actions {
    display: flex;
    align-items: center;
}

.brand {
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: linear-gradient(145deg, var(--accent-2), #455dcc);
    box-shadow: 0 14px 35px rgba(64, 89, 200, 0.32);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 13px;
}

.account {
    gap: 18px;
    color: var(--muted);
}

.text-button,
.icon-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-2);
    cursor: pointer;
}

.icon-button {
    width: 30px;
    height: 30px;
    color: var(--muted);
    font-size: 22px;
}

.icon-button:hover {
    color: var(--danger);
}

.page {
    width: min(1180px, 92vw);
    margin: 34px auto 60px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 24px;
    color: var(--muted);
}

.breadcrumbs a:last-child {
    color: var(--text);
}

.toolbar {
    gap: 12px;
    margin-bottom: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text);
    cursor: pointer;
    font-weight: 650;
}

.button.primary {
    background: var(--accent);
}

.button.primary:hover {
    background: var(--accent-2);
}

.button.secondary {
    border-color: var(--line);
    background: var(--panel);
}

.upload-button input {
    display: none;
}

.folder-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.folder-form input,
.login-form input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: var(--panel);
    color: var(--text);
}

.folder-form input {
    min-width: min(360px, 60vw);
    padding: 0 13px;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.14);
}

.drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 116px;
    padding: 20px;
    border: 1px dashed #3a4354;
    border-radius: 14px;
    color: var(--muted);
    transition: 160ms ease;
}

.drop-zone strong {
    color: var(--text);
}

.drop-zone.active {
    border-color: var(--accent);
    background: rgba(108, 140, 255, 0.08);
}

.file-panel,
.storage-card,
.upload-list {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--panel);
}

.file-header,
.file-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 130px 160px 44px;
    align-items: center;
    min-height: 54px;
    padding: 0 16px;
    gap: 14px;
}

.file-header {
    min-height: 43px;
    color: var(--muted);
    background: var(--panel-2);
    font-size: 13px;
}

.file-row {
    border-top: 1px solid var(--line);
}

.file-row > span {
    color: var(--muted);
}

.file-name {
    min-width: 0;
    gap: 11px;
}

.file-name a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name a:hover {
    color: var(--accent-2);
}

.file-icon {
    flex: 0 0 auto;
    color: #7f8ca5;
    font-size: 9px;
}

.folder-icon {
    color: #e4bb58;
    font-size: 17px;
}

.delete-form {
    justify-self: end;
}

.empty-state {
    padding: 52px 20px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
}

.storage-card {
    padding: 18px;
}

.storage-card > div:first-child {
    justify-content: space-between;
    margin-bottom: 10px;
}

.storage-card span {
    color: var(--muted);
}

.usage-track,
.progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 100px;
    background: #252b36;
}

.usage-track span,
.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #9c7cff);
    transition: width 180ms ease;
}

.upload-item {
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
}

.upload-item:last-child {
    border-bottom: 0;
}

.upload-info,
.upload-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.upload-info span,
.upload-status {
    color: var(--muted);
}

.progress-track {
    margin: 10px 0 8px;
}

.upload-actions {
    justify-content: space-between;
    font-size: 13px;
}

.upload-item.failed .upload-status {
    color: var(--danger);
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(80, 200, 120, 0.35);
    border-radius: 10px;
    background: rgba(80, 200, 120, 0.09);
}

.alert.error {
    border-color: rgba(255, 107, 122, 0.35);
    background: rgba(255, 107, 122, 0.09);
}

.hidden {
    display: none !important;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(410px, 100%);
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(20, 24, 33, 0.92);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.login-card .brand-mark {
    margin-bottom: 24px;
}

.login-card h1 {
    margin: 0;
    font-size: 31px;
}

.muted {
    margin: 6px 0 26px;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 9px;
}

.login-form label {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.login-form input {
    width: 100%;
    padding: 0 13px;
}

.login-form .button {
    width: 100%;
    margin-top: 15px;
}

@media (max-width: 720px) {
    .topbar {
        padding: 0 18px;
    }

    .account > span {
        display: none;
    }

    .page {
        width: calc(100% - 24px);
        margin-top: 22px;
    }

    .drop-zone {
        display: none;
    }

    .file-header {
        display: none;
    }

    .file-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 11px 13px;
    }

    .file-row > span {
        display: none;
    }

    .folder-form {
        flex-wrap: wrap;
    }

    .folder-form input {
        width: 100%;
        min-width: 100%;
    }

    .login-card {
        padding: 30px 24px;
    }
}
