/* ==========================
   PharmaPos Global Styles
========================== */

body {
    background-color: #f4f6f8;
}

/* ==========================
   Top Navbar
========================== */

.pharma-navbar {
    background-color: #0e5a2f;
    padding: calc(0.6rem + env(safe-area-inset-top, 0px)) max(0px, env(safe-area-inset-right, 0px)) 0.6rem max(0px, env(safe-area-inset-left, 0px));
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.pharma-navbar > .container-fluid {
    max-width: 100%;
    flex-wrap: nowrap;
}

@media (min-width: 992px) {
    .pharma-navbar .navbar-collapse {
        min-width: 0;
        flex: 1 1 auto;
    }

    .pharma-navbar .navbar-collapse > .navbar-nav:last-child {
        flex-shrink: 0;
        margin-left: auto;
    }
}

.pharma-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
}

.pharmacy-badge {
    background-color: #fff;
    color: #0e5a2f;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: 50rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .pharmacy-badge {
        max-width: 42vw;
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
    .pharma-brand {
        font-size: 1.1rem;
    }
}

.nav-pill {
    display: inline-block;
    background-color: #1c7a45;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 50rem;
    transition: background-color 0.15s ease-in-out;
}

.nav-pill:hover {
    background-color: #145c34;
}

.nav-pill.active {
    background-color: #fff;
    color: #0e5a2f !important;
}

.pharma-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 1.1rem;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff !important;
}

.nav-notify {
    position: relative;
}

.nav-notify-badge {
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.28rem;
    border-radius: 50rem;
    background: #ffc107;
    color: #0e5a2f;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.nav-notify-menu {
    min-width: 260px;
    max-height: 360px;
    overflow-y: auto;
}

.nav-notify-menu .dropdown-item {
    white-space: normal;
}

.nav-profile {
    display: inline-flex;
    align-items: center;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 50rem;
    background: rgba(255, 255, 255, 0.12);
}

.nav-profile:hover,
.nav-profile.show {
    background: rgba(255, 255, 255, 0.22);
    color: #fff !important;
}

.pharma-dropdown {
    background-color: #145c34;
    border: 1px solid #1c7a45;
    overflow: visible !important;
}

.pharma-dropdown .dropdown-item {
    color: #fff;
}

.pharma-dropdown .dropdown-item:hover,
.pharma-dropdown .dropdown-item:focus {
    background-color: #1c7a45;
    color: #fff;
}

.nav-item.active-parent > .nav-pill {
    background-color: #fff;
    color: #0e5a2f !important;
}

.dropdown-toggle::after {
    margin-left: 0.4em;
}

@media (min-width: 992px) and (max-width: 1599.98px) {
    .nav-pill {
        padding: 0.4rem 0.72rem;
        font-size: 0.82rem;
    }

    .pharmacy-badge {
        max-width: 9rem;
    }

    .pharma-brand {
        font-size: 1.15rem;
    }

    .nav-profile {
        padding: 0.35rem 0.65rem;
        font-size: 0.85rem;
    }

    .pharma-navbar .navbar-nav {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }
}

.pharma-dropdown .dropdown-submenu {
    position: relative;
}

/* Keep hover when moving from the item into the panel on the right */
.pharma-dropdown .dropdown-submenu::after {
    content: "";
    position: absolute;
    top: 0;
    right: -14px;
    width: 14px;
    height: 100%;
}

/* Submenu indicator: ▶ */
.pharma-dropdown .dropdown-submenu > .submenu-toggle::after {
    display: inline-block;
    float: right;
    margin-top: 0.55em;
    margin-left: 0.4em;
    content: "";
    border-top: 0.3em solid transparent;
    border-bottom: 0.3em solid transparent;
    border-left: 0.3em solid currentColor;
    border-right: 0;
}

.submenu-panel {
    display: none;
    list-style: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    margin: 0;
    padding: 0.35rem 0;
    z-index: 1080;
    background-color: #145c34;
    border: 1px solid #1c7a45;
    border-radius: 0.375rem;
}

.submenu-panel .dropdown-item {
    color: #fff;
    display: block;
    padding: 0.35rem 1rem;
    text-decoration: none;
    white-space: nowrap;
}

.submenu-panel .dropdown-item:hover,
.submenu-panel .dropdown-item:focus {
    background-color: #1c7a45;
    color: #fff;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse,
    .navbar-expand-lg .navbar-nav,
    .navbar-expand-lg .navbar-nav .dropdown-menu {
        overflow: visible !important;
    }

    .pharma-dropdown .dropdown-submenu:hover > .submenu-panel,
    .pharma-dropdown .dropdown-submenu.is-open > .submenu-panel {
        display: block;
    }
}

@media (max-width: 991.98px) {
    .pharma-dropdown .dropdown-submenu::after {
        display: none;
    }

    .submenu-panel {
        position: static;
        left: auto;
        min-width: 0;
        margin: 0.25rem 0 0.25rem 1rem;
        border: 0;
        box-shadow: none;
    }

    .pharma-dropdown .dropdown-submenu.is-open > .submenu-panel {
        display: block;
    }

    .pharma-dropdown .dropdown-submenu > .submenu-toggle::after {
        float: right;
        border-left: 0.3em solid transparent;
        border-right: 0.3em solid transparent;
        border-top: 0.3em solid currentColor;
        border-bottom: 0;
        margin-top: 0.5em;
    }

    .pharma-dropdown .dropdown-submenu.is-open > .submenu-toggle::after {
        border-top: 0;
        border-bottom: 0.3em solid currentColor;
    }
}

/* Custom hamburger icon (3 white bars) */

.pharma-toggler {
    border: none;
    padding: 0.45rem 0.5rem;
    flex-shrink: 0;
    overflow: visible;
}

.pharma-toggler:focus {
    box-shadow: none;
}

.pharma-toggler-icon {
    display: block;
    width: 22px;
    height: 16px;
    background:
        linear-gradient(#fff, #fff) center top / 100% 3px no-repeat,
        linear-gradient(#fff, #fff) center / 100% 3px no-repeat,
        linear-gradient(#fff, #fff) center bottom / 100% 3px no-repeat;
}

.pharma-toggler-icon::before,
.pharma-toggler-icon::after {
    content: none;
}

@media (max-width: 991.98px) {

    .pharma-navbar .container-fluid {
        flex-wrap: nowrap;
        align-items: center;
    }

    .navbar-collapse {
        margin-top: 0.75rem;
    }

    .navbar-nav {
        width: 100%;
    }

    .nav-pill {
        display: block;
        text-align: center;
    }

}

/* ==========================
   Shared Page Layout
   (Dashboard, Medicine, Customer,
    Sales History, Invoice View, Accounts, Reports)
========================== */

.page-title {
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
}

.page-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.page-card .card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Stat cards used on Dashboard / Accounts / Reports summaries */

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.1rem 1.25rem;
    height: 100%;
    border-left: 4px solid #0e5a2f;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #212529;
    margin-top: 0.25rem;
    line-height: 1.25;
    word-break: break-word;
}

.stat-card .stat-value.stat-stock-units {
    font-size: 1.05rem;
    line-height: 1.45;
    white-space: normal;
}

.stat-card.stat-danger {
    border-left-color: #dc3545;
}

.stat-card.stat-warning {
    border-left-color: #fd7e14;
}

.stat-card.stat-info {
    border-left-color: #0d6efd;
}

/* Standard table look used across list pages */

.table-clean thead,
.table-clean thead tr {
    background-color: #0e5a2f !important;
}

.table-clean thead th {
    background-color: #0e5a2f !important;
    color: #fff !important;
    border-color: #0e5a2f !important;
    white-space: nowrap;
}

.table-clean td,
.table-clean th {
    vertical-align: middle;
}

/* Responsive tables: allow horizontal scroll on small screens */

.table-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {

    .page-card {
        padding: 0.9rem;
    }

    .stat-value {
        font-size: 1.3rem !important;
    }

}

/* Medicine List: live-search suggestion dropdown */
.medicine-suggest-box {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.plan-card {
    border: 1px solid #d9e3dd;
    border-radius: 0.75rem;
    padding: 1.35rem 1.1rem;
    text-align: center;
    height: 100%;
    background: #f8faf8;
}

.plan-card.is-current {
    border-color: #0e5a2f;
    background: #eef6f1;
}

.plan-card h5 {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.plan-card .plan-price {
    color: #0e5a2f;
    font-weight: 700;
    font-size: 1.15rem;
}

.um-phone-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.um-dial {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #f4faf6;
    border: 1px solid #d9e6dd;
    border-radius: 0.5rem;
    padding: 0 0.45rem 0 0.6rem;
    min-width: 7.5rem;
    flex: 0 0 auto;
}

.um-dial .form-select {
    border: 0;
    background: transparent;
    padding-left: 0;
    box-shadow: none;
    min-width: 4.2rem;
}

.um-flag {
    font-size: 1.15rem;
    line-height: 1;
}

.um-role-card {
    border: 1px solid #dce8e0;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f8fbf9;
}

.um-role-owner { border-left: 4px solid #0e5a2f; }
.um-role-manager { border-left: 4px solid #0d6efd; }
.um-role-sales { border-left: 4px solid #6f42c1; }

.um-perm-card {
    border: 1px solid #dce8e0;
    border-radius: 0.75rem;
    background: #fff;
    overflow: hidden;
    height: 100%;
}

.um-perm-head {
    background: #eef6f1;
    color: #0e5a2f;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.65rem 0.9rem;
}

.um-perm-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.45rem 0.9rem;
    margin: 0;
    border-top: 1px solid #f0f3f1;
    font-size: 0.9rem;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .um-phone-row {
        flex-wrap: wrap;
    }
    .um-dial {
        width: 100%;
    }
}