/* ==========================================================================
   HEROFIS & PENCAD LAYOUT BRAND COLORS ONLY (BORDO / MAVI)
   - data-brand="herofis" -> Mavi (Herofis / GlassCAD)
   - data-brand="pencad"  -> Bordo (PenCAD)
   - Scoped strictly to _Layout shell (top navbar, left rail, flyout drawers)
     so inner page buttons, cards, tables, and forms remain 100% original.
   ========================================================================== */

:root,
html[data-brand="herofis"] {
    --hf-primary: #3063A0;
    --hf-primary-bright: #2563eb;
    --hf-primary-soft: rgba(48, 99, 160, 0.09);
    --hf-topbar-bg: linear-gradient(90deg, #1b3a6b 0%, #3063A0 60%, #2563eb 100%);
    --hf-rail-bg: linear-gradient(180deg, #1b3664 0%, #0f1f3d 100%);
    --hf-rail-indicator: #60a5fa;
    --hf-progress-gradient: linear-gradient(90deg, #38bdf8, #3063A0, #2563eb);
}

html[data-brand="pencad"] {
    --hf-primary: #7a0006;
    --hf-primary-bright: #9e0c15;
    --hf-primary-soft: rgba(122, 0, 6, 0.09);
    --hf-topbar-bg: linear-gradient(90deg, #540004 0%, #7a0006 55%, #9e0c15 100%);
    --hf-rail-bg: linear-gradient(180deg, #5c0005 0%, #260103 100%);
    --hf-rail-indicator: #fb7185;
    --hf-progress-gradient: linear-gradient(90deg, #fb7185, #9e0c15, #f59e0b);
}

/* ==========================================================================
   1. LAYOUT SHELL ONLY (TOP NAVBAR, LEFT RAIL & FLYOUT DRAWERS)
   ========================================================================== */
.top-progress-bar {
    background: var(--hf-progress-gradient) !important;
}

.erp-top-navbar {
    background: var(--hf-topbar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

.erp-left-rail {
    background: var(--hf-rail-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.rail-menu-list .nav-item .nav-link.is-active-module::before {
    background: var(--hf-rail-indicator) !important;
}

/* Left Rail Flyout Drawers - Brand Primary Border & Hover Accent */
.erp-left-rail .left-drawer,
.erp-left-rail .nested-drawer-menu.show {
    border-left: 3px solid var(--hf-primary-bright) !important;
}

.erp-left-rail .left-drawer .dropdown-item:hover,
.erp-left-rail .nested-drawer-menu .dropdown-item:hover {
    background: var(--hf-primary-soft) !important;
    color: var(--hf-primary-bright) !important;
}

html[data-brand="pencad"] .erp-left-rail .left-drawer .drawer-header h4,
html[data-brand="pencad"] .erp-left-rail .left-drawer .drawer-header h4 i {
    color: var(--hf-primary) !important;
}

/* PenCAD Drawer Always Retains Its Signature Bordo Accent */
.erp-left-rail .menu-pencad:hover > .nav-link {
    color: #fb7185 !important;
}

.erp-left-rail .menu-pencad .left-drawer,
.erp-left-rail .menu-pencad .nested-drawer-menu.show {
    border-left-color: #9e0c15 !important;
}

.erp-left-rail .menu-pencad .left-drawer .dropdown-item:hover {
    background: rgba(158, 12, 21, 0.09) !important;
    color: #9e0c15 !important;
}

/* Global Search Modal Active Icon Matches Layout Brand */
.search-result-item.active .search-item-icon {
    background: var(--hf-primary) !important;
    color: #ffffff !important;
}

/* Top Navbar Pill Actions (Scoped to .erp-top-navbar) */
.erp-top-navbar .hf-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-top-navbar .hf-header-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    white-space: nowrap;
}

.erp-top-navbar .hf-header-pill:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

/* Brand-aware Tabs & Page Accents when PenCAD Layout is Active */
html[data-brand="pencad"] .nav-tabs .nav-link.active,
html[data-brand="pencad"] .nav-tabs .nav-item.show .nav-link {
    color: var(--hf-primary, #7a0006) !important;
    border-color: transparent transparent var(--hf-primary, #7a0006) transparent;
}

html[data-brand="pencad"] #customer .bg-primary,
html[data-brand="pencad"] #PencadCustomer .bg-primary,
html[data-brand="pencad"] #listDetail .bg-primary,
html[data-brand="pencad"] #customer .headerForCreate {
    background-color: var(--hf-primary, #7a0006) !important;
}

html[data-brand="pencad"] #customer .border-primary {
    border-color: var(--hf-primary, #7a0006) !important;
}

html[data-brand="pencad"] #customer .text-primary {
    color: var(--hf-primary, #7a0006) !important;
}

/* ==========================================================================
   2. LAYOUT WRAPPER STRUCTURE (NO COLOR OR COMPONENT OVERRIDES)
   ========================================================================== */
.app-main {
    padding-top: 56px !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main > .wrapper {
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
}

.app-main > .wrapper > .page {
    margin-top: 0 !important;
    min-height: calc(100vh - 110px);
}
