/*
 * Recent + Pinned patient panel — appears under the topbar search input
 * when the input has focus and is empty.
 */

.he-pp-search-wrap { position: relative; }

.he-pp-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 280px;
    max-width: 420px;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    z-index: 1070;
    max-height: 70vh;
    overflow-y: auto;
    color: #333;
    font-size: 13px;
}

.he-pp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.he-pp-section-header i { margin-right: 6px; opacity: 0.7; }

.he-pp-clear {
    color: #888;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}
.he-pp-clear:hover { color: #c0392b; text-decoration: underline; }

.he-pp-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}
.he-pp-row:last-child { border-bottom: none; }
.he-pp-row:hover { background: #f0f7ff; color: #333; text-decoration: none; }

.he-pp-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.he-pp-mrn {
    flex: 0 0 auto;
    margin-left: 8px;
    color: #888;
    font-size: 11px;
    font-family: Menlo, Consolas, monospace;
}
.he-pp-actions {
    flex: 0 0 auto;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.he-pp-pin, .he-pp-remove {
    cursor: pointer;
    padding: 4px;
    color: #bbb;
    transition: color 100ms ease;
}
.he-pp-pin:hover    { color: #f1c40f; }   /* gold on hover */
.he-pp-pinned       { color: #f1c40f; }   /* solid gold when pinned */
.he-pp-remove:hover { color: #c0392b; }

/*
 * Hyper-navbar override: in navbar_ng2.php the existing typeahead-style
 * dropdown ("Found N results") also opens directly under the search input,
 * so stacking my panel on top creates an overlap. Push it to the right of
 * the search wrap so the two panels sit side-by-side.
 */
.app-search.he-pp-search-wrap .he-pp-panel {
    top: 0;
    left: calc(100% + 8px);
    right: auto;
    width: 340px;
}

@media (max-width: 1100px) {
    /*
     * On narrower viewports, side-by-side may push the Recent panel
     * off-screen. Fall back to stacking with a higher z-index so it stays
     * readable on top of the existing dropdown.
     */
    .app-search.he-pp-search-wrap .he-pp-panel {
        top: 100%;
        left: 0;
        right: 0;
        width: auto;
    }
}

@media print {
    .he-pp-panel { display: none !important; }
}
