/* Header, body and footer stack in a full-height column - the same arrangement the
   dashboard layout uses - so the footer settles at the bottom of short pages without
   being fixed, and still scrolls away on long ones. */
.patient-layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: linear-gradient(90deg, #186FB5 0%, #1a7cc4 100%);
    border-bottom: 1px solid rgba(24, 111, 181, 0.3);
    padding: 0 4em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    top: 0;
    position: sticky;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(24, 111, 181, 0.1);
    gap: 2rem;
    min-height: 69px;
    height: 69px;
    flex-shrink: 0;
}

.main-header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-header-nav--patient {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.75rem;
}

.patient-header-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.patient-header-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.2;
}

.patient-header-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
    letter-spacing: 0.02em;
}

.patient-header-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
}

.patient-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.patient-header-user {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.patient-header-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.patient-header-theme {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.patient-header-theme-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

.patient-header-theme-text {
    display: inline;
}

.patient-header-theme-select {
    min-width: 9.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.375rem;
    cursor: pointer;
}

.patient-header-theme-select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.patient-header-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 768px) {
    .patient-header-user {
        display: none;
    }

    .patient-header-theme-text {
        display: none;
    }

    .patient-header-theme-label i {
        font-size: 1rem;
    }
}

@media (max-width: 1200px) {
    .main-header-nav {
        gap: 0.25rem;
    }

    .nav-menu-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 992px) {
    .main-header-nav {
    }
}

.main-body {
    flex: 1;
    padding: 4em;
}

.main-footer {
    background: linear-gradient(90deg, #186FB5 0%, #1a7cc4 100%) !important;
    color: #fff !important;
    padding: 0 1.6rem;
    min-height: 69px;
    height: 69px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-selector {
    padding: 0.38em 1em !important;
}