:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --text: #102233;
  --muted: #60758b;
  --line: #d9e3ee;
  --brand: #1663c7;
  --brand-strong: #0d4f9f;
  --ok: #0e8e55;
  --shadow: 0 16px 35px rgba(16, 34, 51, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: radial-gradient(circle at top left, #dbeafe 0%, transparent 46%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(65px);
}

.bg-shape-a {
  width: 280px;
  height: 280px;
  right: -60px;
  top: 8%;
  background: #bae6fd;
}

.bg-shape-b {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: 8%;
  background: #bfdbfe;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.topbar-left {
  width: 1px;
}

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

.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 11px;
  text-decoration: none;
  font-weight: 700;
}

.lang-link.is-active {
  border-color: var(--brand);
  background: #eaf3ff;
}

.flag {
  font-size: 15px;
  line-height: 1;
}

.container {
  width: min(1120px, 94%);
  margin: 20px auto 40px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.auth-card {
  width: min(540px, 96%);
  margin: 8vh auto;
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.success-msg {
  color: var(--ok);
  font-weight: 700;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.folder-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.btn,
.link-btn,
button,
select {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn:hover,
.link-btn:hover,
button:hover,
.lang-link:hover {
  transform: translateY(-1px);
  transition: 0.16s ease;
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
}

.file-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-icon {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

.file-icon-pdf { background: #dc2626; }
.file-icon-doc { background: #2563eb; }
.file-icon-xls { background: #15803d; }
.file-icon-ppt { background: #ea580c; }
.file-icon-txt { background: #4b5563; }
.file-icon-zip { background: #7c3aed; }
.file-icon-file { background: #0f766e; }
.file-icon-link { background: #0ea5e9; }

.subfolder-list {
  display: grid;
  gap: 10px;
}

.subfolder-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.subfolder-title {
  margin: 0;
}

.subfolder-link {
  display: inline-block;
  color: var(--brand-strong);
  text-decoration: none;
  font-weight: 800;
}

.subfolder-link:hover {
  text-decoration: underline;
}

.rename-form {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rename-form input {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
}

form input[type="text"],
form input[type="url"] {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
}

.actions-row {
  display: flex;
  gap: 8px;
}

.users-table-wrap {
  overflow-x: auto;
}

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

.users-table th,
.users-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 6px;
  vertical-align: top;
}

.groups-grid {
  display: grid;
  gap: 6px;
}

.dropzone {
  margin: 14px 0;
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  background: #f8fbff;
}

.dropzone.dragover {
  border-color: var(--brand);
  background: #eaf3ff;
}

#fileInput {
  margin-top: 8px;
}

#selectedFiles {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

@media (max-width: 820px) {
  .file-item {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: flex-start;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lang-link {
    font-size: 13px;
  }
}
