.doctor-card-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.note-button {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe4ee;
    border-radius: 13px;
    background: #f8fafc;
    color: #7e8da1;
    cursor: pointer;
    transition: all .15s ease;
}

.note-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-button:hover {
    background: #eef5ff;
    border-color: #bad3f3;
    color: #1769e0;
    transform: translateY(-1px);
}

.note-button.has-note {
    background: #edf5ff;
    border-color: #c3dafa;
    color: #1769e0;
}

.note-dot {
    display: none;
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1769e0;
    border: 2px solid white;
    box-sizing: content-box;
}

.note-button.has-note .note-dot {
    display: block;
}

.note-tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%) translateX(4px);
    padding: 7px 10px;
    border-radius: 7px;
    background: #172338;
    color: white;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    transition: .15s ease;
}

.note-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #172338;
}

.note-button:hover .note-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}


/* MODAL */

.note-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(19, 34, 54, .38);
    backdrop-filter: blur(3px);
}

.note-modal.open {
    display: flex;
}

.note-modal-card {
    width: min(540px, 100%);
    background: white;
    border: 1px solid #dce5ef;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(16, 37, 64, .22);
    padding: 25px;
}

.note-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.note-modal-eyebrow {
    margin-bottom: 5px;
    color: #1769e0;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.1px;
}

.note-modal-header h2 {
    margin: 0;
    color: #17283d;
    font-size: 21px;
}

.note-modal-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 10px;
    background: #f3f6f9;
    color: #738197;
    font-size: 24px;
    cursor: pointer;
}

.note-modal-close:hover {
    background: #eaf0f6;
    color: #26384e;
}

.note-private-info {
    display: flex;
    gap: 11px;
    margin: 20px 0;
    padding: 13px 14px;
    border-radius: 11px;
    background: #f4f8fd;
    color: #52637a;
}

.note-lock {
    padding-top: 1px;
    font-size: 15px;
}

.note-private-info strong {
    display: block;
    margin-bottom: 3px;
    color: #31445c;
    font-size: 12px;
}

.note-private-info span {
    display: block;
    font-size: 10px;
    line-height: 1.45;
}

.note-modal-label {
    display: block;
    margin-bottom: 7px;
    color: #52637a;
    font-size: 12px;
    font-weight: 750;
}

#doctor-note-text {
    width: 100%;
    min-height: 145px;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid #d7e0eb;
    border-radius: 11px;
    background: #fbfcfe;
    color: #26384e;
    font: inherit;
    line-height: 1.55;
    resize: vertical;
    outline: none;
}

#doctor-note-text:focus {
    border-color: #1769e0;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .08);
}

.note-modal-count {
    margin-top: 6px;
    color: #99a4b3;
    font-size: 10px;
    text-align: right;
}

.note-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 21px;
}

.note-modal-footer-right {
    display: flex;
    gap: 8px;
}

.note-save-button,
.note-cancel-button,
.note-delete-button {
    height: 41px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.note-save-button {
    border: 1px solid #1769e0;
    background: #1769e0;
    color: white;
}

.note-save-button:hover {
    background: #105cc7;
}

.note-cancel-button {
    border: 1px solid #dce4ed;
    background: white;
    color: #64748a;
}

.note-delete-button {
    border: 0;
    background: #fff2f2;
    color: #bd4949;
}

.note-delete-button:hover {
    background: #ffe8e8;
}

@media (max-width: 600px) {

    .note-modal-card {
        padding: 20px;
    }

    .note-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .note-modal-footer-right {
        width: 100%;
    }

    .note-modal-footer-right button {
        flex: 1;
    }

    .note-delete-button {
        width: 100%;
    }
}


/* Sichtbare interne Notiz direkt auf der Arztkarte */

.internal-note-preview {
    margin: 11px 0 13px;
    padding: 10px 12px;
    border: 1px solid #d5e4f7;
    border-radius: 11px;
    background: #f4f8fd;
    cursor: pointer;
    transition: border-color .15s ease,
                background .15s ease,
                transform .15s ease;
}

.internal-note-preview:hover {
    background: #edf5ff;
    border-color: #bad3f3;
    transform: translateY(-1px);
}

.internal-note-preview-head {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    color: #1769e0;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .8px;
}

.internal-note-lock {
    font-size: 10px;
    line-height: 1;
}

.internal-note-preview-text {
    color: #465a72;
    font-size: 11px;
    line-height: 1.45;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* Rechte Spalte: Aktionen oben, interne Notiz darunter */

.doctor-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.doctor-card-side .doctor-card-tools {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.doctor-card-side .internal-note-preview {
    width: 165px;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 10px;
}

.doctor-card-side .internal-note-preview-head {
    margin-bottom: 3px;
}

.doctor-card-side .internal-note-preview-text {
    font-size: 10px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
}


@media (max-width: 650px) {

    .doctor-card-side {
        align-items: flex-end;
    }

    .doctor-card-side .internal-note-preview {
        width: 150px;
    }
}
