/* Client documents: grouping by person, versions and recent access (step 2b). */

.crm-document-holder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 18px 0 4px;
    padding-inline: 16px;
}

.crm-document-holder:first-of-type { margin-top: 6px; }

.crm-document-holder h4 {
    margin: 0;
    color: var(--crm-heading, var(--crm-text, #101d26));
    font-size: 14px;
    font-weight: 700;
}

.crm-document-holder > span:not(.crm-document-initials) {
    color: var(--crm-text-muted, #526673);
    font-size: 12px;
}

.crm-document-holder a {
    margin-inline-start: auto;
    color: var(--crm-button, #1f6f5c);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.crm-document-holder a:hover { text-decoration: underline; }

.crm-document-initials {
    flex: none;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--crm-button, #1f6f5c) 14%, #fff);
    color: var(--crm-primary-dark, #101d26);
    font-size: 11px;
    font-weight: 800;
}

.crm-document-holder-empty {
    margin: 0 0 6px;
    padding-inline-start: 54px;
    color: var(--crm-text-muted, #667985);
    font-size: 12px;
}

.crm-document-panel-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--crm-border, #e3e8eb);
    font-size: 12px;
}

.crm-document-panel-section h4,
.crm-document-panel-section > summary {
    margin: 0 0 8px;
    color: var(--crm-heading, var(--crm-text, #101d26));
    font-size: 13px;
    font-weight: 700;
    cursor: default;
}

.crm-document-panel-section > summary { cursor: pointer; }

.crm-document-panel-section h4 span,
.crm-document-panel-section > summary span {
    color: var(--crm-text-muted, #526673);
    font-weight: 500;
}

.crm-document-panel-section form {
    display: grid;
    gap: 8px;
}

.crm-document-panel-section select {
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--crm-border-strong, #cbd5e1);
    border-radius: var(--crm-radius-medium, 6px);
    background: var(--crm-surface, #fff);
    color: var(--crm-text, #101d26);
    font: inherit;
}

.crm-document-panel-section ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.crm-document-versions li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--crm-border, #eef2f4);
}

.crm-document-versions li:last-child { border-bottom: 0; }

.crm-document-versions em {
    margin-inline-start: 6px;
    color: var(--crm-success, #12805c);
    font-style: normal;
    font-weight: 700;
}

.crm-document-versions small,
.crm-document-access small {
    display: block;
    margin-top: 2px;
    color: var(--crm-text-muted, #667985);
}

.crm-document-versions li > span {
    flex: none;
    display: flex;
    gap: 10px;
}

.crm-document-versions a,
.crm-document-access > a {
    color: var(--crm-button, #1f6f5c);
    font-weight: 700;
    text-decoration: none;
}

.crm-document-access li { padding: 6px 0; }

.crm-document-access p { margin: 0 0 8px; color: var(--crm-text-muted, #667985); }

.crm-document-access > a { display: inline-block; margin-top: 6px; }

.crm-document-access-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-end: 6px;
    font-weight: 700;
}

.crm-document-access-action::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.crm-document-access-viewed { color: var(--crm-success, #12805c); }

.crm-document-access-downloaded { color: var(--crm-warning, #b54708); }

.crm-document-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
