:root {
  --bg: #0e1220; --panel: #161c30; --line: #252d49; --text: #e8ebf5; --muted: #8d97b8;
  --accent: #6c8cff; --accent-2: #9d7bff; --danger: #ff6b7a; --ok: #3ddc97;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 9px; padding: 9px 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
button.ghost, button.tab { background: transparent; color: var(--muted); font-weight: 500; }
button.ghost:hover, button.tab:hover { color: var(--text); background: var(--line); }
button.tab.active { color: var(--text); background: var(--line); }
button.small { padding: 5px 11px; font-size: 13px; }
input { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; min-width: 0; }
input:focus { border-color: var(--accent); }
.muted { color: var(--muted); }
.center { text-align: center; padding: 40px 0; }
.error { color: var(--danger); margin: 0; }

#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 12px; text-align: center; }
.card h1 { margin: 0; font-size: 24px; }
.card p { margin: 0; }
.logo { font-size: 44px; line-height: 1; }

#app { max-width: 980px; margin: 0 auto; padding: 0 16px 48px; }
header { display: flex; align-items: center; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; margin-right: 6px; }
nav { display: flex; gap: 4px; }
#search { flex: 1 1 160px; }

.usage { margin: 4px 0 18px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
#bar-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
#usage-text { font-size: 13px; margin-top: 6px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-bottom: 10px; }
.crumbs button { background: transparent; color: var(--muted); padding: 4px 8px; font-weight: 500; }
.crumbs button:hover { color: var(--text); background: var(--line); }
.crumbs button:last-child { color: var(--text); font-weight: 600; }
.crumbs span { color: var(--muted); }

.rows { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rows:empty { display: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.row:first-child { border-top: 0; }
a.row:hover, .row.folder:hover { background: #1c2440; cursor: pointer; }
.row .icon { flex: none; width: 22px; text-align: center; }
.row .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row .meta { flex: none; color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.row .date { width: 130px; }
@media (max-width: 600px) { .row .date { display: none; } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; box-shadow: 0 8px 30px #0008; max-width: calc(100vw - 32px); }
