:root {
    --erp-primary: #1b4d89;
    --erp-primary-dark: #123a69;
    --erp-accent: #0ea5e9;
    --erp-bg: #f4f7fb;
    --erp-card: #ffffff;
    --erp-border: #d9e2ef;
    --erp-text: #1f2937;
    --erp-muted: #64748b;
}

html, body {
    min-height: 100%;
    background: var(--erp-bg);
    color: var(--erp-text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

.erp-login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #eaf3ff 0%, #f8fbff 45%, #eef7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.erp-login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(30, 64, 175, 0.12);
    padding: 30px;
}

.erp-logo-circle {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--erp-primary), var(--erp-accent));
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.erp-shell {
    min-height: 100vh;
    display: flex;
}

.erp-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary-dark));
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1040;
}

.erp-brand {
    padding: 18px 20px;
    font-weight: 700;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.erp-nav-title {
    padding: 14px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,0.65);
}

.erp-sidebar a,
.erp-sidebar button.erp-nav-btn {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 20px;
    font-size: 13px;
}

.erp-sidebar a:hover,
.erp-sidebar button.erp-nav-btn:hover {
    background: rgba(255,255,255,0.11);
    color: #fff;
}

.erp-submenu a {
    padding-left: 38px;
    font-size: 12.5px;
    background: rgba(0,0,0,0.08);
}

.erp-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.erp-topbar {
    height: 58px;
    background: #fff;
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.erp-content {
    padding: 18px;
}

.erp-card {
    background: var(--erp-card);
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    padding: 18px;
    margin-bottom: 16px;
}

.erp-page-title {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 4px;
}

.erp-page-subtitle {
    color: var(--erp-muted);
    font-size: 13px;
}

.erp-stat-card {
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    padding: 16px;
    min-height: 110px;
}

.erp-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--erp-primary);
}

.erp-stat-label {
    color: var(--erp-muted);
    font-size: 13px;
}

.table.erp-table th {
    background: #eef5ff;
    color: #1e3a8a;
    font-size: 12px;
    vertical-align: middle;
}

.table.erp-table td {
    font-size: 12px;
    vertical-align: middle;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.form-control, .form-select, .btn {
    font-size: 13px;
}

@media (max-width: 991.98px) {
    .erp-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease-in-out;
    }
    .erp-sidebar.show {
        transform: translateX(0);
    }
    .erp-main {
        margin-left: 0;
        width: 100%;
    }
    .erp-content {
        padding: 12px;
    }
}

/* Stable SAP-style sidebar menu */
.erp-sidebar {
    scrollbar-width: thin;
}

.erp-dashboard-link {
    margin-top: 6px;
}

.erp-sidebar a.erp-menu-link,
.erp-sidebar button.erp-menu-toggle {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 18px;
    font-size: 13px;
}

.erp-sidebar a.erp-menu-link span,
.erp-sidebar button.erp-menu-toggle span {
    display: inline-flex;
    align-items: center;
}

.erp-sidebar a.erp-menu-link:hover,
.erp-sidebar button.erp-menu-toggle:hover,
.erp-sidebar a.erp-menu-link.active {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.erp-sidebar a.erp-menu-link.active {
    border-left: 4px solid #fff;
    padding-left: 14px;
    font-weight: 600;
}

.erp-sidebar button.erp-menu-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,0.11);
    color: #fff;
}

.erp-menu-chevron {
    font-size: 11px;
    transition: transform .18s ease-in-out;
}

.erp-menu-toggle[aria-expanded="true"] .erp-menu-chevron {
    transform: rotate(180deg);
}

.erp-submenu {
    background: rgba(0,0,0,0.10);
}

.erp-submenu a.erp-menu-link {
    padding-left: 42px;
    font-size: 12.5px;
    justify-content: flex-start;
}

.erp-submenu a.erp-menu-link.active {
    padding-left: 38px;
}

.erp-sidebar .erp-nav-title {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(18, 58, 105, .92);
}

/* Menu search and stable sidebar scroll position */
.erp-brand {
    position: sticky;
    top: 0;
    z-index: 6;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary));
}

.erp-menu-search {
    position: sticky;
    top: 58px;
    z-index: 5;
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary-dark));
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.erp-menu-search .input-group-text {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.88);
}

.erp-menu-search .form-control {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.22);
    color: #fff;
    box-shadow: none;
}

.erp-menu-search .form-control::placeholder {
    color: rgba(255,255,255,0.62);
}

.erp-menu-search .form-control:focus {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.45);
    color: #fff;
    box-shadow: 0 0 0 .12rem rgba(14,165,233,.25);
}

.erp-menu-search .btn {
    border-color: rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.86);
}

.erp-menu-search .btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.erp-menu-search-empty {
    margin-top: 7px;
    font-size: 11px;
    color: rgba(255,255,255,0.72);
}

.erp-menu-hidden-by-search {
    display: none !important;
}

.erp-menu-searching .erp-submenu {
    background: rgba(0,0,0,0.13);
}

.erp-menu-searching .erp-menu-link mark,
.erp-menu-searching .erp-menu-toggle mark {
    background: rgba(255,255,255,0.28);
    color: #fff;
    padding: 0 2px;
    border-radius: 3px;
}

/* Headings should not jump or cover the clicked item while sidebar scroll is restored. */
.erp-sidebar .erp-nav-title {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
}


/* FINAL FIX: visible menu search on actual Site.Master and stable left menu scroll */
.erp-sidebar {
    overflow-y: auto !important;
    overflow-x: hidden;
    scroll-behavior: auto !important;
}

.erp-menu-search {
    position: sticky;
    top: 56px;
    z-index: 20;
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary-dark));
    border-bottom: 1px solid rgba(255,255,255,0.16);
}

.erp-menu-search .input-group-text {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
}

.erp-menu-search .form-control {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
    color: #fff;
    box-shadow: none;
}

.erp-menu-search .form-control::placeholder {
    color: rgba(255,255,255,0.68);
}

.erp-menu-search .form-control:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.50);
    color: #fff;
    box-shadow: 0 0 0 .12rem rgba(14,165,233,.25);
}

.erp-menu-search .btn {
    border-color: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
}

.erp-menu-search-empty {
    margin-top: 7px;
    font-size: 11px;
    color: rgba(255,255,255,0.78);
}

.erp-menu-hidden-by-search {
    display: none !important;
}

.erp-menu-searching .erp-menu-link mark,
.erp-menu-searching .erp-menu-toggle mark {
    background: rgba(255,255,255,0.30);
    color: #fff;
    padding: 0 2px;
    border-radius: 3px;
}

.erp-brand {
    position: sticky;
    top: 0;
    z-index: 25;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary));
}

.erp-sidebar .erp-nav-title {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
}

/* FORCE FIX 2026-07-16: menu search and stable left sidebar position */
.erp-sidebar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100vh !important;
    scroll-behavior: auto !important;
}

.erp-brand {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary)) !important;
}

#erpMenuSearchBox,
.erp-menu-search {
    display: block !important;
    position: sticky !important;
    top: 58px !important;
    z-index: 49 !important;
    padding: 10px 12px 12px !important;
    background: linear-gradient(180deg, var(--erp-primary), var(--erp-primary-dark)) !important;
    border-bottom: 1px solid rgba(255,255,255,0.16) !important;
}

.erp-menu-search .input-group-text {
    background: rgba(255,255,255,0.13) !important;
    border-color: rgba(255,255,255,0.28) !important;
    color: rgba(255,255,255,0.92) !important;
}

.erp-menu-search .form-control {
    display: block !important;
    min-height: 31px !important;
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.28) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.erp-menu-search .form-control::placeholder {
    color: rgba(255,255,255,0.70) !important;
}

.erp-menu-search .form-control:focus {
    background: rgba(255,255,255,0.18) !important;
    border-color: rgba(255,255,255,0.50) !important;
    color: #fff !important;
    box-shadow: 0 0 0 .12rem rgba(14,165,233,.25) !important;
}

.erp-menu-search .btn {
    border-color: rgba(255,255,255,0.28) !important;
    color: rgba(255,255,255,0.92) !important;
}

.erp-menu-search-empty {
    margin-top: 7px !important;
    font-size: 11px !important;
    color: rgba(255,255,255,0.78) !important;
}

.erp-menu-hidden-by-search {
    display: none !important;
}

.erp-menu-searching .erp-submenu,
.erp-menu-searching .collapse.show {
    background: rgba(0,0,0,0.13) !important;
}

.erp-sidebar .erp-nav-title {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
}

.erp-sidebar a.active,
.erp-sidebar a.erp-menu-link.active {
    background: rgba(255,255,255,0.16) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* MENU SEARCH FIX 2: force visible search results and highlight */
.erp-search-match {
    outline: 1px solid rgba(255,255,255,0.20) !important;
}
.erp-menu-searching .erp-search-match {
    background: rgba(14,165,233,0.20) !important;
}

/* ERP input highlight: make data-entry controls eye-catching across all pages */
.erp-card .form-control:not([readonly]):not(:disabled),
.erp-card .form-select:not(:disabled),
.erp-card textarea.form-control:not([readonly]):not(:disabled),
.erp-entry-section .form-control:not([readonly]):not(:disabled),
.erp-entry-section .form-select:not(:disabled) {
    background-color: #fffdf2 !important;
    border-color: #f59e0b !important;
    box-shadow: inset 3px 0 0 #f59e0b !important;
}

.erp-card .form-control:not([readonly]):not(:disabled):focus,
.erp-card .form-select:not(:disabled):focus,
.erp-entry-section .form-control:not([readonly]):not(:disabled):focus,
.erp-entry-section .form-select:not(:disabled):focus {
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: inset 3px 0 0 #2563eb, 0 0 0 .15rem rgba(37,99,235,.18) !important;
}

.erp-card .form-control[readonly],
.erp-card .form-control:disabled,
.erp-card .form-select:disabled {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

.erp-card .form-check-input {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 .08rem rgba(245,158,11,.12);
}

.erp-card .form-label::after {
    content: "";
}
