#clientDashboard{border:1px solid #3a373e;border-radius:18px;padding:18px;background:linear-gradient(135deg,#222026,#111015);color:#efedf2}
#clientDashboard[hidden]{display:none}
.client-overview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.client-overview-head h2{margin:0;font-size:18px;font-weight:700}.client-overview-head p{margin:4px 0;color:#99969e;font-size:12px}
#clientDashboard button{border:1px solid #5b5124;background:#302b16;color:#ffe344;border-radius:9px;padding:7px 12px;font-size:12px}
#clientDashboardTotals{display:flex;gap:20px;flex-wrap:wrap;margin:14px 0;font-size:13px;color:#b9b6be}#clientDashboardTotals b{font-size:20px;color:#ffe344;margin-left:5px}
#clientDashboardSearch{width:100%;border:1px solid #45404b;border-radius:9px;background:#18161d;color:#eee;padding:8px 12px;font-size:13px;margin-bottom:12px}
#clientDashboardRows{max-height:520px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--gr-scrollbar-thumb,rgba(244,217,34,.42)) var(--gr-scrollbar-track,#0e0d12);container:client-list / inline-size}
#clientDashboardRows::-webkit-scrollbar{width:var(--gr-scrollbar-size-thin,6px);height:var(--gr-scrollbar-size-thin,6px)}
#clientDashboardRows::-webkit-scrollbar-track{background:var(--gr-scrollbar-track,#0e0d12)}
#clientDashboardRows::-webkit-scrollbar-thumb{background:var(--gr-scrollbar-thumb,rgba(244,217,34,.42));border-radius:9999px}
#clientDashboardRows::-webkit-scrollbar-thumb:hover{background:var(--gr-scrollbar-thumb-hover,rgba(244,217,34,.68))}
@media (forced-colors: active){#clientDashboardRows{scrollbar-color:auto !important}}
.client-overview-row{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,3fr);gap:16px;padding:12px 0;border-top:1px solid #38343d}
.client-overview-identity{display:flex;flex-direction:column;gap:3px;font-size:13px;overflow-wrap:anywhere}.client-overview-identity span{color:#99969e;font-size:12px}.client-overview-identity b{color:#f4d922;font-size:12px;margin-top:3px}
.client-overview-connection{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:7px 10px;border:1px solid #36323c;background:#19171e;border-radius:9px;margin-bottom:5px;overflow-wrap:anywhere}
.client-overview-connection div{display:flex;flex-direction:column;gap:3px}.client-overview-connection strong{font-size:13px}.client-overview-connection span{font-size:12px;color:#99969e}.client-overview-server strong{color:#a8d0e8}.client-overview-empty{font-size:13px;color:#99969e;padding:8px 0}
@media(max-width:640px){.client-overview-row{grid-template-columns:1fr;gap:7px}.client-overview-connection{grid-template-columns:1fr}}
#clientDashboard .client-delete-open{align-self:flex-start;margin-top:7px;border-color:#6a3c45;background:#2e1e25;color:#eaa8b3;font-size:11px;padding:5px 9px}
.client-delete-dialog{width:min(460px,calc(100vw - 32px));padding:24px;border:1px solid #5a4f38;border-radius:20px;background:linear-gradient(140deg,#29252d,#121116);color:#efedf2;box-shadow:0 20px 80px #000b}
.client-delete-dialog::backdrop{background:#000b;backdrop-filter:blur(4px)}
.client-delete-dialog h2{font-size:21px;font-weight:700;margin:0 0 12px}.client-delete-dialog p{font-size:13px;line-height:1.6;color:#b9b6be;margin:10px 0}.client-delete-dialog #clientDeleteName{color:#ffe344;overflow-wrap:anywhere}
.client-delete-dialog #clientDeleteError{color:#ff939f;min-height:20px}.client-delete-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.client-delete-actions button{border:1px solid #49414e;border-radius:10px;padding:9px 14px;background:#25222b;color:#eee;font-size:13px}.client-delete-actions #clientDeleteConfirm{background:#713540;border-color:#a45060;color:white}.client-delete-actions button:disabled{opacity:.5;cursor:wait}
#clientDashboard .client-access-open{align-self:flex-start;margin-top:7px;font-size:11px;padding:5px 9px}

/* Compact client rows with expandable connection details. */
#clientDashboard{display:grid;grid-template-columns:max-content max-content minmax(140px,1fr) max-content;align-items:center;gap:8px 14px;padding:10px 14px;min-width:0;max-width:100%;box-sizing:border-box}
#clientDashboard[hidden]{display:none}
#clientDashboard .client-overview-head,#clientDashboard .client-overview-head>div{display:contents}
#clientDashboard .client-overview-head h2{grid-column:1;grid-row:1;font-size:14px;white-space:nowrap}
#clientDashboardTotals{grid-column:2;grid-row:1;margin:0;gap:12px;flex-wrap:wrap;white-space:nowrap;font-size:11px;min-width:0}
#clientDashboardTotals b{font-size:14px;margin-left:3px}
#clientDashboardSearch{grid-column:3;grid-row:1;margin:0;padding:5px 9px;height:30px;font-size:12px;min-width:0;max-width:100%;box-sizing:border-box}
#refreshClientDashboard{grid-column:4;grid-row:1;padding:5px 10px!important;font-size:11px!important;white-space:nowrap}
#clientDashboardMessage{grid-column:1/-1;grid-row:3;margin:0;font-size:11px;overflow-wrap:anywhere}
#clientDashboardMessage:empty{display:none}
#clientDashboardRows{grid-column:1/-1;grid-row:2;min-width:0;max-width:100%;max-height:560px;overflow-y:auto;overflow-x:visible;display:flex;flex-direction:column;gap:5px;padding-top:2px}
#clientDashboard .client-overview-row{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:5px 8px;border:1px solid #302d36;border-radius:11px;background:rgba(20,18,24,0.72);min-width:0;max-width:100%;box-sizing:border-box}
#clientDashboard .client-overview-identity{display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center;gap:4px 7px;flex:1 1 auto;min-width:0;max-width:100%}
#clientDashboard .client-overview-identity>strong{order:0;flex-shrink:1;min-width:0;overflow-wrap:anywhere;font-size:13px;color:#fff}
#clientDashboard .client-overview-identity>span:not(.client-balance-pill){order:1;flex-shrink:1;min-width:0;overflow-wrap:anywhere;font-size:11.5px;color:#99969e}
#clientDashboard .client-overview-identity>span:empty{display:none}
#clientDashboard .client-overview-identity .client-balance-pill{order:3;flex-wrap:wrap;max-width:100%;white-space:normal}
#clientDashboard .client-credit-open,
#clientDashboard .client-impersonate-btn,
#clientDashboard .client-access-open,
#clientDashboard .client-delete-open{margin:0;align-self:center;white-space:normal;flex-shrink:0;text-align:center}
#clientDashboard .client-impersonate-btn{order:5;border:1px solid #7c6820;background:#352c10;color:#ffe866;font-size:11px;padding:5px 9px;border-radius:7px;cursor:pointer}
#clientDashboard .client-impersonate-btn:hover:not(:disabled){background:#473b15;border-color:#a58b29}
#clientDashboard .client-impersonate-btn:disabled{opacity:.45;cursor:not-allowed;border-color:#3a373e;background:#1b1920;color:#777}
#clientDashboard .client-overview-connections{flex:0 1 auto;min-width:0;max-width:100%}
#clientDashboard .client-overview-connection{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;flex:1 1 250px;min-width:0;max-width:100%;padding:6px 10px;margin:0;white-space:normal;box-sizing:border-box}
#clientDashboard .client-overview-connection div{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;gap:4px 7px;min-width:0;max-width:100%}
#clientDashboard .client-overview-connection strong,#clientDashboard .client-overview-connection span{font-size:11.5px;overflow-wrap:anywhere}
#clientDashboard .client-overview-empty{padding:3px 0;font-size:11.5px;white-space:normal}
@media(max-width:1024px){#clientDashboard{grid-template-columns:1fr max-content;gap:8px 10px}#clientDashboard .client-overview-head h2{grid-column:1;grid-row:1}#refreshClientDashboard{grid-column:2;grid-row:1}#clientDashboardTotals{grid-column:1/-1;grid-row:2;white-space:normal}#clientDashboardSearch{grid-column:1/-1;grid-row:3}#clientDashboardRows{grid-row:4}#clientDashboardMessage{grid-row:5}}
@media(max-width:520px){#clientDashboard{padding:10px}#clientDashboard .client-overview-identity{gap:6px}#clientDashboard .client-credit-open,#clientDashboard .client-impersonate-btn,#clientDashboard .client-access-open,#clientDashboard .client-delete-open{flex:1 1 calc(50% - 4px);font-size:11px;padding:6px 8px}}

#clientDashboard .client-overview-connections summary {
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid #36323c;
  border-radius: 7px;
  font-size: 11.5px;
  color: #f4d922;
}

#clientDashboard .client-overview-connections summary span {
  margin-inline-start: 6px;
  color: #b9b6be;
}

#clientDashboard .client-overview-connection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#clientDashboard .client-overview-connections[open] {
  flex-basis: 100%;
}

@container client-list (min-width: 810px) {
  #clientDashboard .client-overview-identity {
    flex-wrap: nowrap;
  }

  #clientDashboard .client-overview-identity > button {
    padding: 4px 8px;
    font-size: 11px;
  }
}

#clientDashboard .client-overview-employees {
  order: 8;
  flex-basis: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 2px;
}

#clientDashboard .client-overview-employees summary {
  display: inline-block;
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid #36323c;
  border-radius: 7px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(25, 23, 30, 0.7);
}

#clientDashboard .client-overview-employee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#clientDashboard .client-overview-employee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #36323c;
  background: #19171e;
  border-radius: 9px;
  box-sizing: border-box;
}

#clientDashboard .client-overview-employee.is-search-match {
  border-color: #7c6820;
  background: #231f16;
}

#clientDashboard .client-overview-employee-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#clientDashboard .client-overview-employee-info strong {
  font-size: 12.5px;
  color: #fff;
}

#clientDashboard .client-overview-employee-info span {
  font-size: 11.5px;
  color: #99969e;
}
