/* Q.Re Paris – portail partenaires. Aucune ressource externe (compatible Chine). */
:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6f6a64;
  --line: #e6e1da;
  --soft: #faf8f5;
  --accent: #1a1a1a;
  --gold: #a88a5b;
  --ok: #3d7a4f;
  --warn: #a8661b;
  --danger: #a33a32;
  --radius: 2px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- en-tête ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 600; letter-spacing: 4px; font-size: 18px; text-decoration: none; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 13px; letter-spacing: .5px; border-left: 1px solid var(--line); padding-left: 20px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.who { color: var(--muted); text-align: right; line-height: 1.3; }
.who strong { color: var(--ink); font-weight: 500; display: block; }

.lang-switch { display: inline-flex; border: 1px solid var(--line); }
.lang-switch button { background: none; border: 0; padding: 4px 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.lang-switch button.on { background: var(--ink); color: #fff; }

.tabs { max-width: 1180px; margin: 0 auto; padding: 0 24px; display: flex; gap: 28px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 0; cursor: pointer; color: var(--muted); font-size: 14px; letter-spacing: .3px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- mise en page ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 28px; margin-bottom: 28px; }
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.card .lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 10px 16px; padding: 14px 16px; }
  .brand-sub { display: none; }
  main { padding: 20px 12px 48px; }
  .card { padding: 20px 16px; }
  .tabs { padding: 0 16px; gap: 20px; overflow-x: auto; }
}

/* ---------- formulaires ---------- */
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
textarea { resize: vertical; min-height: 72px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 10px 20px; cursor: pointer; font-size: 14px; letter-spacing: .3px; text-decoration: none; white-space: nowrap; }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); opacity: 1; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--danger); border-color: #e7cbc8; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 7px 12px; cursor: pointer; user-select: none; font-size: 14px; background: var(--surface); }
.check input { margin: 0; accent-color: var(--ink); }
.check.on { border-color: var(--ink); background: var(--soft); }
.check.locked { opacity: .7; cursor: default; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.inline-check input { accent-color: var(--ink); }

/* ---------- zone de dépôt ---------- */
.dropzone { border: 1px dashed #c9c1b6; background: var(--soft); padding: 32px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); background: #f3efe9; }
.dropzone .dz-title { font-weight: 500; }
.dropzone .dz-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.filelist { list-style: none; margin: 12px 0 0; padding: 0; }
.filelist li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.filelist li .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { width: 140px; height: 4px; background: var(--line); flex-shrink: 0; }
.progress > div { height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.fstatus { width: 90px; text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.fstatus.ok { color: var(--ok); }
.fstatus.err { color: var(--danger); }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .doc-title { font-weight: 500; }
td .doc-file { color: var(--muted); font-size: 12px; word-break: break-all; }
td .doc-desc { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-line; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; font-size: 14px; }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border: 1px solid var(--line); margin: 0 4px 4px 0; white-space: nowrap; background: var(--surface); }
.badge.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.gold { border-color: var(--gold); color: var(--gold); }
.badge.ok { color: var(--ok); border-color: #bcd6c3; }
.badge.warn { color: var(--warn); border-color: #e6cfb2; }
.badge.off { color: var(--danger); border-color: #e7cbc8; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters > * { width: auto; min-width: 160px; }
.filters input[type=search] { min-width: 220px; }

/* ---------- partenaires ---------- */
.partner-card { border: 1px solid var(--line); padding: 20px; margin-bottom: 16px; background: var(--surface); }
.partner-card.inactive { opacity: .6; }
.partner-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.partner-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.partner-head .actions { margin-left: auto; }
.add-user { display: grid; grid-template-columns: 1fr 1.4fr 110px auto; gap: 8px; margin-top: 12px; align-items: center; }
@media (max-width: 760px) { .add-user { grid-template-columns: 1fr; } }

.linkbox { margin-top: 12px; background: var(--soft); border: 1px solid var(--line); padding: 12px; font-size: 13px; }
.linkbox code { display: block; word-break: break-all; margin: 6px 0 10px; font-size: 12px; }

/* ---------- connexion ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); padding: 40px 36px 32px; }
.auth-card .brand { display: block; text-align: center; font-size: 22px; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; letter-spacing: .5px; }
.auth-card form { display: grid; gap: 16px; }
.auth-foot { margin-top: 20px; text-align: center; }
.auth-lang { margin-top: 20px; display: flex; justify-content: center; }
.msg { font-size: 13px; padding: 10px 12px; border: 1px solid; }
.msg.err { color: var(--danger); border-color: #e7cbc8; background: #fbf3f2; }
.msg.ok { color: var(--ok); border-color: #bcd6c3; background: #f2f8f4; }
.legal { margin-top: 24px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- modale & notifications ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(26, 26, 26, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); width: 100%; max-width: 560px; padding: 28px; border: 1px solid var(--line); }
.modal h3 { margin: 0 0 18px; font-size: 17px; font-weight: 600; }
.modal .grid { margin-bottom: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; font-size: 14px; z-index: 60; max-width: 90vw; }
.toast.err { background: var(--danger); }

/* ---------- WeChat ---------- */
.wechat-banner { background: #fff8e6; border-bottom: 1px solid #ecd9a8; padding: 10px 48px 10px 16px; font-size: 13px; line-height: 1.5; position: relative; }
.wechat-banner .arrow { position: absolute; right: 14px; top: 4px; font-size: 26px; line-height: 1; }
.wechat-banner .close { position: absolute; right: 12px; bottom: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }
.wechat-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .82); color: #fff; z-index: 100; padding: 24px; text-align: right; }
.wechat-overlay .arrow { font-size: 64px; line-height: 1; margin-right: 6px; }
.wechat-overlay p { text-align: left; font-size: 17px; line-height: 1.7; max-width: 420px; margin: 16px 0 0 auto; }
.wechat-overlay .dots { display: inline-block; background: #fff; color: #000; padding: 0 8px; font-weight: 700; letter-spacing: 2px; }
.wechat-overlay button { margin-top: 28px; background: none; border: 1px solid #fff; color: #fff; padding: 8px 18px; cursor: pointer; }

footer.site { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 32px; }
.search-input { max-width: 300px; }
@media (max-width: 760px) { .search-input { max-width: none; } }
.modal-foot [data-del] { margin-right: auto; }
.filters input, .filters select { width: auto; }
.lang-switch button { white-space: nowrap; }
.linkbtn { white-space: nowrap; }

/* ---------- mobile : tableaux en cartes, en-tête compact ---------- */
@media (max-width: 760px) {
  .topbar-right { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 10px 14px; }
  .who { text-align: left; flex: 1 1 100%; }
  .filters > * { width: 100%; min-width: 0; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 14px 0; }
  tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 2px 0; }
  td:empty { display: none; }
  td.actions, td .actions { justify-content: flex-start; margin-top: 8px; }
  td .btn.small { padding: 8px 16px; }
  td.empty { padding: 24px 0; }
}
