/* RAMAYCHA — back-office (maquettes « BO 1 » à « BO 7 »). */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #F6F3F5; font-family: Montserrat, system-ui, sans-serif; color: #0E0E10; }
a { color: #B0145C; }
a:hover { color: #8A0F48; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #D81B72; outline-offset: 2px; }
button, input, select, textarea { font-family: Montserrat, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Structure */
.bo { width: 100%; min-height: 100vh; display: flex; flex-wrap: wrap; background: #F6F3F5; }
.bo-side { flex: 1 1 240px; max-width: 100%; background: #0E0E10; color: #FFFFFF; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.bo-main { flex: 999 1 560px; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 900px) { .bo-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; flex: 0 0 272px; } }
.bo-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: transparent; color: #CFCBD1; text-decoration: none; font: 600 14px Montserrat, sans-serif; transition: background .15s, color .15s; }
.bo-nav a:hover { background: #18181C; color: #FFFFFF; }
.bo-nav a.is-on { background: #D81B72; color: #FFFFFF; }
.nav-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #F0509A; color: #0E0E10; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.side-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.16); color: #CFCBD1; text-decoration: none; font-size: 14px; font-weight: 600; }
.side-link:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.4); }
.side-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #18181C; color: #FFFFFF; text-decoration: none; }
.side-user:hover { color: #FFFFFF; background: #222228; }
.side-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: #B9B5BB; font-size: 13px; font-weight: 600; cursor: pointer; }
.side-logout:hover { color: #FFFFFF; }

/* En-tête de page */
.page-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-top h1 { margin: 0; font-size: 28px; font-weight: 800; }
.page-sub { font-size: 14px; color: #5C5762; }
.crumb { font-size: 13px; color: #5C5762; }
.crumb a { color: #5C5762; }

/* Cartes */
.card { padding: 24px; border-radius: 18px; background: #FFFFFF; border: 1px solid #ECE6E9; display: flex; flex-direction: column; gap: 16px; }
.card-dark { background: #0E0E10; color: #FFFFFF; border: 0; }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.caps { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: #5C5762; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.card-head a { font-size: 13px; font-weight: 600; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #DCD3D8; background: #FFFFFF; color: #0E0E10; font: 600 14px Montserrat, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #0E0E10; color: #0E0E10; }
.btn-primary { border: 0; background: #D81B72; color: #FFFFFF; font-weight: 700; padding: 0 18px; }
.btn-primary:hover { background: #B0145C; color: #FFFFFF; }
.btn-dark { border: 0; background: #0E0E10; color: #FFFFFF; font-weight: 700; }
.btn-dark:hover { background: #2B272F; color: #FFFFFF; }
.btn-outline-dark { border: 1px solid #0E0E10; }
.btn-success { border: 0; background: #E3F4EA; color: #14532D; font-weight: 700; cursor: default; }
.btn-sm { min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #5C5762; border-radius: 10px; }
.btn-icon:hover { background: #F6F3F5; color: #A3123F; }
.link-btn { padding: 0; border: 0; background: none; color: #B0145C; font: 600 13px Montserrat, sans-serif; cursor: pointer; text-decoration: underline; }

/* Champs */
.input { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #DCD3D8; background: #FAF7F8; font: 14px Montserrat, sans-serif; color: #0E0E10; width: 100%; }
textarea.input { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.input:focus { outline: none; border-color: #D81B72; box-shadow: 0 0 0 1px #D81B72; background: #FFFFFF; }
.input-white { background: #FFFFFF; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg > label, .fg > .lbl { font-size: 13px; font-weight: 600; }

/* Segments (onglets) */
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: #FFFFFF; border: 1px solid #ECE6E9; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: transparent; color: #0E0E10; font: 600 14px Montserrat, sans-serif; text-decoration: none; cursor: pointer; }
.seg .is-on { background: #0E0E10; color: #FFFFFF; }
.seg-sm a, .seg-sm button { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid #DCD3D8; background: #FFFFFF; color: #0E0E10; font: 600 14px Montserrat, sans-serif; text-decoration: none; cursor: pointer; }
.pill:hover { border-color: #0E0E10; color: #0E0E10; }
.pill.is-on { border-color: #0E0E10; background: #0E0E10; color: #FFFFFF; }
.pill .n { opacity: 0.7; }

/* Pastilles */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #F1EEF0; color: #2B272F; }
.badge-new { background: #D81B72; color: #FFFFFF; }
.badge-ok { background: #E3F4EA; color: #14532D; }
.tag { padding: 7px 14px; border-radius: 999px; background: #FCE8F1; color: #8A0F48; font-size: 13px; font-weight: 700; }

/* Interrupteur */
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border-radius: 14px; border: 0; cursor: pointer; padding: 0; background: #DCD3D8; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: left .15s; }
.switch[aria-checked="true"] { background: #D81B72; }
.switch[aria-checked="true"]::after { left: 23px; }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead tr { text-align: left; color: #5C5762; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.table th { font-weight: 700; padding: 14px; }
.table td { padding: 14px; }
.table tbody tr { border-top: 1px solid #F1EEF0; }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }

/* Messages */
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #0E0E10; color: #FFFFFF; font-size: 14px; font-weight: 600; }
.toast-err { background: #A3123F; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: #FCE8F1; color: #8A0F48; font-size: 13px; font-weight: 600; }

/* Fenêtre modale (<dialog>) */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(14,14,16,0.3); }
dialog.modal::backdrop { background: rgba(14,14,16,0.55); }
.modal-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-body h2 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* Impression (aperçus PDF) */
@media print {
  .no-print { display: none !important; }
  body { background: #FFFFFF !important; }
}

@media (max-width: 700px) {
  .bo-main { padding: 20px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Composants des écrans ---------- */
.row-link:hover { background: #F6F3F5; }
.req-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 15px; border-radius: 16px; border: 1px solid #ECE6E9; background: #FFFFFF; color: #0E0E10; text-decoration: none; }
.req-card:hover { border-color: #DCD3D8; color: #0E0E10; }
.req-card.is-on { padding: 14px; border: 2px solid #D81B72; }
.info-box { padding: 14px; border-radius: 14px; background: #F6F3F5; display: flex; flex-direction: column; gap: 4px; }
.info-box > span { font-size: 12px; color: #5C5762; }
.info-box > b { font-size: 14px; }
.quote-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: #FFFFFF; border: 1px solid #E4DDE1; text-decoration: none; color: #0E0E10; transition: box-shadow .15s, transform .15s; }
.quote-card:hover { color: #0E0E10; box-shadow: 0 10px 24px rgba(14,14,16,0.08); transform: translateY(-1px); }
.step { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; font-size: 14px; font-weight: 600; background: #FFFFFF; color: #5C5762; border: 1px solid #ECE6E9; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; background: #F1EEF0; color: #5C5762; }
.step.is-done { background: #FCE8F1; color: #8A0F48; border-color: transparent; }
.step.is-cur { background: #0E0E10; color: #FFFFFF; border-color: transparent; }
.step.is-done .step-dot, .step.is-cur .step-dot { background: #D81B72; color: #FFFFFF; }
.title-input { margin: 0; width: 100%; font: 800 28px Montserrat, sans-serif; color: #0E0E10; border: 1px solid transparent; border-radius: 10px; background: transparent; padding: 0 8px; margin-left: -9px; min-height: 44px; }
.title-input:hover { border-color: #DCD3D8; }
.title-input:focus { outline: none; border-color: #D81B72; background: #FFFFFF; }
.cell { width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #E4DDE1; background: #FAF7F8; font: 14px Montserrat, sans-serif; color: #0E0E10; }
input[type=number].cell { padding: 0 10px; }
.cell:focus { outline: none; border-color: #D81B72; background: #FFFFFF; }
.cell:disabled { background: transparent; border-color: transparent; color: #0E0E10; }
.quick-add { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed #B0145C; background: #FFFFFF; color: #8A0F48; font: 600 12px Montserrat, sans-serif; cursor: pointer; }
.quick-add:hover { background: #FCE8F1; }
.opt { flex: 1; position: relative; display: flex; }
.opt input, .pchip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid #DCD3D8; background: #FFFFFF; color: #0E0E10; font: 600 13px Montserrat, sans-serif; cursor: pointer; white-space: nowrap; }
.opt input:checked + span { border-color: #D81B72; background: #D81B72; color: #FFFFFF; }
.opt input:focus-visible + span, .pchip input:focus-visible + span { outline: 2px solid #D81B72; outline-offset: 2px; }
.opt input:disabled + span, .pchip input:disabled + span { cursor: default; }
.opt-dark { flex: 0 0 auto; }
.opt-dark span { min-height: 38px; padding: 0 12px; border-color: rgba(255,255,255,0.2); background: transparent; color: #FFFFFF; }
.pchip { position: relative; display: inline-flex; }
.pchip span { padding: 6px 12px; border-radius: 999px; border: 1px solid #DCD3D8; font-size: 12px; font-weight: 600; cursor: pointer; }
.pchip input:checked + span { background: #0E0E10; border-color: #0E0E10; color: #FFFFFF; }
.pay-amount { width: 150px; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: #0E0E10; color: #FFFFFF; font: 700 14px Montserrat, sans-serif; text-align: right; }
.upload-tile { min-height: 280px; border-radius: 18px; border: 2px dashed #DCD3D8; background: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font: 600 14px Montserrat, sans-serif; color: #4A4550; cursor: pointer; }
.upload-tile:hover { border-color: #D81B72; }
.tab-link { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 10px; color: #4A4550; font: 600 14px Montserrat, sans-serif; text-decoration: none; }
.tab-link:hover { color: #0E0E10; background: #FFFFFF; }
.tab-link.is-on { background: #0E0E10; color: #FFFFFF; }
.grip { color: #B9B5BB; cursor: grab; display: flex; }
.srv-row.is-dragging { opacity: 0.5; background: #FCE8F1; }

/* ---------- Animations (désactivées si « réduire les animations ») ---------- */
@keyframes boIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes boGrowY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes boGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes boReveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes boFade { from { opacity: 0; } }
@keyframes boToast { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.card, .quote-card, .req-card, .btn, .switch, .pill, .seg a { transition: background .15s, border-color .15s, box-shadow .2s, transform .2s, color .15s; }
.btn:active, .pill:active { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) {
  .bo-main > * { animation: boIn .5s cubic-bezier(.2,.7,.2,1) both; }
  .bo-main > *:nth-child(2) { animation-delay: .05s; }
  .bo-main > *:nth-child(3) { animation-delay: .1s; }
  .bo-main > *:nth-child(4) { animation-delay: .15s; }
  .bo-main > *:nth-child(5) { animation-delay: .2s; }
  .bo-main > *:nth-child(6) { animation-delay: .25s; }
  .bo-main > *:nth-child(n+7) { animation-delay: .3s; }
  .bo-main > .toast { animation: boToast .4s ease-out both; }
  .bar-v { transform-origin: bottom; animation: boGrowY .8s cubic-bezier(.2,.7,.2,1) .25s both; }
  .bar-v + .bar-v { animation-delay: .35s; }
  .bar-h { transform-origin: left; animation: boGrowX .9s cubic-bezier(.2,.7,.2,1) .3s both; }
  .chart-reveal { animation: boReveal 1.4s cubic-bezier(.65,0,.35,1) .3s both; }

  .bo-nav a .nav-badge { animation: boIn .4s ease-out .4s both; }
  .quote-card:hover, .req-card:hover { transform: translateY(-2px); }
  dialog.modal[open] { animation: boIn .3s cubic-bezier(.2,.7,.2,1); }
  dialog.modal[open]::backdrop { animation: boFade .3s ease; }
}
.en-fields { border: 1px dashed #DCD3D8; border-radius: 12px; padding: 10px 14px; }
.en-fields summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #B0145C; }
