/* M-Val theme overlay for the procurement Supplier Portal (/portal and its pages).

   Loaded through property_management's web_include_css, so it is present ONLY when
   the property app is installed. Without the property app, the procurement portal
   keeps its own standard (orange) look - this file is the M-Val layer on top, the
   same pattern as supplier_application.css.

   Scoped by route (body[data-path^=...]) so no other website page is touched.
   Primary = M-Val crimson #a21d25; secondary = navy #10426f (replaces the generic
   blue). A distinct red #d93a3a is kept for danger/overdue so alerts stay apart
   from the crimson brand. Category purple/green/amber and neutrals are left as the
   portal defines them. */

body:is([data-path^="portal"], [data-path^="my-"], [data-path^="tenders"],
        [data-path^="rfps"], [data-path^="bid"], [data-path^="proposal"],
        [data-path^="submit-"], [data-path^="bank-"], [data-path^="supplier-"],
        [data-path^="rfq"], [data-path^="purchase-"], [data-path^="email-copies"]) {

  /* --- Primary brand: crimson (recolors buttons, KPI tiles, active states, pills) --- */
  /* The soft tint (icon squares, avatars, focus rings) is light navy; icons and buttons keep the crimson. */
  --pt-brand: #a21d25;  --pt-brand-dark: #861118;  --pt-brand-soft: #e7eef6;
  --bd-primary: #a21d25; --bd-primary-dark: #861118; --bd-primary-soft: #e7eef6;
  --tnd-brand: #a21d25; --tnd-brand-dark: #861118; --tnd-brand-soft: #e7eef6;
  --rfp-brand: #a21d25; --rfp-brand-dark: #861118; --rfp-brand-soft: #e7eef6;
  --sd-brand: #a21d25;  --sd-brand-dark: #861118;  --sd-brand-soft: #e7eef6;
  --sd-brand-ring: rgba(162, 29, 37, .35);

  /* --- Secondary accent: navy (replaces the generic blue) --- */
  --pt-blue: #10426f;  --pt-blue-soft: #e7eef6;
  --tnd-blue: #10426f; --tnd-blue-soft: #e7eef6;
  --rfp-blue: #10426f; --rfp-blue-soft: #e7eef6;
  --sd-blue: #10426f;  --sd-blue-soft: #e7eef6;

  /* --- Danger / overdue: a distinct red, not the crimson brand --- */
  --pt-red: #d93a3a;   --pt-red-soft: #fbe4e4;
  --bd-danger: #d93a3a; --bd-danger-soft: #fbe4e4;
  --tnd-red: #d93a3a;  --tnd-red-soft: #fbe4e4;
  --rfp-red: #d93a3a;  --rfp-red-soft: #fbe4e4;
  --sd-red: #d93a3a;   --sd-red-soft: #fbe4e4;

  /* --- Hero banners: the peach gradient + border are hardcoded per page,
         so make them plain white cards (tokens can't reach these) --- */
  & :is(.pt-hero, .mb-hero, .bv-hero, .sb-hero, .bd-hero, .sd-hero, .dr-hero,
        .tnd-header, .rfp-header, .mp-hero, .ms-hero) {
    background:
      #fff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  }

  /* --- Account / profile header: a white card like the banners --- */
  & :is(.ah-head, .ap-head) {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px; padding: 16px 20px;
  }
  & :is(.ah-head, .ap-head) :is(.ah-avatar, .ap-avatar) {
    background: #fff !important; color: #a21d25 !important; border: 2px solid #a21d25; box-shadow: none;
  }
  & :is(.ah-head, .ap-head) h1 { color: #10426f; }
  & .ec-wrap h1 { color: #10426f; }

  /* --- Hardcoded orange elsewhere: crimson for actions, navy for tints.
         Amber warning pills (draft, invited, stopped, private) are left as they are. --- */
  & .pt-hero::after, & .bd-hero::before { display: none !important; }
  & .pt-hero .pt-supplier-chip { border-color: #e5e7eb !important; background: #fff !important; }
  & :is(.pt-action, .tnd-card.clickable, .rfp-card.clickable):hover { border-color: rgba(16, 66, 111, .35) !important; }
  & :is(.mb-hero, .mp-hero, .ms-hero) p { color: #4a5565 !important; }
  & .bv-hero .doctype-eyebrow { color: #a21d25 !important; }
  /* --- Buttons: all crimson. Filled ones crimson with white text, outline ones crimson
         outline + text. Danger buttons (delete, withdraw) stay red. --- */
  & :is(.btn-primary, .btn-j:not(.ghost), .pc-submit-btn) {
    background: #a21d25 !important; border-color: #a21d25 !important; color: #fff !important;
  }
  & :is(.btn-primary, .btn-j:not(.ghost), .pc-submit-btn):hover {
    background: #861118 !important; border-color: #861118 !important; color: #fff !important;
  }
  & :is(.ap-btn.ghost, .bd-btn-ghost, .btn-j.ghost, .bv-btn.ghost, .sb-btn-ghost, .mb-actions a,
        .mb-actions button, .attach-btn, .pc-toggle-btn, .btn-default, .bd-back) {
    background: #fff !important; border: 1px solid #a21d25 !important; color: #a21d25 !important;
  }
  & :is(.ap-btn.ghost, .bd-btn-ghost, .btn-j.ghost, .bv-btn.ghost, .sb-btn-ghost, .mb-actions a,
        .mb-actions button, .attach-btn, .pc-toggle-btn, .btn-default, .bd-back):hover {
    background: #fbf1f2 !important; border-color: #861118 !important; color: #861118 !important;
  }
  & :is(.ah-back, .ap-back):hover { color: #a21d25 !important; }
  & .td-submit-btn { background: #a21d25 !important; }
  & .td-submit-btn:hover { background: #861118 !important; }
  & .td-stat .td-stat-icon { color: #a21d25 !important; }
  /* Icon squares: white with a crimson border, matching the crimson icons. */
  & :is(.ah-ic, .pt-action .pt-action-icon, .pt-kpi.brand .pt-kpi-icon, .td-stat .td-stat-icon, .sd-stat-icon.orange) {
    background: #fff !important; border: 1px solid #a21d25 !important;
  }
  & .td-invited-meta a { color: #a21d25 !important; }
  & .td-msg { background: #f1f5fa !important; border-color: #d3deea !important; border-left-color: #10426f !important; color: #1f2733 !important; }
  & .td-msg .label { color: #10426f !important; }
  & .sd-switcher select { border-color: #d3deea !important; background-color: #f1f5fa !important; }

  /* --- A few other hardcoded-orange spots --- */
  & .dr-btn { background: #a21d25 !important; border-color: #a21d25 !important; }
  & .dr-btn:hover { background: #861118 !important; border-color: #861118 !important; }
  & .dr-btn.secondary { background: #fff !important; color: #a21d25 !important;
                        border-color: rgba(162, 29, 37, .4) !important; }
  & .photo-link, & .catt-chip { color: #a21d25 !important; }
  & .cmsg.mine { background: #e7eef6 !important; }
}
