/* Charte Dominium (refonte.dominium-civ.com) */
:root {
  --yellow: #FFC300;
  --yellow-hover: #E6B000;
  --yellow-soft: #FFF6DB;
  --black: #1c1c1c;
  --text: #585b6f;
  --border: #dddddd;
  --surface: #F5F5F3;
  --success: #1C7C4D;
  --warning: #B8860B;
  --error: #C23B3B;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 Inter, system-ui, sans-serif; color: var(--text); background: linear-gradient(115deg, #fffdf6 0%, var(--yellow-soft) 45%, #ffe27a 100%) fixed; }
h1, h2, strong, b { color: var(--black); }
h1 { font-weight: 800; font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 12px; }

.bar { display: flex; align-items: center; gap: 24px; background: #fff; border-bottom: 1px solid var(--border); }
.brand { background: var(--yellow); padding: 10px 56px 10px 24px; clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%); }
.brand img { height: 52px; display: block; filter: brightness(0); }
.bar-title { font-weight: 600; color: var(--black); }

main { max-width: 820px; margin: 0 auto; padding: 48px 16px 64px; }
main.wide { max-width: 1280px; }
.foot { text-align: center; font-size: .8rem; padding: 24px 16px; background: var(--black); color: rgba(255, 255, 255, .72); }

.hero { margin-bottom: 32px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 16px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--black); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.lead { font-size: 1.1rem; max-width: 60ch; }
.eyebrow { margin: 0; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

.card { background: #fff; border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.card h2 { display: flex; align-items: center; gap: 12px; font-size: 1.125rem; margin: 32px 0 16px; }
.card h2:first-of-type { margin-top: 0; }
.card h2 span { background: var(--yellow); color: var(--black); font-size: .8rem; border-radius: 6px; padding: 2px 8px; }
.center { text-align: center; }
.center .lead { margin: 0 auto 24px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid.three { grid-template-columns: 2fr 2fr 1fr; margin-top: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--black); }
label em { font-weight: 400; color: var(--text); }
input, select { font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--black); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--yellow); border-color: var(--yellow); }
.err { color: var(--error); font-weight: 500; }
.alert { background: #fdecec; color: var(--error); padding: 12px 16px; border-radius: 6px; font-weight: 600; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.methods { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 0; }
.choice span { display: flex; flex-direction: column; border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-weight: 400; transition: .2s; height: 100%; }
.choice input:checked + span { border-color: var(--yellow); background: var(--yellow-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--black); }

.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); margin: 32px 0 20px; padding-top: 20px; }
.total strong { font-size: 1.75rem; font-weight: 800; }
.fine { font-size: .82rem; text-align: center; margin: 12px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: var(--black); color: #fff; font: 700 1rem Inter, sans-serif; border: 0; border-radius: 6px; padding: 6px 6px 6px 20px; min-height: 48px; cursor: pointer; text-decoration: none; }
form.card > .btn { width: 100%; }
.btn .arrow { background: var(--yellow); color: var(--black); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 4px; }
.btn:hover .arrow { background: var(--yellow-hover); }
.btn.ghost { background: #fff; color: var(--black); border: 1px solid var(--border); padding: 0 20px; }
.btn.small { min-height: 44px; padding: 0 20px; }

.badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; font-size: 2rem; font-weight: 800; }
.badge.ok { background: var(--yellow); color: var(--black); }
.badge.ko { background: #fdecec; color: var(--error); }
.badge.wait { background: var(--yellow-soft); color: var(--warning); }
.recap { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 24px; }
.recap dt { font-weight: 600; }
.recap dd { margin: 0; color: var(--black); }

/* Tableau de bord */
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); display: flex; flex-direction: column; }
.kpi span { font-size: .85rem; font-weight: 600; }
.kpi strong { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.dark { background: var(--black); }
.kpi.dark span { color: rgba(255, 255, 255, .72); }
.kpi.dark strong { color: var(--yellow); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.panels .card, main.wide > .card { padding: 24px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px; border-bottom: 2px solid var(--black); color: var(--black); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, monospace; font-size: .8rem; }
.empty { color: var(--text); font-style: italic; }
.scroll { overflow-x: auto; }
.list { min-width: 900px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-size: .9rem; }
.track { background: var(--surface); height: 10px; border-radius: 999px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--chart); border-radius: 999px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tag.success { background: #e3f3ea; color: var(--success); }
.tag.pending { background: var(--yellow-soft); color: #7a5f00; }
.tag.error { background: #fdecec; color: var(--error); }

@media (max-width: 640px) {
  .grid, .grid.three { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .brand { padding-right: 48px; }
  .brand img { height: 40px; }
}

/* Footer sticks to the bottom on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; }

/* Admin shell: sidebar runs the full height of the screen */
body.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.shell-main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.shell main.wide { max-width: 1280px; padding-top: 40px; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--black); padding: 0 12px 20px; }
.side-brand { display: block; border-radius: 0; background: var(--yellow); margin: 0 -12px 20px; padding: 16px 24px; }
.side .side-brand:hover { background: var(--yellow); }
.side-brand img { height: 48px; display: block; filter: brightness(0); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 6px; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 500; font-size: .92rem; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a.on { background: var(--yellow); color: var(--black); font-weight: 700; }
.side nav a span { font-size: .78rem; font-variant-numeric: tabular-nums; opacity: .8; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
a.kpi { text-decoration: none; color: var(--text); transition: box-shadow .2s; }
.kpi strong { white-space: nowrap; font-size: clamp(1.4rem, 1rem + 1vw, 2rem); }
a.kpi:hover { box-shadow: var(--shadow); }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.inline input { width: auto; }
.reset { align-self: center; color: var(--text); font-size: .9rem; }
tr.sum td { font-weight: 700; color: var(--black); border-top: 2px solid var(--black); border-bottom: 0; }
.list a, .panels a { color: inherit; }
@media (max-width: 900px) {
  body.shell { display: flex; flex-direction: column; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 4px; overflow-x: auto; padding: 0 8px 0 0; }
  .side-brand { margin: 0 8px 0 0; padding: 10px 14px; }
  .side-brand img { height: 32px; }
  .side nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 4px; padding: 0 0 0 4px; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .14); }
  .side a { white-space: nowrap; gap: 8px; }
}

/* Dashboard trend chart: one series, validated #A87F00 on the white card */
:root { --chart: #A87F00; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.trend { margin-bottom: 16px; padding: 24px; }
.trend-head, .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.trend-head h2, .panel-head h2 { margin: 0 !important; }
.trend-head strong { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel-head a { font-size: .85rem; font-weight: 600; color: var(--black); white-space: nowrap; }
.chart-wrap { position: relative; padding-top: 28px; }
.chart-peak { position: absolute; top: 0; left: 0; font-size: .72rem; color: var(--text); }
.chart-wrap::before { content: ""; position: absolute; top: 22px; left: 0; right: 0; border-top: 1px dashed var(--border); }
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; height: 180px; border-bottom: 1px solid var(--black); position: relative; }
.col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; outline: none; }
.col i { width: min(28px, 70%); background: var(--chart); border-radius: 4px 4px 0 0; transition: background .15s; }
.col:hover i, .col:focus-visible i { background: var(--yellow); }
.col:hover, .col:focus-visible { background: rgba(0, 0, 0, .03); }
.col .value { font-size: .72rem; font-weight: 700; color: var(--black); margin-bottom: 4px; white-space: nowrap; }
.col .tip { display: none; position: absolute; top: 0; left: 50%; transform: translate(-50%, -100%); background: var(--black); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: .78rem; white-space: nowrap; z-index: 2; pointer-events: none; }
.col .tip b { color: var(--yellow); }
.col:nth-child(-n+2) .tip { left: 0; transform: translateY(-100%); }
.col:nth-last-child(-n+2) .tip { left: auto; right: 0; transform: translateY(-100%); }
.col:hover .tip, .col:focus-visible .tip { display: block; }
.axis { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; margin-top: 6px; font-size: .7rem; text-align: center; color: var(--text); }
.data { margin-top: 12px; font-size: .85rem; }
.data summary { cursor: pointer; font-weight: 600; color: var(--black); }
.data table { margin-top: 8px; max-width: 420px; }
.hint { margin: -8px 0 8px; font-size: .82rem; }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface); font-size: .78rem; text-align: center; }
.attention { box-shadow: inset 4px 0 0 var(--warning), var(--shadow); }
.attention .count { background: var(--yellow-soft); color: #7a5f00; }
@media (max-width: 640px) {
  .axis span:nth-child(even) { visibility: hidden; }
}

/* Payment operator cards: logo above the name */
.choice .operator { align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px 10px 12px; }
.operator img { height: 28px; width: auto; max-width: 100%; object-fit: contain; }
.operator strong { font-size: .82rem; font-weight: 600; }

/* Admin actions are POST forms; `.link` makes their button read like the links around it. */
.act { display: inline; margin: 0; }
.act .link { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; font-weight: 600; color: var(--black); cursor: pointer; text-decoration: underline; white-space: nowrap; }
.side-foot .link { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; color: rgba(255, 255, 255, .85); font-size: .92rem; font-weight: 500; text-decoration: none; }
.side-foot .link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.login { max-width: 420px; margin: 48px auto; display: flex; flex-direction: column; gap: 20px; }
.login h1 { margin: 0; font-size: 1.5rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
