:root {
  color-scheme: dark;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: #070b12;
  color: #eef4ff;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, #14354f, #070b12 36rem); }
a { color: inherit; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); background: rgba(7,11,18,.88); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.brand-logo { width: 2.5rem; height: 2.5rem; object-fit: contain; }
.login-brand-logo { width: 5rem; height: 5rem; object-fit: contain; filter: drop-shadow(0 .8rem 1.6rem rgba(25,197,255,.18)); }
.login-logo { margin-bottom: 1rem; }
nav { display: flex; align-items: center; gap: .75rem; }
nav a, nav button, .button { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: white; background: rgba(255,255,255,.04); padding: .65rem 1rem; text-decoration: none; font-weight: 700; cursor: pointer; }
.shell { width: min(1220px, calc(100vw - 2rem)); margin: 2rem auto; }
.panel { border: 1px solid rgba(255,255,255,.12); border-radius: 1rem; background: rgba(255,255,255,.055); padding: 1.5rem; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.28); }
.panel + .panel { margin-top: 1rem; }
.narrow { max-width: 520px; margin: 7vh auto; }
h1, h2 { margin: 0 0 .75rem; }
p { color: #b7c5d8; line-height: 1.65; }
.stack { display: grid; gap: 1rem; margin-top: 1.25rem; }
label { display: grid; gap: .45rem; color: #cbd7e8; font-size: .95rem; }
input, select, textarea { width: 100%; min-height: 2.75rem; border-radius: .7rem; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.34); color: white; padding: 0 .85rem; font: inherit; }
textarea { padding: .85rem; resize: vertical; }
input[type=file] { padding: .65rem; height: auto; }
button, .primary, .secondary { border: 0; border-radius: 999px; min-height: 2.75rem; padding: 0 1rem; font-weight: 800; cursor: pointer; }
.primary { background: #38bdf8; color: #07111d; }
.secondary { background: rgba(125, 211, 252, .14); color: #e0f2fe; border: 1px solid rgba(125, 211, 252, .24); }
.ghost { background: rgba(255,255,255,.07); color: white; min-height: 2.75rem; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.check-row { display: flex; align-items: center; gap: .65rem; color: #d8e6f6; }
.check-row input { width: 1.1rem; height: 1.1rem; min-height: auto; accent-color: #38bdf8; }
.hint { margin: 0; min-height: 1.5rem; color: #facc15; }
.muted, .muted-link { color: #9db0c6; }
.muted-link { display: inline-block; margin-top: 1rem; }
.split { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.path { margin: 0; color: #8ad8ff; font-family: Consolas, monospace; }
.inline-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.filters { max-width: 260px; margin-top: 1rem; }
.upload { margin: 1.25rem 0; display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: .75rem; align-items: end; border: 1px solid rgba(255,255,255,.1); border-radius: 1rem; padding: 1rem; background: rgba(0,0,0,.18); }
.upload-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.table { display: grid; gap: .5rem; margin-top: 1rem; }
.empty { padding: 1rem; border: 1px dashed rgba(255,255,255,.16); border-radius: .75rem; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; margin-top: 1rem; }
.file-card { display: grid; gap: .35rem; align-content: start; min-height: 154px; padding: 1rem; border: 1px solid rgba(255,255,255,.1); border-radius: .9rem; background: rgba(0,0,0,.2); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.file-card:hover { transform: translateY(-2px); border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.08); }
.file-card.parent { border-style: dashed; }
.file-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .9rem; background: rgba(255,255,255,.08); font-size: 1.8rem; overflow: hidden; }
.file-icon img { width: 2.25rem; height: 2.25rem; object-fit: contain; }
.file-name { color: #f7fbff; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.file-meta, .file-date { color: #94a9c0; font-size: .82rem; line-height: 1.35; }
.user-form { display: grid; gap: 1rem; margin: 1rem 0 1.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.permission-builder { display: grid; grid-template-columns: minmax(240px, 1fr) 160px auto; gap: .75rem; align-items: end; padding: 1rem; border: 1px solid rgba(255,255,255,.1); border-radius: 1rem; background: rgba(0,0,0,.18); }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid rgba(255,255,255,.08); border-radius: .75rem; background: rgba(0,0,0,.18); }
.user-row span { display: block; margin-top: .35rem; color: #97a8bd; font-size: .9rem; }

@media (max-width: 860px) {
  .topbar, nav, .upload, .inline-form, .upload-actions { align-items: stretch; flex-direction: column; }
  .topbar { position: static; }
  .upload, .form-grid, .permission-builder, .user-row { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .brand span:last-child { display: none; }
}
