/* NOURIVOIRE - Base de données clients
   Vue conforme au fichier de référence, sans import des lignes d'exemple. */
#gestion_client #gcPanelDatabase{padding:0;}
#gestion_client .gcd-card{overflow:hidden;}
#gestion_client .gcd-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px;}
#gestion_client .gcd-heading h3{margin:0 0 4px;color:#102a43;font-size:18px;font-weight:900;}
#gestion_client .gcd-heading p{margin:0;color:#52606d;font-size:13px;font-weight:700;}
#gestion_client .gcd-legend{display:flex;align-items:center;gap:7px;flex-wrap:wrap;white-space:nowrap;background:#f8fafc;border:1px solid #d8e1ea;border-radius:9px;padding:8px 10px;font-size:12px;font-weight:800;color:#334155;}
#gestion_client .gcd-dot{width:11px;height:11px;border-radius:3px;display:inline-block;border:1px solid rgba(15,23,42,.15);}
#gestion_client .gcd-dot.required{background:#dff2df;}
#gestion_client .gcd-dot.optional{background:#e8edf3;}

#gestion_client .gcd-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(210px,1fr));gap:12px 14px;align-items:end;}
#gestion_client .gcd-filter-grid-advanced{margin-top:12px;grid-template-columns:repeat(4,minmax(180px,1fr));}
#gestion_client .gcd-field{min-width:0;}
#gestion_client .gcd-field label{display:block;margin:0 0 5px;color:#1f2937;font-weight:900;font-size:13px;}
#gestion_client .gcd-field input,#gestion_client .gcd-field select{width:100%;min-width:0;min-height:42px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:9px;background:#f8fafc;padding:9px 11px;color:#111827;font-weight:750;}
#gestion_client .gcd-field input:focus,#gestion_client .gcd-field select:focus{outline:none;border-color:#2c6f7f;box-shadow:0 0 0 3px rgba(44,111,127,.12);background:#fff;}
#gestion_client .gcd-advanced{margin-top:12px;border:1px solid #d8e1ea;border-radius:10px;background:#fbfdff;padding:0 12px 12px;}
#gestion_client .gcd-advanced summary{cursor:pointer;list-style:none;padding:11px 0 10px;color:#155e75;font-weight:900;user-select:none;}
#gestion_client .gcd-advanced summary::-webkit-details-marker{display:none;}
#gestion_client .gcd-advanced summary::before{content:'▸';display:inline-block;margin-right:7px;transition:transform .15s ease;}
#gestion_client .gcd-advanced[open] summary::before{transform:rotate(90deg);}
#gestion_client .gcd-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:14px 0 8px;}
#gestion_client .gcd-actions-spacer{flex:1 1 auto;}
#gestion_client .gcd-actions button{min-height:40px;}
#gestion_client .gcd-message{min-height:20px;margin:4px 0;font-weight:850;color:#0b6623;}
#gestion_client .gcd-message.error{color:#b42318;}
#gestion_client .gcd-summary{margin:6px 0 10px;padding:9px 12px;border-left:4px solid #2c6f7f;border-radius:7px;background:#eef8fb;color:#174a58;font-weight:900;}

#gestion_client .gcd-table-wrap{position:relative;overflow:auto;max-height:610px;border:1px solid #aebdca;border-radius:10px;background:#fff;scrollbar-gutter:stable;}
#gestion_client #gcdTable{width:max-content;min-width:2780px;border-collapse:separate;border-spacing:0;table-layout:fixed;}
#gestion_client #gcdTable th,#gestion_client #gcdTable td{border-right:1px solid #111;border-bottom:1px solid #111;padding:7px 8px;text-align:center;vertical-align:middle;font-size:12px;line-height:1.25;background:#fff;word-break:break-word;}
#gestion_client #gcdTable th{position:sticky;top:0;z-index:8;background:#dff2df;color:#0f2514;font-size:12px;font-weight:950;white-space:normal;}
#gestion_client #gcdTable th.gcd-optional{background:#e8edf3;color:#263442;}
#gestion_client #gcdTable th:first-child,#gestion_client #gcdTable td:first-child{border-left:1px solid #111;}
#gestion_client #gcdTable thead tr:first-child th{border-top:1px solid #111;}
#gestion_client #gcdTable tbody tr:hover td{background:#f3fafc;}
#gestion_client #gcdTable td.gcd-left{text-align:left;font-weight:750;}
#gestion_client #gcdTable td.gcd-empty{color:#8a94a3;font-style:italic;font-weight:700;}
#gestion_client #gcdTable .gcd-sticky-1{position:sticky;left:0;z-index:10;width:54px;min-width:54px;max-width:54px;background:#d6dce4;}
#gestion_client #gcdTable .gcd-sticky-2{position:sticky;left:54px;z-index:10;width:122px;min-width:122px;max-width:122px;background:#d6dce4;}
#gestion_client #gcdTable tbody td.gcd-sticky-1,#gestion_client #gcdTable tbody td.gcd-sticky-2{z-index:4;background:#fff;}
#gestion_client #gcdTable tbody tr:hover td.gcd-sticky-1,#gestion_client #gcdTable tbody tr:hover td.gcd-sticky-2{background:#f3fafc;}
#gestion_client #gcdTable th:nth-child(3){width:145px;}  #gestion_client #gcdTable th:nth-child(4){width:112px;}
#gestion_client #gcdTable th:nth-child(5){width:118px;}  #gestion_client #gcdTable th:nth-child(6){width:112px;}
#gestion_client #gcdTable th:nth-child(7){width:142px;}  #gestion_client #gcdTable th:nth-child(8){width:120px;}
#gestion_client #gcdTable th:nth-child(9){width:138px;}  #gestion_client #gcdTable th:nth-child(10){width:210px;}
#gestion_client #gcdTable th:nth-child(11){width:130px;} #gestion_client #gcdTable th:nth-child(12){width:160px;}
#gestion_client #gcdTable th:nth-child(13){width:130px;} #gestion_client #gcdTable th:nth-child(14){width:105px;}
#gestion_client #gcdTable th:nth-child(15){width:118px;} #gestion_client #gcdTable th:nth-child(16){width:118px;}
#gestion_client #gcdTable th:nth-child(17){width:135px;} #gestion_client #gcdTable th:nth-child(18){width:230px;}

#gestion_client .gcd-code-btn{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:32px;border:1px solid #2c7d90;border-radius:8px;background:#f2fbfd;color:#0f5f6f;font-weight:950;cursor:pointer;padding:5px 7px;line-height:1.15;}
#gestion_client .gcd-code-btn:hover,#gestion_client .gcd-code-btn:focus{background:#2c6f7f;color:#fff;outline:none;box-shadow:0 0 0 3px rgba(44,111,127,.15);}
#gestion_client .gcd-profile-state{display:block;margin-top:5px;border-radius:999px;padding:3px 6px;font-size:9px;font-weight:950;line-height:1.1;}
#gestion_client .gcd-profile-state.complete{background:#dcfce7;color:#166534;}
#gestion_client .gcd-profile-state.incomplete{background:#fee2e2;color:#b42318;}

/* Le code spécial du Répertoire devient un accès direct à la fiche d'identification. */
#gestion_client #gcClientsTable .gc-col-code .gc-code{display:inline-flex;align-items:center;justify-content:center;min-height:32px;width:100%;box-sizing:border-box;border:1px solid #2c7d90;border-radius:8px;background:#f2fbfd;color:#0f5f6f;font-weight:950;cursor:pointer;padding:5px 7px;}
#gestion_client #gcClientsTable .gc-col-code .gc-code:hover,#gestion_client #gcClientsTable .gc-col-code .gc-code:focus{background:#2c6f7f;color:#fff;outline:none;box-shadow:0 0 0 3px rgba(44,111,127,.15);}

.gcd-modal-overlay{position:fixed;inset:0;z-index:2147483200;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.62);backdrop-filter:blur(2px);}
.gcd-modal-overlay.open{display:flex;}
.gcd-modal-card{position:relative;width:min(96vw,1700px);max-height:92vh;overflow:auto;background:#fff;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.35);padding:18px 18px 20px;}
.gcd-modal-close{position:sticky;float:right;top:0;z-index:20;width:38px;height:38px;border:0;border-radius:50%;background:#b42318;color:#fff;font-size:25px;font-weight:900;line-height:1;cursor:pointer;}
.gcd-modal-title{margin:2px 48px 5px 0;color:#102a43;font-size:20px;font-weight:950;}
.gcd-modal-subtitle{margin:0 48px 13px 0;color:#52606d;font-weight:750;}
.gcd-modal-status{display:inline-flex;align-items:center;gap:7px;margin-bottom:12px;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:950;}
.gcd-modal-status.complete{background:#dcfce7;color:#166534;}
.gcd-modal-status.incomplete{background:#fee2e2;color:#b42318;}
.gcd-profile-table-wrap{overflow:auto;border:1px solid #111;border-radius:8px;background:#fff;}
.gcd-profile-table{width:max-content;min-width:2370px;border-collapse:collapse;table-layout:fixed;}
.gcd-profile-table th,.gcd-profile-table td{border:1px solid #111;padding:7px 8px;text-align:center;vertical-align:middle;font-size:12px;line-height:1.25;}
.gcd-profile-table th{background:#dff2df;color:#0f2514;font-weight:950;}
.gcd-profile-table th.optional{background:#e8edf3;color:#263442;}
.gcd-profile-table td.left{text-align:left;font-weight:800;}
.gcd-profile-table td.missing{background:#fff1f2;color:#b42318;font-weight:900;}
.gcd-profile-note{margin:12px 0 0;padding:9px 12px;border-radius:8px;background:#f8fafc;color:#475569;font-size:12px;font-weight:750;}
.gcd-loading,.gcd-error{padding:28px;text-align:center;font-weight:900;}
.gcd-error{color:#b42318;}

@media(max-width:1250px){
  #gestion_client .gcd-filter-grid{grid-template-columns:repeat(2,minmax(210px,1fr));}
  #gestion_client .gcd-filter-grid-advanced{grid-template-columns:repeat(2,minmax(190px,1fr));}
}
@media(max-width:720px){
  #gestion_client .gcd-heading{display:block;}
  #gestion_client .gcd-legend{margin-top:10px;white-space:normal;}
  #gestion_client .gcd-filter-grid,#gestion_client .gcd-filter-grid-advanced{grid-template-columns:1fr;}
  #gestion_client .gcd-actions{align-items:stretch;}
  #gestion_client .gcd-actions button{width:100%;}
  #gestion_client .gcd-actions-spacer{display:none;}
  .gcd-modal-overlay{padding:6px;}
  .gcd-modal-card{width:100%;max-height:96vh;border-radius:10px;padding:12px;}
}

/* Création directe d'un client depuis Base de données clients */
#gestion_client .gcd-heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;}
#gestion_client #btnGcdCreateClient{min-height:38px;padding:8px 14px;white-space:nowrap;}
.gcd-create-card{width:min(96vw,1180px);}
.gcd-create-core{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:12px;margin:12px 0;}
.gcd-create-field,.gcd-create-profile .nrv-client-profile-field{min-width:0;}
.gcd-create-field label,.gcd-create-profile .nrv-client-profile-field label{display:block;margin:0 0 5px;color:#172b34;font-size:12px;font-weight:900;}
.gcd-create-field label span,.gcd-create-profile .req{color:#c1121f;}
.gcd-create-field input,.gcd-create-profile input,.gcd-create-profile select{width:100%;min-width:0;height:40px;box-sizing:border-box;border:1px solid #b8c8d4;border-radius:8px;background:#fff;padding:7px 9px;color:#14252c;font:inherit;font-size:13px;}
.gcd-create-field input:focus,.gcd-create-profile input:focus,.gcd-create-profile select:focus{outline:2px solid rgba(44,111,127,.2);border-color:#2c6f7f;}
.gcd-create-profile{margin:12px 0;padding:12px;border:1px solid #d5dce5;border-radius:10px;background:#f8fbfc;}
.gcd-create-profile .nrv-client-create-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:10px 12px;}
.gcd-create-profile .nrv-client-profile-field.invalid input,.gcd-create-profile .nrv-client-profile-field.invalid select{border-color:#dc2626;background:#fff7f7;}
.gcd-create-msg{min-height:22px;margin:8px 0;font-weight:850;color:#0b6623;}
.gcd-create-msg.error{color:#b42318;}
.gcd-create-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:10px;}
.gcd-create-actions button{min-height:40px;padding:8px 15px;}
@media(max-width:1050px){.gcd-create-profile .nrv-client-create-grid{grid-template-columns:repeat(3,minmax(160px,1fr));}}
@media(max-width:800px){.gcd-create-profile .nrv-client-create-grid,.gcd-create-core{grid-template-columns:repeat(2,minmax(150px,1fr));}}
@media(max-width:560px){.gcd-create-profile .nrv-client-create-grid,.gcd-create-core{grid-template-columns:1fr;}}
