:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --text: #17191d;
  --muted: #707680;
  --line: #e6e8ec;
  --line-strong: #d9dde3;
  --primary: #17191d;
  --danger: #b42318;
  --shadow: 0 16px 50px rgba(20, 25, 35, 0.07);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }

.page {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 80px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  color: #8a9099;
}
h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -.045em;
}
.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.header-actions { display: flex; gap: 10px; flex: 0 0 auto; }

.button {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 10px 15px;
  font-weight: 700;
  font-size: 13px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 20px rgba(20, 22, 28, .12);
}
.button.secondary { background: transparent; color: #454a52; }
.button.secondary:hover { background: var(--surface); }

.upload-panel {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.upload-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 10px;
}
.text-button { border: 0; background: transparent; color: var(--muted); padding: 3px 0; font-size: 12px; }
.queue { display: grid; gap: 9px; }
.queue-item { padding-top: 5px; }
.queue-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.queue-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 650; }
.queue-status { color: var(--muted); white-space: nowrap; }
.progress { height: 4px; margin-top: 8px; border-radius: 99px; background: #eceef2; overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; background: #24272c; border-radius: inherit; transition: width .15s linear; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.search-box {
  position: relative;
  width: min(330px, 100%);
}
.search-box span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa0a8;
  font-size: 19px;
}
.search-box input {
  width: 100%;
  padding: 10px 13px 10px 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.search-box input:focus { border-color: #aeb4bd; box-shadow: 0 0 0 3px rgba(20,25,35,.04); }
.summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.summary strong { color: #444951; font-weight: 750; }
.dot { color: #b9bdc4; }

.files-surface {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.file-list { width: 100%; }
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 165px auto;
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--surface-soft); }
.file-main { min-width: 0; display: flex; align-items: center; gap: 13px; }
.file-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f1f2f4;
  color: #5c626b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 720; }
.file-kind { margin-top: 4px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size, .file-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.file-actions { display: flex; gap: 7px; }
.action-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: #50555d;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 700;
}
.action-btn:hover { border-color: var(--line-strong); background: #f8f9fa; }
.action-btn.danger { color: var(--danger); }

.state { padding: 72px 22px; text-align: center; color: var(--muted); }
.state h2 { margin: 12px 0 6px; color: var(--text); font-size: 20px; }
.state p { margin: 0 0 18px; font-size: 13px; }
.empty-icon { width: 46px; height: 46px; margin: 0 auto; display: grid; place-items: center; border-radius: 14px; background: #f1f2f4; font-size: 21px; color: #6c727b; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 11px 14px;
  border-radius: 10px;
  background: #202328;
  color: white;
  font-size: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8e1f17; }

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 1080px); padding-top: 30px; }
  .topbar { align-items: stretch; flex-direction: column; margin-bottom: 25px; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 11px; }
  .search-box { width: 100%; }
  .summary { padding-left: 2px; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .file-size, .file-date { display: none; }
  .action-btn { padding: 7px 8px; }
}

@media (max-width: 430px) {
  .file-actions { flex-direction: column; }
  .file-icon { width: 38px; height: 38px; }
  .file-name { font-size: 13px; }
}
