:root {
    --bg: #0d1117;
    --bg2: #161b22;
    --bg3: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --text2: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Login */
#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 360px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 24px;
    font-size: 24px;
    color: var(--accent);
}

.login-box input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-box button:hover { background: var(--accent-hover); }

.error { color: var(--red); margin-top: 8px; font-size: 13px; }

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h1 { font-size: 18px; color: var(--accent); white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 12px; }
#user-info { color: var(--text2); font-size: 13px; }

.btn-sm {
    padding: 5px 12px;
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Breadcrumb */
#breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 14px; flex-wrap: wrap; }
#breadcrumb a { color: var(--accent); text-decoration: none; }
#breadcrumb a:hover { text-decoration: underline; }
#breadcrumb .sep { color: var(--text2); }

/* Toolbar */
#toolbar {
    padding: 12px 24px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

#toolbar button {
    padding: 7px 16px;
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}
#toolbar button:hover { border-color: var(--accent); color: var(--accent); }

/* File table */
#drop-zone { position: relative; }

#drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(88, 166, 255, 0.1);
    border: 2px dashed var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    z-index: 10;
    border-radius: var(--radius);
}

#file-table {
    width: 100%;
    border-collapse: collapse;
}

#file-table th {
    text-align: left;
    padding: 10px 24px;
    color: var(--text2);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

#file-table td {
    padding: 10px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

#file-table tbody tr:hover { background: var(--bg2); }

.col-name { width: 55%; }
.col-size { width: 15%; }
.col-date { width: 20%; }
.col-actions { width: 10%; text-align: right; }

.file-icon { margin-right: 8px; }
.entry-link {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.entry-link:hover { color: var(--accent); }
.entry-dir .entry-link { color: var(--accent); font-weight: 500; }

.btn-del {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius);
}
.btn-del:hover { color: var(--red); background: rgba(248, 81, 73, 0.1); }

/* Upload progress */
#upload-progress {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#upload-bar {
    flex: 1;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}

#upload-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

#upload-text { font-size: 13px; color: var(--text2); white-space: nowrap; }

/* Admin modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    z-index: 101;
    width: 480px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 { margin-bottom: 20px; font-size: 18px; }

#add-user-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

#add-user-form input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

#add-user-form button {
    padding: 8px 16px;
    background: var(--green);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}

#user-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
#user-table th {
    text-align: left;
    padding: 8px;
    color: var(--text2);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
#user-table td {
    padding: 8px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.btn-close {
    padding: 8px 20px;
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 200;
    transition: opacity 0.3s;
}

#toast.error { border-color: var(--red); color: var(--red); }
#toast.success { border-color: var(--green); color: var(--green); }

/* Responsive */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 12px; padding: 12px 16px; }
    #file-table th, #file-table td { padding: 8px 12px; }
    .col-date { display: none; }
    .modal { width: 95%; padding: 20px; }
    #add-user-form { flex-direction: column; }
}
