* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, sans-serif;
}

body {
    background: #0b1020;
    color: #fff;
}

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

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: #4f7cff;
    color: #fff;
    cursor: pointer;
    transition: .2s ease;
}

button:hover, .btn:hover {
    opacity: .92;
}

.danger {
    background: #d54b4b;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #0b1020, #111a34);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: #151d34;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #a8b6d8;
    margin: 10px 0 20px;
}

.mini-note {
    margin-top: 16px;
    color: #9fb0d1;
    font-size: 13px;
    line-height: 1.5;
}

label {
    display: block;
    margin: 12px 0 6px;
    color: #d8e2ff;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #2f406c;
    border-radius: 10px;
    background: #0f1730;
    color: #fff;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: #5f87ff;
}

.alert {
    margin: 12px 0 16px;
    padding: 12px;
    border-radius: 10px;
}

.alert.success {
    background: rgba(46, 204, 113, 0.18);
    color: #8ef0b4;
    border: 1px solid rgba(46, 204, 113, .3);
}

.alert.error {
    background: rgba(231, 76, 60, 0.18);
    color: #ffb2ab;
    border: 1px solid rgba(231, 76, 60, .3);
}

.app {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #11192f;
    padding: 20px;
    border-right: 1px solid rgba(255,255,255,.08);
}

.conn-info {
    color: #a8b6d8;
    margin-top: 8px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.card-form {
    margin-top: 20px;
    background: #16203b;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.05);
}

.main {
    padding: 20px;
}

.path {
    color: #9fb0d1;
    margin: 8px 0 16px;
}

.file-list {
    background: #11192f;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
}

.file-head, .file-row {
    display: grid;
    grid-template-columns: 1.5fr 120px 120px 220px;
    gap: 10px;
    padding: 14px 16px;
    align-items: center;
}

.file-head {
    background: #192441;
    font-weight: bold;
    color: #d9e4ff;
}

.file-row {
    border-top: 1px solid rgba(255,255,255,.06);
}

.file-name a:hover {
    color: #7ea2ff;
}

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

.small {
    margin-top: 0;
    padding: 7px 10px;
    font-size: 13px;
}

.editor-layout {
    padding: 20px;
    min-height: 100vh;
}

.editor-topbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.editor-title {
    flex: 1;
    text-align: center;
    color: #a9bce8;
    word-break: break-all;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.code-area {
    min-height: 72vh;
    font-family: Consolas, monospace;
    resize: vertical;
    line-height: 1.5;
}

.save-btn {
    align-self: flex-end;
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .file-head, .file-row {
        grid-template-columns: 1fr;
    }

    .editor-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-title {
        text-align: left;
    }
}
.upload-status {
    margin-top: 14px;
    padding: 12px;
    background: #0f1730;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
}

.progress-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #cdd9f5;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4f7cff, #7aa2ff);
    border-radius: 999px;
    transition: width .2s ease;
}

.upload-text {
    margin-top: 8px;
    font-size: 13px;
    color: #9fb0d1;
}

.viewer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.viewer-box {
    background: #11192f;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    padding: 18px;
    min-height: 70vh;
}

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

.preview-video,
.preview-frame {
    width: 100%;
    min-height: 75vh;
    border: none;
    border-radius: 12px;
    background: #000;
}

.preview-sep {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

.doc-preview {
    white-space: pre-wrap;
    word-break: break-word;
    background: #0f1730;
    padding: 16px;
    border-radius: 12px;
    line-height: 1.6;
    color: #dce7ff;
}

.binary-box {
    text-align: center;
    padding: 40px 20px;
}

.table-wrap {
    overflow: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    border: 1px solid rgba(255,255,255,.08);
    padding: 10px;
    text-align: left;
}

.preview-table th {
    background: #192441;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.archive-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #0f1730;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 10px;
    padding: 10px 12px;
}

.folder-target.dragover-folder {
    color: #7ea2ff !important;
    text-decoration: underline;
}