:root {
  --bg: #0f1216;
  --surface: #181d24;
  --surface-2: #1f2630;
  --border: #2a323d;
  --text: #e6eaf0;
  --muted: #8b96a5;
  --primary: #4a8cff;
  --primary-hover: #5e9bff;
  --danger: #e2574c;
  --danger-hover: #ee6a60;
  --ok: #45c486;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.back-btn {
  text-decoration: none;
  white-space: nowrap;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.muted { color: var(--muted); }
.error {
  color: var(--danger);
  background: rgba(226, 87, 76, 0.1);
  border: 1px solid rgba(226, 87, 76, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #28313d; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 5px 10px; font-size: 0.8rem; }
.btn.danger { color: var(--danger); border-color: rgba(226, 87, 76, 0.4); }
.btn.danger:hover { background: rgba(226, 87, 76, 0.15); color: var(--danger-hover); }

/* --- Login --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.login {
  max-width: 380px;
  margin: 60px auto 0;
}
.login h2 { margin: 0 0 6px; }
.login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.login input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 1rem;
}
.login input:focus {
  outline: none;
  border-color: var(--primary);
}

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 20px;
}
.dropzone:hover { border-color: #3a4655; background: var(--surface-2); }
.dropzone:focus { outline: none; border-color: var(--primary); }
.dropzone.dragging {
  border-color: var(--primary);
  background: rgba(74, 140, 255, 0.08);
}
.dz-icon { font-size: 2.4rem; color: var(--primary); margin-bottom: 8px; }
.dz-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 4px; }
.dropzone p { margin: 2px 0; }

/* --- Upload-Status --- */
.upload-status {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.upload-status.ok { border-color: rgba(69, 196, 134, 0.4); color: var(--ok); }
.upload-status.err { border-color: rgba(226, 87, 76, 0.4); color: var(--danger); }

/* --- Liste --- */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.list-head h2 { margin: 0; font-size: 1.1rem; }

table.files {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.files th,
table.files td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.files thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
}
table.files tbody tr:last-child td { border-bottom: none; }
table.files tbody tr:hover { background: var(--surface-2); }
table.files td.name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.num { text-align: right; white-space: nowrap; }
td.num { color: var(--muted); }
.actions { white-space: nowrap; }
.actions .btn { margin-left: 6px; }
.actions .btn:first-child { margin-left: 0; }

/* --- Responsiv --- */
@media (max-width: 600px) {
  .container { padding: 16px 12px 48px; }
  .dropzone { padding: 32px 16px; }
  table.files thead { display: none; }
  table.files,
  table.files tbody,
  table.files tr,
  table.files td { display: block; width: 100%; }
  table.files tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  table.files td {
    border: none;
    padding: 4px 14px;
  }
  table.files td.name { max-width: none; white-space: normal; }
  .num { text-align: left; }
  .actions { padding-top: 8px; }
  .actions .btn:first-child { margin-left: 0; }
}
