/* Famille Wellington — charte « mafia classique élégante » */
:root {
  /* palette tirée du blason : marbre émeraude, or, rouge de la couronne, parchemin des rubans */
  --bg: #0b0f0d;
  --bg2: #0f1512;
  --panel: #131b17;
  --panel2: #1a241f;
  --line: #24302a;
  --line2: #324139;
  --emerald: #1b3a2d;
  --emerald-hi: #2f6a4f;
  --gold: #d4a94f;
  --gold-hi: #f0d488;
  --gold-dim: #94702f;
  --crimson: #a5222c;
  --ivory: #f1e6cc;
  --text: #ddd4bd;
  --muted: #949a8c;
  --good: #4f9a72;
  --warn: #d19a3a;
  --bad: #c0434d;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 6px;
  --side: 256px;
  --gold-grad: linear-gradient(180deg, #f3dc97 0%, #d4a94f 55%, #a67b2c 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
body { min-height: 100vh; background:
  radial-gradient(1100px 620px at 85% -15%, rgba(47,106,79,.16), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(212,169,79,.06), transparent 60%),
  var(--bg); background-attachment: fixed; }
body.modal-open { overflow: hidden; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { font-family: var(--serif); color: var(--ivory); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.ico { flex: none; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); font-family: var(--serif); font-size: 20px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { background: radial-gradient(700px 500px at 50% 30%, rgba(47,106,79,.22), transparent 70%); }
.login-card { width: 100%; max-width: 420px; text-align: center; padding: 30px 36px 30px; background: linear-gradient(180deg, rgba(27,58,45,.55), rgba(15,21,18,.92) 45%); border: 1px solid rgba(212,169,79,.35); border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(240,212,136,.08); }
.crest-large { width: 290px; max-width: 100%; height: auto; display: block; margin: 0 auto 10px; filter: drop-shadow(0 12px 28px rgba(0,0,0,.55)); }
.login-card h1 { font-size: 38px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card .motto { font-family: var(--serif); font-style: italic; color: var(--gold); margin: 2px 0 24px; font-size: 17px; letter-spacing: .08em; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card .form-error { text-align: center; }
.rule { display: flex; align-items: center; gap: 12px; color: var(--gold); margin: 22px 0 14px; font-size: 16px; }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.rule::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

/* ---------------------------------------------------------------- structure */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: linear-gradient(180deg, #13261d 0%, #0d1612 38%, #0a0f0c 100%); border-right: 1px solid rgba(212,169,79,.22); padding: 18px 14px 16px; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 0 6px 16px; margin-bottom: 12px; position: relative; color: inherit; }
.brand::after { content: '⚜'; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); color: var(--gold-dim); font-size: 13px; line-height: 1; }
.brand::before { content: ''; position: absolute; bottom: -3px; left: 8px; right: 8px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim) 38%, transparent 44%, transparent 56%, var(--gold-dim) 62%, transparent); }
.crest-small { width: 150px; height: auto; display: block; margin-bottom: 6px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.brand b { display: block; font-family: var(--serif); font-size: 23px; line-height: 1.05; font-weight: 700; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { color: var(--gold-dim); font-family: var(--serif); font-style: italic; font-size: 13.5px; letter-spacing: .06em; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r); color: var(--muted); font-weight: 500; border-left: 2px solid transparent; }
.nav a:hover { color: var(--ivory); background: rgba(255,255,255,.025); }
.nav a.on { color: var(--gold-hi); background: linear-gradient(90deg, rgba(47,106,79,.38), rgba(47,106,79,.08)); border-left-color: var(--gold); }
.nav .sep { height: 1px; background: linear-gradient(90deg, transparent, var(--line2), transparent); margin: 10px 8px; }
.side-foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(212,169,79,.18); display: grid; gap: 10px; }
.side-foot label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.side-foot select { width: 100%; }
.content { min-width: 0; }
.main { min-width: 0; padding: 30px 36px 60px; max-width: 1360px; }
.topbar { display: none; }
.topbar-icon { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; padding-bottom: 16px; flex-wrap: wrap; position: relative; }
.page-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--gold-dim), rgba(148,112,47,.25) 40%, transparent); }
.page-head .sub { color: var(--muted); margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid rgba(207,159,69,.4); background: rgba(207,159,69,.08); color: #e7c98a; border-radius: var(--r); margin-bottom: 18px; }

/* ---------------------------------------------------------------- composants */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; min-width: 0; }
.card > h2, .card > h3, .card-head h2, .card-head h3 { font-size: 20px; margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.card-head h2, .card-head h3 { margin-bottom: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: grid; gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--emerald-hi); }
.kpi.hero { background: linear-gradient(160deg, rgba(27,58,45,.55), var(--bg2) 70%); border-color: rgba(212,169,79,.22); }
.kpi.hero::before { background: var(--gold-grad); }
.kpi > span { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; font-family: var(--serif); font-size: 30px; color: var(--ivory); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line2); background: transparent; color: var(--text); font: 500 13.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--gold-dim); color: var(--ivory); }
.btn-gold { background: var(--gold-grad); border-color: #b8892f; color: #1b1407; font-weight: 600; text-shadow: 0 1px 0 rgba(255,240,200,.35); }
.btn-gold:hover { background: linear-gradient(180deg, #f8e6ad, #e0b85c 55%, #b5893a); border-color: var(--gold-hi); color: #1b1407; }
.btn-danger { border-color: rgba(192,67,77,.6); color: #ea9aa1; }
.btn-danger:hover { background: rgba(165,34,44,.18); border-color: var(--bad); color: #f4bcc1; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--ivory); border-color: var(--line2); }
.icon-btn.danger:hover { color: #e39aa2; border-color: rgba(181,82,93,.5); }
.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }

input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line2); color: var(--ivory); border-radius: var(--r); padding: 8px 10px; font: 14px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(201,165,92,.12); }
input[type=color] { padding: 2px; height: 36px; }
input[type=checkbox] { width: auto; accent-color: var(--gold); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
::placeholder { color: #6d6556; }
textarea { resize: vertical; }
.input-wrap { position: relative; }
.input-wrap.is-money input { padding-right: 26px; }
.input-wrap .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.field > label i { color: var(--gold); font-style: normal; }
.field small { color: var(--muted); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; padding-top: 18px; }
.form-section { font-size: 17px; color: var(--gold); margin: 8px 0 -2px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-preview:not(:empty) { margin-top: 14px; padding: 12px 14px; background: var(--bg2); border: 1px dashed var(--line2); border-radius: var(--r); }
.form-error { color: #e39aa2; margin: 12px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.confirm-text { font-size: 15px; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-opt { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line2); border-radius: 99px; cursor: pointer; font-size: 13px; }
.tag-opt:has(input:checked) { border-color: var(--gold-dim); background: rgba(201,165,92,.1); color: var(--gold-hi); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.chip-empty { --c: #7d7566; }
.chip-free { --c: #a59c8a; font-weight: 500; }
.chip-free::before { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid; }
.badge-good { color: #8fcaa6; border-color: rgba(79,154,114,.5); background: rgba(47,106,79,.18); }
.badge-warn { color: #e3bd72; border-color: rgba(207,159,69,.45); background: rgba(207,159,69,.1); }
.badge-bad { color: #ec9ca3; border-color: rgba(192,67,77,.55); background: rgba(165,34,44,.14); }
.badge-muted { color: var(--muted); border-color: var(--line2); background: transparent; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--ivory); }
.tab.on { color: var(--gold-hi); border-bottom-color: var(--gold); }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--panel2); color: var(--muted); font-size: 11.5px; text-align: center; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 320px; }
.toolbar .search input { padding-left: 34px; }
.toolbar .search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select { width: auto; min-width: 150px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips button { cursor: pointer; font-family: var(--sans); }
.filter-chips button.off { opacity: .45; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #b9a578; padding: 11px 12px; border-bottom: 1px solid rgba(212,169,79,.25); background: linear-gradient(180deg, #16211b, #111915); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--gold); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.018); }
.tbl tbody tr[data-open] { cursor: pointer; }
.tbl tfoot td { font-weight: 600; color: var(--ivory); background: var(--bg2); border-bottom: 0; border-top: 1px solid var(--line2); }
.tbl .strong { color: var(--ivory); font-weight: 500; }
.tbl .nowrap, .tbl td:first-child .strong { white-space: nowrap; }
.tbl tr.cancelled td { opacity: .5; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }

.empty { padding: 30px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 8px; }
.empty p { margin-bottom: 10px; }

.chart { width: 100%; height: auto; display: block; }
.chart .c-axis { stroke: var(--line2); }
.chart .c-val { fill: var(--text); font-size: 12px; font-family: var(--sans); }
.chart .c-lbl { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-l { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.hbar-fill { display: block; height: 100%; background: linear-gradient(90deg, #8a6a2c, var(--gold), var(--gold-hi)); border-radius: 99px; }
.hbar-v { color: var(--ivory); font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.gauge { height: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.gauge > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-hi)); }

.list { display: grid; }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { min-width: 0; flex: 1; }
.list-item .t { color: var(--ivory); }
.list-item .s { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- base clients */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.org-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; color: var(--text); transition: border-color .15s, transform .15s; }
.org-card:hover { border-color: var(--gold-dim); color: var(--text); transform: translateY(-1px); }
.org-card h3 { font-size: 22px; margin-bottom: 6px; }
.org-card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.org-card .sigle { font-family: var(--serif); color: var(--gold-dim); font-size: 16px; margin-left: 6px; }
.org-head { display: flex; gap: 18px; align-items: center; }
.org-mono.has-img { overflow: hidden; background: #0c110e; }
.org-mono img { width: 100%; height: 100%; object-fit: cover; display: block; }
.org-mono.sm { width: 28px; height: 28px; font-size: 12px; }
.org-mono.xl { width: 140px; height: 140px; font-size: 54px; }
.org-cell { display: inline-flex; align-items: center; gap: 10px; }
.org-logo-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.org-logo-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.org-logo-edit { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #1a1408; border: 2px solid var(--bg, #0b0f0d); opacity: .9; transition: opacity .15s, transform .15s; }
.org-logo-btn:hover .org-logo-edit { opacity: 1; transform: scale(1.08); }
.logo-edit { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.logo-drop { position: relative; border-radius: 50%; cursor: pointer; outline: none; }
.logo-drop-hint { position: absolute; inset: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(0,0,0,.6); color: var(--gold-hi); font-size: 13px; opacity: 0; transition: opacity .15s; }
.logo-drop:hover .logo-drop-hint, .logo-drop:focus-visible .logo-drop-hint, .logo-drop.over .logo-drop-hint { opacity: 1; }
.org-mono { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--c, var(--gold)); border: 1px solid color-mix(in srgb, var(--c, var(--gold)) 50%, transparent); background: color-mix(in srgb, var(--c, var(--gold)) 10%, transparent); flex: none; }

.kv { display: grid; grid-template-columns: 170px 1fr; border-top: 1px solid var(--line); }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv .k { color: var(--muted); font-size: 12.5px; padding-right: 12px; }
.kv .v { white-space: pre-wrap; word-break: break-word; }
.editable { cursor: text; border-radius: 4px; padding: 2px 6px; margin: -2px -6px; transition: background .15s; position: relative; display: block; }
.editable:hover { background: rgba(201,165,92,.07); }
.editable:hover::after { content: '✎'; position: absolute; right: 6px; top: 2px; color: var(--gold-dim); font-size: 12px; }
.editable.placeholder { color: #6d6556; font-style: italic; }
.inline-editor { display: grid; gap: 6px; }
.inline-editor .row { display: flex; gap: 6px; justify-content: flex-end; }

.journal { display: grid; gap: 0; }
.journal-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.journal-item .when { color: var(--gold-dim); font-family: var(--serif); font-size: 16px; }
.journal-item .who { color: var(--muted); font-size: 12px; }
.journal-item .txt { white-space: pre-wrap; }
.journal-item img { max-width: 260px; border-radius: 6px; border: 1px solid var(--line2); margin-top: 6px; display: block; }

/* ---------------------------------------------------------------- organigramme */
.org-tree { display: grid; gap: 22px; }
.tier { display: grid; gap: 10px; }
.tier-label { font-family: var(--serif); color: var(--gold); font-size: 19px; display: flex; align-items: center; gap: 12px; }
.tier-label::before { content: '⚜'; color: var(--gold-dim); font-size: 14px; }
.tier-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.tier-row { display: flex; flex-wrap: wrap; gap: 12px; }
.member { width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: border-color .15s; }
.member:hover { border-color: var(--gold-dim); }
.member.away { opacity: .6; }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #2a5440, #13281e); border: 1px solid var(--gold-dim); color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 18px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member b { display: block; color: var(--ivory); font-weight: 500; line-height: 1.25; }
.member small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- devis imprimable */
.quote { background: #f4eee1; color: #1d1912; padding: 40px 44px; border-radius: 4px; font-family: var(--serif); }
.quote h2 { color: #1d1912; font-size: 30px; }
.quote .q-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #8c7444; padding-bottom: 16px; margin-bottom: 18px; gap: 16px; }
.quote .q-crest { width: 120px; height: auto; }
.quote table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13.5px; margin: 14px 0; }
.quote th, .quote td { padding: 8px 6px; border-bottom: 1px solid #d7ccb4; text-align: left; }
.quote th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #6b5a39; }
.quote .total { font-size: 22px; text-align: right; margin-top: 10px; }
.quote .q-foot { font-family: var(--sans); font-size: 12.5px; color: #5b5040; margin-top: 18px; }

/* ---------------------------------------------------------------- modale, toasts */
.modal-wrap { position: fixed; inset: 0; background: rgba(5,4,3,.72); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 6vh 16px 24px; overflow-y: auto; z-index: 50; animation: fade .15s ease-out; }
.modal { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 24px; }
.modal-body { padding: 18px 20px 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 80; }
.toast { padding: 10px 16px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--good); color: var(--ivory); box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .3s, transform .3s; }
.toast-error { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(6px); }

.lines-editor { display: grid; gap: 8px; }
.line-row { display: grid; grid-template-columns: 110px 1.4fr 90px 80px 110px 30px; gap: 6px; align-items: center; }
.line-row.head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ech-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }

.diff { font-size: 12.5px; color: var(--muted); }
.diff b { color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .topbar-icon { display: inline-block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(14,13,11,.95); z-index: 30; }
  .topbar b { font-family: var(--serif); font-size: 20px; color: var(--gold-hi); display: inline-flex; align-items: center; gap: 8px; }
  .topbar-icon { width: 26px; height: 26px; border-radius: 5px; }
  .main { padding: 20px 16px 50px; }
  h1 { font-size: 28px; }
  .g2, .g3, .g4, .form .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { border-bottom: 0; padding-bottom: 0; }
  .journal-item { grid-template-columns: 1fr; gap: 4px; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-row.head { display: none; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line2); padding: 8px 0; }
  .tbl td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .tbl tfoot { display: block; }
}

@media print {
  body { background: #fff; }
  .side, .topbar, .page-head .actions, #toasts, .modal-head, .no-print { display: none !important; }
  .modal-wrap { position: static; background: none; padding: 0; backdrop-filter: none; }
  .modal { box-shadow: none; border: 0; max-width: none; background: #fff; }
  #app { display: none; }
  .quote { border-radius: 0; }
}

/* ---------------------------------------------------------------- catalogue d'armes */
.weapon-section { margin-bottom: 28px; }
.weapon-section .tier-label { margin-bottom: 12px; font-size: 22px; }
.weapon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.weapon-card { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.weapon-cell { position: relative; display: flex; }
.weapon-cell > .weapon-card { flex: 1; min-width: 0; }
.weapon-cell.in-cart > .weapon-card { border-color: var(--gold-dim); }
.weapon-cart { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 4px; background: rgba(8,12,10,.78); border: 1px solid var(--line); border-radius: 999px; padding: 3px; backdrop-filter: blur(4px); }
.cart-btn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.cart-btn:hover, .cart-btn:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.cart-btn.add { background: var(--gold-grad); color: #1a1408; }
.cart-btn.add:hover { filter: brightness(1.1); }
.cart-qty { min-width: 18px; text-align: center; font-weight: 600; color: var(--gold-hi); font-size: 14px; }
.cart-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.cart-chip.full { border-color: var(--gold-dim); }
.cart-chip.full b { color: var(--gold-hi); }
.cart-chip:hover { border-color: var(--gold-dim); }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty input { width: 56px; text-align: center; padding: 4px; }
.cart-total { color: var(--gold-hi); font-size: 16px; }
.weapon-card:hover, .weapon-card:focus-visible { border-color: var(--gold-dim); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.35); outline: none; }
.weapon-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: radial-gradient(120% 90% at 50% 40%, #1f3a2d 0%, #111a15 60%, #0c110e 100%); border-bottom: 1px solid var(--line); overflow: hidden; }
.weapon-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.weapon-sil { width: 62%; height: auto; color: var(--gold-dim); opacity: .35; }
.weapon-img.empty .weapon-add { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--gold-dim); letter-spacing: .04em; opacity: 0; transition: opacity .15s; }
.weapon-card:hover .weapon-add { opacity: 1; }
.weapon-body { display: grid; gap: 3px; padding: 12px 14px 14px; }
.weapon-name { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ivory); line-height: 1.15; }
.weapon-price { font-size: 13.5px; }
.weapon-price b { color: var(--gold-hi); font-weight: 600; font-variant-numeric: tabular-nums; }
.weapon-meta { font-size: 12px; color: var(--muted); }
.weapon-sheet { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.weapon-drop { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; border: 1px dashed var(--line2); background: radial-gradient(120% 90% at 50% 40%, #1f3a2d 0%, #111a15 60%, #0c110e 100%); cursor: pointer; overflow: hidden; outline: none; }
.weapon-drop:focus-visible, .weapon-drop.over { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,169,79,.18); }
.weapon-drop img { width: 100%; height: 100%; object-fit: contain; padding: 14px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); }
.weapon-drop .weapon-sil { width: 55%; }
.weapon-drop-hint { position: absolute; inset: auto 0 0 0; display: grid; justify-items: center; gap: 2px; padding: 12px; background: linear-gradient(transparent, rgba(5,8,6,.85)); color: var(--gold-hi); font-weight: 500; }
.weapon-drop-hint .ico { margin-bottom: 2px; }
.weapon-drop-hint small { color: var(--muted); font-weight: 400; font-size: 11.5px; text-align: center; }
.weapon-drop.has-img .weapon-drop-hint { opacity: 0; transition: opacity .15s; }
.weapon-drop.has-img:hover .weapon-drop-hint, .weapon-drop.has-img.over .weapon-drop-hint { opacity: 1; }
@media (max-width: 820px) {
  .weapon-sheet { grid-template-columns: 1fr; }
  .weapon-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .weapon-name { font-size: 18px; }
  .weapon-img.empty .weapon-add { opacity: 1; }
}

/* ---------------------------------------------------------------- planning */
.today-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.today-strip .kpi small { display: block; margin-top: 2px; line-height: 1.4; }
.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.week-nav b { font-family: var(--serif); font-size: 20px; color: var(--ivory); font-weight: 600; }
.week-nav .icon-btn { font-size: 22px; line-height: 1; border-color: var(--line2); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-height: 260px; display: flex; flex-direction: column; min-width: 0; }
.day.today { border-color: rgba(212,169,79,.55); box-shadow: inset 0 2px 0 var(--gold); }
.day.past { opacity: .62; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--ivory); }
.day.today .day-head span { color: var(--gold-hi); }
.day-head .icon-btn { width: 24px; height: 24px; }
.day-body { display: grid; gap: 6px; padding: 8px; align-content: start; }
.day-empty { color: var(--line2); text-align: center; padding: 10px 0; }
.ev { display: grid; gap: 1px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 6px; border: 1px solid; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); min-width: 0; }
.ev:hover { filter: brightness(1.15); }
.ev-title { font-weight: 600; color: var(--ivory); overflow: hidden; text-overflow: ellipsis; }
.ev-time { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ev-who { color: var(--text); font-size: 11.5px; }
.ev-rdv { background: rgba(212,169,79,.1); border-color: rgba(212,169,79,.45); }
.ev-rdv .ev-time { color: var(--gold-hi); font-weight: 600; }
.ev-dispo { background: rgba(79,154,114,.12); border-color: rgba(79,154,114,.45); }
.ev-absence { background: rgba(165,34,44,.14); border-color: rgba(192,67,77,.5); }
.ev-flag { justify-self: start; margin-top: 2px; font-size: 10.5px; padding: 0 6px; border-radius: 99px; border: 1px solid rgba(114,137,218,.5); color: #aab8ee; background: rgba(88,101,242,.15); }
.ev-flag.warn { border-color: rgba(209,154,58,.5); color: #e6bf72; background: rgba(209,154,58,.12); }
.ev-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dispo-tbl th.today { color: var(--gold-hi); }
.dispo-tbl td.cell { vertical-align: top; min-width: 120px; padding: 6px; }
.dispo-tbl td.cell .ev { margin-bottom: 4px; }
.dispo-tbl td.is-absent { background: rgba(165,34,44,.07); }
.dispo-tbl td.today { background: rgba(212,169,79,.05); }
.cell-add { width: 100%; height: 30px; border: 1px dashed transparent; border-radius: 6px; background: none; color: transparent; cursor: pointer; font-size: 16px; }
.dispo-tbl tr:hover .cell-add { border-color: var(--line2); color: var(--muted); }
.cell-add:hover, .cell-add:focus-visible { border-color: var(--gold-dim) !important; color: var(--gold) !important; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid; margin-left: 8px; }
.lg-rdv { background: rgba(212,169,79,.25); border-color: var(--gold); }
.lg-dispo { background: rgba(79,154,114,.3); border-color: var(--good); }
.lg-absence { background: rgba(165,34,44,.3); border-color: var(--bad); }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .today-strip { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day.past { display: none; }
  .legend { margin-left: 0; }
  .dispo-tbl td.cell { min-width: 0; }
  .cell-add { color: var(--muted); border-color: var(--line2); }
}

/* ---------------------------------------------------------------- organigramme en arbre */
.orgchart { position: relative; display: grid; gap: 56px; padding: 12px 0 30px; }
.org-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.org-lines path { fill: none; stroke: var(--gold-dim); stroke-width: 1.5; opacity: .85; }
.org-level { position: relative; display: grid; justify-items: center; gap: 12px; }
.org-grade { font-family: var(--serif); font-size: 15px; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; background: var(--bg); padding: 0 12px; position: relative; z-index: 1; }
.org-level.top .org-grade { font-size: 17px; color: var(--gold-hi); }
.org-level.top .org-grade::before, .org-level.top .org-grade::after { content: '⚜'; margin: 0 10px; color: var(--gold-dim); }
.org-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 28px; position: relative; z-index: 1; }
.member.lead { width: 260px; padding: 16px; border-color: rgba(212,169,79,.6); background: linear-gradient(160deg, rgba(27,58,45,.65), var(--panel) 70%); box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(240,212,136,.1); }
.member.lead .avatar { width: 56px; height: 56px; font-size: 21px; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,169,79,.15); }
.member.lead b { font-family: var(--serif); font-size: 19px; }
.orgchart .member { position: relative; z-index: 1; }
.org-unassigned { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line2); display: grid; gap: 10px; }
@media (max-width: 820px) { .orgchart { gap: 40px; } .member.lead { width: 100%; max-width: 300px; } .orgchart .member { width: 100%; max-width: 300px; } }

/* ---------------------------------------------------------------- véhicules */
.plate { display: inline-block; padding: 1px 8px; border-radius: 4px; background: linear-gradient(180deg, #f4f1e6, #ddd6c2); color: #1a2a5a; font: 700 12.5px/1.5 'Inter', sans-serif; letter-spacing: .12em; border: 1px solid #b9b19a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); text-transform: uppercase; }
.veh-state { position: absolute; top: 8px; right: 8px; }

/* ---------------------------------------------------------------- récap de soirée */
.recap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.recap-grid h3 { font-size: 19px; margin-bottom: 10px; }
.recap-inc { display: grid; gap: 8px; }
.recap-out textarea { font: 13.5px/1.55 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; min-height: 420px; background: #0d1210; }
@media (max-width: 1100px) { .recap-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- calendrier partagé (façon Teams) */
.cal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.cal-row { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
.cal-gutter { color: var(--muted); font-size: 11px; padding: 6px 6px 0 0; text-align: right; }
.cal-head { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #16211b, #111915); }
.cal-dayhead { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cal-dayhead b { font-family: var(--serif); font-size: 24px; color: var(--ivory); font-weight: 600; letter-spacing: 0; }
.cal-dayhead.today b { color: #17130c; background: var(--gold-grad); border-radius: 99px; min-width: 34px; height: 34px; display: inline-grid; place-items: center; font-size: 20px; }
.cal-dayhead.today { color: var(--gold-hi); }
.cal-allday { border-bottom: 1px solid var(--line2); min-height: 34px; }
.cal-allday .cal-gutter { padding-top: 9px; }
.cal-allcell { border-left: 1px solid var(--line); padding: 4px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
.cal-allcell.today, .cal-col.today { background: rgba(212,169,79,.04); }
.pill { border: 1px solid; border-radius: 99px; padding: 1px 8px; font: 500 11.5px var(--sans); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-absence { background: rgba(165,34,44,.18); border-color: rgba(192,67,77,.55); color: #f0b8bd; }
.cal-scroll { height: 620px; overflow-y: auto; position: relative; }
.cal-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); position: relative; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.cal-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--line) 47px, var(--line) 48px), repeating-linear-gradient(to bottom, transparent 0, transparent 23px, rgba(47,58,51,.35) 23px, rgba(47,58,51,.35) 24px); cursor: cell; }
.cal-col.past { background-color: rgba(0,0,0,.12); }
.cal-ev-wrap { position: absolute; display: flex; }
.cal-ev-wrap .ev { height: 100%; overflow: hidden; align-content: start; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.ev-soiree { background: linear-gradient(160deg, rgba(47,106,79,.4), rgba(27,58,45,.55)); border-color: rgba(212,169,79,.55); }
.ev-soiree .ev-time { color: var(--gold-hi); font-weight: 600; }
.ev-mine { font-size: 11px; font-weight: 600; margin-top: 2px; }
.pbar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); margin: 4px 0 2px; min-width: 60px; }
.pbar i { display: block; height: 100%; }
.pb-present { background: #4fb57f; } .pb-retard { background: #e08a3c; } .pb-incertain { background: #d6b24a; } .pb-absent { background: #c0434d; }
.pcounts { font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums; }
.rep-present { color: #8fe0b1; } .rep-retard { color: #f0b27a; } .rep-incertain { color: #ecd27f; } .rep-absent { color: #f0a0a7; } .rep-attente { color: var(--muted); }
.rep-chip { display: block; width: 100%; text-align: left; border: 1px solid currentColor; border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; background: transparent; font: 600 12px var(--sans); cursor: pointer; }
.rep-chip.rep-attente { border-style: dashed; font-weight: 500; }
.dispo-tbl td.cell-present { background: rgba(79,181,127,.12); }
.dispo-tbl td.cell-retard, .dispo-tbl td.cell-incertain { background: rgba(214,178,74,.1); }
.dispo-tbl td.cell-absent { background: rgba(192,67,77,.12); }
.lg-soiree { background: rgba(47,106,79,.6); border-color: var(--gold); }
.soiree-head { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; }
.soiree-date { font-family: var(--serif); font-size: 22px; color: var(--gold-hi); }
.soiree-prog { margin: 8px 0; padding-left: 18px; }
.soiree-prog li { margin: 3px 0; }
.soiree-discord { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.my-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 8px; padding: 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg2); }
.my-vote > span { margin-right: 6px; }
.vote-btn { border: 1px solid currentColor; background: transparent; border-radius: 99px; padding: 6px 14px; font: 600 13px var(--sans); cursor: pointer; opacity: .75; }
.vote-btn:hover { opacity: 1; }
.vote-btn.on { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent); }
.presence-big .pbar { height: 10px; }
.att-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.att-col { border: 1px solid var(--line); border-radius: 8px; padding: 10px; border-top: 3px solid; min-height: 90px; }
.att-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.att-head b { color: var(--ivory); font-size: 14px; }
.att-name { padding: 3px 0; font-size: 13.5px; }
.att-present { border-top-color: #4fb57f; } .att-retard { border-top-color: #e08a3c; } .att-incertain { border-top-color: #d6b24a; } .att-absent { border-top-color: #c0434d; } .att-attente { border-top-color: var(--line2); }
.today-strip .kpi .pbar { margin-top: 8px; }
.today-strip .kpi .pcounts { display: block; }
@media (max-width: 1100px) { .att-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .cal-row, .cal-grid { grid-template-columns: 40px repeat(7, minmax(54px, 1fr)); }
  .cal { overflow-x: auto; }
  .cal-dayhead { flex-direction: column; gap: 0; padding: 6px; }
  .cal-dayhead b { font-size: 18px; }
  .soiree-head { grid-template-columns: 1fr; }
  .att-grid { grid-template-columns: 1fr 1fr; }
}
.lab-sub { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 17px; color: var(--gold); }
b.purete { color: var(--gold-hi); font-family: var(--serif); font-size: 22px; }

/* ------------------------------------------------------------ carte */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.map-view { position: relative; height: calc(100vh - 230px); min-height: 440px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #1862ad; cursor: grab; touch-action: none; user-select: none; outline: none; }
.map-view:focus-visible { border-color: var(--gold-dim); }
.map-view.dragging { cursor: grabbing; }
.map-view.placing { cursor: crosshair; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.map-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-img { display: block; width: 100%; height: 100%; pointer-events: none; image-rendering: auto; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; background:
  linear-gradient(rgba(212,169,79,.08) 1px, transparent 1px) 0 0 / 128px 128px,
  linear-gradient(90deg, rgba(212,169,79,.08) 1px, transparent 1px) 0 0 / 128px 128px,
  radial-gradient(60% 50% at 50% 55%, #1e3a2c, #0d1a22 70%); }
.map-fallback span { font-family: var(--serif); font-size: 64px; color: rgba(212,169,79,.35); }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; width: 46px; height: 56px; margin: -56px 0 0 -23px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.pin-face { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--c); background: #10160f; overflow: hidden; display: grid; place-items: center; color: var(--c); font: 700 15px var(--serif); transition: transform .15s; }
.pin-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-tail { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 10px solid var(--c); margin-top: -1px; }
.pin:hover .pin-face, .pin:focus-visible .pin-face { transform: scale(1.15); }
.pin.focus .pin-face { animation: pin-pulse 1s ease-in-out 2; }
@keyframes pin-pulse { 50% { transform: scale(1.35); box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 35%, transparent); } }
.map-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; background: rgba(8,12,10,.82); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: rgba(8,12,10,.88); border: 1px solid var(--gold-dim); color: var(--gold-hi); padding: 8px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; }
.map-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-height: calc(100vh - 230px); }
.map-side .search { position: relative; }
.map-side .search input { padding-left: 34px; }
.map-side .search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.map-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; }
.map-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.map-item:hover { border-color: var(--gold-dim); }
.map-item-face { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--c); overflow: hidden; display: grid; place-items: center; flex: none; color: var(--c); font: 700 13px var(--serif); }
.map-item-face img { width: 100%; height: 100%; object-fit: cover; }
.map-item-txt { display: flex; flex-direction: column; min-width: 0; }
.map-item-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-item-txt small { color: var(--muted); }
.lieu-drop { position: relative; height: 170px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--panel); outline: none; }
.lieu-drop.over, .lieu-drop:focus-visible { border-color: var(--gold); }
.lieu-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lieu-drop-hint { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.lieu-drop.has-img .lieu-drop-hint { background: rgba(0,0,0,.65); border-radius: 8px; color: var(--gold-hi); opacity: 0; transition: opacity .15s; }
.lieu-drop.has-img:hover .lieu-drop-hint { opacity: 1; }
.lieu-sheet { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
.lieu-photo { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--c); overflow: hidden; display: grid; place-items: center; background: #10160f; color: var(--c); font: 700 60px var(--serif); }
.lieu-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-view { height: 62vh; min-height: 360px; }
  .map-side { max-height: none; }
  .lieu-sheet { grid-template-columns: 1fr; }
  .lieu-photo { max-width: 260px; }
}

/* ------------------------------------------------------------ choix de période (tableau de bord) */
.period-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-label { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; }
.period-label:hover { border-color: var(--gold-dim); }
.period-label .ico { color: var(--gold); }
.period-label input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.period-label input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--gold-grad); color: #1a1408; font-weight: 600; }

/* ------------------------------------------------------------ stock des laboratoires */
.stock-card { margin-bottom: 20px; }
.stock-card .card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock-card .card-head h3 { margin-right: auto; }
.stock-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stock-tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: rgba(255,255,255,.02); display: flex; flex-direction: column; gap: 4px; }
.stock-tile > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stock-tile b { font-family: var(--serif); font-size: 30px; color: var(--text); }
.stock-tile b em { font: 600 13px var(--sans, inherit); font-style: normal; margin-left: 6px; }
.stock-tile small { color: var(--muted); }
.releves { margin-top: 12px; }
.releves summary { cursor: pointer; color: var(--gold); font-size: 13px; margin-bottom: 8px; }
.section-title { margin: 6px 0 12px; }

/* ------------------------------------------------------------ vitrine des matières premières */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mat-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mat-card.dirty { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.mat-img { width: 100%; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; padding: 0; font: inherit; color: var(--gold-dim); }
.mat-img:hover .weapon-add, .mat-img:focus-visible .weapon-add { opacity: 1; }
.mat-svg { display: block; width: 38%; color: var(--gold-dim); opacity: .8; }
.mat-svg svg { width: 100%; height: auto; display: block; }
.mat-body { display: grid; gap: 6px; padding: 12px 14px 14px; justify-items: start; }
.mat-name { font-family: var(--serif); font-size: 19px; color: var(--ivory); }
.mat-total { font-family: var(--serif); font-size: 28px; color: var(--gold-hi); }
.mat-qty { display: flex; align-items: center; gap: 6px; }
.mat-qty input { width: 100px; height: 40px; text-align: center; font: 600 22px var(--serif); color: var(--gold-hi); }
.mat-qty .cart-btn { width: 34px; height: 34px; border: 1px solid var(--line); }
.mat-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mat-save-actions { display: inline-flex; align-items: center; gap: 8px; }
.mat-save:not(.on) [data-action="mat-save"], .mat-save:not(.on) [data-action="mat-reset"] { opacity: .45; pointer-events: none; }
.mat-save.on [data-mat-dirty] { color: var(--gold-hi); }
.content .mat-card { background: rgba(14, 20, 17, .78); }

.modal.sens-entree { border-color: rgba(94,168,106,.7); box-shadow: 0 0 0 1px rgba(94,168,106,.35), 0 20px 60px rgba(0,0,0,.6); }
.modal.sens-entree .modal-head { background: linear-gradient(90deg, rgba(94,168,106,.28), rgba(94,168,106,.04)); border-bottom-color: rgba(94,168,106,.5); }
.modal.sens-entree .modal-head h2 { color: #9fe0aa; }
.modal.sens-sortie { border-color: rgba(192,69,63,.75); box-shadow: 0 0 0 1px rgba(192,69,63,.35), 0 20px 60px rgba(0,0,0,.6); }
.modal.sens-sortie .modal-head { background: linear-gradient(90deg, rgba(192,69,63,.3), rgba(192,69,63,.04)); border-bottom-color: rgba(192,69,63,.55); }
.modal.sens-sortie .modal-head h2 { color: #f0a09b; }
.chip-s { display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.07); color: var(--text); }
.chip-s.gold { background: rgba(212,169,79,.16); color: var(--gold-hi); }
.buy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.buy-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,.03); }
.rep-check { margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.rep-check.ok { background: rgba(94,168,106,.12); color: #9fe0aa; }
.rep-check.ko { background: rgba(192,69,63,.12); color: #f0a09b; }
.hint-vente { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--gold-dim); border-radius: 8px; background: rgba(212,169,79,.08); line-height: 1.9; }

/* ------------------------------------------------------------ que peut-on produire ? */
.cap-card { margin: 16px 0 8px; }
.cap-card .card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cap-card .card-head h3 { margin-right: auto; }
.cap-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
.cap-hero { border: 1px solid var(--gold-dim); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 4px; background: rgba(212,169,79,.05); }
.cap-hero > span, .cap-stock > span, .cap-sum span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.cap-hero > b { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--gold-hi); }
.cap-hero > small { color: var(--muted); }
.cap-stock { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.cap-stock b { font-family: var(--serif); font-size: 26px; }
.cap-ask { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 15px; }
.cap-ask input { width: 100px; height: 40px; text-align: center; font: 600 20px var(--serif); color: var(--gold-hi); }
.cap-lines { display: grid; gap: 10px; margin-bottom: 14px; }
.cap-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.cap-line input { width: 90px; height: 38px; text-align: center; font: 600 19px var(--serif); color: var(--gold-hi); }
.cap-line select { width: auto; height: 38px; }
.cap-line > span, .cap-line > label { color: var(--muted); }
.cap-lab { margin-left: auto; font-family: var(--serif); font-size: 19px; color: var(--ivory); }
.cap-hint { flex-basis: 100%; color: var(--muted); }
.cap-choix select { width: auto; min-width: 120px; height: 40px; }
.cap-choix label { color: var(--muted); }
.cap-vide { padding: 14px 16px; border: 1px dashed var(--gold-dim); border-radius: 10px; background: rgba(212,169,79,.05); }
.cap-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.cap-sum > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.cap-sum b { font-family: var(--serif); font-size: 24px; }
.cap-sum small { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .cap-grid { grid-template-columns: 1fr; } .cap-sum { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ sections repliables */
.fold { margin-top: 8px; }
.fold > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px 6px 4px; border-radius: 8px; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover, .fold > summary:focus-visible { background: rgba(255,255,255,.04); outline: none; }
.fold-arrow { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); transition: transform .2s; }
.fold[open] .fold-arrow { transform: rotate(90deg); }
.fold-title { font-family: var(--serif); font-size: 20px; color: var(--ivory); }
.fold > summary .count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); }
.fold-body { margin-top: 10px; }

/* ------------------------------------------------------------ casino */
.jet::after { content: ' ⛁'; color: var(--gold); font-size: .85em; }
.cas-wallet { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border: 1px solid var(--gold-dim); border-radius: 12px; background: rgba(14,20,17,.78); }
.cas-wallet > div > span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.cas-wallet > div > b { font-family: var(--serif); font-size: 28px; }
.cas-wallet-act { margin-left: auto; display: flex; gap: 8px; }
.cas-game { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.cas-stage { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: radial-gradient(90% 80% at 50% 60%, #14261d 0%, #0b120e 70%); }
.cas-stage canvas { display: block; width: 100%; height: auto; }
.cas-hist { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 70%; }
.cas-hist span { font: 600 12px var(--sans, Inter); padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.45); }
.cas-hist .up { color: #7fd18b; } .cas-hist .down { color: #e0645d; }
.cas-side { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: rgba(14,20,17,.78); }
.cas-side h3 { margin: 6px 0 2px; font-size: 18px; }
.cas-big { height: 48px; font-size: 16px; justify-content: center; margin-top: 4px; }
.btn-cash { background: linear-gradient(135deg, #3f9a55, #7fd18b); color: #08140b; border: 0; font-weight: 700; animation: cash-pulse 1s ease-in-out infinite; }
@keyframes cash-pulse { 50% { box-shadow: 0 0 0 6px rgba(127,209,139,.25); } }
.cas-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cas-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.03); font-size: 13.5px; }
.cas-list .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.cas-duels { display: grid; gap: 16px; }
.cas-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cas-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.cas-gate { max-width: 640px; }
.cas-gate .check { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; }
.duel-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.fighter { border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; display: grid; gap: 8px; }
.fighter b { font-family: var(--serif); font-size: 22px; }
.fighter .hp { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.fighter .hp span { display: block; height: 100%; background: linear-gradient(90deg, #c0453f, #7fd18b); transition: width .35s ease; }
.fighter.hit { animation: hit .35s; }
@keyframes hit { 25% { transform: translateX(-6px); border-color: #e0645d; } 75% { transform: translateX(6px); } }
.vs { font: 700 28px var(--serif); color: var(--gold); }
.duel-log { list-style: none; padding: 0; margin: 16px 0 0; max-height: 220px; overflow-y: auto; display: grid; gap: 4px; font-size: 13.5px; }
.duel-log li { padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,.03); }
.duel-log li.critique { color: #f0cf7a; } .duel-log li.esquive { color: var(--muted); }
.duel-result { margin-top: 14px; padding: 12px; text-align: center; font-size: 18px; border: 1px solid var(--gold-dim); border-radius: 10px; color: var(--gold-hi); }
@media (max-width: 1000px) { .cas-game { grid-template-columns: 1fr; } .cas-wallet-act { margin-left: 0; } }

/* ------------------------------------------------------------ fond photo de la zone de contenu */
.content { position: relative; isolation: isolate; }
.content::before { content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: var(--side); z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(6,9,7,.42) 0%, rgba(6,9,7,.72) 70%, rgba(6,9,7,.86) 100%),
    url('/img/fond.webp') center / cover no-repeat; }
@media (max-width: 820px) { .content::before { left: 0; } }
/* panneaux en verre fumé pour laisser deviner la photo */
.content .card, .content .kpi, .content .table-wrap, .content .org-card, .content .weapon-card, .content .member, .content .stock-tile {
  background: rgba(14, 20, 17, .78); backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); }
