/* Style Sôluxe */
:root{
  --soluxe-admin-bg:#0f1115;
  --soluxe-admin-bg-deep:#0b1220;
  --soluxe-admin-card:#151823;
  --soluxe-admin-card-2:#0e131c;
  --soluxe-admin-card-3:#101827;
  --soluxe-admin-nav:#1c2333;
  --soluxe-admin-border:rgba(255,255,255,.08);
  --soluxe-admin-border-strong:rgba(148,163,184,.24);
  --soluxe-admin-text:#e8edf2;
  --soluxe-admin-muted:#9aa4b2;
  --soluxe-admin-blue:#3da9fc;
  --soluxe-admin-blue-btn:#2f6df6;
  --soluxe-admin-blue-btn-hover:#255fdc;

  /* Rouge unique officiel : erreurs, annulés, en retard, reste à encaisser. */
  --soluxe-red:#ff3b4f;
  --soluxe-red-soft:rgba(255,59,79,.16);
  --soluxe-red-border:rgba(255,59,79,.55);
  --soluxe-red-text:#ff3b4f;

  --bg:var(--soluxe-admin-bg);
  --card:var(--soluxe-admin-card-2);
  --card-soft:var(--soluxe-admin-bg-deep);
  --card-2:var(--soluxe-admin-card-3);
  --line:var(--soluxe-admin-border);
  --line-2:var(--soluxe-admin-border-strong);
  --text:var(--soluxe-admin-text);
  --muted:var(--soluxe-admin-muted);
  --accent:var(--soluxe-admin-blue-btn);
  --soft:rgba(61,169,252,.13);
  --ok-bg:rgba(61,169,252,.13);
  --ok-text:#bfdbfe;
  --bad-bg:var(--soluxe-red-soft);
  --bad-text:var(--soluxe-red);
  --error-bg:var(--soluxe-red-soft);
  --error-text:var(--soluxe-red);
  --danger:var(--soluxe-red);
  --soluxe-danger:var(--soluxe-red);
  --soluxe-danger-strong:var(--soluxe-red);
  --soluxe-danger-bg:var(--soluxe-red-soft);
  --soluxe-danger-border:var(--soluxe-red-border);
  --soluxe-blue:var(--soluxe-admin-blue-btn);
  --soluxe-blue-hover:var(--soluxe-admin-blue-btn-hover);
  --soluxe-blue-soft:rgba(61,169,252,.13);
  --soluxe-blue-border:rgba(61,169,252,.38);
  --soluxe-blue-text:#bfdbfe;
}

*{box-sizing:border-box;}
html,body{min-height:100%;}
body{
  background:var(--soluxe-admin-bg)!important;
  color:var(--soluxe-admin-text)!important;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif!important;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 15% 8%, rgba(47,109,246,.11), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(61,169,252,.08), transparent 28%),
    var(--soluxe-admin-bg);
}

.wrap{max-width:1240px!important;margin-inline:auto!important;padding-inline:16px!important;}
h1,.head h1{color:var(--soluxe-admin-text)!important;text-shadow:none!important;}
.sub,.meta,.summary-note,.summary-label,.client-phone,.muted,.panel-sub,.ops-muted,.date-line,.metrics-sub,.mini-label,.cell-label,.history-prop,.history-date,.expense-help{
  color:var(--soluxe-admin-muted)!important;
}

.toolbar,.toolbar-form,.quick-search-panel,.operations-panel,.summary-card,.client-card,.receipt-card,.ops-card,.ops-detail-card,.month-section,.property-section,.date-group,.message,.empty,.action-notice,.section-card,.form-section,.property-panel,.search-result-card,.info-box,.metrics-box,.history-box,.history-item,.history-cell,.mini-card,.stat-chip,.money-chip,.source-panel,.output,.notice,.receipt-detail,.client-content,.details-panel{
  background:var(--soluxe-admin-bg-deep)!important;
  color:var(--soluxe-admin-text)!important;
  border-color:var(--soluxe-admin-border)!important;
  box-shadow:none!important;
}
.toolbar,.quick-search-panel,.operations-panel,.client-card,.month-section,.property-section,.date-group,.ops-detail-card,.form-section{
  border:1px solid var(--soluxe-admin-border)!important;
}

/* Supprime les anciens blocs blancs dans fidélité et les détails déroulés. */
details[open] .client-summary,
details.client-card[open] .client-summary,
.client-summary,
.client-content,
.client-top,
.history-list,
.history-grid,
.mini-grid,
.history-item,
.history-cell,
.mini-card,
.info-box,
.metrics-box,
.history-box,
.money-chip,
.stat-chip{
  background:var(--soluxe-admin-bg-deep)!important;
  color:var(--soluxe-admin-text)!important;
  border-color:var(--soluxe-admin-border)!important;
}
.client-card[open],details.client-card[open]{background:var(--soluxe-admin-bg-deep)!important;}
.client-name,.summary-value,.stat-value,.money-value,.mini-value,.cell-value,.history-id,.ops-client,.ops-property,.box-title,.metrics-title,.panel-title,.receipt-id,.section-title,.client-title,.date-group-title,.month-title,.property-title{
  color:var(--soluxe-admin-text)!important;
}

input,select,textarea{
  background:var(--soluxe-admin-bg-deep)!important;
  color:var(--soluxe-admin-text)!important;
  border:1px solid var(--soluxe-admin-border-strong)!important;
  box-shadow:none!important;
}
input::placeholder,textarea::placeholder{color:rgba(154,164,178,.75)!important;}
input:focus,select:focus,textarea:focus{
  outline:none!important;
  border-color:rgba(61,169,252,.65)!important;
  box-shadow:0 0 0 3px rgba(61,169,252,.14)!important;
}

button,.btn,.btn-link,.btn-light,.nav-btn,.ops-filter,.ops-mini-btn,.toggle-btn,a.btn-link{
  background:var(--soluxe-admin-nav)!important;
  color:var(--soluxe-admin-text)!important;
  border:1px solid var(--soluxe-admin-border-strong)!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
button:hover,.btn:hover,.btn-link:hover,.btn-light:hover,.nav-btn:hover,.ops-filter:hover,.ops-mini-btn:hover,.toggle-btn:hover,a.btn-link:hover{
  filter:brightness(1.08)!important;
  transform:translateY(-1px)!important;
}
.btn,.btn-primary,button[type="submit"],.primary,.ops-filter.is-active,.nav-btn.primary{
  background:var(--soluxe-admin-blue-btn)!important;
  border-color:var(--soluxe-admin-blue-btn)!important;
  color:#fff!important;
}
.btn:hover,.btn-primary:hover,button[type="submit"]:hover,.primary:hover{background:var(--soluxe-admin-blue-btn-hover)!important;}

/* Badges bleus neutres. */
.pill,.pill.ACTIF,.ACTIF,.source-badge,.source-whatsapp,.source-site,.source-facebook,.source-tiktok,.source-phone,.source-other,.flow-today,.flow-paid,.flow-future,.badge-note,.tag,.ops-status,.status-chip{
  background:rgba(61,169,252,.13)!important;
  color:#bfdbfe!important;
  border-color:rgba(61,169,252,.38)!important;
}

/* Rouge unique officiel partout où l'information est négative ou à encaisser. */
.ANNULE,.ANNULÉ,.ERREUR,.pill.ANNULE,.pill.ANNULÉ,.pill.ERREUR,.flow-cancel,.flow-error,.flow-late,.ops-status.late,.status-late,.status-error,.status-cancel,.excluded,.message.is-error,.action-notice.ko,.is-error,.is-danger,.badge-danger,.late-badge{
  background:var(--soluxe-red-soft)!important;
  color:var(--soluxe-red)!important;
  border-color:var(--soluxe-red-border)!important;
}
.amt-bad,.ops-amount.pending,.rest-danger,.remaining-positive,.money-value.rest-positive,.amount-rest,.reste-positive,.money-line .rest-positive,.cell-value.rest-positive,.summary-value.rest-positive,.history-rest,.receipt-rest,.rest-positive,[data-rest-positive="true"]{
  color:var(--soluxe-red)!important;
  -webkit-text-fill-color:var(--soluxe-red)!important;
}
/* Le libellé + le fond restent basés sur le même rouge officiel. */
.rest-chip,.money-chip.has-rest,.summary-card.has-rest,.history-cell.has-rest,.ops-amount.pending{
  border-color:var(--soluxe-red-border)!important;
}

/* Totaux, cartes et détails : même contraste que le dashboard admin. */
.summary-card,.stat-chip,.money-chip,.mini-card,.history-cell,.history-item,.info-box,.metrics-box,.history-box{
  border-radius:16px!important;
}
.money-chip.is-highlight,.summary-card.is-highlight{
  background:var(--soluxe-admin-bg-deep)!important;
  border-color:var(--soluxe-admin-border-strong)!important;
}

/* Messages informatifs sans vert dominant. */
.message.is-info,.action-notice.ok,.notice.ok,.success,.sync-ok{
  background:rgba(61,169,252,.13)!important;
  color:#bfdbfe!important;
  border-color:rgba(61,169,252,.38)!important;
}

.back-top-btn{
  background:var(--soluxe-admin-blue-btn)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.14)!important;
  box-shadow:0 16px 40px rgba(0,0,0,.28)!important;
}

/* Petites corrections de lisibilité. */
hr,.divider{border-color:var(--soluxe-admin-border)!important;}
table,th,td{border-color:var(--soluxe-admin-border)!important;color:var(--soluxe-admin-text)!important;}
::-webkit-scrollbar{width:12px;height:12px;}
::-webkit-scrollbar-track{background:var(--soluxe-admin-bg);}
::-webkit-scrollbar-thumb{background:#283246;border-radius:999px;border:3px solid var(--soluxe-admin-bg);}
::-webkit-scrollbar-thumb:hover{background:#34425c;}


/* Finition interface : champs, boutons et icône calendrier. */
input,select,textarea,button,.btn,.btn-primary,.btn-light,.btn-link,.nav-btn,.archive-btn,.backup-btn,.ops-filter,.ops-mini-btn,.toggle-btn,.btn-state,.tag-btn,.file-link{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif!important;
}
input,select,textarea{
  min-height:44px!important;
  border-radius:14px!important;
  padding:0 14px!important;
  background:#0b1220!important;
  color:#e8edf2!important;
  caret-color:#e8edf2!important;
}
textarea{padding-top:12px!important;padding-bottom:12px!important;}
input[type="date"],input[type="month"],input[type="datetime-local"]{
  /* Le champ reste sombre pour que l’icône soit lisible,
     mais le sélecteur natif du navigateur garde son rendu clair. */
  color-scheme:light!important;
  padding-right:46px!important;
  background-color:#0b1220!important;
  color:#e8edf2!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23e8edf2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:right 16px center!important;
  background-size:18px 18px!important;
}
input[type="time"]{
  color-scheme:light!important;
  padding-right:42px!important;
  background-color:#0b1220!important;
  color:#e8edf2!important;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator{
  opacity:0!important;
  cursor:pointer!important;
  width:34px!important;
  height:34px!important;
}
input[type="time"]::-webkit-calendar-picker-indicator{
  opacity:.78!important;
  cursor:pointer!important;
}
input[type="date"]:hover,input[type="date"]:focus,
input[type="month"]:hover,input[type="month"]:focus,
input[type="datetime-local"]:hover,input[type="datetime-local"]:focus{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E")!important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color:#0f172a!important;
  box-shadow:0 0 0 1000px #eaf2ff inset!important;
  border-color:rgba(61,169,252,.55)!important;
}
button,.btn,.btn-primary,.btn-light,.btn-link,.nav-btn,.archive-btn,.backup-btn,.ops-filter,.ops-mini-btn,.toggle-btn,.btn-state,.tag-btn,.file-link{
  min-height:44px!important;
  border-radius:14px!important;
  padding:10px 16px!important;
  line-height:1.15!important;
  font-weight:800!important;
  text-decoration:none!important;
}
button:disabled,.btn:disabled,.btn-light:disabled,.backup-btn:disabled,.archive-btn:disabled{
  opacity:.48!important;
  cursor:not-allowed!important;
  transform:none!important;
}
.actions-box .muted{
  color:#bfdbfe!important;
}


/* Correction ciblée sur la page de génération du reçu :
   l’icône visible est désormais l’indicateur natif, donc la zone cliquable reste au même endroit. */
input.soluxe-date-picker[type="date"]{
  color-scheme:light!important;
  padding-right:14px!important;
  background-image:none!important;
  background-color:#0b1220!important;
  color:#e8edf2!important;
}
input.soluxe-date-picker[type="date"]:hover,
input.soluxe-date-picker[type="date"]:focus{
  background-image:none!important;
}
input.soluxe-date-picker[type="date"]::-webkit-calendar-picker-indicator{
  opacity:1!important;
  display:block!important;
  width:22px!important;
  height:22px!important;
  padding:6px!important;
  margin:0!important;
  cursor:pointer!important;
  filter:invert(1) brightness(1.8)!important;
}
