:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #687385;
  --line: #dfe5ee;
  --blue: #2563eb;
  --blue-dark: #1746a2;
  --green: #0f9f6e;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 18px 45px rgba(40, 49, 70, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.upload-button,
.hero button {
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.upload-button {
  height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.upload-button span {
  font-size: 25px;
  line-height: 1;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}

nav a.active,
nav a:hover {
  color: var(--blue-dark);
  background: #edf4ff;
}

.storage {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.storage-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.storage-row strong {
  color: var(--ink);
}

.meter {
  height: 7px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: #e8edf5;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.25s ease;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 28px 40px;
}

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

.search {
  height: 48px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search span {
  font-size: 22px;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.view-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.view-switch button,
#refreshFiles {
  width: 40px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.view-switch button.active,
.view-switch button:hover,
#refreshFiles:hover {
  color: var(--ink);
  background: #eef2f8;
}

.hero {
  min-height: 178px;
  margin: 26px 0 22px;
  padding: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(110deg, rgba(12, 33, 70, 0.94), rgba(33, 91, 117, 0.76)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero p {
  margin: 0 0 10px;
  font-weight: 700;
  opacity: 0.86;
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.03;
}

.hero button {
  min-height: 44px;
  padding: 0 18px;
  background: var(--green);
  white-space: nowrap;
}

.dropzone {
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed #c8d4e5;
  border-radius: 8px;
  background: white;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.dragging {
  border-color: var(--blue);
  background: #f0f6ff;
}

.drop-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.dropzone h2,
.empty h2,
.content-head h2 {
  margin: 14px 0 6px;
  font-size: 20px;
}

.dropzone p,
.empty p,
.content-head p {
  margin: 0;
  color: var(--muted);
}

.progress {
  width: min(360px, 100%);
  height: 8px;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 999px;
  background: #e8edf5;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.2s ease;
}

.content-head {
  margin: 26px 0 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.files.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.files.list {
  display: grid;
  gap: 8px;
}

.file-card {
  min-width: 0;
  position: relative;
  padding: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.list .file-card {
  grid-template-columns: 44px 1fr auto;
  align-items: center;
}

.file-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--amber);
  font-weight: 900;
}

.file-icon.image {
  background: var(--green);
}

.file-icon.pdf {
  background: var(--red);
}

.file-icon.text {
  background: var(--blue);
}

.file-icon::after {
  content: attr(data-label);
}

.file-info {
  min-width: 0;
}

.file-info h3 {
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.file-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.grid .file-actions {
  justify-content: flex-end;
}

.file-actions a,
.file-actions button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.file-actions a:hover {
  color: var(--blue);
  border-color: #bdd1ff;
}

.file-actions button:hover {
  color: var(--red);
  border-color: #fecaca;
}

.empty {
  padding: 52px 20px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.warning {
  border-color: #facc15;
  background: #fffbea;
}

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav,
  .storage {
    display: none;
  }

  .shell {
    padding: 18px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
