:root {
    --semicolon-primary: #087052;
    --semicolon-primary-dark: #05523d;
    --semicolon-primary-soft: #e9f7f1;
    --semicolon-accent: #d9a441;
    --semicolon-ink: #15352b;
}
.theme-acru {
    --erp-green: var(--semicolon-primary);
    --erp-green-dark: var(--semicolon-primary-dark);
    --erp-green-light: #dff3ea;
    --erp-green-tint: #eef9f4;
    --erp-green-tint-lighter: #f7fcfa;
    --erp-text: #14271f;
    --erp-muted: #465b52;
    --erp-border: #cfdcd6;
    --erp-page-bg: #f4f8f6;
    color: var(--erp-text);
    font-weight: 500;
}

/* Stronger global typography and field contrast. Light surfaces should not
   make labels, values, or helper copy look washed out. */
.theme-acru label,
.theme-acru .form-label,
.theme-acru .custom-control-label {
    color: var(--erp-text) !important;
    font-weight: 600;
}

.theme-acru .text-muted,
.theme-acru .text-secondary,
.theme-acru .form-text,
.theme-acru .help-block {
    color: var(--erp-muted) !important;
    font-weight: 500;
}

.theme-acru .form-control,
.theme-acru .form-select,
.theme-acru .erp-field,
.theme-acru :where(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea),
.theme-acru .select2-container--default .select2-selection--single .select2-selection__rendered,
.theme-acru .select2-container--default .select2-results__option {
    color: #17241f !important;
    font-weight: 600;
}

.theme-acru .form-control,
.theme-acru .form-select,
.theme-acru .erp-field,
.theme-acru .select2-container--default .select2-selection--single {
    border-color: #c7d5ce !important;
    background-color: #fff;
}

.theme-acru .form-control::placeholder,
.theme-acru :where(input, textarea)::placeholder,
.theme-acru .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #586c63 !important;
    font-weight: 500;
    opacity: 1;
}

.theme-acru .form-control:disabled,
.theme-acru .form-control[readonly],
.theme-acru input:disabled,
.theme-acru select:disabled,
.theme-acru textarea:disabled {
    color: #405149 !important;
    -webkit-text-fill-color: #405149;
    opacity: 1;
}
.theme-acru .erp-logo-badge {
    width: 48px !important; height: 48px !important; padding: 0 !important;
    border: 1px solid #d9eee5;
    border-radius: 15px !important; background: #f2fbf7 !important;
    box-shadow: 0 8px 22px rgba(8, 112, 82, .16) !important;
}
.theme-acru .erp-logo-badge .navbar-logo {
    display: block !important;
    width: 48px !important; height: 48px !important;
    max-width: none !important; max-height: none !important;
    object-fit: contain;
    filter: none !important;
    opacity: 1 !important;
}
.theme-acru #sidebar .theme-text .nav-link {
    color: var(--semicolon-ink) !important; font-family: Poppins, Cairo, sans-serif;
    font-size: 17px !important; font-weight: 700 !important; letter-spacing: -.2px;
}
.semicolon-login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.semicolon-login-brand img { width: min(240px, 82%); height: auto; }
.login-one .ripple-button-primary, .login-one .btn-login {
    background: linear-gradient(135deg, var(--semicolon-primary), var(--semicolon-primary-dark)) !important;
    border-color: var(--semicolon-primary) !important; box-shadow: 0 8px 20px rgba(8, 112, 82, .2);
}
.login-one .text-primary, .login-one a:hover { color: var(--semicolon-primary) !important; }
.login-one .slider-half {
    position: relative; overflow: hidden;
    background: linear-gradient(145deg, #0b7054 0%, #064535 65%, #15352b 100%) !important;
}
.login-one .slider-half::after {
    content: ";"; position: absolute; inset-inline-end: 7%; bottom: -18%;
    color: rgba(217, 164, 65, .13); font: 700 420px/1 Poppins, sans-serif; pointer-events: none;
}

.app-switcher .app-switcher-menu {
    min-width: 310px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    border: 1px solid #dfeae5;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(21, 53, 43, .14);
    left: 0 !important;
    right: auto !important;
    text-align: start;
}
.app-switcher-title {
    padding: 5px 9px 10px;
    color: #7a8c85;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    color: #15352b;
    border-radius: 12px;
    transition: background .15s ease, transform .15s ease;
}
.app-switcher-item:hover {
    color: #15352b;
    background: #eef9f4;
    transform: translateY(-1px);
}
.app-switcher-item > span:last-child { display: flex; flex-direction: column; }
.app-switcher-item strong { font-size: 14px; line-height: 1.3; }
.app-switcher-item small { color: #71827b; font-size: 11px; margin-top: 2px; }
.app-switcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    font-size: 20px;
}
.app-switcher-icon.erp { color: #087052; background: #e9f7f1; }
.app-switcher-icon.store { color: #9a6a0d; background: #fff5dc; }
.app-switcher-icon.clinic { color: #b33a55; background: #fff0f3; }
.app-switcher-icon.tasks { color: #844c63; background: #f6ecf0; }

/* Keep the context controls grouped for ordering only; no surrounding card. */
.theme-acru .navbar-context-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.theme-acru .navbar-context-card > .navbar-item {
    margin: 0;
    padding: 0;
}

.theme-acru .navbar-context-card .nav-link,
.theme-acru .navbar-context-card .quick-links-btn {
    height: 30px !important;
    min-height: 30px;
    padding-block: 2px !important;
    font-size: 11.5px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.theme-acru .navbar-context-card .quick-links-btn {
    padding-inline: 10px !important;
}

.theme-acru .navbar-context-card .scope-nav .nav-link {
    padding-inline: 8px !important;
}

/* Compact application header. */
.theme-acru .header-container {
    top: 6px;
}

.theme-acru .header-container .navbar {
    min-height: 44px;
    margin-bottom: 8px;
    padding: 3px 10px;
    border-radius: 12px;
}

.theme-acru .header-container .navbar .sidebarCollapse,
.theme-acru .header-container .navbar .nav-link,
.theme-acru .header-container .navbar .erp-navbar-pin {
    width: 32px;
    height: 32px;
}

.theme-acru .header-container .navbar .user-profile-dropdown .nav-link,
.theme-acru .user-profile-dropdown .nav-link.user {
    padding-block: 1px !important;
}

.theme-acru .user-profile-dropdown .nav-link.user img {
    width: 28px;
    height: 28px;
}

.theme-acru #content {
    padding-top: 75px !important;
}

@media (max-width: 767.98px) {
    .theme-acru .header-container {
        top: 4px;
    }

    .theme-acru .header-container .navbar {
        min-height: 42px;
        margin-bottom: 6px;
        padding: 3px 6px;
    }

    .theme-acru #content {
        padding-top: 56px !important;
    }
}

/* Arabic visual order from the right: company/branch, then quick links. */
html[dir="rtl"] .theme-acru .navbar-context-card .scope-nav {
    order: -2;
}

html[dir="rtl"] .theme-acru .navbar-context-card .quick-links-nav {
    order: -1;
}

/*
 * Treat the final utility list as part of the header's main flex row. This lets
 * the sidebar control sit at the sidebar edge while keeping the remaining
 * actions in one tidy cluster, regardless of RTL/LTR visual ordering.
 */
.theme-acru .header-container .header > .navbar-item:last-of-type {
    display: contents;
}

.theme-acru .header-container .header > .sidebarCollapse {
    order: 100;
    margin-inline-start: 4px;
    border-inline-start: 1px solid var(--erp-border);
}

.theme-acru .header-container .header > .navbar-item:last-of-type > .app-switcher {
    order: -100;
}

/* Arabic header: the sidebar toggle is the first control on the visual right,
   while the application switcher moves to the visual left. Since its trigger
   is then at the left edge, anchor the menu there so the panel opens inward
   (towards the right) and remains fully visible. */
html[dir="rtl"] .theme-acru .header-container .header > .sidebarCollapse {
    order: -200;
    margin-inline-start: 0;
    margin-inline-end: 4px;
    border-inline-start: 0;
    border-inline-end: 1px solid var(--erp-border);
}

html[dir="rtl"] .theme-acru .header-container .header > .navbar-item:last-of-type > .app-switcher {
    order: 200;
}

html[dir="rtl"] .app-switcher .app-switcher-menu {
    left: 0 !important;
    right: auto !important;
}

/* Mirror the sidebar-edge controls in English and keep spare space between
   the company context and the utility group, rather than inside the tools. */
html[dir="ltr"] .theme-acru .header-container .header > .sidebarCollapse {
    order: -200;
    margin-inline-start: 0;
    margin-inline-end: 4px;
    border-inline-start: 0;
    border-inline-end: 1px solid var(--erp-border);
}

html[dir="ltr"] .theme-acru .header-container .header > .navbar-item:last-of-type > .app-switcher {
    order: 200;
}

html[dir="ltr"] .theme-acru .navbar-context-card .scope-nav .nav-link > span {
    max-width: clamp(100px, 12vw, 320px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    html[dir="ltr"] .theme-acru .header-container .header > .navbar-item.ml-md-auto {
        margin-left: auto !important;
        margin-right: 0 !important;
    }
}

html[dir="ltr"] .app-switcher .app-switcher-menu {
    left: auto !important;
    right: 0 !important;
}

/* A wrapped pinned toolbar must reserve its actual height above the workspace. */
html:not(.erp-navbar-unpinned) body.theme-acru #container #content{padding-top:var(--erp-toolbar-offset,75px)!important}
@media(max-width:767.98px){html:not(.erp-navbar-unpinned) body.theme-acru #container #content{padding-top:var(--erp-toolbar-offset,56px)!important}}

html.erp-navbar-unpinned body.theme-acru #container #content{padding-top:16px!important}
@media(max-width:767.98px){html.erp-navbar-unpinned body.theme-acru #container #content{padding-top:10px!important}}

/* Large business forms and tables need room; compact dialogs retain their size. */
@media(min-width:768px){
    .theme-acru .modal-dialog.modal-lg{width:calc(100% - 48px);max-width:1280px}
    .theme-acru .modal-dialog.modal-xl{width:calc(100% - 32px);max-width:none}
}
.theme-acru .modal-dialog-scrollable{max-height:calc(100dvh - 32px)}
.theme-acru .modal-dialog-scrollable .modal-content{max-height:calc(100dvh - 32px)}
.theme-acru .modal-dialog-scrollable .modal-body{min-height:0;overflow-y:auto}
