:root {
  --bg: #0b1020;
  --panel: rgba(17, 24, 39, 0.86);
  --panel-strong: #111827;
  --line: rgba(255,255,255,0.08);
  --text: #e5eefc;
  --muted: #9db0cf;
  --accent: #62c4ff;
  --accent-2: #7c5cff;
  --danger: #ff6a6a;
  --success: #36d399;
  --shadow: 0 18px 50px rgba(0,0,0,0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top left, #172554 0%, var(--bg) 45%, #030712 100%); color: var(--text); }
a { color: inherit; text-decoration: none; }
body { padding: 24px; }
.shell { display: grid; grid-template-columns: 290px 1fr; gap: 22px; min-height: calc(100vh - 48px); }
.sidebar, .panel, .dropzone, .login-card, .topbar { background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.sidebar { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.brand-pill { display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(98,196,255,0.25); color: #d9f1ff; background: rgba(98,196,255,0.08); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.brand-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px var(--accent); }
.sidebar h1, .login-card h1 { margin: 18px 0 8px; font-size: 30px; line-height: 1.05; }
.sidebar p, .login-card p, .hint-box p, .muted, .eyebrow { color: var(--muted); }
.nav-links a, button, .button-like, .inline-action { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text); font-weight: 600; cursor: pointer; transition: 180ms ease; display: inline-flex; align-items: center; justify-content: center; }
.nav-links a.active, button:hover, .button-like:hover, .inline-action:hover { transform: translateY(-1px); border-color: rgba(98,196,255,0.35); background: rgba(98,196,255,0.08); }
.ghost { background: rgba(255,255,255,0.02); }
.danger:hover { border-color: rgba(255,106,106,0.35); background: rgba(255,106,106,0.08); }
.secondary { border-color: rgba(124,92,255,0.25); background: rgba(124,92,255,0.08); }
.hint-box { border: 1px dashed rgba(255,255,255,0.14); border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.02); }
.main { display: flex; flex-direction: column; gap: 18px; }
.topbar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 15px; }
.breadcrumbs span { color: rgba(255,255,255,0.3); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.selection-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sort-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sort-inline select { border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text); padding: 10px 12px; }
.check-inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.check-inline input, .select-item { width: 18px; height: 18px; accent-color: var(--accent); }
.select-item { padding: 0; }
.dropzone { border-style: dashed; padding: 30px; text-align: center; color: var(--muted); background: linear-gradient(135deg, rgba(98,196,255,0.07), rgba(124,92,255,0.08)); }
.dropzone.dragging { border-color: rgba(98,196,255,0.6); color: var(--text); transform: scale(1.003); }
.panel { overflow: hidden; }
.upload-card { width: min(560px, 100%); }
.upload-body { padding: 22px; display: grid; gap: 14px; }
.progress-track { width: 100%; height: 14px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 180ms ease; }
table { width: 100%; border-collapse: collapse; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-action { padding: 10px 12px; }
.name-cell { min-width: 320px; }
.name-wrap { display: flex; align-items: center; gap: 12px; }
.thumb { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,0.05); border: 1px solid var(--line); flex: 0 0 auto; }
.thumb-button { padding: 0; }
.thumb-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-folder, .thumb-generic { color: var(--muted); font-size: 14px; font-weight: 700; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
.file-link { font-weight: 600; }
.file-link.dir::before { content: "📁 "; }
.error-banner, .error { color: #ffd8d8; background: rgba(255,106,106,0.1); border: 1px solid rgba(255,106,106,0.2); border-radius: 14px; padding: 12px 14px; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 32px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-weight: 600; }
input { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text); padding: 14px 15px; }
input:focus { outline: 2px solid rgba(98,196,255,0.35); border-color: transparent; }
.preview-modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 50; }
.preview-modal.hidden { display: none; }
.preview-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.76); }
.preview-card { position: relative; z-index: 1; width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: hidden; background: var(--panel-strong); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr; }
.preview-header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-body { min-height: 300px; max-height: calc(100vh - 180px); overflow: auto; display: grid; place-items: center; background: rgba(255,255,255,0.02); }
.preview-media, .preview-frame { width: 100%; height: min(78vh, 760px); border: 0; background: #0b1020; }
.preview-audio { width: min(640px, calc(100% - 32px)); }
.text-frame { background: white; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { gap: 24px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .selection-bar { flex-direction: column; align-items: flex-start; }
  .name-cell { min-width: 220px; }
  .thumb { width: 42px; height: 42px; }
}
