/* ═══════════════════════════════════════════════════════════════
   ehr_header.css — Desktop header + Mobile quick-button bar
   Load order: 3
   ═══════════════════════════════════════════════════════════════ */

/* ─── Desktop header (>768px) ─── */
.ehr-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--ehr-sidebar-width);
    height: var(--ehr-header-height);
    background: var(--ehr-header-bg);
    box-shadow: 0 1px 4px var(--ehr-shadow);
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: left var(--ehr-transition);
}

/* When sidebar is collapsed */
.ehr-sidebar.collapsed ~ .ehr-page-container .ehr-header {
    left: 0;
}

/* Sidebar toggle button — desktop */
.ehr-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: var(--ehr-text);
    transition: background var(--ehr-transition);
}

.ehr-sidebar-toggle:hover {
    background: var(--ehr-border-light);
}

.ehr-sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

/* Header right area */
.ehr-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.ehr-header-right a {
    color: var(--ehr-text-light);
    transition: color var(--ehr-transition);
}

.ehr-header-right a:hover {
    color: var(--ehr-text);
}

.ehr-header-divider {
    width: 1px;
    height: 20px;
    background: var(--ehr-border);
}

/* ─── Mobile top bar (≤768px) ─── */
.ehr-mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ehr-mobile-bar-height);
    background: var(--ehr-mobile-bar-bg);
    z-index: 1100;
}

.ehr-mobile-bar-inner {
    display: flex;
    align-items: stretch;
    height: 100%;
}

/* Quick buttons */
.ehr-quick-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ehr-mobile-bar-text);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: background var(--ehr-transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ehr-quick-btn:hover,
.ehr-quick-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.ehr-quick-btn.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Active indicator line */
.ehr-quick-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--ehr-green-accent);
    border-radius: 1px;
}

/* Quick button icons */
.ehr-quick-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.ehr-quick-btn.active svg {
    opacity: 1;
}

/* ─── Mobile sub-panel (dropdown under quick buttons) ─── */
.ehr-mobile-sub {
    display: none;
    position: fixed;
    top: var(--ehr-mobile-bar-height);
    left: 0;
    right: 0;
    background: var(--ehr-mobile-sub-bg);
    z-index: 1099;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ehr-mobile-sub.open {
    display: block;
    max-height: 400px;
}

.ehr-mobile-sub-inner {
    padding: 8px 0;
}

.ehr-mobile-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.4);
}

/* Close button */
.ehr-mobile-sub-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    transition: background var(--ehr-transition), color var(--ehr-transition);
    font-size: 18px;
    line-height: 1;
}

.ehr-mobile-sub-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Sub-panel links */
.ehr-mobile-sub a {
    display: block;
    padding: 11px 16px;
    color: var(--ehr-mobile-sub-text);
    font-size: 14px;
    transition: background var(--ehr-transition);
}

.ehr-mobile-sub a:hover,
.ehr-mobile-sub a:active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ─── Breakpoints ─── */
@media (max-width: 768px) {
    .ehr-header {
        display: none !important;
    }
    .ehr-mobile-bar {
        display: block;
    }
}
