:root {
  --bg: #0f1220;
  --card: #1a1f35;
  --card2: #232a45;
  --text: #e8ebf5;
  --muted: #9aa3c0;
  --primary: #5b8cff;
  --primary-d: #3f6fe0;
  --danger: #ff5b6e;
  --ok: #34d399;
  --border: #2c3454;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, #1b2342 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 32px 18px 80px; }

h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 14px; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.login-card { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.login-card h1 { margin-bottom: 6px; }
.login-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }

input[type=password], input[type=number], input[type=text], select {
  width: 100%;
  padding: 11px 13px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.95rem;
}
input:focus, select:focus { outline: 2px solid var(--primary); border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--card2);
  color: var(--text);
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary-d); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.inline { display: inline; margin: 0; }

.drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 110px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  padding: 16px;
  transition: border-color .15s, background .15s;
}
.drop.dragover { border-color: var(--primary); background: rgba(91,140,255,.08); color: var(--text); }
.drop input[type=file] { display: none; }

.row { display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.row label { flex: 1; min-width: 180px; font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

.progress {
  height: 10px; background: var(--card2); border-radius: 99px;
  overflow: hidden; margin-top: 16px;
}
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .15s; }

.hidden { display: none; }

.alert { padding: 10px 12px; border-radius: 9px; margin: 12px 0; font-size: 0.9rem; }
.alert.error { background: rgba(255,91,110,.12); border: 1px solid var(--danger); color: #ffb4bd; }
.alert.ok { background: rgba(52,211,153,.12); border: 1px solid var(--ok); color: #a7f3d0; }

#upload-msg { margin-top: 12px; }
#upload-msg .link-box {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
  background: var(--card2); padding: 8px 10px; border-radius: 9px;
}
#upload-msg .link-box code {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.82rem; color: var(--primary);
}

table.files { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.files th, table.files td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border);
}
table.files th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
table.files td.name { word-break: break-all; max-width: 240px; }
table.files td.actions { white-space: nowrap; text-align: right; }
table.files td.actions .btn { margin-left: 6px; }

@media (max-width: 560px) {
  table.files thead { display: none; }
  table.files, table.files tbody, table.files tr, table.files td { display: block; width: 100%; }
  table.files tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 6px; }
  table.files td { border: none; padding: 4px 8px; }
  table.files td.actions { text-align: left; }
  table.files td.actions .btn { margin: 6px 6px 0 0; }
}
