﻿/* ==========================================================================
   Marsh McLennan — Brand Color Tokens (CSS Custom Properties)
   ========================================================================== */

:root {
  /* ---------- Primary ---------- */
  --marsh-sky-blue: #ceecff;
  --marsh-midnight-blue: #000f47;

  /* ---------- Accent: Gold ---------- */
  --marsh-gold-1000: #cb7e03;
  --marsh-gold-750: #ffbf00;
  --marsh-gold-500: #ffd98a;
  --marsh-gold-250: #fff3da;

  /* ---------- Accent: Blue ---------- */
  --marsh-blue-750: #0b4bff;
  --marsh-blue-500: #81b9ff;

  /* ---------- Accent: Green ---------- */
  --marsh-green-1000: #2f7500;
  --marsh-green-750: #6abf30;
  --marsh-green-500: #b0dc92;
  --marsh-green-250: #dfecd7;

  /* ---------- Accent: Purple ---------- */
  --marsh-purple-1000: #5e017f;
  --marsh-purple-750: #8f20de;
  --marsh-purple-500: #deb1ff;
  --marsh-purple-250: #f5e8ff;

  /* ---------- Neutral ---------- */
  --marsh-neutral-1000: #3d3c37;
  --marsh-neutral-750: #7b7974;
  --marsh-neutral-500: #b9b6b1;
  --marsh-neutral-250: #f7f3ee;

  /* ---------- Semantic ---------- */
  --marsh-success: #14853d;
  --marsh-attention: #ffbf00;
  --marsh-warning: #c53532;

  /* ---------- Contextual Tokens ---------- */
  --marsh-color-text-primary: var(--marsh-midnight-blue);
  --marsh-color-text-secondary: var(--marsh-neutral-750);
  --marsh-color-text-disabled: var(--marsh-neutral-500);
  --marsh-color-text-inverse: #ffffff;
  --marsh-color-text-link: var(--marsh-blue-750);
  --marsh-color-text-success: var(--marsh-success);
  --marsh-color-text-warning: var(--marsh-warning);

  --marsh-color-bg-surface: #ffffff;
  --marsh-color-bg-subtle: var(--marsh-neutral-250);
  --marsh-color-bg-inverse: var(--marsh-midnight-blue);
  --marsh-color-bg-highlight: var(--marsh-gold-250);

  --marsh-color-border-default: var(--marsh-neutral-500);
  --marsh-color-border-strong: var(--marsh-neutral-1000);
  --marsh-color-border-focus: var(--marsh-blue-750);

  --marsh-color-icon-default: var(--marsh-midnight-blue);
  --marsh-color-icon-subtle: var(--marsh-neutral-750);
}

/* ==========================================================================
   Brand overrides for third-party CSS (Bootstrap, jQuery UI).
   This file must be linked AFTER bootstrap / W3 / jQuery UI / jqGrid CSS.
   ========================================================================== */

/* ---------- Bootstrap button variants ---------- */
.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-info, .btn-info:hover, .btn-info:focus, .btn-info:active,
.btn-success, .btn-success:hover, .btn-success:focus, .btn-success:active {
  background-color: var(--marsh-midnight-blue) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.btn-default, .btn-default:hover, .btn-default:focus, .btn-default:active {
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: var(--marsh-midnight-blue) !important;
}

/* Delete buttons: Neutral-500 (not red) */
.btn-danger, .btn-danger:hover, .btn-danger:focus, .btn-danger:active {
  background-color: var(--marsh-neutral-500) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-neutral-500) !important;
  color: var(--marsh-midnight-blue) !important;
}

.btn-warning, .btn-warning:hover, .btn-warning:focus, .btn-warning:active {
  background-color: var(--marsh-attention) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-attention) !important;
  color: var(--marsh-midnight-blue) !important;
}

.btn-link, .btn-link:hover, .btn-link:focus {
  color: var(--marsh-blue-750) !important;
}

/* Legacy framework skins: btn small|medium|large black|save_blue|red|white */
.btn.black, .btn.save_blue, .btn.login.blue {
  background-color: var(--marsh-midnight-blue) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.btn.red {
  background-color: var(--marsh-neutral-500) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-neutral-500) !important;
  color: var(--marsh-midnight-blue) !important;
}

.btn.white:not(.logout) {
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: var(--marsh-midnight-blue) !important;
}

/* Delete buttons are always Neutral-500, whatever class/order the page uses.
   #btn_delete (id) outranks Bootstrap's .btn-danger and any theme gradient. */
#btn_delete, #btn_delete:hover, #btn_delete:focus, #btn_delete:active,
.btn-delete, .btn-delete:hover, .btn-delete:focus, .btn-delete:active,
.btn-danger.btn-delete, .btn-delete.btn-danger {
  background-color: var(--marsh-neutral-500) !important;
  background-image: none !important;
  border: 1px solid var(--marsh-neutral-500) !important;
  color: var(--marsh-midnight-blue) !important;
}

/* ---------- Focus indicator (WCAG 2.4.7) ---------- */
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--marsh-blue-750) !important;
  outline-offset: 2px;
}

/* ---------- Semantic popups (.layer_popup containers) ----------
   Border + icon convey meaning; action buttons stay Midnight Blue. */
.marsh-popup-success {
  border-color: var(--marsh-success) !important;
}

.marsh-popup-success .btn-ok {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.marsh-popup-danger {
  border-color: var(--marsh-warning) !important;
}

.marsh-popup-danger .btn-ok {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.marsh-popup-danger .marsh-popup-title {
  color: var(--marsh-warning) !important;
}

.marsh-popup-warning {
  border-color: var(--marsh-attention) !important;
}

.marsh-popup-warning .btn-ok {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

/* ---------- Semantic jQuery UI dialogs (dialogClass) ----------
   Border conveys meaning; primary button stays Midnight Blue. */
.ui-dialog.marsh-dialog-success {
  border-color: var(--marsh-success) !important;
}

.ui-dialog.marsh-dialog-success .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.ui-dialog.marsh-dialog-danger {
  border-color: var(--marsh-warning) !important;
}

.ui-dialog.marsh-dialog-danger .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

.ui-dialog.marsh-dialog-warning {
  border-color: var(--marsh-attention) !important;
}

.ui-dialog.marsh-dialog-warning .ui-dialog-buttonpane .ui-dialog-buttonset button:first-child {
  background: var(--marsh-midnight-blue) !important;
  border: 1px solid var(--marsh-midnight-blue) !important;
  color: #ffffff !important;
}

/* ---------- Icon tinting utilities ----------
   brightness(0) first normalises any coloured source icon to a black
   silhouette, then the remaining filter tints it to the target brand colour. */
.marsh-icon-midnight {
  filter: brightness(0) saturate(100%) invert(6%) sepia(63%) saturate(3760%) hue-rotate(221deg) brightness(95%) contrast(101%);
}

.marsh-icon-danger {
  filter: brightness(0) saturate(100%) invert(27%) sepia(44%) saturate(2615%) hue-rotate(332deg) brightness(93%) contrast(94%);
}

/* jqGrid row action icons (edit/delete) in Midnight Blue across all grids */
.ui-icon-pencil,
.ui-icon-trash,
.ui-state-hover .ui-icon-pencil,
.ui-state-hover .ui-icon-trash {
  filter: brightness(0) saturate(100%) invert(6%) sepia(63%) saturate(3760%) hue-rotate(221deg) brightness(95%) contrast(101%);
}
