:root {
    --pharmacy-primary-color: #28a745;
    --pharmacy-primary-rgb: 40, 167, 69;
}

/* Override Bootstrap primary color with pharmacy color */
.btn-primary,
.bg-primary,
.badge-primary {
    background-color: var(--pharmacy-primary-color) !important;
    border-color: var(--pharmacy-primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pharmacy-primary-color) !important;
    border-color: var(--pharmacy-primary-color) !important;
    opacity: 0.9;
}

/* Apply brand color to .text-primary on light backgrounds */
.bg-light .text-primary,
.bg-white .text-primary,
.card .text-primary,
.container .text-primary,
.sidebar .text-primary,
#sidebarMenu .text-primary {
    color: var(--pharmacy-primary-color) !important;
}

.border-primary {
    border-color: var(--pharmacy-primary-color) !important;
}

/* Make outline buttons solid with brand color and white text */
.btn-outline-primary,
.btn-outline-secondary {
    color: #fff !important;
    background-color: var(--pharmacy-primary-color) !important;
    border-color: var(--pharmacy-primary-color) !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    color: #fff !important;
    background-color: var(--pharmacy-primary-color) !important;
    border-color: var(--pharmacy-primary-color) !important;
    opacity: 0.9;
}

.btn-outline-primary .text-primary,
.btn-outline-primary .h6,
.btn-outline-secondary .text-primary,
.btn-outline-secondary .text-secondary,
.btn-outline-secondary .h6 {
    color: #fff !important;
}

.btn-outline-primary:hover .text-primary,
.btn-outline-primary:hover .h6,
.btn-outline-secondary:hover .text-secondary,
.btn-outline-secondary:hover .h6 {
    color: #fff !important;
}

/* Alert primary */
.alert-primary {
    color: var(--pharmacy-primary-color) !important;
    background-color: rgba(var(--pharmacy-primary-rgb), 0.1) !important;
    border-color: rgba(var(--pharmacy-primary-rgb), 0.2) !important;
}

/* Links - only on light backgrounds, not in navbar */
.container a:not(.btn):not(.nav-link),
.bg-light a:not(.btn):not(.nav-link),
.bg-white a:not(.btn):not(.nav-link) {
    color: var(--pharmacy-primary-color) !important;
}

.container a:not(.btn):not(.nav-link):hover,
.bg-light a:not(.btn):not(.nav-link):hover,
.bg-white a:not(.btn):not(.nav-link):hover {
    color: var(--pharmacy-primary-color) !important;
    opacity: 0.8;
}

/* Sidebar nav-links use brand color */
.sidebar .nav-link,
#sidebarMenu .nav-link {
    color: var(--pharmacy-primary-color) !important;
}

.sidebar .nav-link:hover,
#sidebarMenu .nav-link:hover {
    color: var(--pharmacy-primary-color) !important;
    opacity: 0.9;
}

/* Keep navbar text white */
.navbar .text-primary,
.navbar .nav-link,
.navbar a,
.bg-dark .text-primary {
    color: #fff !important;
}

/* Dashboard icons are white on solid buttons */
.btn-outline-primary i,
.btn-outline-secondary i {
    color: #fff !important;
}

/* When hovering, icons stay white */
.btn-outline-primary:hover i,
.btn-outline-secondary:hover i {
    color: #fff !important;
}

/* Form controls focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--pharmacy-primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--pharmacy-primary-rgb), 0.25) !important;
}

/* Nav pills active */
.nav-pills .nav-link.active {
    background-color: var(--pharmacy-primary-color) !important;
}

/* Pagination active */
.pagination .page-item.active .page-link {
    background-color: var(--pharmacy-primary-color) !important;
    border-color: var(--pharmacy-primary-color) !important;
}

/* Progress bar */
.progress-bar {
    background-color: var(--pharmacy-primary-color) !important;
}
/* Tile icon and button height standardization */
.row .col i[class*="fa-2x"] {
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

/* Ensure all tile buttons have consistent height */
.row .col-xs-12 .d-grid .btn,
.row .col-sm-6 .d-grid .btn,
.row .col-lg-3 .d-grid .btn,
.row .col-xl-2 .d-grid .btn {
    min-height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center the row and column content inside buttons */
.row .col-xs-12 .d-grid .btn .row,
.row .col-sm-6 .d-grid .btn .row,
.row .col-lg-3 .d-grid .btn .row,
.row .col-xl-2 .d-grid .btn .row {
    width: 100%;
    justify-content: center;
}

.row .col-xs-12 .d-grid .btn .col,
.row .col-sm-6 .d-grid .btn .col,
.row .col-lg-3 .d-grid .btn .col,
.row .col-xl-2 .d-grid .btn .col {
    text-align: center;
}