* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #0b1020;
    color: #e5e7eb;
    font-family: Arial, sans-serif;
}

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

.app {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 255px;
    background: #0f172a;
    border-right: 1px solid #1f2937;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 25px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: #2563eb;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: bold;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span {
    color: #94a3b8;
    font-size: 13px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    padding: 12px;
    border-radius: 10px;
    color: #cbd5e1;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #1e293b;
    color: white;
}

.logout {
    margin-top: auto;
    color: #94a3b8;
    padding: 12px;
}

.main {
    flex: 1;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 0;
}

.topbar p {
    color: #94a3b8;
    margin: 6px 0 0;
}

.lock-button {
    background: #dc2626;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: bold;
}

.lock-button:hover {
    background: #b91c1c;
}

.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

.card h2 {
    margin-top: 0;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 14px;
    color: #cbd5e1;
}

input,
textarea {
    background: #020617;
    border: 1px solid #334155;
    color: white;
    border-radius: 10px;
    padding: 12px;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

button {
    background: #2563eb;
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background: #1d4ed8;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.alert.success {
    background: #064e3b;
    border: 1px solid #10b981;
}

.alert.error {
    background: #7f1d1d;
    border: 1px solid #ef4444;
}

.muted {
    color: #94a3b8;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.stat {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 18px;
}

.stat strong {
    display: block;
    font-size: 28px;
}

.stat span {
    color: #94a3b8;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.file-card {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-card strong {
    word-break: break-word;
}

.file-card span {
    color: #94a3b8;
    font-size: 13px;
}

.file-preview {
    height: 145px;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.file-preview img,
.file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview audio {
    width: 95%;
}

.generic-file,
.folder-preview {
    font-size: 44px;
}

.folder-card {
    min-height: 210px;
}

.download,
.folder-link {
    background: #1e293b;
    border-radius: 8px;
    padding: 9px 10px;
    color: #e5e7eb;
    display: inline-block;
    text-align: center;
}

.download:hover,
.folder-link:hover {
    background: #334155;
}

.note-item {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.note-item pre {
    white-space: pre-wrap;
    color: #cbd5e1;
    font-family: Arial, sans-serif;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-box {
    width: 380px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 25px;
}

.login-box h1 {
    margin-top: 0;
}

.login-box p {
    color: #94a3b8;
}

.small-link {
    display: inline-block;
    margin-top: 15px;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .grid-two,
    .stats {
        grid-template-columns: 1fr;
    }
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.actions form {
    margin: 0;
}

.danger-button {
    background: #dc2626;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    font-weight: bold;
}

.danger-button:hover {
    background: #b91c1c;
}

.locked-page {
    background: radial-gradient(circle at top, #1f2937, #020617);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.actions form {
    margin: 0;
}

.danger-button {
    background: #dc2626;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    font-weight: bold;
}

.danger-button:hover {
    background: #b91c1c;
}

.locked-page {
    background: radial-gradient(circle at top, #1f2937, #020617);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.actions form {
    margin: 0;
}

.danger-button {
    background: #dc2626;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    font-weight: bold;
}

.danger-button:hover {
    background: #b91c1c;
}

.locked-page {
    background: radial-gradient(circle at top, #1f2937, #020617);
}

.recorder-card {
    border-color: #334155;
}

.recorder-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.recorder-time {
    background: #020617;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 11px 14px;
    font-weight: bold;
    color: #e5e7eb;
}

.recorder-wave {
    width: 100%;
    height: 120px;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 12px;
    display: block;
    margin-bottom: 10px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.media-open-button {
    border: 0;
    cursor: pointer;
    font-weight: bold;
}

.media-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.88);
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
}

.media-modal[hidden] {
    display: none;
}

.media-player {
    width: min(980px, 96vw);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.media-player-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 14px;
}

.media-player-header strong {
    word-break: break-word;
}

.media-close {
    background: #1e293b;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    padding: 0;
}

.media-close:hover {
    background: #334155;
}

.media-screen {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 14px;
    overflow: hidden;
    min-height: 180px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}

.media-screen video {
    width: 100%;
    max-height: 65vh;
    background: #000;
}

.media-screen audio {
    display: none !important;
}

.media-screen canvas {
    width: 100%;
    height: 160px;
    display: block;
}

.media-controls {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 12px;
    align-items: center;
}

.media-controls button {
    white-space: nowrap;
}

.media-time {
    color: #cbd5e1;
    font-weight: bold;
    min-width: 105px;
    text-align: center;
}

.media-controls input[type="range"] {
    width: 100%;
    accent-color: #60a5fa;
    cursor: pointer;
}

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

    .media-time {
        text-align: left;
    }
}

.rename-form {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.rename-form input {
    min-width: 120px;
    flex: 1;
    padding: 9px;
}

.rename-form button {
    padding: 9px 10px;
    white-space: nowrap;
}

.actions {
    flex-wrap: wrap;
}
