:root {
    --bg: #1c1505;
    --bg-card: #231a04;
    --bg-hover: #2a2008;
    --border: #3a2c08;
    --border-light: #5a4a1a;
    --gold: #D4A843;
    --gold-bright: #F0C85A;
    --gold-dim: #8B6914;
    --green: #4CAF50;
    --red: #e53935;
    --text: #c9a84c;
    --text-muted: #6b5a2a;
    --text-bright: #f0d080;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ── NAVBAR ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background: #161004;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user {
    color: var(--text-muted);
    font-size: 13px;
}

/* ── CONTAINER ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--gold);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--gold-dim);
    color: var(--gold-bright);
}

.btn-primary {
    background: #2a1f06;
    border-color: var(--gold-dim);
    color: var(--gold-bright);
}

.btn-primary:hover {
    background: #3a2c08;
    border-color: var(--gold);
}

.btn-danger { border-color: #5a1a1a; color: #e57373; }
.btn-danger:hover { background: #2a0f0f; border-color: var(--red); color: var(--red); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── CARD ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--gold-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--border-light); }

/* ── TOOLBAR ── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-right {
    margin-left: auto;
}

.toolbar-right input {
    padding: 7px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    width: 220px;
    outline: none;
}

.toolbar-right input:focus {
    border-color: var(--gold-dim);
}

/* ── FILE TABLE ── */
.file-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

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

.file-table thead tr {
    background: #161004;
    border-bottom: 1px solid var(--border);
}

.file-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.file-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-table .file-row:last-child td { border-bottom: none; }

.file-table .file-row:hover td {
    background: var(--bg-hover);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.file-name a { color: var(--text); }
.file-name a:hover { color: var(--gold); }

.file-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 3px 6px;
    border-radius: 3px;
    color: var(--text-muted);
    transition: all 0.15s;
    text-decoration: none;
}

.action-btn:hover { background: var(--bg-hover); color: var(--gold); }
.action-btn.danger:hover { background: #2a0f0f; color: var(--red); }

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 13px;
}

/* ── MODAL ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large { max-width: 800px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { color: var(--gold); font-size: 15px; }

.modal-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.modal-header button:hover { color: var(--text); }
.modal-body { padding: 20px; }

/* ── DROP ZONE ── */
.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: 6px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.drop-zone.dragover {
    border-color: var(--gold);
    background: var(--bg-hover);
    color: var(--gold);
}

.drop-zone p { margin-bottom: 8px; }

/* ── UPLOAD PROGRESS ── */
.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

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

.upload-bar-wrap {
    flex: 1;
    background: var(--bg);
    border-radius: 10px;
    height: 4px;
    overflow: hidden;
}

.upload-bar {
    height: 100%;
    background: var(--gold);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

.upload-status { font-size: 11px; color: var(--text-muted); }
.upload-status.done { color: var(--green); }
.upload-status.error { color: var(--red); }

/* ── FORM ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--gold-dim);
}

/* ── ALERTS ── */
.alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success {
    background: #0d2a0d;
    border: 1px solid #2d5a2d;
    color: #81c784;
}

.alert-error {
    background: #2a0d0d;
    border: 1px solid #5a2d2d;
    color: #e57373;
}

/* ── LOGIN PAGE ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-wrap {
    width: 100%;
    padding: 16px;
}

.login-box {
    max-width: 380px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--gold-dim);
    border-radius: 8px;
    padding: 36px 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    justify-content: center;
}

.logo-x { font-size: 22px; color: var(--gold); }

.logo-text {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 3px;
}

.login-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 28px;
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 24px;
    letter-spacing: 1px;
}

/* ── BADGE ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

.badge-admin {
    background: #2a1f06;
    border-color: var(--gold-dim);
    color: var(--gold);
}

/* ── DISK INFO ── */
.disk-info {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.disk-info strong { color: var(--gold); }

.progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    border-radius: 10px;
    transition: width 0.5s;
}

/* ── SHARE ── */
.share-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-url-box input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--gold-dim);
    font-size: 12px;
    font-family: monospace;
    outline: none;
}

.share-link-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-token {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

.share-expiry {
    font-size: 11px;
    color: var(--gold-dim);
}

/* ── PREVIEW ── */
#previewBody img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

#previewBody video,
#previewBody audio {
    width: 100%;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .file-table th:nth-child(2),
    .file-table td:nth-child(2),
    .file-table th:nth-child(3),
    .file-table td:nth-child(3) { display: none; }
    .toolbar-right input { width: 140px; }
    .navbar { padding: 0 12px; }
    .container { padding: 16px 12px; }
}
