
:root{--bg:#f4f7fb;--surface:#fff;--text:#202532;--muted:#70798b;--line:#e1e6ef;--red:#e85b5b;--orange:#f1a23b;--blue:#478ddd;--green:#39ae79;--purple:#7658ef;--teal:#2fa7a0;--pink:#dc6fa8;--gray:#8c95a6;--shadow:0 12px 32px rgba(45,57,87,.08)}*{box-sizing:border-box}body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}.hidden{display:none!important}.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#eef1ff,#fff7eb,#eafaf5)}.login-card{width:min(430px,92%);background:#fff;padding:32px;border-radius:28px;box-shadow:var(--shadow)}.login-logo{width:220px;max-width:80%;display:block;margin:auto}.login-card label,label{display:block;font-size:12px;font-weight:800;color:var(--muted);margin:12px 0 6px}.login-card small{display:block;color:var(--muted);margin-top:12px}.full{width:100%;margin-top:14px}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:11px;padding:10px;background:#fff;color:var(--text)}textarea{min-height:76px}.btn{border:0;border-radius:11px;padding:10px 14px;font-weight:800;cursor:pointer}.primary{background:var(--purple);color:white}.soft{background:#edf0f7;color:#495164}.white{background:#fff;color:var(--purple)}.app{display:grid;grid-template-columns:245px 1fr;min-height:100vh}aside{background:#fff;border-right:1px solid var(--line);padding:20px 15px;height:100vh;position:sticky;top:0;display:flex;flex-direction:column}.side-logo{width:170px;margin:0 auto 18px}nav{display:grid;gap:5px;overflow:auto}.nav{border:0;background:transparent;text-align:left;padding:11px;border-radius:11px;color:var(--muted);font-weight:800;cursor:pointer}.nav.active,.nav:hover{background:#f0edff;color:var(--purple)}#logout{margin-top:auto}main{padding:25px 30px 55px;min-width:0}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}header h1{margin:0}header p{margin:5px 0;color:var(--muted)}.page{display:none}.page.active{display:block}.panel{background:#fff;border:1px solid var(--line);border-radius:22px;padding:20px;box-shadow:var(--shadow)}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.panel-head h2{margin:0}.panel-head p{margin:5px 0 0;color:var(--muted)}.hero{background:linear-gradient(120deg,var(--purple),var(--blue),var(--green));color:#fff;padding:27px;border-radius:25px;display:flex;justify-content:space-between;align-items:center}.hero h2{font-size:30px;margin:8px 0}.today-event{background:rgba(255,255,255,.17);padding:11px;border-radius:12px;margin-top:8px}.status-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}.status{color:#fff;border-radius:18px;padding:18px}.status strong{display:block;font-size:27px;margin-top:7px}.urgent{background:var(--red)}.todo{background:var(--orange)}.progress{background:var(--blue)}.done{background:var(--green)}.purple{background:var(--purple)}.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}.mt{margin-top:16px}.item{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#f8f9fc;border-radius:13px;padding:12px;margin-top:8px}.tag-select{border:0!important;color:#fff!important;font-weight:800;padding:6px 9px!important;border-radius:999px!important;min-width:110px;width:auto!important}.tag-red{background:var(--red)!important}.tag-orange{background:var(--orange)!important}.tag-blue{background:var(--blue)!important}.tag-green{background:var(--green)!important}.tag-purple{background:var(--purple)!important}.tag-gray{background:var(--gray)!important}.cell-input{min-width:95px;padding:7px!important;background:#fff}.cell-textarea{min-width:170px;min-height:55px;padding:7px!important}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:10px 8px;border-bottom:1px solid var(--line);font-size:12px;vertical-align:top;text-align:left}th{color:var(--muted);text-transform:uppercase;font-size:10px;letter-spacing:.3px}.week{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.week-day{min-height:105px;background:#f8f9fc;border:1px solid var(--line);border-radius:13px;padding:9px}.week-chip,.event-chip{display:block;color:#fff;border-radius:8px;padding:6px;margin-top:5px;font-size:10px;position:relative}.cal-toolbar{display:flex;align-items:center;justify-content:center;gap:20px;margin:14px 0}.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.calendar-head{text-align:center;color:var(--muted);font-weight:800;font-size:11px}.cal-day{min-height:108px;border:1px solid var(--line);background:#fafbfe;border-radius:12px;padding:7px;cursor:pointer}.cal-day.today{border:2px solid var(--purple)}.tooltip{display:none;position:absolute;top:100%;left:0;width:230px;background:#202532;color:#fff;padding:10px;border-radius:9px;z-index:20;white-space:normal;box-shadow:0 12px 26px rgba(0,0,0,.22)}.event-chip:hover .tooltip{display:block}.legend{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.legend span{color:#fff;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:800}.client-card{border:1px solid var(--line);border-radius:18px;margin-top:13px;overflow:hidden}.client-title{display:flex;justify-content:space-between;align-items:center;padding:16px;background:#f7f8fc}.client-table{width:100%}.client-table th{width:180px;background:#fafbfe}.contact-row td{background:#f7f8fb}.prospect-main{font-size:15px;font-weight:900}.prospect-mail{font-size:14px;font-weight:800;color:var(--purple)}.dropzone{border:2px dashed #cbd2df;border-radius:18px;padding:42px;text-align:center;margin-top:15px;position:relative}.dropzone input{position:absolute;inset:0;opacity:0;cursor:pointer}.file-actions{display:flex;gap:7px}.file-btn{border:0;border-radius:9px;background:#edf0f6;padding:7px 9px;cursor:pointer}.invoice-editor{padding:24px}.invoice-sheet{background:#fff;border:1px solid var(--line);padding:28px;margin-top:18px}.invoice-top{display:grid;grid-template-columns:1fr 1fr;gap:40px}.invoice-logo{width:260px;max-width:100%}.client-block{text-align:right}.invoice-meta{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:24px 0}.invoice-lines input{border:0;background:transparent;padding:6px}.invoice-lines td{border:1px solid #ccd3df}.invoice-lines th{background:#e9edf5;border:1px solid #ccd3df}.invoice-total{text-align:right;margin:20px 0;font-size:22px}.invoice-total strong{display:inline-block;margin-left:20px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}dialog{border:0;border-radius:20px;width:min(650px,94%);padding:0}dialog form{padding:20px}.field{margin-bottom:10px}@media(max-width:1000px){.app{grid-template-columns:1fr}aside{position:fixed;bottom:0;top:auto;width:100%;height:auto;z-index:30;padding:7px}.side-logo,#logout{display:none}nav{display:flex;overflow:auto}.nav{white-space:nowrap;font-size:10px}main{padding:16px 12px 85px}.status-grid,.two{grid-template-columns:1fr 1fr}.week{grid-template-columns:1fr 1fr}.invoice-top,.invoice-meta{grid-template-columns:1fr}.calendar{font-size:10px}.cal-day{min-height:80px}}
@media print{aside,header,.panel-head,.btn,#addInvoiceRow{display:none!important}.app{display:block}.page{display:none!important}#creator{display:block!important}.invoice-editor,.invoice-sheet{border:0;box-shadow:none;padding:0}.invoice-sheet input,.invoice-sheet select,.invoice-sheet textarea{border:0;appearance:none;resize:none}.invoice-logo{width:220px}}
/* V6 — lecture claire et édition volontaire au double-clic */
.dbl-edit{display:block;min-width:70px;padding:8px 9px;border-radius:9px;font-weight:700;color:#20283a;cursor:text;border:1px solid transparent;line-height:1.25}.dbl-edit:hover{background:#f3f5fa;border-color:#dfe5ef}.dbl-edit em{font-weight:500;color:#9098a8;font-size:12px}.strong-cell{font-weight:800}.dbl-input{width:100%;min-width:100px;padding:8px 9px;border:2px solid #7658ef;border-radius:9px;background:#fff;font-weight:750}.company-card{background:#fff;border:1px solid #e0e6ef;border-radius:20px;padding:18px;margin-bottom:18px;box-shadow:0 8px 25px rgba(34,48,78,.06)}.company-header{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:15px}.company-header small,.contact-title{font-size:11px;font-weight:900;letter-spacing:.8px;color:#7b8495}.company-header h2{margin:3px 0 0}.company-name{font-size:22px;font-weight:900;padding-left:0}.info-table,.contact-table{width:100%;border-collapse:collapse}.info-table th,.contact-table th{font-size:11px;text-transform:uppercase;color:#737d90;background:#f7f8fb}.info-table td,.info-table th,.contact-table td,.contact-table th{padding:10px;border:1px solid #e5e9f0;text-align:left;vertical-align:middle}.contact-title{margin:18px 0 7px}.prospect-table{min-width:1450px}.prospect-card{overflow-x:auto}.actions{display:flex;gap:8px;flex-wrap:wrap}.btn.success{background:#38ad79;color:#fff}.tiny-delete{border:0;background:#ffe8e8;color:#b63838;border-radius:8px;padding:6px 9px;cursor:pointer}.compact-input{min-width:125px;padding:8px;border:1px solid #dfe4ed;border-radius:9px}.auto-status{display:block;margin-top:5px;color:#70798b}.project-one-line{display:flex;align-items:center;gap:10px;min-width:330px}.project-one-line select{max-width:210px}.project-one-line strong{white-space:nowrap}.project-select{padding:9px;border:1px solid #dde3ed;border-radius:9px;background:#fff;font-weight:750}.tag-select{font-weight:800}.cal-event strong{font-weight:900}.hero-event{padding:9px 0}.side-logo{max-height:70px;object-fit:contain}

/* V7 — calendrier lisible et facture calquée sur le modèle */
.invoice-kpis{grid-template-columns:repeat(5,1fr)}.teal-card{background:var(--teal)}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}.week-day{min-height:145px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:0;overflow:hidden}.week-day.today{outline:3px solid rgba(118,88,239,.25);border-color:var(--purple)}.week-date{padding:11px 12px;background:#f1f4f9;font-size:14px;font-weight:900;text-transform:capitalize;border-bottom:1px solid var(--line)}.week-events{padding:8px}.week-chip{display:flex;flex-direction:column;gap:2px;color:#fff;border-radius:10px;padding:8px 9px;margin-bottom:7px;line-height:1.15;overflow:hidden}.week-chip strong{font-size:11px;text-transform:uppercase;letter-spacing:.35px}.week-chip span{font-size:12px;font-weight:850;white-space:normal}.week-chip small{font-size:10px;font-weight:800;opacity:.9}.week-empty{font-size:11px;color:var(--muted);font-weight:700}
.calendar{gap:9px}.day{min-height:132px;border:1px solid var(--line);background:#fff;border-radius:15px;padding:8px;overflow:visible}.day>b{display:block;margin-bottom:7px;font-size:13px}.cal-event{display:flex!important;flex-direction:column;gap:2px;color:#fff;border-radius:10px;padding:7px 8px!important;margin:6px 0 0!important;font-size:11px!important;line-height:1.15;white-space:normal!important;position:relative;overflow:visible}.cal-event strong{font-size:10px;text-transform:uppercase;letter-spacing:.35px}.cal-event span{font-weight:850}.cal-event small{font-weight:750;opacity:.9}
.edit-hint{display:block;color:var(--muted);font-size:9px;margin-top:3px;cursor:pointer}.invoice-model{max-width:960px;margin:20px auto;background:#fff;padding:34px 22px 45px;min-height:1100px}.invoice-title-row{display:flex;justify-content:space-between;align-items:flex-start}.invoice-title-select{width:auto;border:0;font-size:28px;font-weight:900;padding:0;background:transparent}.invoice-logo-corner{width:210px;max-height:95px;object-fit:contain}.invoice-parties{display:grid;grid-template-columns:1fr 1fr;gap:60px;margin-top:24px;min-height:250px}.plain-field{border:1px solid transparent!important;background:transparent!important;border-radius:7px!important;padding:5px!important}.plain-field:hover,.plain-field:focus{border-color:#cfd6e3!important;background:#fafbfe!important}.issuer-name,.client-name{font-size:17px;font-weight:900}.party-address{min-height:95px;line-height:1.65;font-weight:600}.invoice-client{text-align:right;padding-top:0;display:flex;flex-direction:column;align-items:flex-end}.invoice-client select{margin-bottom:8px}.plain-field.right{text-align:right}.invoice-meta-table{width:480px;max-width:100%;border:1px solid #cbd2de;margin:15px 0 36px}.invoice-meta-table label{display:grid;grid-template-columns:58% 42%;margin:0;border-bottom:1px solid #cbd2de}.invoice-meta-table label:last-child{border-bottom:0}.invoice-meta-table strong{background:#e8edf5;padding:12px;font-size:14px;color:#202532}.invoice-meta-table input{border:0;border-radius:0;padding:12px;background:#fff}.invoice-lines{font-size:14px}.invoice-lines th{background:#e8edf5!important;color:#202532!important;text-transform:none!important;font-size:13px!important;border:1px solid #cbd2de!important}.invoice-lines td{border:1px solid #cbd2de!important;vertical-align:middle}.invoice-lines input{font-weight:700}.line-description{display:flex;flex-direction:column}.line-detail{font-weight:500!important;color:#4f5664}.lineTotal{font-weight:800;text-align:right}.invoice-total-box{display:grid;grid-template-columns:1fr 1fr;width:480px;max-width:100%;margin:38px 0 35px auto;border:1px solid #cbd2de}.invoice-total-box span{background:#e8edf5;padding:13px;font-weight:900}.invoice-total-box strong{padding:13px;font-size:17px}.invoice-legal{border:1px solid transparent!important;min-height:75px;line-height:1.5;font-size:13px}.invoice-legal:hover,.invoice-legal:focus{border-color:#cfd6e3!important}
@media(max-width:1000px){.invoice-kpis{grid-template-columns:1fr 1fr}.week{grid-template-columns:1fr 1fr}.invoice-parties{grid-template-columns:1fr;gap:10px}.invoice-client{padding-top:0}.invoice-model{padding:22px 12px}.invoice-logo-corner{width:150px}}
@media print{.invoice-title-row select,.invoice-sheet input,.invoice-sheet textarea,.invoice-sheet select{border:0!important;background:transparent!important}.invoice-model{max-width:none;min-height:auto;padding:10mm 8mm;font-size:11px}.invoice-logo-corner{width:150px}.issuer-name,.client-name{font-size:14px}.party-address,.invoice-lines,.invoice-legal,.invoice-meta-table strong,.invoice-meta-table input{font-size:11px}.invoice-parties{gap:30px;min-height:150px}.removeRow,#addInvoiceRow{display:none!important}}
.invoice-kpis{grid-template-columns:repeat(2,minmax(260px,1fr));max-width:900px}.year-summary{border:1px solid var(--line);border-radius:16px;overflow:hidden;margin-top:14px}.year-summary-head{display:flex;align-items:center;gap:24px;flex-wrap:wrap;padding:14px 16px;background:#f2f0ff}.year-summary-head strong{font-size:20px;color:var(--purple)}.year-summary-head span{font-weight:800}.year-summary table{margin:0}.year-summary th,.year-summary td{padding:12px 16px}@media(max-width:700px){.invoice-kpis{grid-template-columns:1fr}.year-summary-head{align-items:flex-start;flex-direction:column;gap:6px}}

/* V9.1 — facture compacte et propre à l’export PDF */
.invoice-client{
  text-align:left;
  align-items:stretch;
}
.invoice-client .client-name,
.invoice-client .party-address,
.invoice-client .plain-field.right{
  text-align:left;
  width:100%;
}
.invoice-client .client-name{margin-top:4px}
.invoice-client .party-address{
  min-height:58px;
  height:58px;
  line-height:1.35;
  margin:0;
}
.invoice-client #invClientSiret{margin-top:0}

@page{
  size:A4 portrait;
  margin:7mm 8mm;
}

@media print{
  html,body{
    width:210mm;
    min-height:297mm;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    font-size:8.5pt!important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  main{padding:0!important;margin:0!important}
  .panel.invoice-editor{padding:0!important;margin:0!important}
  .invoice-sheet.invoice-model{
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    margin:0!important;
    padding:3mm 4mm 2mm!important;
    font-size:8.5pt!important;
    overflow:visible!important;
    page-break-inside:avoid;
    break-inside:avoid-page;
  }
  .invoice-title-row{margin:0 0 3mm!important}
  .invoice-title-select{
    font-size:19pt!important;
    line-height:1!important;
  }
  .invoice-logo-corner{
    width:43mm!important;
    max-height:19mm!important;
  }
  .invoice-parties{
    grid-template-columns:1fr 1fr!important;
    gap:18mm!important;
    margin-top:2mm!important;
    min-height:0!important;
    align-items:start!important;
  }
  .issuer-name,.client-name{
    font-size:10pt!important;
    line-height:1.15!important;
    padding:1mm 0!important;
  }
  .party-address{
    min-height:0!important;
    height:auto!important;
    line-height:1.3!important;
    font-size:8.5pt!important;
    padding:1mm 0!important;
    overflow:visible!important;
  }
  .invoice-client{
    text-align:left!important;
    align-items:stretch!important;
  }
  .invoice-client select{
    display:none!important;
  }
  .invoice-client .plain-field,
  .invoice-client .right{
    text-align:left!important;
    margin:0!important;
    padding:1mm 0!important;
  }
  .invoice-meta-table{
    width:112mm!important;
    margin:5mm 0 6mm!important;
  }
  .invoice-meta-table label{
    grid-template-columns:58% 42%!important;
  }
  .invoice-meta-table strong,
  .invoice-meta-table input{
    padding:2.2mm 3mm!important;
    font-size:8.5pt!important;
    line-height:1.15!important;
  }
  .invoice-lines{
    font-size:8.5pt!important;
    margin:0!important;
    table-layout:fixed!important;
  }
  .invoice-lines th,
  .invoice-lines td{
    padding:2.3mm 2.5mm!important;
    font-size:8.5pt!important;
    line-height:1.2!important;
  }
  .invoice-lines th:nth-child(1){width:31%!important}
  .invoice-lines th:nth-child(2){width:18%!important}
  .invoice-lines th:nth-child(3){width:25%!important}
  .invoice-lines th:nth-child(4){width:22%!important}
  .invoice-lines th:last-child,
  .invoice-lines td:last-child{display:none!important}
  .invoice-lines input{
    font-size:8.5pt!important;
    padding:0!important;
  }
  .invoice-total-box{
    width:112mm!important;
    margin:6mm 0 5mm auto!important;
  }
  .invoice-total-box span,
  .invoice-total-box strong{
    padding:2.5mm 3mm!important;
    font-size:9pt!important;
  }
  .invoice-total-box strong{font-size:12pt!important}
  .invoice-legal{
    min-height:0!important;
    height:auto!important;
    font-size:8pt!important;
    line-height:1.3!important;
    padding:1mm 0!important;
    overflow:visible!important;
  }
  textarea{
    overflow:visible!important;
    scrollbar-width:none!important;
  }
  textarea::-webkit-scrollbar{display:none!important}
  select{
    appearance:none!important;
    -webkit-appearance:none!important;
    background-image:none!important;
  }
}

/* user tweak */
.invoice-client{padding-top:45px!important;}
@media print{
  .invoice-client{padding-top:18mm!important;}
}

/* V9.3 — coordonnées émetteur entièrement visibles dans le PDF */
@media print{
  .issuer-block{
    overflow:visible!important;
    min-height:34mm!important;
  }
  #issuerAddress{
    display:block!important;
    width:100%!important;
    min-height:29mm!important;
    height:29mm!important;
    max-height:none!important;
    overflow:hidden!important;
    white-space:pre-wrap!important;
    line-height:1.35!important;
    font-size:8.2pt!important;
    padding:1mm 0!important;
  }
  .invoice-parties{
    min-height:48mm!important;
    overflow:visible!important;
  }
}
.sync-status{font-size:12px;font-weight:800;padding:8px 12px;border-radius:999px;background:#edf0f7;color:#596174;white-space:nowrap}.sync-status[data-state="saving"],.sync-status[data-state="pending"]{background:#fff3dc;color:#9b6500}.sync-status[data-state="saved"]{background:#e5f8ee;color:#18734b}.sync-status[data-state="error"]{background:#ffe9e9;color:#b52c2c}@media(max-width:700px){header{align-items:flex-start;gap:10px}.sync-status{font-size:10px;padding:7px 9px}}

/* V3 — tableaux Factures/Devis lisibles et PDF toujours accessibles */
.finance-table{table-layout:auto;min-width:980px}
.finance-table th,.finance-table td{padding:9px 7px;vertical-align:middle}
.finance-table .project-one-line{min-width:175px;max-width:235px;gap:6px;flex-wrap:wrap}
.finance-table .project-one-line select{max-width:175px;min-width:125px}
.finance-table .project-one-line strong{white-space:normal;font-size:11px}
.finance-table .tag-select{min-width:88px;padding:6px 7px!important}
.pdf-cell{min-width:150px;position:sticky;right:0;background:#fff;box-shadow:-8px 0 14px rgba(45,57,87,.05);z-index:2}
.finance-table th:last-child{position:sticky;right:0;background:#fff;z-index:3;box-shadow:-8px 0 14px rgba(45,57,87,.05)}
.pdf-upload{display:inline-flex;align-items:center;justify-content:center;background:var(--purple);color:#fff;border-radius:9px;padding:7px 9px;margin:0 0 7px;cursor:pointer;font-size:11px;white-space:nowrap}
.pdf-upload input{display:none}
.pdf-cell .file-actions{flex-wrap:wrap;gap:5px}
.pdf-cell .file-btn{font-size:10px;padding:6px 7px;text-decoration:none;color:var(--text)}
@media(max-width:1500px){
 .invoice-finance-table th:nth-child(6),.invoice-finance-table td:nth-child(6),
 .invoice-finance-table th:nth-child(10),.invoice-finance-table td:nth-child(10){display:none}
 .invoice-finance-table{min-width:850px}
}
@media(max-width:900px){
 .finance-table{min-width:760px}
 .invoice-finance-table th:nth-child(8),.invoice-finance-table td:nth-child(8){display:none}
 .pdf-cell{min-width:135px}
}

/* V4 — utilisation optimale de l'espace et tableaux réellement responsives */
main{width:100%;max-width:none}
.panel{width:100%}
.table-wrap{width:100%;max-width:100%}

@media (min-width:1501px){
  .finance-table{width:100%;min-width:0!important;table-layout:fixed}
  .finance-table th,.finance-table td{padding:10px 6px;overflow-wrap:anywhere}
  .finance-table .dbl-edit{min-width:0;padding:7px 5px}
  .finance-table .project-one-line{min-width:0;max-width:none;display:grid;grid-template-columns:1fr;gap:5px}
  .finance-table .project-one-line select{min-width:0;max-width:none;width:100%;padding:8px 28px 8px 8px}
  .finance-table .project-one-line strong{font-size:10px;line-height:1.25}
  .finance-table .tag-select{width:100%!important;min-width:0!important;max-width:100%;padding:7px 24px 7px 9px!important}
  .finance-table .edit-hint{font-size:8px;line-height:1.2}
  .invoice-finance-table th:nth-child(1),.invoice-finance-table td:nth-child(1){width:6%}
  .invoice-finance-table th:nth-child(2),.invoice-finance-table td:nth-child(2){width:22%}
  .invoice-finance-table th:nth-child(3),.invoice-finance-table td:nth-child(3){width:9%}
  .invoice-finance-table th:nth-child(4),.invoice-finance-table td:nth-child(4){width:8%}
  .invoice-finance-table th:nth-child(5),.invoice-finance-table td:nth-child(5){width:8%}
  .invoice-finance-table th:nth-child(6),.invoice-finance-table td:nth-child(6){width:8%}
  .invoice-finance-table th:nth-child(7),.invoice-finance-table td:nth-child(7){width:10%}
  .invoice-finance-table th:nth-child(8),.invoice-finance-table td:nth-child(8){width:8%}
  .invoice-finance-table th:nth-child(9),.invoice-finance-table td:nth-child(9){width:10%}
  .invoice-finance-table th:nth-child(10),.invoice-finance-table td:nth-child(10){width:7%}
  .invoice-finance-table th:nth-child(11),.invoice-finance-table td:nth-child(11){width:12%}
  .quotes-finance-table th:nth-child(1),.quotes-finance-table td:nth-child(1){width:8%}
  .quotes-finance-table th:nth-child(2),.quotes-finance-table td:nth-child(2){width:30%}
  .quotes-finance-table th:nth-child(3),.quotes-finance-table td:nth-child(3){width:16%}
  .quotes-finance-table th:nth-child(4),.quotes-finance-table td:nth-child(4){width:12%}
  .quotes-finance-table th:nth-child(5),.quotes-finance-table td:nth-child(5){width:11%}
  .quotes-finance-table th:nth-child(6),.quotes-finance-table td:nth-child(6){width:13%}
  .quotes-finance-table th:nth-child(7),.quotes-finance-table td:nth-child(7){width:10%}
  .pdf-cell{position:static!important;min-width:0!important;box-shadow:none!important}
  .finance-table th:last-child{position:static!important;box-shadow:none!important}
  .pdf-upload{width:100%;padding:7px 5px;font-size:10px}
  .pdf-cell .file-actions{display:grid;grid-template-columns:1fr;gap:4px}
  .pdf-cell .file-btn{display:block;width:100%;text-align:center;font-size:9px;padding:6px 4px}
}

@media (min-width:1001px) and (max-width:1500px){
  main{padding:22px 20px 50px}
  .panel{padding:17px}
  .finance-table th,.finance-table td{font-size:11px}
}

@media (max-width:1000px){
  .panel-head{align-items:flex-start;flex-wrap:wrap}
  .panel-head .btn{margin-left:auto}
}

/* V5 — interface compacte : une information par ligne, sans doublons */
.finance-table th,.finance-table td{white-space:nowrap}
.finance-table .dbl-edit{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.finance-table .compact-project{display:block!important;min-width:0!important;max-width:none!important}
.finance-table .compact-project select{width:100%!important;max-width:none!important;min-width:0!important;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.finance-table .edit-hint{display:none}
.finance-table td:hover .edit-hint{display:block;position:absolute;background:#fff;border:1px solid #e1e5ed;border-radius:7px;padding:4px 7px;box-shadow:0 5px 14px rgba(25,35,60,.12);z-index:8}
.finance-table td{position:relative}
.finance-table .nowrap-cell,.finance-table .money-cell{white-space:nowrap}
.finance-table .tag-select{white-space:nowrap}
.invoice-finance-table{min-width:1120px!important}
.quotes-finance-table{min-width:820px!important}
.invoice-finance-table th:nth-child(1),.invoice-finance-table td:nth-child(1){width:21%!important}
.invoice-finance-table th:nth-child(2),.invoice-finance-table td:nth-child(2){width:12%!important}
.invoice-finance-table th:nth-child(3),.invoice-finance-table td:nth-child(3){width:9%!important}
.invoice-finance-table th:nth-child(4),.invoice-finance-table td:nth-child(4){width:9%!important}
.invoice-finance-table th:nth-child(5),.invoice-finance-table td:nth-child(5){width:9%!important}
.invoice-finance-table th:nth-child(6),.invoice-finance-table td:nth-child(6){width:8%!important}
.invoice-finance-table th:nth-child(7),.invoice-finance-table td:nth-child(7){width:10%!important}
.invoice-finance-table th:nth-child(8),.invoice-finance-table td:nth-child(8){width:8%!important}
.invoice-finance-table th:nth-child(9),.invoice-finance-table td:nth-child(9){width:9%!important}
.invoice-finance-table th:nth-child(10),.invoice-finance-table td:nth-child(10){width:12%!important}
.quotes-finance-table th:nth-child(1),.quotes-finance-table td:nth-child(1){width:30%!important}
.quotes-finance-table th:nth-child(2),.quotes-finance-table td:nth-child(2){width:18%!important}
.quotes-finance-table th:nth-child(3),.quotes-finance-table td:nth-child(3){width:13%!important}
.quotes-finance-table th:nth-child(4),.quotes-finance-table td:nth-child(4){width:13%!important}
.quotes-finance-table th:nth-child(5),.quotes-finance-table td:nth-child(5){width:16%!important}
.quotes-finance-table th:nth-child(6),.quotes-finance-table td:nth-child(6){width:10%!important}
.info-table th,.info-table td,.contact-table th,.contact-table td{padding:8px 9px}
.company-card{padding:15px}
.panel{padding:16px}
@media (min-width:1350px){
  .invoice-finance-table{min-width:0!important;width:100%!important;table-layout:fixed!important}
  .quotes-finance-table{min-width:0!important;width:100%!important;table-layout:fixed!important}
}

/* V6 — statuts lisibles + pièce jointe PDF toujours accessible */
.invoice-status{min-width:138px!important;width:138px!important;padding:7px 25px 7px 9px!important;font-size:10px!important}
.invoice-pdf-upload{display:flex!important;align-items:center;justify-content:center;min-width:96px!important;width:100%!important;min-height:34px!important;background:#7658ef!important;color:#fff!important;border-radius:9px!important;font-weight:900!important;cursor:pointer!important;white-space:nowrap!important}
.invoice-pdf-upload:hover{filter:brightness(.96)}
.pdf-cell{min-width:116px!important;overflow:visible!important}
.pdf-cell .file-actions{margin-top:6px!important}
.pdf-cell .file-btn{white-space:nowrap!important}
.invoice-finance-table th:nth-child(10),.invoice-finance-table td:nth-child(10){width:13%!important;min-width:116px!important}
.invoice-finance-table th:nth-child(1),.invoice-finance-table td:nth-child(1){width:19%!important}
.invoice-finance-table th:nth-child(2),.invoice-finance-table td:nth-child(2){width:11%!important}
.invoice-finance-table th:nth-child(6),.invoice-finance-table td:nth-child(6){width:12%!important}
.invoice-finance-table th:nth-child(8),.invoice-finance-table td:nth-child(8){width:13%!important}
@media (max-width:1350px){
  .invoice-finance-table{min-width:1250px!important}
}

/* V7 — calendrier : fiche événement et modification */
.cal-event{display:block;width:100%;border:0;color:#fff;border-radius:8px;padding:6px;margin-top:5px;font-size:10px;text-align:left;cursor:pointer;line-height:1.25}
.cal-event strong,.cal-event span,.cal-event small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-event:hover{filter:brightness(.96);transform:translateY(-1px)}
.event-detail-dialog{padding:20px;min-width:0}
.event-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.event-detail-grid>div{background:#f7f8fc;border:1px solid var(--line);border-radius:13px;padding:12px;min-width:0}
.event-detail-grid .wide{grid-column:1/-1}
.event-detail-grid span{display:block;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;margin-bottom:5px}
.event-detail-grid strong,.event-detail-grid p{margin:0;white-space:normal;overflow-wrap:anywhere}
.btn.danger{background:#fff0f0;color:var(--red)}
@media(max-width:600px){.event-detail-grid{grid-template-columns:1fr}.event-detail-grid .wide{grid-column:auto}}

/* V8 — projets compacts, sans numéro visible, RDV sur une ligne */
.projects-table{min-width:1180px;table-layout:auto}
.projects-table th,.projects-table td{white-space:nowrap;padding:9px 7px;vertical-align:middle}
.projects-table .project-name-cell{min-width:210px;max-width:280px}
.projects-table .project-name-cell .dbl-edit{font-weight:900;overflow:hidden;text-overflow:ellipsis;display:block}
.projects-table .project-rdv-cell{min-width:220px;width:220px}
.projects-table .rdv-inline{display:flex;align-items:center;gap:7px;min-width:205px}
.projects-table .rdv-inline .dbl-edit{display:inline-block;min-width:88px;white-space:nowrap}
.projects-table .rdv-inline .dbl-edit:last-child{min-width:55px}
.projects-table td:nth-child(7){min-width:180px;max-width:250px}
.projects-table td:nth-child(9){min-width:135px}
@media(min-width:1450px){.projects-table{width:100%;min-width:0;table-layout:fixed}.projects-table th:nth-child(1),.projects-table td:nth-child(1){width:17%}.projects-table th:nth-child(2),.projects-table td:nth-child(2){width:10%}.projects-table th:nth-child(3),.projects-table td:nth-child(3){width:8%}.projects-table th:nth-child(4),.projects-table td:nth-child(4){width:10%}.projects-table th:nth-child(5),.projects-table td:nth-child(5){width:8%}.projects-table th:nth-child(6),.projects-table td:nth-child(6){width:8%}.projects-table th:nth-child(7),.projects-table td:nth-child(7){width:15%}.projects-table th:nth-child(8),.projects-table td:nth-child(8){width:5%}.projects-table th:nth-child(9),.projects-table td:nth-child(9){width:9%}.projects-table th:nth-child(10),.projects-table td:nth-child(10){width:10%}.projects-table th:nth-child(11),.projects-table td:nth-child(11){width:15%}}

/* V9 — projets sans prix, dates sur une ligne, calendrier premium */
.date-one-line{white-space:nowrap!important;min-width:96px!important}
.projects-table{min-width:1080px!important}
.projects-table th,.projects-table td{white-space:nowrap!important;vertical-align:middle!important}
.projects-table .project-date-cell{min-width:112px;width:112px}
.projects-table .project-comment-cell{min-width:190px;max-width:280px;white-space:normal!important}
.projects-table .project-comment-cell .dbl-edit{white-space:normal!important;line-height:1.25}
.projects-table .project-rdv-cell{min-width:225px!important;width:225px!important}
.projects-table .rdv-inline{display:flex;align-items:center;gap:7px;min-width:210px;white-space:nowrap}
.projects-table .rdv-inline .date-one-line{min-width:96px!important}
.projects-table .rdv-inline .dbl-edit:last-child{min-width:58px!important;white-space:nowrap!important}
.projects-table .rdv-sep{color:#a7afbd}
@media(min-width:1450px){
  .projects-table{width:100%!important;min-width:0!important;table-layout:fixed!important}
  .projects-table th:nth-child(1),.projects-table td:nth-child(1){width:18%}
  .projects-table th:nth-child(2),.projects-table td:nth-child(2){width:11%}
  .projects-table th:nth-child(3),.projects-table td:nth-child(3){width:10%}
  .projects-table th:nth-child(4),.projects-table td:nth-child(4){width:11%}
  .projects-table th:nth-child(5),.projects-table td:nth-child(5){width:9%}
  .projects-table th:nth-child(6),.projects-table td:nth-child(6){width:18%}
  .projects-table th:nth-child(7),.projects-table td:nth-child(7){width:6%}
  .projects-table th:nth-child(8),.projects-table td:nth-child(8){width:10%}
  .projects-table th:nth-child(9),.projects-table td:nth-child(9){width:13%}
  .projects-table th:nth-child(10),.projects-table td:nth-child(10){width:16%}
}

#calendar .panel{padding:22px 24px}
#calendar .panel-head p{font-size:12px}
.calendar{gap:1px!important;background:#e7ebf2;border:1px solid #e7ebf2;border-radius:16px;overflow:hidden}
.cal-head{background:#f7f8fb;padding:11px 8px;text-align:center;color:#8a93a4;font-size:10px;letter-spacing:.5px;text-transform:uppercase}
.day{min-height:132px!important;border:0!important;border-radius:0!important;background:#fff!important;padding:9px!important;overflow:hidden!important}
.day.empty{background:#fafbfc!important}
.day>b{font-size:12px;color:#6d7686;margin-bottom:8px}
.day:has(.cal-event) > b{color:#252b38}
.cal-event{--event-color:#7658ef;display:block!important;width:100%!important;border:0!important;border-left:3px solid var(--event-color)!important;border-radius:4px!important;background:#f7f8fb!important;color:#252b38!important;padding:7px 8px!important;margin:5px 0 0!important;text-align:left!important;cursor:pointer!important;box-shadow:none!important;transition:background .15s ease,transform .15s ease!important;outline:none!important}
.cal-event:hover{background:#f0f2f6!important;transform:translateX(1px)!important;filter:none!important}
.cal-event:focus,.cal-event:focus-visible,.cal-event:active{outline:none!important;box-shadow:none!important;background:#eceff4!important}
.cal-event-top{display:flex!important;align-items:center;gap:5px;min-width:0}
.cal-event-top i{width:6px;height:6px;border-radius:50%;background:var(--event-color);flex:0 0 auto}
.cal-event-top strong{font-size:9px!important;letter-spacing:.35px!important;text-transform:uppercase;color:#777f8f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-event-top small{margin-left:auto;font-size:9px!important;color:#8b93a1;font-weight:800;white-space:nowrap}
.cal-event-title{display:block!important;margin-top:3px;font-size:11px!important;font-weight:850!important;color:#252b38!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.legend{gap:14px!important;margin-top:16px!important}
.legend span{display:inline-flex!important;align-items:center;gap:6px;background:transparent!important;color:#6f7888!important;border-radius:0!important;padding:0!important;font-size:10px!important;font-weight:800!important}
.legend span i{width:7px;height:7px;border-radius:50%;display:inline-block}

#eventDetails{width:min(560px,94%);border-radius:18px!important;box-shadow:0 24px 70px rgba(24,31,48,.18)}
#eventDetails::backdrop,#modal::backdrop{background:rgba(24,31,48,.30);backdrop-filter:blur(3px)}
.event-detail-dialog{padding:22px 24px!important}
.event-detail-dialog .panel-head{padding-bottom:14px;border-bottom:1px solid #edf0f4}
.event-detail-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:0 22px!important;margin-top:6px!important}
.event-detail-grid>div{background:transparent!important;border:0!important;border-bottom:1px solid #edf0f4!important;border-radius:0!important;padding:14px 0!important}
.event-detail-grid .wide{grid-column:1/-1!important}
.event-detail-grid span{font-size:9px!important;letter-spacing:.55px!important;color:#969eac!important;margin-bottom:6px!important}
.event-detail-grid strong{display:flex;align-items:center;gap:7px;font-size:13px;color:#252b38}
.event-detail-grid p{font-size:13px;line-height:1.55;color:#3e4654}
.event-detail-grid .notes-row{border-bottom:0!important}
.event-detail-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex:0 0 auto}
#eventDetails .modal-actions{border-top:1px solid #edf0f4;padding-top:16px;margin-top:2px}
#eventDetails .btn{border-radius:9px;padding:9px 12px;font-size:12px}
@media(max-width:700px){.calendar{min-width:760px}.event-detail-grid{grid-template-columns:1fr!important}.event-detail-grid .wide{grid-column:auto!important}}


/* V10 — page Réseaux sociaux, carnet d'idées minimal */
.social-panel{max-width:1050px}
.social-ideas{display:grid;gap:14px;margin-top:18px}
.social-card{border:1px solid #e7ebf2;background:#fff;border-radius:16px;padding:18px 19px;box-shadow:0 8px 26px rgba(26,34,51,.045);transition:opacity .15s ease,background .15s ease}
.social-card.social-complete{background:#f7f8fb;opacity:.72}
.social-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:12px;border-bottom:1px solid #edf0f4}
.social-card h3{margin:0;font-size:16px;line-height:1.3;color:#252b38;overflow-wrap:anywhere}
.social-statuses{display:flex;align-items:center;gap:14px;flex:0 0 auto}
.social-statuses label{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:850;color:#505969;cursor:pointer;user-select:none;white-space:nowrap}
.social-statuses input{appearance:none;width:18px;height:18px;border:1.5px solid #c8cfda;border-radius:5px;background:#fff;display:grid;place-items:center;cursor:pointer;margin:0}
.social-statuses input:checked{background:#7658ef;border-color:#7658ef}
.social-statuses input:checked::after{content:'✓';color:#fff;font-size:12px;font-weight:1000;line-height:1}
.social-note{padding-top:13px;color:#596273;font-size:13px;line-height:1.6;white-space:normal;overflow-wrap:anywhere}
.social-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin-top:13px}
.social-actions .tiny-delete{position:static}
.social-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:220px;border:1px dashed #d9dee7;border-radius:16px;color:#8b94a4;background:#fafbfc}
.social-empty strong{color:#535c6c;margin-bottom:6px}
.social-empty span{font-size:12px}
@media(max-width:650px){.social-card-head{flex-direction:column}.social-statuses{width:100%;justify-content:flex-start}.social-card{padding:15px}}
