:root {
  --ink: #14212b;
  --muted: #5b6b78;
  --line: #d5dde4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #f7fafc;
  --accent: #0f766e;
  --accent-deep: #0b5f59;
  --accent-soft: #d9f3ef;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --shadow: 0 18px 40px rgba(20, 33, 43, 0.08);
  --radius: 16px;
  --font-display: "Sora", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 8% -10%, #c8ebe4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dce8f4 0%, transparent 50%),
    linear-gradient(180deg, #eef3f6 0%, #e7eef2 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 33, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 43, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 20%, #000 35%, transparent 80%);
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #14b8a6, #0f766e 55%, #0b4f4a);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}

.user-name {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px 24px;
  border: 1px solid rgba(213, 221, 228, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.28s ease;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.up {
  background: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16);
}

.status-dot.down {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.status-text {
  font-size: 0.88rem;
  color: var(--muted);
}

.main {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid rgba(213, 221, 228, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 22px;
}

.panel-head h1,
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel-head.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.upload-form {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 132px;
  padding: 24px;
  border: 1.5px dashed #9bb3bf;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(240, 248, 246, 0.85));
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dropzone strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.dropzone span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #5fafa6;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.btn {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--surface-solid);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-deep);
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost {
  height: 34px;
  padding: 0 10px;
  font-size: 0.86rem;
  background: transparent;
}

.btn.danger {
  color: var(--danger);
  border-color: #f0c2bd;
  background: var(--danger-soft);
}

.selected-files,
.progress-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.selected-files li,
.progress-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.progress-list li.ok {
  border-color: #9ed7cf;
  background: #edf9f6;
}

.progress-list li.err {
  border-color: #f0c2bd;
  background: var(--danger-soft);
}

.filter-row {
  display: flex;
  gap: 8px;
  min-width: min(420px, 100%);
}

.filter-row input {
  flex: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.file-table th,
.file-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.file-table th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(238, 244, 247, 0.9);
}

.file-table td.key {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  word-break: break-all;
}

.file-table td.size,
.file-table td.time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.file-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 14px !important;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 36px rgba(20, 33, 43, 0.25);
  font-size: 0.92rem;
  animation: rise 0.22s ease;
}

.toast.error {
  background: #7f1d1d;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .panel-head.row {
    flex-direction: column;
    align-items: stretch;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
  }
}
