/* ================================================================
   BAKERY CUSTOMER PORTAL — BRAND STYLESHEET
   brand.css  |  Loaded after stylebundle.css (style.css)
   Brand Primary : #383091  (dark indigo/purple)
   Brand Accent  : #e3142e  (red)

   Selector strategy:
   - Data-attribute selectors for nav/sidebar: same specificity as
     style.css blocks → cascade wins by later source order, no !important
   - Bootstrap utility overrides (.bg-primary, .btn-primary): style.css
     already uses !important on these, so we match with !important only
     where the original does
   - badge-danger, table thead, h4/h2/h3: plain class selectors,
     no !important needed
   ================================================================ */

/* ----------------------------------------------------------------
   CSS Custom Properties
   ---------------------------------------------------------------- */
:root {
  --brand-primary:       #383091;
  --brand-primary-dark:  #2d2779;
  --brand-primary-light: #4a3ea8;
  --brand-accent:        #e3142e;
  --brand-accent-dark:   #c01025;
}

/* ----------------------------------------------------------------
   Nav Header (logo bar)
   data-nav-headerbg="color_3"

   Overrides style.css: [data-nav-headerbg="color_3"] .nav-header { background-color: blue; }
   White brand-logo text and white hamburger lines are already set
   in style.css — no changes needed there.
   ---------------------------------------------------------------- */
[data-nav-headerbg="color_3"] .nav-header,
[data-nav-headerbg="color_3"][data-theme-version="dark"] .nav-header {
  background-color: var(--brand-primary);
}

/* ----------------------------------------------------------------
   Sidebar
   data-sibebarbg="color_3"  (intentional typo in theme attribute name)

   Overrides style.css: [data-sibebarbg="color_3"] .deznav { background-color: blue; }
   White menu text, icons, and hover states are already wired in
   style.css — no changes needed there.
   ---------------------------------------------------------------- */
[data-sibebarbg="color_3"] .deznav,
[data-sibebarbg="color_3"][data-theme-version="dark"] .deznav {
  background-color: var(--brand-primary);
}

/* Sub-menu flyout and active-item background in mini/menu-toggle modes */
[data-sibebarbg="color_3"][data-sidebar-style="mini"][data-layout="vertical"]
  .deznav .metismenu li > ul,
[data-sibebarbg="color_3"][data-sidebar-style="mini"][data-layout="vertical"]
  .deznav .metismenu > li.mm-active > a,
[data-sibebarbg="color_3"][data-sidebar-style="mini"][data-layout="vertical"]
  .deznav .metismenu > li:hover > a,
[data-sibebarbg="color_3"][data-sidebar-style="full"][data-layout="vertical"]
  .menu-toggle .deznav .metismenu li > ul,
[data-sibebarbg="color_3"][data-sidebar-style="full"][data-layout="vertical"]
  .menu-toggle .deznav .metismenu > li.mm-active > a,
[data-sibebarbg="color_3"][data-sidebar-style="full"][data-layout="vertical"]
  .menu-toggle .deznav .metismenu > li:hover > a {
  background-color: var(--brand-primary-light);
}

/* Top-level nav item dividers */
[data-sibebarbg="color_3"] .deznav .metismenu > li,
[data-sibebarbg="color_3"][data-theme-version="dark"] .deznav .metismenu > li {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Nav-tab active underline */
[data-sibebarbg="color_3"] .deznav .menu-tabs li a.active,
[data-sibebarbg="color_3"][data-theme-version="dark"] .deznav .menu-tabs li a.active {
  color: #fff;
  border-bottom: 2px solid var(--brand-accent);
}

/* Active/hover nav item subtle highlight in full sidebar mode */
[data-sibebarbg="color_3"] .deznav .metismenu > li.mm-active > a,
[data-sibebarbg="color_3"] .deznav .metismenu > li:hover > a,
[data-sibebarbg="color_3"] .deznav .metismenu > li:focus > a {
  background-color: rgba(255, 255, 255, 0.08);
}

/* ----------------------------------------------------------------
   Preloader spinner
   Overrides style.css .sk-three-bounce .sk-child { background-color: blue; }
   Outside any color-slot block so a plain class selector wins.
   ---------------------------------------------------------------- */
.sk-three-bounce .sk-child {
  background-color: var(--brand-primary);
}

/* ----------------------------------------------------------------
   Bootstrap Primary → Brand Primary

   btn-primary: secondary save actions.
   bg-primary:  Excel export buttons.

   style.css overrides Bootstrap defaults with !important — we match.
   ---------------------------------------------------------------- */
.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled {
  background-color: var(--brand-primary) !important;
  border-color:     var(--brand-primary) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background-color: var(--brand-primary-dark) !important;
  border-color:     var(--brand-primary-dark) !important;
}

.btn-primary:focus,
.btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(56, 48, 145, 0.35) !important;
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--brand-primary-dark) !important;
  border-color:     var(--brand-primary-dark) !important;
}

.bg-primary {
  background-color: var(--brand-primary) !important;
}

a.bg-primary:hover,
a.bg-primary:focus,
button.bg-primary:hover,
button.bg-primary:focus {
  background-color: var(--brand-primary-dark) !important;
}

/* ----------------------------------------------------------------
   Outline Primary → Brand Primary
   Used for Prev/Next pagination buttons.
   style.css uses plain values (no !important) so later source order wins.
   ---------------------------------------------------------------- */
.btn-outline-primary {
  color:        var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color:     var(--brand-primary);
  color: #fff;
}

.btn-outline-primary:focus,
.btn-outline-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(56, 48, 145, 0.35);
}

.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
  color:        var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle {
  background-color: var(--brand-primary);
  border-color:     var(--brand-primary);
  color: #fff;
}

/* ----------------------------------------------------------------
   Danger Badge → Brand Accent
   badge-danger: Dr (debit) balance — replace CSS keyword "red" with
   precise brand accent. badge-success (Cr credit, green) is
   intentionally NOT touched.
   ---------------------------------------------------------------- */
.badge-danger {
  background-color: var(--brand-accent);
}

a.badge-danger:hover,
a.badge-danger:focus {
  background-color: var(--brand-accent-dark);
}

/* ----------------------------------------------------------------
   Table Header → Brand Primary
   Manufacturing users live in report and order tables. Branded
   thead provides strong scannable column hierarchy.
   :not(.table-dark) guard leaves explicitly dark-styled tables alone.
   ---------------------------------------------------------------- */
.table:not(.table-dark) thead th {
  background-color: var(--brand-primary);
  color: #fff;
  border-bottom: none;
}

/* DataTables sort arrows: lighten to remain visible on dark thead */
.table:not(.table-dark) thead th.sorting::before,
.table:not(.table-dark) thead th.sorting::after,
.table:not(.table-dark) thead th.sorting_asc::before,
.table:not(.table-dark) thead th.sorting_desc::before,
.table:not(.table-dark) thead th.sorting_desc::after {
  color: rgba(255, 255, 255, 0.55);
}

/* ----------------------------------------------------------------
   Page / Section Titles → Brand Primary
   ---------------------------------------------------------------- */
.page-titles h4,
.content-body h2,
.content-body h3 {
  color: var(--brand-accent);
}

/* ----------------------------------------------------------------
   Table Readability — Manufacturing Users
   15px on desktop (up from 14px default), 14px on mobile.
   ---------------------------------------------------------------- */
.table {
  font-size: 0.9375rem;
}

@media (max-width: 767px) {
  .table {
    font-size: 0.875rem;
  }
}
