:root {
  --ink: #1d1d1b; --muted: #74726c; --line: #e3e1db; --bg: #f6f5f1; --card: #fff;
  --accent: #1d1d1b; --ok: #2f7a4a; --warn: #a86b12; --danger: #a8322a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 24px; font-weight: 600; margin: 28px 0 18px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }

header.top { background: var(--ink); color: #fff; }
header.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; font-size: 13px; }
header nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header nav a { text-decoration: none; padding: 6px 10px; border-radius: 4px; opacity: .75; font-size: 14px; }
header nav a:hover, header nav a.on { opacity: 1; background: rgba(255,255,255,.12); }
.me { font-size: 13px; opacity: .8; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-bottom: 22px; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.stat b { display: block; font-size: 28px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
td.num, th.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cfccc4; border-radius: 5px; font: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input[type=file] { font: inherit; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.btn, button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 5px; padding: 9px 16px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn.light, button.light { background: #fff; color: var(--ink); border: 1px solid #cfccc4; }
.btn.danger, button.danger { background: var(--danger); }
.btn.sm, button.sm { padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
.mt { margin-top: 16px; }

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eee; white-space: nowrap; }
.badge.ok { background: #e2f1e7; color: var(--ok); }
.badge.warn { background: #f8ecd8; color: var(--warn); }
.badge.danger { background: #f6e0de; color: var(--danger); }
.badge.muted { background: #ecebe7; color: var(--muted); }

.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #e2f1e7; color: #1f5534; }
.flash.error { background: #f6e0de; color: #7a1f19; }
.flash.info { background: #e6edf6; color: #1f3b5c; }

.copybox { display: flex; gap: 8px; }
.copybox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: #f4f4f2; padding: 6px 12px; border-radius: 4px; display: inline-block; letter-spacing: .05em; }
.doclist { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; }
.doclist .check { margin: 6px 0; }

/* Pages publiques */
main.public { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; }
.narrow-card { width: 100%; max-width: 640px; }
.brand-public { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 18px; }
.files { list-style: none; padding: 0; margin: 16px 0 0; }
.files li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.files li .meta { color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .me { width: 100%; padding-bottom: 8px; }
  th, td { padding: 8px 6px; }
}
.warn-text { color: var(--warn); }
.align-end { align-items: end; }
input.w-date { width: 150px; }
