/* =========================================================
   SHHC - GLOBAL HEADER & NAVIGATION
   Sheikh Hassan Herbal Center
   Shared across all pages
   ========================================================= */


/* =========================================================
   GLOBAL RESET
   ========================================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    width: 100%;
}

body {
    font-family:
        "Segoe UI",
        Tahoma,
        Geneva,
        Verdana,
        sans-serif;

    background: #f6f8f7;
    color: #1f2937;
    line-height: 1.5;

    min-height: 100vh;
    width: 100%;

    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

table {
    border-collapse: collapse;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #e5ebe8;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04);

    position: relative;

    z-index: 1100;
}


/* =========================================================
   HEADER INNER
   ========================================================= */

.header-inner {
    width: 100%;
    max-width: 1440px;

    min-height: 82px;

    margin: 0 auto;

    padding: 16px 32px;

    display: flex;
    align-items: center;

    gap: 24px;

    position: relative;

    z-index: 2100;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 14px;

    text-decoration: none;

    color: #123c31;

    min-width: 0;

    flex: 1 1 auto;

    overflow: hidden;
}


/* =========================================================
   BRAND LOGO
   ========================================================= */

.brand-logo {
    width: 52px;
    height: 52px;

    min-width: 52px;
    min-height: 52px;

    max-width: 52px;
    max-height: 52px;

    object-fit: contain;

    flex: 0 0 52px;
}


/* =========================================================
   BRAND TEXT
   ========================================================= */

.brand-text {
    display: flex;
    flex-direction: column;

    min-width: 0;

    overflow: hidden;
}

.brand-title {
    color: #0b6e4f;

    font-size: 19px;
    font-weight: 700;

    line-height: 1.2;

    letter-spacing: 0.2px;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-subtitle {
    margin-top: 3px;

    color: #6b7280;

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.8px;

    text-transform: uppercase;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   USER AREA
   ========================================================= */

.header-user {
    display: flex;
    align-items: center;

    gap: 12px;

    flex: 0 0 auto;

    min-width: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;

    min-width: 42px;
    min-height: 42px;

    border-radius: 50%;

    background: #e8f4ef;
    color: #0b6e4f;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
    font-weight: 700;

    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    line-height: 1.25;
}

.user-name {
    color: #1f2937;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    max-width: 180px;
}

.user-role {
    margin-top: 3px;

    color: #6b7280;

    font-size: 11px;
    font-weight: 500;

    text-transform: uppercase;

    letter-spacing: 0.5px;

    white-space: nowrap;
}


/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.navbar {
    width: 100%;

    background: #ffffff;

    border-top: 1px solid #f0f3f2;
    border-bottom: 1px solid #e5ebe8;

    position: relative;

    z-index: 1050;
}

.navbar-inner {
    width: 100%;
    max-width: 1440px;

    min-height: 58px;

    margin: 0 auto;

    padding: 0 32px;

    display: flex;
    align-items: center;

    gap: 12px;
}

.nav-links {
    display: flex;
    align-items: center;

    gap: 4px;

    min-width: 0;

    flex: 1 1 auto;

    flex-wrap: nowrap;
}

.navbar a {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 9px 12px;

    border-radius: 7px;

    color: #4b5563;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    white-space: nowrap;

    flex: 0 1 auto;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.navbar a:hover {
    background: #eef7f3;

    color: #0b6e4f;
}

.navbar a.active {
    background: #e8f4ef;

    color: #0b6e4f;

    font-weight: 650;
}

.navbar a.active::after {
    content: "";

    position: absolute;

    left: 12px;
    right: 12px;

    bottom: -1px;

    height: 2px;

    background: #0b6e4f;

    border-radius: 2px;
}


/* =========================================================
   NAVIGATION ACTIONS
   ========================================================= */

.navbar-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex: 0 0 auto;
}

.navbar .logout {
    color: #b42318;

    background: transparent;

    font-weight: 600;
}

.navbar .logout:hover {
    color: #b42318;

    background: #fff1f0;
}


/* =========================================================
   PROFILE AREA
   ========================================================= */

.profile-container {
    position: relative;

    display: flex;
    align-items: center;

    flex: 0 0 auto;

    z-index: 2300;
}


/* =========================================================
   PROFILE BUTTON
   ========================================================= */

.profile-button {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    min-height: 44px;

    padding: 5px 9px 5px 6px;

    border: 1px solid transparent;

    border-radius: 9px;

    background: transparent;

    color: #1f2937;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.profile-button:hover,
.profile-button:focus-visible {
    background: #f2f7f5;

    border-color: #dce5e1;
}

.profile-button:focus-visible {
    outline: 3px solid rgba(11, 110, 79, 0.18);

    outline-offset: 2px;
}


/* =========================================================
   PROFILE AVATAR
   ========================================================= */

.profile-avatar {
    width: 40px;
    height: 40px;

    min-width: 40px;
    min-height: 40px;

    border-radius: 50%;

    object-fit: cover;

    background: #e8f4ef;

    border: 2px solid #ffffff;

    box-shadow:
        0 0 0 1px #dce5e1;
}


/* =========================================================
   PROFILE NAME
   ========================================================= */

.profile-button-name {
    max-width: 145px;

    color: #1f2937;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   PROFILE ARROW
   ========================================================= */

.profile-arrow {
    color: #6b7280;

    font-size: 14px;

    line-height: 1;

    transition: transform 0.2s ease;
}

.profile-button[aria-expanded="true"] .profile-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   PROFILE DROPDOWN
   ========================================================= */

.profile-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 300px;

    max-width: calc(100vw - 24px);

    padding: 0;

    background: #ffffff;

    border: 1px solid #dce5e1;

    border-radius: 12px;

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.14);

    overflow: hidden;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform: translateY(-6px);

    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;

    z-index: 2400;
}

.profile-dropdown.show {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);
}


/* =========================================================
   PROFILE TOP
   ========================================================= */

.profile-top {
    padding: 22px 20px 18px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            #f2f8f5 0%,
            #ffffff 100%
        );

    border-bottom: 1px solid #e5ebe8;
}

.profile-large-image {
    width: 72px;
    height: 72px;

    margin: 0 auto 10px;

    border-radius: 50%;

    object-fit: cover;

    background: #e8f4ef;

    border: 3px solid #ffffff;

    box-shadow:
        0 0 0 1px #cddbd5,
        0 5px 14px rgba(0, 0, 0, 0.08);
}

.profile-top h3 {
    margin: 0;

    color: #17221f;

    font-size: 16px;
    font-weight: 700;

    line-height: 1.3;
}

.profile-top p {
    margin-top: 4px;

    color: #0b6e4f;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.6px;

    text-transform: uppercase;
}


/* =========================================================
   PROFILE DETAILS
   ========================================================= */

.profile-details {
    padding: 14px 20px;

    display: flex;
    flex-direction: column;

    gap: 12px;

    border-bottom: 1px solid #e5ebe8;
}

.profile-detail {
    display: flex;
    flex-direction: column;

    gap: 2px;

    min-width: 0;
}

.profile-detail small {
    color: #8a9490;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}

.profile-detail strong {
    color: #374151;

    font-size: 13px;
    font-weight: 600;

    overflow-wrap: anywhere;
}


/* =========================================================
   PROFILE OPTIONS
   ========================================================= */

.profile-option {
    width: 100%;

    min-height: 46px;

    padding: 12px 20px;

    display: flex;
    align-items: center;

    border: 0;

    border-bottom: 1px solid #edf1ef;

    background: #ffffff;

    color: #374151;

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.profile-option:hover {
    background: #f2f8f5;

    color: #0b6e4f;
}

.profile-option:last-child {
    border-bottom: 0;
}


/* =========================================================
   PROFILE LOGOUT
   ========================================================= */

.profile-option.profile-logout {
    color: #b42318;
}

.profile-option.profile-logout:hover {
    background: #fff1f0;

    color: #b42318;
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    min-width: 42px;
    min-height: 42px;

    padding: 0;

    border: 1px solid #dce5e1;

    border-radius: 8px;

    background: #ffffff;

    color: #0b6e4f;

    align-items: center;
    justify-content: center;

    /* IMPORTANT:
       Stack hamburger lines vertically. */
    flex-direction: column;

    /* Small consistent spacing between lines. */
    gap: 4px;

    font-size: 22px;

    line-height: 1;

    flex: 0 0 42px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.menu-toggle:hover {
    background: #eef7f3;

    border-color: #b9d8cc;
}


/* =========================================================
   HAMBURGER ICON LINES
   ========================================================= */

.menu-toggle span {
    display: block;

    width: 18px;
    height: 2px;

    min-width: 18px;
    min-height: 2px;

    background: #0b6e4f;

    border-radius: 2px;

    flex: 0 0 2px;
}


/* =========================================================
   MOBILE NAVIGATION OVERLAY
   ========================================================= */

.nav-overlay {
    display: none;

    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(15, 23, 42, 0.35);

    z-index: 1999;

    opacity: 0;

    pointer-events: none;

    transition: opacity 0.25s ease;
}

.nav-overlay.show {
    opacity: 1;

    pointer-events: auto;
}


/* =========================================================
   PAGE CONTAINER
   ========================================================= */

.container {
    width: 100%;
    max-width: 1440px;

    margin: 0 auto;

    padding: 28px 32px;

    min-width: 0;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    margin-bottom: 28px;

    min-width: 0;
}

.page-eyebrow {
    margin-bottom: 6px;

    color: #0b6e4f;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;

    color: #17221f;

    font-size: 30px;
    font-weight: 700;

    line-height: 1.2;

    overflow-wrap: anywhere;
}

.page-header p {
    margin-top: 8px;

    max-width: 720px;

    color: #6b7280;

    font-size: 14px;

    line-height: 1.6;

    overflow-wrap: anywhere;
}


/* =========================================================
   STATUS MESSAGE
   ========================================================= */

.status-message {
    display: none;

    position: fixed;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    width: min(92%, 520px);

    padding: 13px 18px;

    background: #ffffff;

    color: #1f2937;

    border: 1px solid #dce5e1;

    border-left: 4px solid #0b6e4f;

    border-radius: 8px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.12);

    text-align: center;

    font-size: 14px;
    font-weight: 600;

    z-index: 9999;

    opacity: 0;

    transition: opacity 0.25s ease;
}

.status-message.show {
    display: block;

    opacity: 1;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .header-inner {
        min-height: 76px;

        padding: 14px 24px;

        gap: 18px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;

        min-width: 48px;
        min-height: 48px;

        max-width: 48px;
        max-height: 48px;

        flex-basis: 48px;
    }

    .brand-title {
        font-size: 17px;
    }

    .navbar-inner {
        padding: 0 24px;

        gap: 8px;
    }

    .nav-links {
        gap: 2px;
    }

    .navbar a {
        padding: 8px 9px;

        font-size: 12px;
    }

    .navbar a.active::after {
        left: 9px;
        right: 9px;
    }

    .container {
        padding: 24px;
    }
}


/* =========================================================
   MOBILE - 800PX AND BELOW
   ========================================================= */

@media (max-width: 800px) {

    html,
    body {
        width: 100%;
        max-width: 100%;

        overflow-x: hidden;
    }


    /* =====================================================
       MOBILE HEADER
       ===================================================== */

    .header-inner {
        width: 100%;

        min-height: 68px;

        padding: 10px 14px;

        gap: 10px;

        justify-content: flex-start;

        overflow: visible;
    }


    /* =====================================================
       MOBILE BRAND
       ===================================================== */

    .brand {
        min-width: 0;

        width: auto;

        max-width: none;

        flex: 1 1 auto;

        gap: 9px;

        overflow: hidden;
    }

    .brand-logo {
        width: 40px !important;
        height: 40px !important;

        min-width: 40px !important;
        min-height: 40px !important;

        max-width: 40px !important;
        max-height: 40px !important;

        flex: 0 0 40px;

        object-fit: contain;
    }

    .brand-text {
        min-width: 0;

        flex: 1 1 auto;

        max-width: 100%;

        overflow: hidden;
    }

    .brand-title {
        font-size: 15px;

        line-height: 1.2;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }

    .brand-subtitle {
        margin-top: 2px;

        font-size: 8px;

        letter-spacing: 0.65px;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }


    /* =====================================================
       MOBILE USER
       ===================================================== */

    .header-user {
        display: none;
    }


    /* =====================================================
       MOBILE MENU BUTTON
       ===================================================== */

    .menu-toggle {
        display: inline-flex;

        width: 40px;
        height: 40px;

        min-width: 40px;
        min-height: 40px;

        flex: 0 0 40px;

        margin-left: auto;

        border: 1px solid #dce5e1;

        border-radius: 8px;

        background: #ffffff;

        color: #0b6e4f;

        /* Keep the lines stacked on mobile. */
        flex-direction: column;

        gap: 4px;

        font-size: 20px;

        line-height: 1;

        position: relative;

        z-index: 2200;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;

        min-width: 18px;
        min-height: 2px;

        flex: 0 0 2px;
    }


    /* =====================================================
       MOBILE NAVIGATION DRAWER
       ===================================================== */

    .navbar {
        position: fixed;

        top: 0;
        left: 0;

        width: min(290px, 86vw);

        height: 100dvh;

        min-height: 100vh;

        margin: 0;

        background: #ffffff;

        border: 0;

        transform: translate3d(-105%, 0, 0);

        transition: transform 0.28s ease;

        z-index: 2000;

        box-shadow:
            8px 0 28px rgba(0, 0, 0, 0.12);

        overflow: hidden;

        visibility: visible;
    }

    .navbar.open {
        transform: translate3d(0, 0, 0);
    }


    /* =====================================================
       MOBILE NAVIGATION INNER
       ===================================================== */

    .navbar-inner {
        width: 100%;
        height: 100%;

        min-height: 100%;

        padding:
            max(70px, env(safe-area-inset-top) + 60px)
            14px
            max(18px, env(safe-area-inset-bottom) + 12px);

        display: flex;

        flex-direction: column;

        align-items: stretch;

        justify-content: flex-start;

        gap: 12px;

        overflow-x: hidden;

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;

        overscroll-behavior: contain;
    }


    /* =====================================================
       MOBILE NAVIGATION LINKS
       ===================================================== */

    .nav-links {
        width: 100%;

        min-width: 0;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 4px;

        flex: 0 0 auto;

        overflow: visible;
    }

    .navbar a {
        width: 100%;

        min-height: 44px;

        padding: 10px 13px;

        border-radius: 7px;

        display: flex;

        align-items: center;

        justify-content: flex-start;

        color: #4b5563;

        font-size: 14px;

        font-weight: 500;

        line-height: 1.3;

        white-space: normal;

        flex: 0 0 auto;
    }

    .navbar a:hover {
        background: #eef7f3;

        color: #0b6e4f;
    }

    .navbar a.active {
        background: #e8f4ef;

        color: #0b6e4f;
    }

    .navbar a.active::after {
        display: none;
    }


    /* =====================================================
       MOBILE LOGOUT
       ===================================================== */

    .navbar-actions {
        width: 100%;

        min-width: 0;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 4px;

        margin-top: auto;

        padding-top: 14px;

        border-top: 1px solid #e5ebe8;

        flex: 0 0 auto;
    }

    .navbar .logout {
        width: 100%;

        min-height: 44px;

        justify-content: flex-start;
    }


    /* =====================================================
       MOBILE OVERLAY
       ===================================================== */

    .nav-overlay {
        display: block;

        position: fixed;

        inset: 0;

        width: 100%;
        height: 100%;

        background: rgba(15, 23, 42, 0.35);

        z-index: 1999;

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }

    .nav-overlay.show {
        opacity: 1;

        visibility: visible;

        pointer-events: auto;
    }


    /* =====================================================
       MOBILE PAGE CONTAINER
       ===================================================== */

    .container {
        width: 100%;
        max-width: 100%;

        padding: 20px 15px;

        min-width: 0;
    }


    /* =====================================================
       MOBILE PAGE HEADER
       ===================================================== */

    .page-header {
        margin-bottom: 22px;

        min-width: 0;
    }

    .page-eyebrow {
        margin-bottom: 5px;

        font-size: 10px;

        letter-spacing: 0.8px;
    }

    .page-header h1 {
        font-size: 24px;

        line-height: 1.25;

        overflow-wrap: anywhere;
    }

    .page-header p {
        margin-top: 7px;

        font-size: 13px;

        line-height: 1.55;

        overflow-wrap: anywhere;
    }


    /* =====================================================
       MOBILE FORM SAFETY
       ===================================================== */

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }
}


/* =========================================================
   SMALL PHONES - 480PX AND BELOW
   ========================================================= */

@media (max-width: 480px) {

    .header-inner {
        min-height: 64px;

        padding: 9px 12px;

        gap: 8px;
    }


    /* =====================================================
       SMALL PHONE LOGO
       ===================================================== */

    .brand-logo {
        width: 38px !important;
        height: 38px !important;

        min-width: 38px !important;
        min-height: 38px !important;

        max-width: 38px !important;
        max-height: 38px !important;

        flex: 0 0 38px;
    }


    /* =====================================================
       SMALL PHONE BRAND
       ===================================================== */

    .brand {
        gap: 8px;

        flex: 1 1 auto;

        min-width: 0;

        max-width: none;
    }

    .brand-title {
        font-size: 13px;

        letter-spacing: 0.1px;
    }

    .brand-subtitle {
        display: none;
    }


    /* =====================================================
       SMALL PHONE MENU
       ===================================================== */

    .menu-toggle {
        width: 38px;
        height: 38px;

        min-width: 38px;
        min-height: 38px;

        flex: 0 0 38px;

        flex-direction: column;

        gap: 4px;

        font-size: 19px;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;

        min-width: 18px;
        min-height: 2px;

        flex: 0 0 2px;
    }


    /* =====================================================
       SMALL PHONE DRAWER
       ===================================================== */

    .navbar {
        width: min(285px, 88vw);
    }

    .navbar-inner {
        padding-left: 12px;
        padding-right: 12px;

        padding-top:
            max(66px, env(safe-area-inset-top) + 58px);

        padding-bottom:
            max(15px, env(safe-area-inset-bottom) + 10px);

        gap: 10px;
    }

    .navbar a {
        min-height: 42px;

        padding: 9px 12px;

        font-size: 13px;
    }

    .navbar .logout {
        min-height: 42px;
    }


    /* =====================================================
       SMALL PHONE CONTAINER
       ===================================================== */

    .container {
        padding: 18px 13px;
    }


    /* =====================================================
       SMALL PHONE PAGE HEADER
       ===================================================== */

    .page-header {
        margin-bottom: 19px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-header p {
        font-size: 12.5px;
    }


    /* =====================================================
       SMALL PHONE STATUS
       ===================================================== */

    .status-message {
        top: 10px;

        width: calc(100% - 20px);

        padding: 10px 12px;

        font-size: 12px;
    }
}


/* =========================================================
   EXTRA SMALL PHONES - 360PX AND BELOW
   ========================================================= */

@media (max-width: 360px) {

    .header-inner {
        min-height: 60px;

        padding: 8px 10px;

        gap: 7px;
    }


    /* =====================================================
       EXTRA SMALL LOGO
       ===================================================== */

    .brand-logo {
        width: 36px !important;
        height: 36px !important;

        min-width: 36px !important;
        min-height: 36px !important;

        max-width: 36px !important;
        max-height: 36px !important;

        flex: 0 0 36px;
    }


    /* =====================================================
       EXTRA SMALL BRAND
       ===================================================== */

    .brand {
        gap: 7px;

        min-width: 0;

        flex: 1 1 auto;
    }

    .brand-title {
        font-size: 12px;

        letter-spacing: 0;
    }


    /* =====================================================
       EXTRA SMALL MENU
       ===================================================== */

    .menu-toggle {
        width: 36px;
        height: 36px;

        min-width: 36px;
        min-height: 36px;

        flex: 0 0 36px;

        flex-direction: column;

        gap: 4px;

        font-size: 18px;
    }

    .menu-toggle span {
        width: 17px;
        height: 2px;

        min-width: 17px;
        min-height: 2px;

        flex: 0 0 2px;
    }


    /* =====================================================
       EXTRA SMALL CONTAINER
       ===================================================== */

    .container {
        padding: 16px 10px;
    }


    /* =====================================================
       EXTRA SMALL PAGE HEADER
       ===================================================== */

    .page-header h1 {
        font-size: 20px;
    }

    .page-header p {
        font-size: 12px;
    }


    /* =====================================================
       EXTRA SMALL DRAWER
       ===================================================== */

    .navbar {
        width: min(270px, 90vw);
    }

    .navbar-inner {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar a {
        min-height: 40px;

        padding: 8px 10px;

        font-size: 12.5px;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.navbar a:focus-visible,
.menu-toggle:focus-visible,
.brand:focus-visible {
    outline: 3px solid rgba(11, 110, 79, 0.25);

    outline-offset: 2px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   GLOBAL MODAL LAYERING & SCROLL SAFETY
   ========================================================= */

/* Every application modal must sit above the desktop and mobile
   navigation, and must own its own scrolling surface. */
.modal,
.patient-modal,
.treatment-modal,
.confirmation-modal,
.record-modal {
    z-index: 10000 !important;
    isolation: isolate;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Keep modal panels within the viewport while the overlay scrolls. */
.modal .modal-content,
.patient-modal-content,
.treatment-modal-content,
.confirmation-card,
.record-modal-content {
    max-height: calc(100dvh - 40px);
}

/* On small screens leave enough breathing room for browser UI/safe areas. */
@media (max-width: 720px) {
    .modal,
    .patient-modal,
    .treatment-modal,
    .confirmation-modal,
    .record-modal {
        padding-top: max(16px, env(safe-area-inset-top) + 10px);
        padding-bottom: max(16px, env(safe-area-inset-bottom) + 10px);
    }

    .modal .modal-content,
    .patient-modal-content,
    .treatment-modal-content,
    .confirmation-card,
    .record-modal-content {
        max-height: calc(100dvh - 32px);
    }
}


html.shhc-modal-open,
body.shhc-modal-open {
    overflow: hidden !important;
}

/* Shared profile dropdown on secondary pages */
@media (max-width: 800px) {
  .profile-container { flex: 0 0 auto; margin-left: auto; }
  .profile-button { min-height: 40px; padding: 4px; }
  .profile-button-name { display: none; }
  .profile-avatar { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  .profile-arrow { display: none; }
  .profile-dropdown { top: calc(100% + 8px); right: 0; width: min(300px, calc(100vw - 24px)); }
}

/* TEMPORARILY HIDE SYSTEM BACKUP FROM ALL NAVBARS
   The navigation code remains intact; remove this rule to show it again. */
a[href="backups.php"] {
    display: none !important;
}
/* Shared utility classes (kept outside PHP templates) */
.js-hidden{display:none!important}.text-center{text-align:center}.mb-15{margin-bottom:15px}.mt-20{margin-top:20px}.text-danger{color:#a61b1b}.col-min-260{min-width:260px}.backup-inline-mb{margin-bottom:14px}
