/* Palette reprise des rapports (tons parchemin et ambre) */
:root {
  --bg: #f6f1e8; --surface: #fffdf8; --surface-2: #f1e9da; --ink: #2a2118; --muted: #7a6a58;
  --line: #e3d7c3; --accent: #b8741a; --accent-soft: #f5e3c6; --ok: #2f7d52;
  --warn: #b3261e; --warn-soft: #fbe4e1; --on-accent: #fff;
  --shadow: 0 1px 2px rgba(60,40,10,.06), 0 4px 16px rgba(60,40,10,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120e; --surface: #211b15; --surface-2: #2a231b; --ink: #f3eadb; --muted: #b0a08a;
    --line: #3a3026; --accent: #f0a940; --accent-soft: #3b2d19; --ok: #6fcf97;
    --warn: #ff8a80; --warn-soft: #3a1d1a; --on-accent: #16120e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
main { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 1.5rem; margin: 0 0 18px; letter-spacing: -.02em; }

.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.head h1 { margin: 0; }
.others { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.others a { font-size: .88rem; padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink); }
.others a:hover { border-color: var(--accent); text-decoration: none; }
.crumbs { color: var(--muted); word-break: break-word; }
.crumbs span { color: var(--ink); font-weight: 600; }
.tools { display: flex; gap: 8px; margin-bottom: 14px; }
.tools input, .tools select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.tools input { flex: 1; min-width: 0; }
.hint, .empty { color: var(--muted); }

.files { list-style: none; margin: 0; padding: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.files li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; align-items: center;
  padding: 11px 14px; border-top: 1px solid var(--line);
}
.files li:first-child { border-top: 0; }
.files .name { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.files .name small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }
.files .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.files .dl { font-size: 1.1rem; padding: 0 6px; }
.ico { display: inline-block; width: 11px; height: 14px; margin-right: 9px; vertical-align: -1px;
  border: 1.6px solid var(--muted); border-radius: 2px; }
.files .versions { color: var(--accent); font-weight: 600; }
.files li.current .name { font-weight: 600; }
.ico.old { border-style: dashed; }
.ico.dir { width: 15px; height: 11px; border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 600px) {
  .files li { grid-template-columns: 1fr auto; }
  .files .meta { grid-column: 1; grid-row: 2; white-space: normal; }
  .files .dl { grid-row: 1 / span 2; grid-column: 2; }
}

/* En-tête : logo et menu du compte */
.brand { display: inline-flex; align-items: center; border-radius: 9px; }
.brand img { display: block; border-radius: 9px; transition: transform .15s; }
.brand:hover img { transform: scale(1.06); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand:hover { text-decoration: none; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; border-radius: 50%; }
.account summary::-webkit-details-marker { display: none; }
.account summary img, .account .initial {
  display: block; width: 34px; height: 34px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); transition: box-shadow .15s;
}
.account summary:hover img, .account summary:hover .initial,
.account[open] summary img, .account[open] .initial { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.account summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.account .initial { display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 10; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column;
}
.account-who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-who strong { display: block; }
.account-who span { color: var(--muted); font-size: .85rem; word-break: break-all; }
.account-menu a { padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.account-menu a:hover { background: var(--accent-soft); text-decoration: none; }

/* Administration */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.panel h3 { font-size: .95rem; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; margin-bottom: 0; }
.emails { list-style: none; padding: 0; margin: 14px 0; border-top: 1px solid var(--line); }
.emails li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.emails .email { font-weight: 500; overflow-wrap: anywhere; }
.emails form { margin-left: auto; }
.badge { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.badge.strong { color: var(--accent); border-color: var(--accent); }
.panel button { font: inherit; cursor: pointer; border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.panel button.link { background: none; border: 0; padding: 4px 6px; color: var(--accent); font-weight: 500; }
.panel button.danger { color: var(--warn); }
.panel input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; min-width: 0; }
.add, .secret { display: flex; gap: 8px; margin: 12px 0; }
.add input, .secret input { flex: 1; }
.secret input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.secret button { background: var(--surface); color: var(--ink); border-color: var(--line); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  overflow-x: auto; font-size: .82rem; margin: 0; }
pre code { background: none; padding: 0; }
.stats { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--accent); background: var(--accent-soft); }
.flash.error { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
@media (max-width: 600px) { .secret { flex-wrap: wrap; } .secret input { flex-basis: 100%; } }

/* Page de connexion */
.login { max-width: 380px; margin: 12vh auto 0; text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid transparent;
  border-radius: 14px; padding: 32px 24px; box-shadow: var(--shadow); }
.login h1 { margin-bottom: 8px; }
.login-logo { display: block; margin: 0 auto 14px; border-radius: 16px; }
.login .muted { color: var(--muted); }
.login .error { color: var(--warn); }
.google { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 600; }
.google:hover { border-color: var(--accent); text-decoration: none; }
.google svg { width: 18px; height: 18px; }
