@import "./variables.css";

.clients__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.clients__search {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    gap: 4px;
    border: 1px solid var(--clients-border-color);
    background: transparent;
}

.clients__search-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 40px;
    border: none;
    background: transparent;
    cursor: default;
    color: var(--grey-arrow);
    transition: background .2s ease, color .2s ease;
}

#clientsSearch {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-color);
}

#clientsSearch::placeholder {
    color: var(--alerts-settings-cell-text);
}

.clients__actions .clients__add-btn {
    width: 52px;
    height: 44px;
    border-radius: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--clients-border-color);
    transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
}

.clients__add-btn:hover {
    background: var(--blue-btn-color-hover);
}

.clients__add-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 16px var(--clients-shadow-active);
}

.clients__add-btn path {
  stroke: var(--clients-text);
  color: var(--clients-text);
  fill: transparent;
}

/* clients table */

#accountSettingsClients {
    overflow: auto;
    padding: 24px 8px;
}

.clients__inner {
  display: flex;
  flex-direction: column;
}

.clients__content {
    flex: 1; 
    min-height: 0; 
    display: flex;        
    flex-direction: column;
    position: relative; 
    border-radius: 12px;
    background: var(--clients-bg-card);
    border: 1px solid var(--clients-table-border-color);
    overflow: hidden;
    line-height: 1.2;
}

.clients__scroll-wrapper {
    flex: 1;
    overflow: auto;
}

#accountSettingsClients .clients__table-head-row,
#accountSettingsClients .clients__table-row {
    display: grid;
     grid-template-columns:
        minmax(230px, 3fr)
        minmax(180px, 2fr)
        minmax(190px, 3fr)
        minmax(130px, 1.5fr)
        60px;
    align-items: center;
}

#accountSettingsClients.clients--no-analyst .clients__table-head-row,
#accountSettingsClients.clients--no-analyst .clients__table-row {
    grid-template-columns: 
        minmax(450px, 3fr)
        minmax(190px, 2fr)
        minmax(96px, 1fr)
        60px;
}

.clients__table-head,
.clients__table-body {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
}

.clients__table-head {
    position: sticky;
    top: 0;
    z-index: 3;
    user-select: none;
}

.clients__table-row {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
}

.clients__table-head .clients__table-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 46px;
    padding: 8px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    background: var(--clients-bg-card);
    color: var(--clients-text-header);
    border-bottom: 1px solid var(--clients-table-border-color);
    border-right: 1px solid var(--clients-table-border-color);
}

.clients__table-head .clients__table-cell:not(.clients-company, .clients-contact) {
    justify-content: center;
    text-align: center;
}

.clients__table-head .clients__table-cell:last-child {
  border-right: none;
}

.clients__table-cell-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.clients__table-cell-button svg {
    display: block;
}

.clients__table-cell-button svg path {
    stroke: currentColor;
}

.clients__table-cell-button:hover {
    background: var(--clients-bg-hover-icon);
}

.clients__table-body .clients__table-row:nth-child(odd) {
    background: var(--clients-bg-zebra);
}

.clients__packages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clients__package-more {
  color: var(--clients-text-grey);
}

.clients__package-icon {
    width: 16px;
    height: 16px;
}

.clients__package-icon img {
    display: block;
    max-width: 100%;
}

.clients__table-body .clients__table-cell {
    display: flex;
    align-items: center;
    height: 100%;
    min-height: 46px;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 400;
    border-right: 1px solid var(--clients-table-border-color);
    transition: background .2s ease, border-color .2s ease;
}

.clients__table-body .clients__table-cell.clients-company {
  font-size: 14px;
  font-weight: 400;
}

.clients__table-body .clients__table-cell:last-child {
    border-right: 1px solid transparent;
}

.clients__table-cell.clients-action {
  justify-content: center;
}

.clients__cell-content.clients__company {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clients__table-cell.contact {
    padding-inline: 16px;
}

.clients__contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.clients__contact--analyst {
  justify-content: center;
}

.clients__contact-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clients__contact-icons {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.clients__contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background .2s ease, color .2s ease;
}

.clients__contact-icon svg path,
.clients__table-cell-button svg path {
    color: var(--clients-text-grey);
}

.clients__contact-icon:hover {
    background: var(--clients-bg-hover-icon);
    color: var(--clients-text);
    border-radius: 50%;
}

.clients__table-cell.analyst {
    padding-inline: 16px;
}

.clients__analyst {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.clients__analyst-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clients__analyst-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
}

.clients__table .clients__action-btn {
    border-radius: 50%;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.clients__table .clients__action-btn:hover {
    background: var(--clients-bg-hover-icon);
    color: var(--clients-text);
}

.has-shadow::after {
    pointer-events: none;
    user-select: none;
    content: "";
    width: 100%;
    height: 34px;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    background: var(--clients-table-gradient);
}
