:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2129;
  --muted: #6b7280;
  --border: #e3e5e8;
  --accent: #2f6fed;
  --accent-text: #ffffff;
  --danger: #d33a3a;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --card: #1e2128;
    --text: #e6e8eb;
    --muted: #9097a3;
    --border: #2d313a;
    --accent: #5b8cff;
    --danger: #ff6b6b;
  }
}

* { box-sizing: border-box; }

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

main { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
[hidden] { display: none !important; }

h1 { font-size: 1.4rem; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* Connexion */
.login { max-width: 360px; margin-top: 15vh; }
.login h1 { margin-bottom: 16px; }
.login form { display: flex; flex-direction: column; gap: 10px; }

input[type=password], input[type=search] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .button {
  display: inline-block;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: default; }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

button.small { padding: 4px 10px; font-size: .85rem; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); }

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

/* Zone d'envoi */
.dropzone {
  text-align: center;
  border: 2px dashed var(--border);
  transition: border-color .15s, background .15s;
}
.dropzone p { margin: 0 0 10px; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }

.progress {
  height: 6px;
  margin-top: 14px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .1s; }

.msg { margin: 10px 0 0 !important; font-size: .9rem; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .9rem; }

/* Liste */
.list-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.list-head input { max-width: 280px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

td.name { word-break: break-all; }
td.name a { color: var(--text); text-decoration: none; }
td.name a:hover { color: var(--accent); text-decoration: underline; }
.num { text-align: right; white-space: nowrap; }
td.date { white-space: nowrap; color: var(--muted); }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * + * { margin-left: 6px; }

.muted { color: var(--muted); }
.center { text-align: center; }

@media (max-width: 600px) {
  th:nth-child(3), td.date { display: none; }
}

