:root { color: #14212d; background: #f5f7f8; font-family: Arial, Helvetica, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: #fff; border-bottom: 1px solid #dfe5e8; }
.brand img { display: block; width: 122px; height: auto; }
.brand small { display: block; margin-top: 5px; color: #60707c; font-size: 12px; }
.account { display: flex; align-items: center; gap: 18px; color: #33434d; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.view-switch { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid #dfe5e8; border-radius: 10px; background: #f8fafb; }
.view-switch button { border: 0; border-radius: 7px; padding: 8px 10px; background: transparent; color: #52616b; font-size: 13px; font-weight: 700; }
.view-switch button.active { background: #247b78; color: #fff; }
.logout { border: 0; background: transparent; color: #385a6b; padding: 7px; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; max-width: 1200px; margin: 0 auto; padding: 34px 24px; }
.admin-layout { display: block; }
.nav, .card, .form-card { background: #fff; border: 1px solid #dfe5e8; border-radius: 12px; }
.nav { height: max-content; padding: 9px; }
.nav button { width: 100%; border: 0; border-radius: 8px; background: transparent; color: #40515c; text-align: left; padding: 12px 13px; font-weight: 600; }
.nav button.active, .nav button:hover { background: #edf6f4; color: #175d5a; }
.eyebrow { color: #278783; font-weight: 700; font-size: 14px; margin: 0 0 7px; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.02em; }
.intro { margin: 10px 0 0; color: #64747f; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.primary { border: 0; border-radius: 8px; padding: 12px 17px; background: #247b78; color: white; font-weight: 700; }
.primary:hover { background: #196b68; }
.danger-button { border: 0; border-radius: 8px; padding: 11px 14px; background: #b53a36; color: #fff; font-weight: 700; }
.danger-button:hover { background: #922d2a; }
.danger-button:disabled { cursor: wait; opacity: .7; }
.compact-danger { margin-left: 8px; padding: 8px 10px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 18px; }
.stat { padding: 21px; }
.stat strong { display: block; font-size: 31px; }
.stat span { color: #697984; font-size: 14px; }
.card-title { padding: 17px 20px; border-bottom: 1px solid #e6ecee; font-weight: 700; }
.empty { padding: 38px 20px; color: #6d7d87; text-align: center; }
.row { display: grid; grid-template-columns: 1fr 120px 210px; gap: 15px; align-items: center; padding: 16px 20px; border-bottom: 1px solid #edf0f2; }
.row:last-child { border-bottom: 0; }
.muted { color: #6d7d87; font-size: 14px; }
.badge { justify-self: start; border-radius: 999px; background: #e9f5f3; color: #176c68; padding: 5px 9px; font-size: 12px; font-weight: 700; }
.status-yellow { background: #fff4cc; color: #8a6400; }
.status-green { background: #e1f5e8; color: #187143; }
.status-red { background: #fde8e7; color: #ad3532; }
.rates-table { width: 100%; min-width: 580px; border-collapse: collapse; }
.rates-table th, .rates-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #e6ecee; }
.rates-table th { color: #52616b; font-size: 13px; background: #f8fafb; }
.rates-mobile { display: none; }
.form-card { max-width: 720px; padding: 28px; }
label { display: block; margin-top: 17px; font-size: 14px; font-weight: 700; }
input, textarea, select { width: 100%; margin-top: 7px; border: 1px solid #cfd9dd; border-radius: 8px; padding: 12px; color: #14212d; background: white; }
input:focus, textarea:focus, select:focus { outline: 2px solid #a9d9d5; border-color: #278783; }
textarea { min-height: 116px; resize: vertical; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.consent { display: flex; gap: 10px; align-items: start; margin-top: 22px; color: #52616b; font-size: 14px; }
.consent input { width: auto; margin: 2px 0 0; }
.notice { margin-top: 15px; font-size: 14px; color: #b23c3c; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login .form-card { width: min(100%, 460px); }
.login .brand { margin-bottom: 32px; }
.login-heading { font-size: clamp(23px, 3vw, 28px); }
.success { color: #176c68; font-weight: 700; }
.loading { min-height: 100vh; display: grid; place-items: center; color: #278783; }
.case-list { display: grid; gap: 14px; }
.case-card { margin: 0; overflow: hidden; }
.case-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; cursor: pointer; list-style: none; }
.case-summary::-webkit-details-marker { display: none; }
.case-summary:hover { background: #f8fbfb; }
.case-recap { display: flex; align-items: center; gap: 10px; }
.probability { color: #52616b; font-size: 14px; font-weight: 700; white-space: nowrap; }
.chevron { color: #52616b; font-size: 20px; transition: transform .15s ease; }
.case-card[open] .chevron { transform: rotate(180deg); }
.case-content { border-top: 1px solid #e6ecee; padding: 20px; }
.case-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.case-contact { display: grid; gap: 4px; margin: 14px 0; color: #40515c; }
.case-note { border-left: 3px solid #a9d9d5; margin: 14px 0; padding: 9px 12px; color: #52616b; background: #f8fbfb; }
.case-fields { display: grid; grid-template-columns: 1fr 130px; gap: 0 16px; }
.case-fields .full { grid-column: 1 / -1; }
.secondary { border: 1px solid #cfd9dd; border-radius: 8px; padding: 11px 14px; background: white; color: #40515c; font-weight: 700; }
.case-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.documents { margin: 14px 0; }
.documents a { display: inline-block; margin: 4px 8px 0 0; color: #176c68; font-size: 14px; }
.admin-section { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.admin-table th, .admin-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid #e6ecee; vertical-align: middle; }
.partner-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.partner-table th, .partner-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #e6ecee; vertical-align: middle; }
.partner-table th { background: #f8fafb; color: #52616b; font-size: 13px; }
.admin-table th { background: #f8fafb; color: #52616b; font-size: 13px; }
.admin-table select { min-width: 150px; margin: 0; padding: 8px; }
.admin-table .secondary { padding: 8px 10px; font-size: 13px; }
.search-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.search-title input { width: min(300px, 45%); margin: 0; padding: 9px 11px; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.detail-card { padding: 20px; }
.detail-card h2 { margin: 0 0 16px; font-size: 18px; }
.detail-card p { margin: 13px 0; line-height: 1.45; color: #52616b; }
.detail-card p strong { color: #14212d; }
.commission-form { padding: 22px; }
.inactive { display: inline-block; margin-left: 8px; color: #9b5b23; font-size: 12px; font-weight: 700; }
.toggle { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: #52616b; }
.toggle input { width: auto; margin: 0; }
.admin-note { margin: 18px 0; }
.danger-zone { border-color: #efcdcb; }
.danger-zone .card-title { color: #942f2c; }
.danger-content { padding: 20px; }
.danger-content p { margin: 0 0 16px; color: #64747f; }
.confirm-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(20,33,45,.45); }
.confirm-dialog { width: min(100%, 460px); padding: 26px; border-radius: 14px; background: #fff; box-shadow: 0 18px 46px rgba(18,35,47,.28); }
.confirm-dialog h2 { margin: 0; font-size: 23px; }
.confirm-dialog > p:not(.eyebrow):not(.notice) { margin: 14px 0; line-height: 1.45; color: #52616b; }
.confirm-warning { color: #942f2c !important; font-weight: 700; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 780px) {
  .topbar { padding: 0 22px; }
  .layout { display: block; padding: 24px 18px; }
  .nav { display: block; margin-bottom: 22px; overflow: visible; }
  .nav button { white-space: normal; width: 100%; }
  .rates-desktop { display: none; }
  .rates-mobile { display: grid; gap: 12px; padding: 14px; }
  .rate-card { border: 1px solid #e1e8ea; border-radius: 10px; padding: 15px; }
  .rate-card > strong { display: block; color: #175d5a; margin-bottom: 10px; }
  .rate-card div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid #edf0f2; color: #52616b; }
  .rate-card b { color: #14212d; }
  .stats { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .heading { align-items: start; flex-direction: column; }
  .fields { grid-template-columns: 1fr; }
  .case-fields { grid-template-columns: 1fr; }
  .case-summary { align-items: start; padding: 15px; }
  .case-recap { align-items: end; flex-direction: column; gap: 5px; }
  .case-content { padding: 15px; }
  .partner-table { min-width: 0; }
  .partner-table thead { display: none; }
  .partner-table, .partner-table tbody, .partner-table tr, .partner-table td { display: block; width: 100%; }
  .partner-table tr { padding: 12px 14px; border-bottom: 1px solid #e6ecee; }
  .partner-table td { border: 0; padding: 3px 0; font-size: 13px; }
  .partner-table td:first-child { padding-bottom: 7px; font-size: 14px; }
  .partner-table td:not(:first-child)::before { display: inline-block; min-width: 126px; color: #64717b; font-size: 12px; }
  .partner-table td:nth-child(2)::before { content: "Conseiller :"; }
  .partner-table td:nth-child(3)::before { content: "Chances :"; }
  .partner-table td:nth-child(4)::before { content: "Étape :"; }
  .partner-table td:nth-child(5)::before { content: "Rémunération :"; }
  .search-title { align-items: stretch; flex-direction: column; }
  .search-title input { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .account span { display: none; }
  .topbar { height: auto; min-height: 82px; padding-top: 12px; padding-bottom: 12px; align-items: start; }
  .top-actions { width: 100%; flex-direction: column; align-items: end; gap: 9px; }
  .view-switch { width: 100%; display: grid; grid-template-columns: 1fr; gap: 3px; }
  .view-switch button { width: 100%; text-align: center; }
  .compact-danger { margin: 8px 0 0; }
  .confirm-actions { align-items: stretch; flex-direction: column-reverse; }
  .confirm-actions button { width: 100%; }
}
