/* =====================================================================
   99HUBS CRM — RED + WHITE THEME  (theme-red-white.css)  v3
   ---------------------------------------------------------------------
   Single source of colour for the dashboard.

   The previous setup loaded three colour systems at once: theme-yugen.css
   and theme-yugen-fixes.css (dark navy, #110549 / #303293), crm-user-mobile
   .css (teal, #159f9a) and this file. Whichever won a specificity contest
   decided the pixel, which is why blue survived in places and why white
   text kept landing on white surfaces.

   Both yugen sheets are now retired. Their genuine layout corrections live
   in theme-layout-keep.css; everything else is defined here.

   Rules of this file:
     - presentation only, never layout, routing, forms or JS behaviour
     - dark text on light surfaces, white text on red surfaces, always
     - loaded last so it also beats inline style="" colours in the blades

   Contrast target: body text >= 7:1, secondary text >= 4.5:1 on white.
   ===================================================================== */

/* ============================== TOKENS ============================== */
:root{
  /* Brand */
  --rw-red:#c0202e;
  --rw-red-dark:#8e1420;
  --rw-red-deep:#6e0f18;
  --rw-red-mid:#d23b48;
  --rw-red-light:#e4717b;

  /* Red tints used as surfaces / hovers */
  --rw-red-soft:#fdecee;
  --rw-red-soft-2:#fff5f6;
  --rw-red-faint:#fffafa;

  /* Neutrals */
  --rw-white:#ffffff;
  --rw-page:#f7f5f5;
  --rw-border:#ecd9dc;
  --rw-border-strong:#dcb6bc;

  /* Text — warm near-black, readable on white and on tints */
  --rw-text:#2b1a1c;          /* 14.8:1 on white */
  --rw-text-2:#4a3235;        /* 9.6:1  on white */
  --rw-muted:#6b5256;         /* 6.4:1  on white */
  --rw-faint:#8a6d71;         /* 4.6:1  on white */

  /* Semantic — kept distinguishable from brand red */
  --rw-success:#1b7a4b;
  --rw-success-soft:#e6f5ec;
  --rw-warning:#8a5a00;
  --rw-warning-soft:#fdf1dc;
  --rw-danger:#b3121f;
  --rw-danger-soft:#fdeaec;
  --rw-info:#7a2230;
  --rw-info-soft:#fdeef0;

  --rw-radius:12px;
  --rw-radius-sm:9px;
  --rw-shadow:0 6px 20px rgba(110,15,24,.07);
  --rw-shadow-lg:0 14px 36px rgba(110,15,24,.14);

  /* ---------------------------------------------------------------
     Compatibility remap.
     theme-yugen*.css is no longer loaded, but any leftover rule or
     inline snippet that still reads a --b-* token resolves to the red
     palette instead of an undefined value.
     --------------------------------------------------------------- */
  --b-bg:#f7f5f5;
  --b-navy:#c0202e;
  --b-navy-dk:#8e1420;
  --b-surface:#ffffff;
  --b-surface-2:#fdecee;
  --b-surface-3:#fff5f6;
  --b-border:#ecd9dc;
  --b-border-2:#dcb6bc;
  --b-text:#2b1a1c;
  --b-text-muted:#6b5256;
  --b-text-faint:#8a6d71;
  --b-gold:#c0202e;
  --b-gold-lt:#d23b48;
  --b-gold-soft:#fdecee;
  --b-radius:12px;
  --b-radius-sm:9px;

  /* ---------------------------------------------------------------
     Mobile remap. crm-user-mobile.css declares these teal; redefining
     them here (same specificity, later sheet) turns the whole mobile
     app red without touching that file or its layout.
     --------------------------------------------------------------- */
  --crm-teal:#c0202e;
  --crm-teal-dark:#8e1420;
  --crm-bg:#f7f5f5;
  --crm-card:#ffffff;
  --crm-text:#2b1a1c;
  --crm-muted:#6b5256;
  --crm-line:#ecd9dc;
  --crm-blue:#8e1420;
  --crm-red:#b3121f;
  --crm-green:#1b7a4b;
  --crm-yellow:#8a5a00;
  --crm-shadow:0 2px 8px rgba(110,15,24,.10);
}

/* ============================== BASE ============================== */
html,body,body.app,.app,.app-body,.app-content,#content,#view,[ui-view]{
  background-color:var(--rw-page)!important;
  color:var(--rw-text)!important;
}
body{color:var(--rw-text)!important}
body::before{background:none!important;display:none!important}

/* Typography defaults are zero-specificity (:where) and not !important.
   Any colour a page or component sets for its own context wins, so white
   text inside a red header, button or badge is no longer forced dark. */
:where(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.page-title){
  color:var(--rw-text);
}
p,div,span,td,th,li,dd,dt,figcaption{color:inherit}
:where(small,.small,.help-block,.form-text){color:var(--rw-muted)}
.text-muted,small.text-muted,.text-secondary{color:var(--rw-muted)!important}
.text-dark,.text-black,.text-body{color:var(--rw-text)!important}
.text-white{color:#fff!important}
.text-primary{color:var(--rw-red)!important}
.text-danger{color:var(--rw-danger)!important}
.text-success{color:var(--rw-success)!important}
.text-warning{color:var(--rw-warning)!important}
.text-info{color:var(--rw-info)!important}

/* :where() keeps link specificity at (0,0,1). The previous (0,3,1) beat
   even the table-header link rule, painting header links red on red. */
a:where(:not(.btn):not(.nav-link):not(.dropdown-item)){color:var(--rw-red)}
a:where(:not(.btn):not(.nav-link):not(.dropdown-item)):hover{color:var(--rw-red-dark)}

hr,.b-a,.b-b,.b-t,.b-l,.b-r,.border,.border-top,.border-bottom{
  border-color:var(--rw-border)!important;
}

*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--rw-border-strong);border-radius:8px;border:2px solid var(--rw-page)}
*::-webkit-scrollbar-thumb:hover{background:var(--rw-red-light)}
::selection{background:var(--rw-red-soft);color:var(--rw-red-deep)}

/* ============================== SIDEBAR ==============================
   The sidebar carries the red, so white text is correct here and only
   here. Everything downstream of this block is dark-on-light.
   ==================================================================== */
#aside,.app-aside,.app-aside .navside,.navside,.navside.dark,.navside.dk{
  background:linear-gradient(180deg,var(--rw-red-dark) 0%,var(--rw-red) 55%,var(--rw-red-deep) 100%)!important;
  border-right:1px solid var(--rw-red-deep)!important;
  color:#fff!important;
}
#aside .navbar,#aside .navbar-brand,.navside .navbar,.navside .navbar-brand{
  background:transparent!important;color:#fff!important;
}
#aside .navbar-brand img{background:transparent!important}
.navside .nav-header,.navside .nav-header small,
#aside .nav-header,#aside .nav-header small{
  color:rgba(255,255,255,.72)!important;
  text-transform:uppercase;letter-spacing:.13em;font-weight:600;
}
.navside .nav > li > a,.navside .nav li a,
#aside .nav li a,#aside .nav-text,#aside .nav-caret i,
#aside .nav li a span,#aside .nav li a i{
  color:rgba(255,255,255,.93)!important;
  border-radius:8px;
}
.navside .nav > li > a:hover,.navside .nav li a:hover,#aside .nav li a:hover,
#aside .nav li a:hover span,#aside .nav li a:hover i{
  background-color:rgba(255,255,255,.14)!important;color:#fff!important;
}
.navside .nav li.active > a,.navside .nav > li.active > a,
.nav-active-primary .nav li.active > a,#aside .nav li.active > a{
  background:#fff!important;
  color:var(--rw-red-dark)!important;
  box-shadow:inset 4px 0 0 var(--rw-red-deep)!important;
  font-weight:600;
}
.navside .nav li.active > a i,.navside .nav li.active > a span,
.navside .nav li.active > a .nav-icon i,#aside .nav li.active > a i,
#aside .nav li.active > a span{
  color:var(--rw-red-dark)!important;
}
.navside .nav ul,#aside .nav-sub{background:transparent!important}
.navside .nav ul li a,#aside .nav-sub a{color:rgba(255,255,255,.80)!important}
.navside .nav ul li a:hover,#aside .nav-sub a:hover{
  color:#fff!important;background-color:rgba(255,255,255,.13)!important;
}
#aside .nav li.active > ul li a,#aside .nav-sub li.active > a{
  color:#fff!important;background-color:rgba(255,255,255,.18)!important;
}
#aside .badge,#aside .label,.navside .badge{
  background:#fff!important;color:var(--rw-red-dark)!important;
}
@media(max-width:991px){
  #aside.app-aside.modal{background:rgba(43,26,28,.55)!important}
}

/* ============================== HEADER ============================== */
.app-header,.app-header.white,.navbar.app-header,.top-header,.navbar-md{
  background:#fff!important;
  color:var(--rw-text)!important;
  border-bottom:1px solid var(--rw-border)!important;
  box-shadow:0 2px 12px rgba(110,15,24,.06)!important;
}
.app-header .navbar-item,.app-header #pageTitle,.app-header .navbar-brand{
  color:var(--rw-text)!important;font-weight:600;
}
.app-header .nav-link,.app-header .material-icons,.app-header .dropdown-toggle,
.app-header .navbar-nav > li > a,.app-header i{
  color:var(--rw-red-dark)!important;
}
/* Anything inside a filled button takes the button's own text colour. */
.app-header .btn i,.app-header .btn .material-icons,.app-header .btn small,
.app-header .btn span,.app-header .btn .fa{color:inherit!important}
.app-header .pa-13 .btn.info,.app-header .pa-13 .btn.info:hover{
  background:var(--rw-red-dark)!important;color:#fff!important;border-color:var(--rw-red-dark)!important;
}
.app-header .nav-link:hover,.app-header .dropdown-toggle:hover,
.app-header .navbar-nav > li > a:hover{color:var(--rw-red)!important}
.app-header .avatar{border:2px solid var(--rw-border-strong)!important;background:#fff!important}
.app-header .navbar-form .form-control,.app-header .input-group .form-control{
  background:#fff!important;color:var(--rw-text)!important;
  border:1px solid var(--rw-border-strong)!important;border-radius:var(--rw-radius-sm)!important;
}
.app-header .navbar-form .form-control::placeholder{color:var(--rw-faint)!important}
.app-header .input-group-btn .btn,.app-header .btn.white{
  background:var(--rw-red)!important;color:#fff!important;border-color:var(--rw-red)!important;
}
.app-header .input-group-btn .btn:hover{background:var(--rw-red-dark)!important}
.header-help-link{
  background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important;
  border:1px solid var(--rw-border-strong)!important;
}

/* ============================== SURFACES ==============================
   Every card / panel / box becomes white with dark text. Listed
   explicitly rather than with a wildcard so nothing unexpected flips.
   ===================================================================== */
.white,.bg-white,.light,.bg-light,.grey,.bg-grey,.r-2x,.r-3x,
.box,.box-table,.card,.panel,.well,.jumbotron,
.contacts-wrap,.contacts-topbar,.filter-panel,.filter-panel-header,.filter-actions,
.active-filter-chips,.columns-list,.columns-list li,.bulk-edit-info,
.table-responsive,.list-group,.list-group-item,.popover,.popover-body,
.summary-table,.call-card,.call-stat,.help-card,.help-quick,.tutorial-steps,
.bulk-assign-panel,.assign-search-panel,.analytics-shell,.chart-box,
.crm-form-card,.crm-dashboard-mini-card,.crm-mobile-shell,
.disposition-rule-card,.template-mini-preview,
.listing-tabs,.contact-details-page,.contact-details-page .card-body,
.mobile-contact-details,.mobile-lead-workflow-card,.mobile-note-item,
.mobile-call-row,.mobile-project-summary,.mobile-project-card,.mobile-info-card,
.mobile-detail-section,.mobile-section-card,.mobile-task-row,.mobile-activity-log,
.mob-contact-card,.mob-search,.mob-quick-actions,.mob-as-card,.mob-as-search,
.mob-as-bulk-panel,.mob-as-history,.mob-us-card,.mob-us-hierarchy,.mob-us-bulk-bar,
.mob-db-stat-card,.mob-db-profile,.mob-db-menu-item,.mob-db-calendar,.mob-db-search{
  background-color:#fff!important;
  color:var(--rw-text)!important;
  border-color:var(--rw-border)!important;
}
.box,.card,.panel,.crm-form-card,.crm-dashboard-mini-card,.chart-box,
.call-card,.help-card,.mob-contact-card,.mobile-info-card{
  box-shadow:var(--rw-shadow)!important;
  border-radius:var(--rw-radius)!important;
}
.contacts-wrap,.app-body > .container,.app-body > .container-fluid{
  background-color:var(--rw-page)!important;
}
.no-bg,.bg-transparent{background:transparent!important}

.card-header,.box-header,.panel-heading,.filter-panel-header{
  background:var(--rw-red-faint)!important;
  border-bottom:1px solid var(--rw-border)!important;
  color:var(--rw-text)!important;
}
.card-header h1,.card-header h2,.card-header h3,.card-header h4,.card-header h5,
.box-header h1,.box-header h2,.box-header h3,.box-header h4,.box-header h5,
.panel-heading h1,.panel-heading h2,.panel-heading h3,.panel-heading h4,
.filter-panel-header h4{color:var(--rw-text)!important}
.card-footer,.box-footer,.panel-footer,.filter-actions{
  background:var(--rw-red-faint)!important;
  border-top:1px solid var(--rw-border)!important;
  color:var(--rw-text)!important;
}

/* ---------------------------------------------------------------------
   CONTRAST GUARD.
   The retired navy theme forced white text in dozens of places. Any of
   those that survive in a blade or a plugin stylesheet would now be
   invisible, so white text inside a white surface is corrected back to
   the readable ink colour. Red surfaces are excluded by selector.
   --------------------------------------------------------------------- */
.box .text-white,.card .text-white,.panel .text-white,
.modal-content .text-white,.dropdown-menu .text-white,
.card-body .text-white,.box-body .text-white,
.crm-form-card .text-white,.mobile-info-card .text-white{
  color:var(--rw-text)!important;
}
.box [style*="color:#fff" i]:not([style*="background" i]):not([class*="btn"]):not([class*="badge"]):not([class*="label"]),
.card [style*="color:#fff" i]:not([style*="background" i]):not([class*="btn"]):not([class*="badge"]):not([class*="label"]),
.card-body [style*="color: #fff" i]:not([style*="background" i]):not([class*="btn"]):not([class*="badge"]):not([class*="label"]),
.modal-body [style*="color:#fff" i]:not([style*="background" i]):not([class*="btn"]):not([class*="badge"]):not([class*="label"]){
  color:var(--rw-text)!important;
}

/* ============================== TABLES ============================== */
.table,table,#contactsTable,.summary-table{
  background-color:#fff!important;color:var(--rw-text)!important;
}
.table > thead > tr > th,.table thead th,thead th,
#contactsTable thead th,.summary-table thead th{
  background-color:var(--rw-red-dark)!important;
  color:#fff!important;
  border-bottom:1px solid var(--rw-red-deep)!important;
  border-top:none!important;
  text-transform:uppercase;font-size:11.5px;letter-spacing:.03em;font-weight:700;
}
.table > thead > tr > th a,.table thead th a,#contactsTable thead th a,
.table thead th i,#contactsTable thead th i{color:#fff!important}
.table > tbody > tr > td,.table td,tbody td,#contactsTable tbody td,.summary-table td{
  background-color:transparent!important;
  color:var(--rw-text-2)!important;
  border-top:1px solid var(--rw-border)!important;
  border-color:var(--rw-border)!important;
}
.table > tbody > tr,#contactsTable tbody tr{background-color:#fff!important}
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(odd) > td{
  background-color:var(--rw-red-faint)!important;
}
.table-hover > tbody > tr:hover,tbody tr:hover,
#contactsTable tbody tr.contact-row:hover,
#contactsTable tbody tr.contact-row:hover td{
  background-color:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
}
tr.contact-row:hover .edit-icon-btn{color:var(--rw-red)!important}
.edit-icon-btn,.sno{color:var(--rw-faint)!important}
.table > tbody > tr.active > td,.table tr.selected,.table tr.selected td{
  background-color:var(--rw-red-soft)!important;
}

/* ============================== FORMS ============================== */
.form-control,select.form-control,textarea.form-control,.custom-select,
input[type=text],input[type=email],input[type=password],input[type=number],
input[type=search],input[type=tel],input[type=url],input[type=date],
input[type=datetime-local],input[type=time],select,textarea{
  background-color:#fff!important;
  border:1px solid var(--rw-border-strong)!important;
  color:var(--rw-text)!important;
  border-radius:var(--rw-radius-sm)!important;
}
.form-control:focus,select:focus,textarea:focus,input:focus{
  border-color:var(--rw-red)!important;
  box-shadow:0 0 0 3px rgba(192,32,46,.15)!important;
  background-color:#fff!important;
  outline:none!important;
}
.form-control::placeholder,input::placeholder,textarea::placeholder{color:var(--rw-faint)!important}
.form-control:disabled,.form-control[readonly],input:disabled,select:disabled{
  background-color:var(--rw-page)!important;color:var(--rw-muted)!important;
}
.form-control-label,.control-label,.filter-field label,.bulk-label,
.crm-form-field label,.form-group > label{color:var(--rw-text-2)!important;font-weight:600}
:where(label){color:var(--rw-text-2)}
.input-group-addon,.input-group-text{
  background:var(--rw-red-soft)!important;
  border-color:var(--rw-border-strong)!important;
  color:var(--rw-red-dark)!important;
}
input[type=checkbox],input[type=radio]{accent-color:var(--rw-red)}
.crm-form-field input,.crm-form-field select,.crm-form-field textarea{
  background:#fff!important;border-color:var(--rw-border-strong)!important;color:var(--rw-text)!important;
}
.was-validated .form-control:invalid,.form-control.is-invalid{border-color:var(--rw-danger)!important}
.invalid-feedback,.error,.text-error{color:var(--rw-danger)!important}

/* select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple{
  background:#fff!important;border:1px solid var(--rw-border-strong)!important;
  color:var(--rw-text)!important;border-radius:var(--rw-radius-sm)!important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
  color:var(--rw-text)!important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder{
  color:var(--rw-faint)!important;
}
.select2-dropdown,.select2-results,.select2-results__options{
  background:#fff!important;border-color:var(--rw-border-strong)!important;
}
.select2-results__option{color:var(--rw-text)!important;background:#fff!important}
.select2-container--default .select2-results__option--highlighted[aria-selected]{
  background:var(--rw-red)!important;color:#fff!important;
}
.select2-container--default .select2-results__option[aria-selected=true]{
  background:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
}
.select2-search__field{
  background:#fff!important;color:var(--rw-text)!important;border-color:var(--rw-border)!important;
}
.select2-selection__choice{
  background:var(--rw-red)!important;border-color:transparent!important;color:#fff!important;
}
.select2-selection__choice__remove{color:#fff!important}

/* ============================== BUTTONS ============================== */
.btn{border-radius:var(--rw-radius-sm)!important;font-weight:600}
.btn.white,.btn-default,.btn.light,.btn-light,.btn-secondary{
  background:#fff!important;color:var(--rw-red-dark)!important;
  border:1px solid var(--rw-border-strong)!important;
}
.btn.white:hover,.btn-default:hover,.btn-light:hover,.btn-secondary:hover{
  background:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
}
.btn-primary,.btn.primary,.crm-primary-btn{
  background:var(--rw-red)!important;color:#fff!important;
  border:1px solid var(--rw-red)!important;font-weight:700;
}
.btn-primary:hover,.btn.primary:hover,.crm-primary-btn:hover,
.btn-primary:focus,.btn-primary:active{
  background:var(--rw-red-dark)!important;color:#fff!important;border-color:var(--rw-red-dark)!important;
}
.btn.info,.btn-info,.btn.accent{
  background:var(--rw-red-dark)!important;color:#fff!important;border-color:var(--rw-red-dark)!important;
}
.btn.info:hover,.btn-info:hover,.btn.accent:hover{background:var(--rw-red-deep)!important}
.btn.warning,.btn-warning{
  background:var(--rw-warning)!important;color:#fff!important;border-color:transparent!important;
}
.btn.success,.btn-success{
  background:var(--rw-success)!important;color:#fff!important;border-color:transparent!important;
}
.btn.danger,.btn-danger{
  background:var(--rw-danger)!important;color:#fff!important;border-color:transparent!important;
}
.btn-outline-primary,.btn.outline{
  background:transparent!important;color:var(--rw-red)!important;border:1px solid var(--rw-red)!important;
}
.btn-outline-primary:hover,.btn.outline:hover{background:var(--rw-red)!important;color:#fff!important}
.btn-link{background:transparent!important;color:var(--rw-red)!important;border-color:transparent!important}
.btn:disabled,.btn.disabled{opacity:.55}
.crm-secondary-btn{
  background:#fff!important;border:1px solid var(--rw-border-strong)!important;color:var(--rw-red-dark)!important;
}

/* ============================== MODALS / DROPDOWNS ============================== */
.modal-content,.modal-body,.modal-header,.modal-footer{
  background-color:#fff!important;color:var(--rw-text)!important;
}
.modal-content{border:1px solid var(--rw-border-strong)!important;border-radius:var(--rw-radius)!important;box-shadow:var(--rw-shadow-lg)!important}
.modal-header{border-bottom:1px solid var(--rw-border)!important}
.modal-footer{border-top:1px solid var(--rw-border)!important}
.modal-title{color:var(--rw-text)!important;font-weight:700}
.modal-backdrop,.modal-backdrop.in,.modal-backdrop.show{background:#2b1a1c!important;opacity:.55!important}
.modal .close,.modal-header .close,.btn-close{
  color:var(--rw-muted)!important;opacity:1;text-shadow:none;
}
.modal .close:hover{color:var(--rw-red)!important}

.dropdown-menu{
  background:#fff!important;border:1px solid var(--rw-border-strong)!important;
  border-radius:var(--rw-radius-sm)!important;box-shadow:var(--rw-shadow-lg)!important;
}
.dropdown-item,.dropdown-menu a,.dropdown-menu li > a{color:var(--rw-text)!important;background:transparent!important}
.dropdown-item:hover,.dropdown-menu a:hover,.dropdown-menu li > a:hover{
  background:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
}
.dropdown-item.active,.dropdown-menu li.active > a{background:var(--rw-red)!important;color:#fff!important}
.dropdown-divider,.dropdown-menu .divider{border-color:var(--rw-border)!important;background:var(--rw-border)!important}
.dropdown-header{color:var(--rw-muted)!important}

/* ============================== PAGINATION ============================== */
.pagination > li > a,.pagination > li > span,.page-link,
.mob-pagination a,.mob-pagination span,.crm-simple-pagination a{
  background:#fff!important;border:1px solid var(--rw-border-strong)!important;
  color:var(--rw-red-dark)!important;
}
.pagination > li > a:hover,.page-link:hover,.crm-simple-pagination a:hover{
  background:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
}
.pagination > .active > a,.pagination > .active > span,.page-item.active .page-link,
.mob-pagination .active-page{
  background:var(--rw-red)!important;border-color:var(--rw-red)!important;color:#fff!important;
}
.pagination > .disabled > a,.page-item.disabled .page-link{
  background:var(--rw-page)!important;color:var(--rw-faint)!important;
}

/* ============================== BADGES / LABELS / CHIPS / TABS ============================== */
.label,.badge{font-weight:600;border-radius:20px}
.label.warn,.badge-warning,.label-warning,.badge.bg-warning{
  background:var(--rw-warning-soft)!important;color:var(--rw-warning)!important;
}
.label.success,.badge-success,.label-success,.badge.bg-success{
  background:var(--rw-success-soft)!important;color:var(--rw-success)!important;
}
.label.danger,.badge-danger,.label-danger,.badge.bg-danger{
  background:var(--rw-danger-soft)!important;color:var(--rw-danger)!important;
}
.label.info,.badge-info,.label-info,.badge.bg-info,
.label.primary,.badge-primary,.badge.bg-primary{
  background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important;
}
.list-group-item{background:#fff!important;border-color:var(--rw-border)!important;color:var(--rw-text)!important}
.list-group-item.active{background:var(--rw-red)!important;border-color:var(--rw-red)!important;color:#fff!important}

.nav-tabs{border-bottom:1px solid var(--rw-border)!important}
.nav-tabs > li > a,.nav-tabs .nav-link{color:var(--rw-muted)!important;border:none!important;background:transparent!important}
.nav-tabs > li > a:hover,.nav-tabs .nav-link:hover{color:var(--rw-red)!important}
.nav-tabs > li.active > a,.nav-tabs .nav-link.active{
  color:var(--rw-red-deep)!important;background:var(--rw-red-soft)!important;
  border-radius:8px!important;font-weight:700;
}
.listing-tabs{border-bottom:1px solid var(--rw-border)!important}
.listing-tab-btn{background:#fff!important;border:1px solid var(--rw-border-strong)!important;color:var(--rw-red-dark)!important}
.listing-tab-btn.active{background:var(--rw-red)!important;color:#fff!important;border-color:var(--rw-red)!important}

.filter-chip{
  background:var(--rw-red-soft)!important;color:var(--rw-red-deep)!important;
  border:1px solid var(--rw-border-strong)!important;
}
.filter-chip.clear-all-chip{background:transparent!important;color:var(--rw-danger)!important}
.crm-status-chip{background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important}
.crm-pill.pending{background:var(--rw-warning-soft)!important;color:var(--rw-warning)!important}
.crm-pill.approved,.crm-pill.accepted{background:var(--rw-success-soft)!important;color:var(--rw-success)!important}
.crm-pill.rejected,.crm-pill.overdue{background:var(--rw-danger-soft)!important;color:var(--rw-danger)!important}
.crm-pill.won{background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important}

.alert{
  border-radius:var(--rw-radius-sm)!important;
  background:var(--rw-red-faint)!important;
  border:1px solid var(--rw-border)!important;
  color:var(--rw-text)!important;
}
.alert-success{background:var(--rw-success-soft)!important;color:var(--rw-success)!important;border-color:rgba(27,122,75,.25)!important}
.alert-danger,.alert-error{background:var(--rw-danger-soft)!important;color:var(--rw-danger)!important;border-color:rgba(179,18,31,.25)!important}
.alert-warning{background:var(--rw-warning-soft)!important;color:var(--rw-warning)!important;border-color:rgba(138,90,0,.25)!important}
.alert-info{background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important;border-color:var(--rw-border-strong)!important}

.breadcrumb{background:transparent!important}
.breadcrumb a{color:var(--rw-muted)!important}
.breadcrumb .active{color:var(--rw-text)!important}

.progress{background:var(--rw-red-soft)!important}
.progress-bar{background:var(--rw-red)!important}

/* ============================== DASHBOARD CARDS ============================== */
.crm-dashboard-mini-card,.mob-db-stat-card{
  background:#fff!important;border:1px solid var(--rw-border)!important;
}
.mob-db-stat-num{color:var(--rw-red-dark)!important}
.mob-db-stat-label{color:var(--rw-muted)!important}

/* ============================== LIVE NOTIFICATION ============================== */
.crm-live-notification{
  background:#fff!important;border:1px solid var(--rw-border-strong)!important;
  box-shadow:var(--rw-shadow-lg)!important;color:var(--rw-text)!important;
  border-radius:var(--rw-radius)!important;
}
.crm-live-notification-icon{background:var(--rw-red)!important;color:#fff!important;border-radius:50%}
.crm-live-notification-close{background:transparent!important;color:var(--rw-muted)!important;border:0!important}

/* ============================== MOBILE ==============================
   crm-user-mobile.css keeps all of its geometry. Only the colours that
   it hardcodes (rather than reading from --crm-*) are corrected here.
   ==================================================================== */
@media(max-width:767px){
  body,.mobile-view,.mob-db-body,.crm-mobile-shell,
  .contact-details-page,.mobile-contact-details,
  .schedule-page,.callback-page{
    background-color:var(--rw-page)!important;color:var(--rw-text)!important;
  }
  .crm-mobile-topbar,.mob-header,.mob-db-topbar,
  .mobile-contact-header,.schedule-header,.callback-header{
    background:var(--rw-red)!important;color:#fff!important;
  }
  .crm-mobile-topbar h1,.crm-mobile-topbar .back,.crm-mobile-topbar button,
  .crm-mobile-topbar a.icon,.mob-header-title,.mob-header-subtitle,
  .mobile-contact-header span,.mobile-back-btn,
  .schedule-header h3,.schedule-header p,.callback-header h3,.callback-header p{
    color:#fff!important;
  }
  .crm-searchbar,.mob-search,.mob-db-search{
    background:#fff!important;border-color:var(--rw-border-strong)!important;
  }
  .crm-searchbar input,.mob-search input,.mob-db-search input{color:var(--rw-text)!important}
  .crm-tab-row,.schedule-tabs,.callback-tabs,.mob-quick-actions{
    background:#fff!important;border-bottom-color:var(--rw-border)!important;
  }
  .crm-tab-row a,.schedule-tab,.callback-tab,.mob-quick-actions button{
    color:var(--rw-muted)!important;background:#fff!important;
  }
  .crm-tab-row a.active,.schedule-tab.active,.callback-tab.active{
    color:var(--rw-red)!important;border-color:var(--rw-red)!important;font-weight:700;
  }
  .crm-lead-card,.mob-contact-card,.schedule-card,.callback-card,
  .mobile-contact-identity,.mobile-project-journeys,.mobile-project-summary,
  .mobile-info-card,.mobile-detail-section,.mobile-project-card,.crm-empty,.empty-state{
    background:#fff!important;border-color:var(--rw-border)!important;color:var(--rw-text)!important;
  }
  .crm-lead-card .primary,.mob-contact-name,.mobile-contact-title-row h2,
  .schedule-card-main strong,.callback-card strong,
  .mobile-project-summary-grid strong,.mobile-info-item strong{
    color:var(--rw-text)!important;
  }
  .crm-lead-card .secondary,.mob-contact-meta,.mobile-contact-title-row p,
  .schedule-card-main span,.schedule-card-main small,.callback-card span,
  .callback-card small,.mobile-project-summary-grid span,.mobile-info-item span,
  .mob-date-group,.crm-date-label{
    color:var(--rw-muted)!important;
  }
  .crm-lead-card .tertiary,.mob-contact-source,.crm-simple-pagination span{
    color:var(--rw-faint)!important;
  }
  .mobile-project-summary h3,.mobile-section-heading h3{color:var(--rw-red-dark)!important}
  .mobile-project-card.active{border:2px solid var(--rw-red)!important;background:var(--rw-red-soft)!important}
  .mob-avatar{background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important}
  .mob-fab,.mobile-add-circle{background:var(--rw-red)!important;color:#fff!important}
  .crm-mobile-bottom-nav{background:#fff!important;border-top-color:var(--rw-border)!important}
  .crm-mobile-bottom-nav a{color:var(--rw-faint)!important}
  .crm-mobile-bottom-nav a.active{color:var(--rw-red)!important;font-weight:700}
  .mobile-sticky-actions,.mobile-contact-bottom-bar{
    background:#fff!important;border-top-color:var(--rw-border)!important;
  }
  .mobile-sticky-actions .mobile-secondary-action,
  .mobile-contact-bottom-bar .mobile-secondary-action{
    border-color:var(--rw-red)!important;color:var(--rw-red)!important;background:#fff!important;
  }
  .mobile-sticky-actions .mobile-primary-action,
  .mobile-contact-bottom-bar .mobile-primary-action{
    background:var(--rw-red)!important;color:#fff!important;
  }
  .mobile-task-box{background:var(--rw-red-faint)!important;color:var(--rw-text)!important;border-color:var(--rw-border)!important}
  .mobile-empty-state,.crm-empty{color:var(--rw-faint)!important;background:#fff!important}
  .schedule-tab span,.callback-tab span{background:var(--rw-red-soft)!important;color:var(--rw-red-dark)!important}
  /* the circular call/mail/whatsapp/edit actions stay semantic, not brand */
  .crm-circle-action.mail{background:var(--rw-red-dark)!important}
  .crm-circle-action.edit{background:var(--rw-muted)!important}
}

/* ============================== INLINE STYLE OVERRIDES ==============================
   ~130 places in the blades hardcode the old navy (#201F5C, #171963) or
   the old teal (#159F9A, #087D79) in a style="" attribute, plus a few
   stray bootstrap blues. Rewriting 30+ blade files would be a large and
   risky diff for a pure colour change, so those values are intercepted
   here by attribute selector instead. A stylesheet declaration marked
   !important outranks a plain inline declaration, so this wins.

   Order matters: the `color:` block must come before the background and
   border blocks, because "background-color:#X" also contains the
   substring "color:#X".
   ==================================================================== */

/* 1 — foreground colour */
[style*="color:#201F5C" i],[style*="color: #201F5C" i],
[style*="color:#171963" i],[style*="color: #171963" i],
[style*="color:#272957" i],[style*="color: #272957" i],
[style*="color:#1976D2" i],[style*="color: #1976D2" i],
[style*="color:#0D6EFD" i],[style*="color: #0D6EFD" i]{
  color:var(--rw-red-dark)!important;
}
[style*="color:#159F9A" i],[style*="color: #159F9A" i],
[style*="color:#087D79" i],[style*="color: #087D79" i]{
  color:var(--rw-red)!important;
}

/* 2 — backgrounds (white text, because these were dark fills) */
[style*="background:#201F5C" i],[style*="background: #201F5C" i],
[style*="background-color:#201F5C" i],[style*="background-color: #201F5C" i],
[style*="background:#171963" i],[style*="background: #171963" i],
[style*="background-color:#171963" i],[style*="background-color: #171963" i],
[style*="background:#0D6EFD" i],[style*="background: #0D6EFD" i],
[style*="background-color:#0D6EFD" i],[style*="background-color: #0D6EFD" i]{
  background:var(--rw-red-dark)!important;color:#fff!important;
}
[style*="background:#159F9A" i],[style*="background: #159F9A" i],
[style*="background-color:#159F9A" i],[style*="background-color: #159F9A" i],
[style*="background:#087D79" i],[style*="background: #087D79" i],
[style*="background-color:#087D79" i],[style*="background-color: #087D79" i]{
  background:var(--rw-red)!important;color:#fff!important;
}

/* 3 — borders */
[style*="border-color:#201F5C" i],[style*="border-color: #201F5C" i],
[style*="border-color:#1976D2" i],[style*="border-color: #1976D2" i],
[style*="border-color:#0D6EFD" i],[style*="border-color: #0D6EFD" i],
[style*="border-color:#159F9A" i],[style*="border-color: #159F9A" i]{
  border-color:var(--rw-red)!important;
}
[style*="border:1px solid #201F5C" i],[style*="border: 1px solid #201F5C" i],
[style*="border:2px solid #159F9A" i],[style*="border: 2px solid #159F9A" i]{
  border-color:var(--rw-red)!important;
}

/* ============================== THIRD PARTY ============================== */
.sweet-alert{background:#fff!important;color:var(--rw-text)!important}
.sweet-alert h2,.sweet-alert p{color:var(--rw-text)!important}
.sweet-alert button.confirm{background:var(--rw-red)!important;color:#fff!important}
.sweet-alert button.cancel{background:#fff!important;color:var(--rw-red-dark)!important;border:1px solid var(--rw-border-strong)!important}
.toast,.toast-success,.toast-error,.toast-info{color:#fff!important}
.daterangepicker,.datepicker,.ui-datepicker{background:#fff!important;color:var(--rw-text)!important;border-color:var(--rw-border-strong)!important}
.daterangepicker td.active,.datepicker td.active,.ui-datepicker .ui-state-active{background:var(--rw-red)!important;color:#fff!important}
.tooltip-inner{background:var(--rw-red-deep)!important;color:#fff!important}

/* ============================== BRAND LOGO ==============================
   The 99Hubs logo is white lettering with a red "H". On the white header
   the lettering disappears, and on the red sidebar the "H" disappears. So
   the logo always sits on a dark chip, which shows it exactly as designed.

   If a future logo is dark-on-transparent, change --rw-logo-chip to #fff.
   ======================================================================= */
:root{--rw-logo-chip:#1f1315}

/* Sidebar: the brand band at the top of the red sidebar. */
#aside .navside > .navbar{
  background:var(--rw-logo-chip)!important;
  border-bottom:1px solid rgba(255,255,255,.08)!important;
}
#aside .navbar-brand img.crm-brand-logo{
  width:auto!important;height:auto!important;
  max-width:min(172px,100%)!important;max-height:48px!important;
  object-fit:contain!important;border-radius:0!important;background:transparent!important;
}
#aside .navside > .navbar .folded-toggle,
#aside .navside > .navbar .folded-toggle i{color:rgba(255,255,255,.85)!important}

/* Header: the profile menu trigger shows the logo as a chip, not a crop
   into a 42px circle (a 152x40 logo lost both ends in the circle). */
.app-header .avatar.crm-header-brand{
  width:auto!important;height:38px!important;padding:6px 12px!important;
  display:inline-flex!important;align-items:center!important;position:relative;
  border-radius:9px!important;border:0!important;
  background:var(--rw-logo-chip)!important;
}
.app-header .avatar.crm-header-brand img{
  width:auto!important;height:24px!important;max-width:132px!important;
  object-fit:contain!important;border-radius:0!important;background:transparent!important;
}
.app-header .avatar.crm-header-brand .on{right:-3px;bottom:-3px}

/* Mobile dashboard profile card. */
body .mob-db-profile img.mob-db-profile-logo.crm-logo-on-chip{
  width:auto!important;height:36px!important;max-width:124px!important;
  padding:6px 9px!important;border-radius:8px!important;
  background:var(--rw-logo-chip)!important;object-fit:contain!important;
}

/* ============================== PRINT ============================== */
@media print{
  #aside,.app-aside,.app-header,.crm-mobile-bottom-nav{display:none!important}
  body,.app,.app-body,.box,.card{background:#fff!important;color:#000!important;box-shadow:none!important}
  .table thead th{background:#fff!important;color:#000!important;border-bottom:2px solid #000!important}
}
