:root {
  --bg: #121016;
  --bg-2: #1b1822;
  --bg-3: #241f2d;
  --line: #3a3346;
  --text: #f3eef8;
  --muted: #a89bb3;
  --gold: #e3b34f;
  --gold-dim: #8a6a2a;
  --danger: #e07a7a;
  --ok: #8dcf9a;
  --lock: #6d6578;
  --radius: 14px;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.brand {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 700;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #000;
}

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(400px, 92vw);
}

.login-header {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  width: 100%;
}

.logo-fk {
  display: block;
  width: 240px;
  height: auto;
  background: #000;
}

.brand-logo { display: flex; align-items: center; line-height: 0; }
.logo-fk-bar {
  display: block;
  height: 52px;
  width: auto;
  background: #000;
  border-radius: 8px;
}

.login-card {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 20px;
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: -1.2rem;
}

.login-card h1 { margin: 0.2rem 0 0.6rem; font-size: 1.7rem; font-weight: 600; }
.login-card label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.login-card input, .search input, .upload-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.login-card input:focus, .search input:focus {
  outline: 2px solid var(--gold-dim);
  border-color: var(--gold);
}
.login-card button, .btn {
  background: var(--gold);
  color: #1a1408;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
.login-card button:hover, .btn:hover { filter: brightness(1.08); }
.alert { background: #3a2020; color: var(--danger); padding: 0.65rem 0.8rem; border-radius: 8px; margin: 0; }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.search input { width: 100%; max-width: 420px; }
.who { display: flex; align-items: center; gap: 0.85rem; font-size: 0.92rem; }
.downloads {
  background: #2c2414;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
}
.downloads.empty { color: var(--danger); border-color: #7a3a3a; background: #2a1616; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 62px); }
aside {
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  padding: 1rem 0.7rem;
}
aside h2 {
  margin: 0 0.6rem 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
#folder-list { display: flex; flex-direction: column; gap: 0.25rem; }
.folder-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  color: var(--text);
}
.folder-btn:hover { background: var(--bg-3); }
.folder-btn.active { background: var(--bg-3); outline: 1px solid var(--gold-dim); }
.folder-btn.locked { color: var(--muted); cursor: default; }
.folder-btn.locked:hover { background: transparent; }
.folder-btn .lock {
  color: var(--lock);
  display: inline-flex;
  align-items: center;
}
.folder-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 1.4rem 1.6rem 2.4rem; }
.hint, .empty, .locked-msg { color: var(--muted); }
.locked-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  color: var(--muted);
}
.locked-panel svg { color: var(--lock); }
.locked-panel h1 { margin: 0; color: var(--text); font-size: 1.35rem; }

.folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.folder-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-2);
  margin-bottom: 1.1rem;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--gold); background: #2c2414; color: var(--text); }
.dropzone input { display: none; }
.upload-btn { cursor: pointer; display: inline-block; margin-top: 0.55rem; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th, .file-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
}
.file-table th { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; }
.file-table td.actions { text-align: right; }
.link-btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.link-btn:hover { background: #2c2414; }
.link-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.toast {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.toast.error { border-color: #7a3a3a; color: var(--danger); }

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; }
  .layout { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  #folder-list { flex-direction: row; overflow-x: auto; }
  .folder-btn { white-space: nowrap; }
}
