/* ==========================================================================
   MAILYSIS — Brand Design System (theme.css)
   Warm espresso / coffee palette. Single source of truth for the app skin.
   Loaded AFTER Bootstrap 4.6.2 so these rules override defaults.
   RULE: components must use --mly-* variables, never new hardcoded hex.
   Legacy ugly colors being replaced: peach #FCE4D6, red stripe #E77167,
   tan modal #BDB29C, green button #70F570, purple/neon — all gone.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand — espresso family */
  --mly-espresso: #3B3324;
  --mly-espresso-700: #2E2818;
  --mly-espresso-900: #211C12;
  --mly-coffee: #5C4B33;
  --mly-latte: #8A7A63;

  /* Surfaces */
  --mly-cream: #F6F2EB;
  --mly-cream-2: #EFE8DC;
  --mly-surface: #FFFFFF;

  /* Borders */
  --mly-border: #E4DBCD;
  --mly-border-2: #D8CDBA;

  /* Text */
  --mly-text: #2B2823;
  --mly-text-2: #6E665A;
  --mly-muted: #9A9183;

  /* Accents & status */
  --mly-gold: #C29A57;
  --mly-success: #2E7D5B;
  --mly-danger: #C0492F;
  --mly-warning: #C98A1E;
  --mly-info: #3E6E8E;

  /* Shape & elevation */
  --mly-radius: 10px;
  --mly-radius-sm: 8px;
  --mly-shadow: 0 1px 3px rgba(43, 40, 35, .08), 0 1px 2px rgba(43, 40, 35, .04);

  /* Derived helpers (one place to reference) */
  --mly-zebra: #FAF7F2;
  --mly-sidebar-text: var(--mly-cream);
  --mly-focus-ring: 0 0 0 3px rgba(59, 51, 36, .18);
  --mly-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mly-transition: .18s ease;
}

/* --------------------------------------------------------------------------
   2. Base layout
   -------------------------------------------------------------------------- */
html,
body,
.page-wrapper,
.page-content {
  background-color: var(--mly-cream);
  color: var(--mly-text);
  font-family: var(--mly-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 14px;
  line-height: 1.55;
}

.page-content {
  padding: 24px;
}

a {
  color: var(--mly-coffee);
  transition: color var(--mly-transition);
}

a:hover,
a:focus {
  color: var(--mly-espresso-700);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--mly-text);
  font-weight: 600;
}

hr {
  border-top: 1px solid var(--mly-border);
}

::selection {
  background: rgba(194, 154, 87, .28);
  color: var(--mly-espresso-900);
}

/* --------------------------------------------------------------------------
   3. Sidebar  (.chiller-theme = espresso skin)
   -------------------------------------------------------------------------- */
.sidebar-wrapper,
.chiller-theme .sidebar-wrapper {
  background: var(--mly-espresso);
  color: var(--mly-sidebar-text);
  border-right: 1px solid var(--mly-espresso-900);
}

.chiller-theme .page-wrapper.toggled .sidebar-wrapper {
  background: var(--mly-espresso);
}

.sidebar-wrapper .sidebar-brand,
.sidebar-wrapper .sidebar-header {
  background: var(--mly-espresso-700);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: var(--mly-cream);
}

.sidebar-brand > a {
  color: var(--mly-cream);
  font-weight: 600;
  letter-spacing: .2px;
}

.sidebar-brand > a:hover {
  color: #FFFFFF;
}

.sidebar-brand #close-sidebar {
  color: var(--mly-latte);
  transition: color var(--mly-transition);
}

.sidebar-brand #close-sidebar:hover {
  color: var(--mly-cream);
}

/* User block */
.sidebar-header .user-pic,
.sidebar-header .user-pic img {
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(194, 154, 87, .55);
}

.sidebar-header .user-info .user-name {
  color: var(--mly-cream);
  font-weight: 600;
}

.sidebar-header .user-info .user-status {
  color: var(--mly-latte);
  font-size: 12px;
}

.sidebar-header .user-info .user-status i {
  color: var(--mly-success);
}

/* Search box (if present) */
.sidebar-wrapper .sidebar-search input.search-menu {
  background: var(--mly-espresso-900);
  color: var(--mly-cream);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--mly-radius-sm);
}

.sidebar-wrapper .sidebar-search input.search-menu::placeholder {
  color: var(--mly-latte);
}

.sidebar-wrapper .sidebar-search .input-group-text {
  background: var(--mly-espresso-900);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--mly-latte);
}

/* Section labels */
.sidebar-menu .header-menu span {
  color: var(--mly-latte);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .6px;
  font-weight: 600;
}

/* Menu items */
.sidebar-menu ul li a {
  color: var(--mly-cream);
  border-left: 3px solid transparent;
  transition: background var(--mly-transition), color var(--mly-transition),
    border-color var(--mly-transition);
}

.sidebar-menu ul li a i {
  color: var(--mly-latte);
  transition: color var(--mly-transition);
}

.sidebar-menu ul li a:hover,
.sidebar-menu ul li a:focus {
  background: var(--mly-espresso-700);
  color: #FFFFFF;
  border-left-color: var(--mly-gold);
  text-decoration: none;
}

.sidebar-menu ul li a:hover i {
  color: var(--mly-gold);
}

/* Active / open dropdown */
.sidebar-menu ul li.active > a,
.sidebar-dropdown.active > a {
  background: var(--mly-espresso-900);
  color: #FFFFFF;
  border-left-color: var(--mly-gold);
}

.sidebar-menu ul li.active > a i,
.sidebar-dropdown.active > a i {
  color: var(--mly-gold);
}

/* Badges inside menu items */
.sidebar-menu ul li a .badge {
  background: var(--mly-gold);
  color: var(--mly-espresso-900);
}

/* Submenu */
.sidebar-dropdown .sidebar-submenu {
  background: var(--mly-espresso-900);
}

.sidebar-dropdown .sidebar-submenu ul li a {
  color: var(--mly-latte);
  padding-left: 44px;
  border-left: 3px solid transparent;
}

.sidebar-dropdown .sidebar-submenu ul li a:hover,
.sidebar-dropdown .sidebar-submenu ul li a:focus {
  color: var(--mly-cream);
  background: rgba(255, 255, 255, .04);
  border-left-color: var(--mly-gold);
}

.sidebar-dropdown.active .sidebar-submenu {
  display: block;
}

/* Dropdown caret */
.sidebar-dropdown > a:after {
  color: var(--mly-latte);
}

/* Sidebar footer */
.sidebar-footer {
  background: var(--mly-espresso-700);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-footer > a {
  color: var(--mly-latte);
  border-left: 1px solid rgba(255, 255, 255, .06);
  transition: color var(--mly-transition), background var(--mly-transition);
}

.sidebar-footer > a:first-child {
  border-left: none;
}

.sidebar-footer > a:hover {
  color: var(--mly-cream);
  background: var(--mly-espresso-900);
}

.sidebar-footer .badge-sonar {
  background: var(--mly-danger);
}

/* Toggle buttons */
#show-sidebar {
  background: var(--mly-espresso);
  color: var(--mly-cream);
  border: none;
  border-radius: 0 var(--mly-radius-sm) var(--mly-radius-sm) 0;
  box-shadow: var(--mly-shadow);
  transition: background var(--mly-transition);
}

#show-sidebar:hover {
  background: var(--mly-espresso-700);
  color: #FFFFFF;
}

#close-sidebar {
  background: transparent;
  border: none;
  color: var(--mly-latte);
}

#close-sidebar:hover {
  color: var(--mly-cream);
}

/* Sidebar scrollbar */
.sidebar-wrapper ::-webkit-scrollbar {
  width: 6px;
}

.sidebar-wrapper ::-webkit-scrollbar-thumb {
  background: var(--mly-coffee);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: var(--mly-shadow);
}

.card-header {
  background: var(--mly-surface);
  border-bottom: 1px solid var(--mly-border);
  color: var(--mly-text);
  font-weight: 600;
  border-radius: var(--mly-radius) var(--mly-radius) 0 0 !important;
  padding: 14px 18px;
}

.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6 {
  margin-bottom: 0;
}

.card-body {
  background: var(--mly-surface);
  color: var(--mly-text);
  padding: 18px;
}

.card-footer {
  background: var(--mly-cream);
  border-top: 1px solid var(--mly-border);
  border-radius: 0 0 var(--mly-radius) var(--mly-radius) !important;
}

/* --------------------------------------------------------------------------
   5. Tables
   Header: espresso bg + white text. Zebra: --mly-zebra. Soft borders.
   High-specificity + !important to beat legacy inline <style>
   (peach #FCE4D6 headers, red #E77167 stripes, beige headers).
   -------------------------------------------------------------------------- */
.table {
  background: var(--mly-surface);
  color: var(--mly-text);
  border-color: var(--mly-border);
  margin-bottom: 0;
}

.table thead th,
.table > thead > tr > th,
table.table thead th,
.table thead tr th {
  background-color: var(--mly-espresso) !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border-color: var(--mly-espresso-700) !important;
  border-bottom: 2px solid var(--mly-espresso-700) !important;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
  text-transform: none;
  vertical-align: middle;
  padding: 12px 14px;
}

.table thead th a,
.table thead th a:hover {
  color: #FFFFFF !important;
}

.table td,
.table th {
  border-color: var(--mly-border);
  padding: 11px 14px;
  vertical-align: middle;
}

.table tbody tr {
  background-color: var(--mly-surface);
  transition: background var(--mly-transition);
}

/* Zebra — overrides legacy peach/red stripes */
.table-striped tbody tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(odd) > td,
.table-striped tbody tr:nth-of-type(odd) > th {
  background-color: var(--mly-zebra) !important;
}

.table-striped tbody tr:nth-of-type(even),
.table-striped > tbody > tr:nth-of-type(even) {
  background-color: var(--mly-surface) !important;
}

/* Hover row */
.table-hover tbody tr:hover,
.table tbody tr:hover,
.table tbody tr:hover > td,
.table tbody tr:hover > th {
  background-color: var(--mly-cream-2) !important;
  color: var(--mly-text);
}

/* Bordered variant */
.table-bordered,
.table-bordered td,
.table-bordered th {
  border-color: var(--mly-border) !important;
}

/* Neutralize any legacy colored header bg / row attribute (peach/red/beige) */
.table thead th[style],
.table thead th[bgcolor],
.table tr[bgcolor] th {
  background-color: var(--mly-espresso) !important;
  background-image: none !important;
  color: #FFFFFF !important;
}

.table td[bgcolor],
.table tr[bgcolor] td {
  background-color: inherit !important;
}

/* Responsive table wrapper */
.table-responsive {
  border-radius: var(--mly-radius);
  border: 1px solid var(--mly-border);
  background: var(--mly-surface);
  overflow-x: auto;
}

.table-responsive > .table {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  border-radius: var(--mly-radius-sm);
  font-weight: 500;
  letter-spacing: .2px;
  transition: background var(--mly-transition), color var(--mly-transition),
    border-color var(--mly-transition), box-shadow var(--mly-transition);
}

.btn:focus,
.btn.focus {
  box-shadow: var(--mly-focus-ring);
}

/* Primary / submit — espresso. Overrides legacy green #70F570 etc. */
.btn-primary,
.btn-submit,
.btn-submit2,
input[type="submit"],
button[type="submit"].btn {
  background-color: var(--mly-espresso) !important;
  background-image: none !important;
  border: 1px solid var(--mly-espresso) !important;
  color: #FFFFFF !important;
  border-radius: var(--mly-radius-sm);
  font-weight: 500;
}

.btn-primary:hover,
.btn-submit:hover,
.btn-submit2:hover,
input[type="submit"]:hover,
button[type="submit"].btn:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--mly-espresso-700) !important;
  border-color: var(--mly-espresso-700) !important;
  color: #FFFFFF !important;
}

.btn-primary:focus,
.btn-submit:focus,
.btn-submit2:focus,
input[type="submit"]:focus {
  box-shadow: var(--mly-focus-ring) !important;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: var(--mly-latte) !important;
  border-color: var(--mly-latte) !important;
  opacity: .65;
}

/* Secondary / default — cream outline */
.btn-secondary,
.btn-default {
  background-color: var(--mly-cream) !important;
  border: 1px solid var(--mly-border-2) !important;
  color: var(--mly-text) !important;
}

.btn-secondary:hover,
.btn-default:hover,
.btn-secondary:focus,
.btn-default:focus,
.btn-secondary:not(:disabled):not(.disabled):active {
  background-color: var(--mly-cream-2) !important;
  border-color: var(--mly-latte) !important;
  color: var(--mly-espresso-700) !important;
}

/* Outline primary */
.btn-outline-primary {
  color: var(--mly-espresso) !important;
  border-color: var(--mly-espresso) !important;
  background: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--mly-espresso) !important;
  border-color: var(--mly-espresso) !important;
  color: #FFFFFF !important;
}

/* Light */
.btn-light {
  background-color: var(--mly-surface) !important;
  border: 1px solid var(--mly-border) !important;
  color: var(--mly-text) !important;
}

.btn-light:hover {
  background-color: var(--mly-cream-2) !important;
}

/* Status buttons mapped to brand status tokens */
.btn-success {
  background-color: var(--mly-success) !important;
  border-color: var(--mly-success) !important;
  color: #FFFFFF !important;
}

.btn-danger {
  background-color: var(--mly-danger) !important;
  border-color: var(--mly-danger) !important;
  color: #FFFFFF !important;
}

.btn-warning {
  background-color: var(--mly-warning) !important;
  border-color: var(--mly-warning) !important;
  color: #FFFFFF !important;
}

.btn-info {
  background-color: var(--mly-info) !important;
  border-color: var(--mly-info) !important;
  color: #FFFFFF !important;
}

.btn-link {
  color: var(--mly-coffee) !important;
}

.btn-link:hover {
  color: var(--mly-espresso-700) !important;
}

/* Button group cohesion */
.btn-group > .btn {
  border-radius: 0;
}

.btn-group > .btn:first-child {
  border-top-left-radius: var(--mly-radius-sm);
  border-bottom-left-radius: var(--mly-radius-sm);
}

.btn-group > .btn:last-child {
  border-top-right-radius: var(--mly-radius-sm);
  border-bottom-right-radius: var(--mly-radius-sm);
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
label,
.form-label {
  color: var(--mly-text-2);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-control,
.input--style-1,
select.form-control,
textarea.form-control {
  background-color: var(--mly-surface);
  border: 1px solid var(--mly-border-2);
  border-radius: var(--mly-radius-sm);
  color: var(--mly-text);
  transition: border-color var(--mly-transition), box-shadow var(--mly-transition);
}

.form-control::placeholder,
.input--style-1::placeholder {
  color: var(--mly-muted);
}

.form-control:focus,
.input--style-1:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--mly-coffee);
  box-shadow: var(--mly-focus-ring);
  background-color: var(--mly-surface);
  color: var(--mly-text);
  outline: none;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--mly-cream-2);
  color: var(--mly-text-2);
}

.form-control.is-invalid {
  border-color: var(--mly-danger);
}

.form-control.is-valid {
  border-color: var(--mly-success);
}

.invalid-feedback,
.text-danger,
.field-validation-error {
  color: var(--mly-danger) !important;
}

.valid-feedback,
.text-success {
  color: var(--mly-success) !important;
}

/* Custom select */
.custom-select {
  background-color: var(--mly-surface);
  border: 1px solid var(--mly-border-2);
  border-radius: var(--mly-radius-sm);
  color: var(--mly-text);
}

.custom-select:focus {
  border-color: var(--mly-coffee);
  box-shadow: var(--mly-focus-ring);
}

/* Input groups */
.input-group-text {
  background-color: var(--mly-cream-2);
  border: 1px solid var(--mly-border-2);
  color: var(--mly-text-2);
  border-radius: var(--mly-radius-sm);
}

.input-group > .form-control:not(:last-child),
.input-group > .input--style-1:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .input--style-1:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Checkboxes & radios */
.custom-control-label {
  color: var(--mly-text);
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--mly-espresso);
  border-color: var(--mly-espresso);
}

.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: var(--mly-focus-ring);
}

/* --------------------------------------------------------------------------
   8. Tabs
   -------------------------------------------------------------------------- */
.tab-list,
.nav-tabs {
  border-bottom: 1px solid var(--mly-border);
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.tab-list__item,
.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.tab-list__link,
.nav-tabs .nav-link {
  display: block;
  padding: 10px 18px;
  color: var(--mly-text-2);
  border: 1px solid transparent;
  border-top-left-radius: var(--mly-radius-sm);
  border-top-right-radius: var(--mly-radius-sm);
  background: transparent;
  font-weight: 500;
  transition: color var(--mly-transition), background var(--mly-transition),
    border-color var(--mly-transition);
}

.tab-list__link:hover,
.nav-tabs .nav-link:hover {
  color: var(--mly-espresso-700);
  border-color: var(--mly-border) var(--mly-border) transparent;
  background: var(--mly-cream);
}

.tab-list__link.active,
.tab-list__item.active .tab-list__link,
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: var(--mly-espresso-900);
  background: var(--mly-surface);
  border-color: var(--mly-border) var(--mly-border) var(--mly-surface);
  border-bottom: 2px solid var(--mly-gold);
  font-weight: 600;
}

.tab-content,
.tab-pane {
  background: var(--mly-surface);
  color: var(--mly-text);
}

.tab-content {
  padding: 18px;
  border: 1px solid var(--mly-border);
  border-top: none;
  border-radius: 0 0 var(--mly-radius) var(--mly-radius);
}

/* Pill nav */
.nav-pills .nav-link {
  color: var(--mly-text-2);
  border-radius: var(--mly-radius-sm);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--mly-espresso);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   9. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  margin: 0;
}

.page-link {
  color: var(--mly-coffee);
  background-color: var(--mly-surface);
  border: 1px solid var(--mly-border);
  transition: background var(--mly-transition), color var(--mly-transition);
}

.page-link:hover,
.page-link:focus {
  color: var(--mly-espresso-700);
  background-color: var(--mly-cream-2);
  border-color: var(--mly-border-2);
  box-shadow: none;
}

.page-item.active .page-link {
  background-color: var(--mly-espresso) !important;
  border-color: var(--mly-espresso) !important;
  color: #FFFFFF !important;
}

.page-item.disabled .page-link {
  color: var(--mly-muted);
  background-color: var(--mly-cream);
  border-color: var(--mly-border);
}

.page-item:first-child .page-link {
  border-top-left-radius: var(--mly-radius-sm);
  border-bottom-left-radius: var(--mly-radius-sm);
}

.page-item:last-child .page-link {
  border-top-right-radius: var(--mly-radius-sm);
  border-bottom-right-radius: var(--mly-radius-sm);
}

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 600;
  font-size: 11.5px;
  padding: .4em .7em;
  border-radius: var(--mly-radius-sm);
}

.badge-pill {
  border-radius: 10rem;
}

.badge-primary {
  background-color: var(--mly-espresso) !important;
  color: #FFFFFF !important;
}

.badge-secondary {
  background-color: var(--mly-cream-2) !important;
  color: var(--mly-text) !important;
}

.badge-success {
  background-color: rgba(46, 125, 91, .14) !important;
  color: var(--mly-success) !important;
}

.badge-danger {
  background-color: rgba(192, 73, 47, .14) !important;
  color: var(--mly-danger) !important;
}

.badge-warning {
  background-color: rgba(201, 138, 30, .16) !important;
  color: var(--mly-warning) !important;
}

.badge-info {
  background-color: rgba(62, 110, 142, .14) !important;
  color: var(--mly-info) !important;
}

.badge-light {
  background-color: var(--mly-cream) !important;
  color: var(--mly-text-2) !important;
}

.badge-gold {
  background-color: rgba(194, 154, 87, .18) !important;
  color: var(--mly-espresso-900) !important;
}

/* --------------------------------------------------------------------------
   11. Modals
   -------------------------------------------------------------------------- */
.modal-content {
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: 0 12px 32px rgba(33, 28, 18, .22);
}

.modal-header {
  background: var(--mly-espresso) !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid var(--mly-espresso-700);
  border-radius: var(--mly-radius) var(--mly-radius) 0 0;
  padding: 16px 20px;
}

.modal-header .modal-title {
  color: #FFFFFF !important;
  font-weight: 600;
}

.modal-header .close,
.modal-header .close span {
  color: var(--mly-cream) !important;
  opacity: .85;
  text-shadow: none;
}

.modal-header .close:hover {
  color: #FFFFFF !important;
  opacity: 1;
}

.modal-body {
  background: var(--mly-surface);
  color: var(--mly-text);
  padding: 20px;
}

.modal-footer {
  background: var(--mly-cream);
  border-top: 1px solid var(--mly-border);
  border-radius: 0 0 var(--mly-radius) var(--mly-radius);
}

.modal-backdrop.show {
  background: var(--mly-espresso-900);
  opacity: .5;
}

/* --------------------------------------------------------------------------
   12. Dashboard KPI / metric cards
   Override legacy nth-child gradient backgrounds with flat brand tints.
   -------------------------------------------------------------------------- */
.kpi-card,
.metric-card,
.stat-card,
.dashboard-card,
.info-box,
.small-box {
  background: var(--mly-surface) !important;
  background-image: none !important;
  border: 1px solid var(--mly-border) !important;
  border-radius: var(--mly-radius) !important;
  box-shadow: var(--mly-shadow) !important;
  color: var(--mly-text) !important;
  border-left: 4px solid var(--mly-espresso) !important;
}

.kpi-card .kpi-value,
.metric-card .metric-value,
.stat-card .stat-value,
.small-box h3 {
  color: var(--mly-espresso-900) !important;
  font-weight: 700;
}

.kpi-card .kpi-label,
.metric-card .metric-label,
.stat-card .stat-label,
.small-box p {
  color: var(--mly-text-2) !important;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
}

.kpi-card .kpi-icon,
.metric-card .metric-icon,
.small-box .icon {
  color: var(--mly-latte) !important;
}

/* Flat brand-tinted accent per card position (replaces gradients) */
.kpi-card:nth-child(1),
.metric-card:nth-child(1),
.stat-card:nth-child(1),
.col:nth-child(1) > .kpi-card {
  border-left-color: var(--mly-espresso) !important;
}

.kpi-card:nth-child(2),
.metric-card:nth-child(2),
.stat-card:nth-child(2) {
  border-left-color: var(--mly-coffee) !important;
}

.kpi-card:nth-child(3),
.metric-card:nth-child(3),
.stat-card:nth-child(3) {
  border-left-color: var(--mly-gold) !important;
}

.kpi-card:nth-child(4),
.metric-card:nth-child(4),
.stat-card:nth-child(4) {
  border-left-color: var(--mly-latte) !important;
}

/* Generic dashboard tiles that used inline gradients */
[class*="bg-gradient"] {
  background: var(--mly-surface) !important;
  background-image: none !important;
  color: var(--mly-text) !important;
}

/* --------------------------------------------------------------------------
   13. Date range picker
   -------------------------------------------------------------------------- */
.daterangepicker {
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: 0 8px 24px rgba(33, 28, 18, .18);
  color: var(--mly-text);
  font-family: var(--mly-font);
}

.daterangepicker .calendar-table {
  background: var(--mly-surface);
  border-color: var(--mly-border);
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
  background-color: var(--mly-cream-2);
  color: var(--mly-espresso-700);
}

.daterangepicker td.in-range {
  background-color: var(--mly-cream-2);
  color: var(--mly-text);
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
  background-color: var(--mly-espresso) !important;
  color: #FFFFFF !important;
}

.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
  color: var(--mly-muted);
  background: var(--mly-surface);
}

.daterangepicker .ranges li.active {
  background-color: var(--mly-espresso);
  color: #FFFFFF;
}

.daterangepicker .ranges li:hover {
  background-color: var(--mly-cream-2);
}

.daterangepicker .drp-buttons {
  border-top: 1px solid var(--mly-border);
}

.daterangepicker .drp-buttons .btn {
  border-radius: var(--mly-radius-sm);
}

.daterangepicker:before {
  border-bottom-color: var(--mly-border);
}

.daterangepicker:after {
  border-bottom-color: var(--mly-surface);
}

/* --------------------------------------------------------------------------
   14. Alerts
   -------------------------------------------------------------------------- */
.alert {
  border-radius: var(--mly-radius-sm);
  border: 1px solid transparent;
}

.alert-success {
  background-color: rgba(46, 125, 91, .10);
  border-color: rgba(46, 125, 91, .30);
  color: var(--mly-success);
}

.alert-danger {
  background-color: rgba(192, 73, 47, .10);
  border-color: rgba(192, 73, 47, .30);
  color: var(--mly-danger);
}

.alert-warning {
  background-color: rgba(201, 138, 30, .12);
  border-color: rgba(201, 138, 30, .32);
  color: var(--mly-warning);
}

.alert-info {
  background-color: rgba(62, 110, 142, .10);
  border-color: rgba(62, 110, 142, .30);
  color: var(--mly-info);
}

.alert-primary {
  background-color: var(--mly-cream-2);
  border-color: var(--mly-border-2);
  color: var(--mly-espresso-700);
}

/* --------------------------------------------------------------------------
   15. Dropdowns, breadcrumbs, list groups, progress, tooltips, misc
   -------------------------------------------------------------------------- */
.dropdown-menu {
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius-sm);
  box-shadow: var(--mly-shadow);
}

.dropdown-item {
  color: var(--mly-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--mly-cream-2);
  color: var(--mly-espresso-700);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--mly-espresso);
  color: #FFFFFF;
}

.dropdown-divider {
  border-top: 1px solid var(--mly-border);
}

.breadcrumb {
  background-color: transparent;
  padding: 8px 0;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--mly-text-2);
}

.breadcrumb-item.active {
  color: var(--mly-espresso-700);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--mly-muted);
}

.list-group-item {
  background: var(--mly-surface);
  border-color: var(--mly-border);
  color: var(--mly-text);
}

.list-group-item.active {
  background-color: var(--mly-espresso);
  border-color: var(--mly-espresso);
  color: #FFFFFF;
}

.list-group-item-action:hover {
  background-color: var(--mly-cream);
}

.progress {
  background-color: var(--mly-cream-2);
  border-radius: 10rem;
}

.progress-bar {
  background-color: var(--mly-espresso);
}

.tooltip-inner {
  background-color: var(--mly-espresso-900);
  border-radius: var(--mly-radius-sm);
}

.tooltip .arrow::before {
  border-top-color: var(--mly-espresso-900);
  border-bottom-color: var(--mly-espresso-900);
}

.popover {
  border-color: var(--mly-border);
  border-radius: var(--mly-radius-sm);
}

.popover-header {
  background-color: var(--mly-cream);
  border-bottom-color: var(--mly-border);
  color: var(--mly-text);
}

/* Color / bg utilities re-pointed at brand */
.text-muted {
  color: var(--mly-muted) !important;
}

.text-primary {
  color: var(--mly-espresso) !important;
}

.bg-primary {
  background-color: var(--mly-espresso) !important;
}

.bg-light {
  background-color: var(--mly-cream) !important;
}

.border {
  border-color: var(--mly-border) !important;
}

/* Footer */
.footer {
  background-color: var(--mly-surface);
  border-top: 1px solid var(--mly-border) !important;
  color: var(--mly-text-2);
}

.footer a {
  color: var(--mly-coffee);
}

.footer a:hover {
  color: var(--mly-espresso-700);
}

/* --------------------------------------------------------------------------
   16. .mly- utility helpers (opt-in for pages)
   -------------------------------------------------------------------------- */
.mly-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--mly-espresso-900);
  margin: 0 0 4px;
}

.mly-page-subtitle {
  color: var(--mly-text-2);
  font-size: 14px;
  margin: 0 0 18px;
}

.mly-card {
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: var(--mly-shadow);
  padding: 18px;
}

.mly-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  margin-bottom: 8px;
}

.mly-toolbar .mly-toolbar-spacer {
  margin-left: auto;
}

.mly-divider {
  height: 1px;
  background: var(--mly-border);
  border: none;
  margin: 16px 0;
}

.mly-text-muted {
  color: var(--mly-muted);
}

.mly-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10rem;
  font-size: 12px;
  font-weight: 600;
  background: var(--mly-cream-2);
  color: var(--mly-espresso-700);
}

.mly-pill--gold {
  background: rgba(194, 154, 87, .18);
  color: var(--mly-espresso-900);
}

.mly-pill--success {
  background: rgba(46, 125, 91, .14);
  color: var(--mly-success);
}

.mly-pill--danger {
  background: rgba(192, 73, 47, .14);
  color: var(--mly-danger);
}

.mly-section {
  margin-bottom: 24px;
}

/* Brand color/background helpers */
.text-brand {
  color: var(--mly-espresso) !important;
}

.bg-brand {
  background-color: var(--mly-espresso) !important;
  color: #FFFFFF !important;
}

.bg-cream {
  background-color: var(--mly-cream) !important;
}

.border-brand {
  border-color: var(--mly-border) !important;
}

/* Auth pages: centered branded card */
.mly-auth-wrap {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.mly-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: var(--mly-shadow);
  padding: 2rem;
}

.mly-auth-brand {
  color: var(--mly-espresso);
  font-weight: 600;
  letter-spacing: .02em;
}

.mly-auth-card label {
  color: var(--mly-text);
  margin-bottom: .35rem;
}

.mly-auth-card .input-group-text {
  color: var(--mly-coffee);
}

/* Label weight utility (Inter medium) */
.font-weight-500 {
  font-weight: 500;
}

/* Error page card */
.mly-error-card {
  max-width: 640px;
  margin: 3rem auto;
  background: var(--mly-surface);
  border: 1px solid var(--mly-border);
  border-radius: var(--mly-radius);
  box-shadow: var(--mly-shadow);
  padding: 2rem 2.25rem;
}

.mly-error-card .mly-error-code {
  color: var(--mly-danger);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   17. Scrollbar (page-level)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--mly-cream-2);
}

::-webkit-scrollbar-thumb {
  background: var(--mly-latte);
  border-radius: 6px;
  border: 2px solid var(--mly-cream-2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mly-coffee);
}
