/* =========================================================================
   Site styles on top of AdminLTE 4 (RTL).
   ========================================================================= */

:root {
    /* income is blue and expenses are red everywhere: boxes, badges and charts */
    --clinic-income: #256abf;
    --clinic-expense: #c93636;
    --clinic-neutral: #3d4852;
}

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

/* numbers, amounts and phone numbers always read left-to-right */
.num {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

td .num,
th .num {
    font-variant-numeric: tabular-nums;
}

/* ----- side menu brand ----- */
.sidebar-brand .brand-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* ----- coloured boxes and badges ----- */
.bg-income {
    color: #fff;
    background-color: var(--clinic-income);
}

.bg-expense {
    color: #fff;
    background-color: var(--clinic-expense);
}

.small-box.kpi-income {
    color: #fff;
    background-color: var(--clinic-income);
}

.small-box.kpi-expense {
    color: #fff;
    background-color: var(--clinic-expense);
}

.small-box.kpi-neutral {
    color: #fff;
    background-color: var(--clinic-neutral);
}

.small-box h3 {
    font-size: 1.75rem !important;
    white-space: normal;
}

.small-box h3 small {
    font-size: 1rem;
    font-weight: 400;
}

.small-box .small-box-footer {
    color: #fff;
    text-decoration: none;
}

.small-box .small-box-icon {
    line-height: 1;
}

/* ----- cards, tables and info boxes ----- */
.app-content .card,
.login-box .card {
    margin-bottom: 1rem;
}

.table thead th {
    white-space: nowrap;
}

.info-box .info-box-icon {
    flex: 0 0 70px;
}

.info-box .info-box-content {
    min-width: 0;
}

/* the page title and its buttons */
.app-content-header .btn {
    margin-bottom: .125rem;
}

.card-title .badge {
    font-weight: 500;
    vertical-align: middle;
}

/* ----- charts ----- */
.chart-box {
    position: relative;
    width: 100%;
}

/* ----- lawyer search box on the visit form ----- */
.lawyer-picker {
    position: relative;
}

.lawyer-results {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.lawyer-results.show {
    display: block;
}

/* ----- line items (purchase invoice lines, items sold on a receipt) ----- */
.line-table .col-qty { width: 110px; }
.line-table .col-price { width: 190px; }
.line-table .col-date { width: 170px; }
.line-table .col-total { width: 130px; }
.line-table .col-remove { width: 48px; }
.line-table select { min-width: 200px; }

/* ----- receipt ----- */
.receipt {
    max-width: 600px;
}

/* ----- printing (receipts and reports): the page only, no menu ----- */
@media print {
    body,
    body.bg-body-tertiary {
        background-color: #fff !important;
    }

    .app-main,
    .app-content {
        padding: 0 !important;
    }

    .card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .receipt {
        max-width: none;
    }
}

/* ----- every amount also shown in the other currency (current USD -> LBP rate) ----- */
.amount-alt {
    display: block;
    font-size: .78em;
    font-weight: normal;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.small-box .amount-alt {
    color: rgba(255, 255, 255, .85);
    font-size: .45em;
    margin-top: .15rem;
}

.info-box-number .amount-alt {
    font-size: .8em;
}

.rate-badge {
    font-weight: 600;
    white-space: nowrap;
}

@media print {
    .amount-alt {
        color: #555;
    }
}

/* what was actually paid in each currency, under a combined total */
.amount-split {
    display: block;
    font-size: .72rem;
    font-weight: normal;
    color: var(--bs-secondary-color);
}

.text-income {
    color: var(--clinic-income) !important;
}

.text-expense {
    color: var(--clinic-expense) !important;
}

/* ----- quick "add quantity" page: large, simple controls ----- */
.add-stock .qty-stepper .form-control {
    font-size: 1.75rem;
}

.add-stock .qty-stepper .btn {
    min-width: 4rem;
    font-size: 1.5rem;
}

.add-stock-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* ----- "Ministry of Health medication" choice on the item form ----- */
.ministry-toggle {
    cursor: pointer;
    background: var(--bs-tertiary-bg);
}

.ministry-toggle .ministry-check {
    width: 1.6rem;
    height: 1.6rem;
    margin: .15rem 0 0;
    cursor: pointer;
}

.ministry-toggle:has(.ministry-check:checked) {
    border-color: var(--bs-info) !important;
    background: var(--bs-info-bg-subtle);
}

/* ----- dentist services on the visit form ----- */
.dental-section {
    background: var(--bs-tertiary-bg);
}

/* =========================================================================
   Side menu: grouped by task, each group with its own colour, big clear items.
   ========================================================================= */
.app-sidebar {
    --menu-accent: #6ea8fe;
}

/* quick actions at the top */
.sidebar-quick {
    padding: .85rem .75rem .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-quick .btn {
    font-weight: 600;
    padding: .55rem .75rem;
    text-align: start;
}

.sidebar-quick .btn i {
    margin-inline-end: .4rem;
}

/* items */
.app-sidebar .sidebar-menu {
    padding: .35rem .5rem 1rem;
}

.app-sidebar .sidebar-menu .nav-link {
    padding: .5rem .75rem;
    margin-bottom: 1px;
    border-radius: .5rem;
    font-size: .98rem;
    color: rgba(255, 255, 255, .82);
    transition: background-color .15s;
}

.app-sidebar .sidebar-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, .07);
    color: #fff;
}

.app-sidebar .sidebar-menu .nav-link .nav-icon {
    font-size: 1.1rem;
    color: var(--menu-accent);
}

/* the page that is open: coloured bar + strong background */
.app-sidebar .sidebar-menu .nav-link.active {
    background-color: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: inset -4px 0 0 var(--menu-accent);   /* bar on the right side (RTL start) */
}

.app-sidebar .sidebar-menu .nav-link.active .nav-icon {
    color: #fff;
}

/* group titles: small coloured label with an icon and a line, clearly not clickable */
.app-sidebar .sidebar-menu .nav-header.menu-sec {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .7rem;
    padding: .35rem .75rem .3rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--menu-accent);
    text-transform: none;
}

.app-sidebar .sidebar-menu .nav-header.menu-sec::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .3;
}

/* one colour per group */
.app-sidebar .sec-reception { --menu-accent: #6ea8fe; }   /* blue */
.app-sidebar .sec-doctors   { --menu-accent: #5fd3a6; }   /* green */
.app-sidebar .sec-money     { --menu-accent: #f3b562; }   /* amber */
.app-sidebar .sec-stock     { --menu-accent: #c49cff; }   /* violet */
.app-sidebar .sec-settings  { --menu-accent: #adb5bd; }   /* grey */

/* settings folded */
.app-sidebar .nav-treeview {
    padding-inline-start: .6rem;
}

.app-sidebar .nav-treeview .nav-link {
    font-size: .92rem;
}

.app-sidebar .nav-link.active-parent {
    color: #fff;
}

.app-sidebar .nav-link.link-danger-menu,
.app-sidebar .nav-link.link-danger-menu .nav-icon {
    color: #ff8a8a !important;
}

.sidebar-quick .btn.sale-active {
    background-color: #fff;
    border-color: #fff;
    color: #1f2d3d;
}
