/* Patient Notes, unified: chart / vital / medication notes, encounters and texts in one list.
   The grid reuses .reading-* from site.css; this file is the filter bar and the card view. */

.unotes-toolbar {
    padding: 0.5rem 0.75rem;
}

.unotes-groups {
    padding: 0.25rem 0;
}

.unotes-group {
    margin-bottom: 1.25rem;
}

.unotes-date {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rz-text-secondary-color);
    margin-bottom: 0.5rem;
}

.unotes-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Wide enough to read a note in full; a long note grows the card downward, never clips. */
.unotes-card {
    display: flex;
    min-width: 280px;
    max-width: 440px;
    flex: 1 1 320px;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-base-300);
    border-left: 3px solid var(--rz-base-400);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.unotes-card:hover,
.unotes-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    outline: none;
}

.unotes-strip {
    width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-200);
    color: var(--rz-text-secondary-color);
    font-size: 1.1rem;
}

.unotes-body {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.unotes-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.unotes-kind {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--rz-text-color);
}

.unotes-time {
    font-size: 0.75rem;
    color: var(--rz-text-tertiary-color);
    white-space: nowrap;
}

.unotes-note {
    font-size: 0.85rem;
    color: var(--rz-text-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.unotes-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--rz-text-tertiary-color);
}

.unotes-foot .unotes-patient {
    font-weight: 600;
    color: var(--rz-text-secondary-color);
}

/* One colour per kind on the strip and the left edge, so a page of cards reads at a glance. */
.unotes-card.kind-chart      { border-left-color: var(--rz-primary); }
.unotes-card.kind-chart .unotes-strip      { background: var(--rz-primary-lighter, var(--rz-base-200)); color: var(--rz-primary); }
.unotes-card.kind-vital      { border-left-color: var(--rz-danger); }
.unotes-card.kind-vital .unotes-strip      { background: var(--rz-danger-lighter, var(--rz-base-200)); color: var(--rz-danger); }
.unotes-card.kind-medication { border-left-color: var(--rz-info); }
.unotes-card.kind-medication .unotes-strip { background: var(--rz-info-lighter, var(--rz-base-200)); color: var(--rz-info); }
.unotes-card.kind-threshold { border-left-color: var(--rz-warning); }
.unotes-card.kind-threshold .unotes-strip { background: var(--rz-warning-lighter, var(--rz-base-200)); color: var(--rz-warning-darker, var(--rz-warning)); }
.unotes-card.kind-encounter  { border-left-color: var(--rz-success); }
.unotes-card.kind-encounter .unotes-strip  { background: var(--rz-success-lighter, var(--rz-base-200)); color: var(--rz-success); }
.unotes-card.kind-sms-in     { border-left-color: var(--rz-secondary); }
.unotes-card.kind-sms-in .unotes-strip     { background: var(--rz-secondary-lighter, var(--rz-base-200)); color: var(--rz-secondary); }
.unotes-card.kind-sms-out    { border-left-color: var(--rz-warning); }
.unotes-card.kind-sms-out .unotes-strip    { background: var(--rz-warning-lighter, var(--rz-base-200)); color: var(--rz-warning); }

/* Grid: the kind line under the date. Its parent is white-space: pre-wrap (for note text), so
   this line opts out, or the markup's own line breaks show up between the icon and the label. */
.unotes-kind-line {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Grid: the small kind icon under the date. */
.unotes-grid-icon {
    font-size: 0.85rem;
    margin-right: 0.3rem;
    color: var(--rz-text-tertiary-color);
}

@media (max-width: 768px) {
    .unotes-card {
        min-width: 100%;
        max-width: 100%;
    }
}
