:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --muted: #667085;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff4ff;
  --success: #12b76a;
  --danger: #d92d20;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 16px 40px -18px rgba(16, 24, 40, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.brand b { color: var(--brand); font-weight: 700; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand);
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 20px; height: 20px; color: #fff; }

.badge {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 24px 56px;
}

.hero { text-align: center; padding: 28px 0 30px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  font-weight: 800;
}
.grad { color: var(--brand); }
.hero p { color: var(--muted); font-size: 1rem; margin: 0; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Upload */
.upload-card { padding: 12px; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
  background: var(--surface);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone.drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dz-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border: 1px solid #dbe6ff;
}
.dz-icon svg { width: 24px; height: 24px; color: var(--brand); }

.dropzone h3 { margin: 0 0 7px; font-size: 1.05rem; letter-spacing: -0.01em; }
.dropzone p { margin: 0 0 9px; color: var(--muted); font-size: 0.92rem; }
.dropzone .link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dropzone small { color: #98a2b3; font-size: 0.79rem; }

/* Progress */
.upload-progress { padding: 16px 6px 6px; }
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 9px;
}
.progress-track {
  height: 8px;
  background: #eef1f5;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.2s ease;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  flex: none;
}
.stat-icon svg { width: 19px; height: 19px; color: var(--brand); }
.stat > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 0.73rem; color: var(--muted); }
.stat strong { font-size: 1.22rem; letter-spacing: -0.02em; }

/* Files */
.files-card { padding: 20px; }
.files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.files-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.02em; }
.files-tools { display: flex; gap: 8px; align-items: center; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.search svg { width: 16px; height: 16px; color: #98a2b3; flex: none; }
.search input {
  width: 160px;
  font-family: inherit;
  font-size: 0.87rem;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}
.search input::placeholder { color: #98a2b3; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.btn svg { width: 16px; height: 16px; }
.btn.ghost { padding: 9px; }

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

.btn.danger {
  color: var(--danger);
  border-color: #f2d5d2;
  background: #fff;
}
.btn.danger:hover { background: #fef3f2; border-color: #f4b8b2; }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 9px; }

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.16s, background 0.16s;
}
.file-item:hover { border-color: var(--border-strong); background: var(--surface-2); }

.file-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: none;
}

.file-info { min-width: 0; }
.file-name {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.75rem;
  color: var(--muted);
}
.file-actions { display: flex; gap: 8px; align-items: center; }

/* Empty */
.empty { text-align: center; padding: 50px 18px; color: var(--muted); }
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.empty-icon svg { width: 24px; height: 24px; color: #98a2b3; }
.empty h3 { margin: 0 0 5px; color: var(--text); font-size: 1rem; }
.empty p { margin: 0; font-size: 0.85rem; }

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.85rem;
  max-width: 340px;
  animation: toastIn 0.2s ease both;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.out { animation: toastOut 0.2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.footer { text-align: center; padding: 28px 20px 42px; color: #98a2b3; font-size: 0.8rem; }

/* Responsive */
@media (max-width: 720px) {
  .header { padding: 18px; }
  .container { padding: 6px 16px 40px; }
  .stats { grid-template-columns: 1fr; }
  .files-card { padding: 16px; }
  .file-item { grid-template-columns: auto 1fr; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .search input { width: 110px; }
  .files-head { align-items: stretch; }
  .files-tools { justify-content: space-between; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
