/* ============================================================
   UAESA COIDA Return of Earnings — CIPC AR UI baseline
   This file intentionally embeds the exact CIPC AR front-end UI
   so the COIDA stepper and enterprise dropdown render identically
   even when WordPress enqueue order/theme optimisation changes.
   ============================================================ */

/* ============================================================
   UAESA CIPC Annual Return Selector — Front-End Styles
   File: uaesa-cipc-ar.css

   Consumed by:
     • class-uaesa-gf-cipc-ar.php  (field + wizard + dialogs)
     • uaesa-cipc-ar.js            (5-step wizard, Confirm & Sign
                                    sub-stepper, hover popovers via
                                    ? icons, signature selector)
     • class-uaesa-gf-signature.php (shared tokens)
     • uaesa-terms.php             (shared tokens)

   Version history
   ---------------
   v5.0   — BO confirmation dialog, restoration workflow
   v5.1   — Dialog visibility fixes, contrast overrides
   v5.1.1 — Compact radio buttons in AR-table cells
   v5.2   — Conflict hardening (GF / theme overshoots)
   v5.3   — Reduced motion support
   v6.0   — Question panel (step 3), record-AR dialog, restore info
   v6.1   — No CSS changes required (PHP output guard)
   v6.2   — Pre-flight "Confirm & Sign" card
   v6.3   — Pre-flight card also renders in Step 3
   v6.4   — Signature visual-state detection
   v6.5   — Signoff gating moved to step 4
   v6.6   — Mini-stepper inside preflight card
   v6.7   — 5-step wizard (Confirm & Sign is its own step)
   v6.8   — Confirm & Sign sub-stepper: Terms → Signature → Ready
   v6.9   — Question-mark icons as popover triggers (cards no
             longer open popovers on hover/click; only the small
             ? icon does)
   v7.0   — Inline UAESA Signature Selector inside Step 4
             signature sub-step. Hover-to-preview popover,
             saved-signatures menu, inline error card. Replaces
             the dead "Add Signature" button.
   ============================================================ */

/* ============================================================
   TOKENS
   ============================================================ */
.gfield_type_uaesa_cipc_ar_selector,
.gfield_type_uaesa_coida_roe,
.uaesa-coida-field-shell,
.uaesa-cipc-wizard,
.md-menu,
.md-overlay,
.md-snackbar-container {
  --md-primary: #00A5A7;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #6FF6FE;
  --md-on-primary-container: #002022;
  --md-secondary: #4A6365;
  --md-on-secondary: #FFFFFF;
  --md-secondary-container: #CCE8E9;
  --md-on-secondary-container: #051F21;
  --md-error: #BA1A1A;
  --md-on-error: #FFFFFF;
  --md-error-container: #FFDAD6;
  --md-on-error-container: #410002;
  --md-success: #2E7D32;
  --md-success-container: #DCFCE7;
  --md-on-success-container: #052E16;
  --md-warning: #8C5000;
  --md-warning-container: #FFDDB3;
  --md-on-warning-container: #2E1500;
  --md-surface: #F4FBFB;
  --md-on-surface: #161D1D;
  --md-surface-variant: #DAE4E4;
  --md-on-surface-variant: #3F4849;
  --md-surface-container-lowest: #FFFFFF;
  --md-surface-container-low: #EEF5F5;
  --md-surface-container: #E9EFEF;
  --md-surface-container-high: #E3E9E9;
  --md-surface-container-highest: #DDE4E4;
  --md-outline: #6F7979;
  --md-outline-variant: #BEC8C8;
  --md-inverse-surface: #2B3232;
  --md-inverse-on-surface: #ECF2F2;
  --md-scrim-bg: rgba(0, 0, 0, .42);
  --md-elev-1: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06);
  --md-elev-2: 0 1px 2px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .08);
  --md-elev-3: 0 4px 8px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);
  --md-elev-5: 0 12px 24px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .08);
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 28px;
  --md-shape-full: 9999px;
}

/* ============================================================
   HIDDEN NATIVE SELECT
   ============================================================ */
.uaesa-hidden-select {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
}

/* ============================================================
   DROPDOWN SHELL
   ============================================================ */
.md-field-outlined {
  position: relative;
  margin: 16px 0 24px;
  z-index: 1;
}

/* Keep the enterprise list above the high-z-index wizard/cards. */
.md-field-outlined.is-focused {
  z-index: 100600;
}

.md-field-outlined.is-focused .md-menu,
.md-menu.open {
  z-index: 100700;
}

.md-field-outlined__container {
  position: relative;
  min-height: 56px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-xs);
  background: var(--md-surface-container-lowest);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.md-field-outlined__container:hover {
  border-color: var(--md-on-surface);
}

.md-field-outlined__container:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 1px var(--md-primary);
}

.md-field-outlined.is-filled .md-field-outlined__container {
  border-color: var(--md-primary);
}

.md-field-outlined__label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--md-surface-container-lowest);
  padding: 0 4px;
  font-size: 16px;
  color: var(--md-on-surface-variant);
  pointer-events: none;
  transition: all .15s cubic-bezier(.4, 0, .2, 1);
  z-index: 2;
  line-height: 1;
}

.md-field-outlined.is-focused .md-field-outlined__label,
.md-field-outlined.is-filled .md-field-outlined__label {
  top: 0;
  transform: translateY(-50%) scale(.75);
  color: var(--md-primary);
  font-weight: 500;
}

.md-field-outlined__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  min-height: 56px;
  font-size: 16px;
  color: var(--md-on-surface);
  position: relative;
  z-index: 1;
}

.md-field-outlined__trigger-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-field-outlined__trigger-icon {
  margin-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-field-outlined__trigger-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--md-on-surface-variant);
  transition: transform .2s;
}

.md-field-outlined.is-focused .md-field-outlined__trigger-icon svg {
  transform: rotate(180deg);
}

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
.md-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--md-surface-container);
  border-radius: var(--md-shape-xs);
  box-shadow: var(--md-elev-2);
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  padding: 8px 0;
  margin: 0;
  z-index: 20;
  display: none;
}

.md-menu.open {
  display: block;
  animation: mdMenuIn .15s cubic-bezier(.4, 0, .2, 1);
}

@keyframes mdMenuIn {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1); }
}

.md-menu li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--md-on-surface);
  cursor: pointer;
  min-height: 48px;
  transition: background .12s;
}

.md-menu li:hover,
.md-menu li:focus {
  background: rgba(0, 165, 167, .08);
  outline: none;
}

.md-menu li.is-selected {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-weight: 500;
}

.md-menu li .mi-name {
  display: block;
  font-weight: 500;
  font-size: 14px;
}

.md-menu li .mi-meta {
  display: block;
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
}

.md-menu li .mi-status {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.md-menu li .mi-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: statusPulse 1.8s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}

.md-menu li .mi-status.ok   { background: var(--md-success-container); color: var(--md-on-success-container); }
.md-menu li .mi-status.warn { background: var(--md-warning-container); color: var(--md-on-warning-container); }
.md-menu li .mi-status.er   { background: var(--md-error-container);   color: var(--md-on-error-container); }

/* ============================================================
   WIZARD
   ============================================================ */
.uaesa-cipc-wizard {
  margin-top: 8px;
  position: relative;
  z-index: 99990;
}

.m3-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 20px 0 24px;
  margin: 0;
  list-style: none;
}

.m3-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
  padding: 0 4px;
}

.m3-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 1px;
  background: var(--md-outline-variant);
  z-index: 0;
}

.m3-step.is-complete:not(:last-child)::after {
  background: var(--md-primary);
}

.m3-step-indicator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-surface-container-highest);
  color: var(--md-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
}

.m3-step-indicator svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.m3-step.is-active .m3-step-indicator,
.m3-step.is-complete .m3-step-indicator {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.m3-step-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2px;
  color: var(--md-on-surface-variant);
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
  hyphens: auto;
}

.m3-step.is-active .m3-step-label {
  color: var(--md-primary);
  font-weight: 600;
}

.m3-step.is-complete .m3-step-label {
  color: var(--md-on-surface);
}

/* Stepper responsive */
@media (min-width: 601px) and (max-width: 900px) {
  .m3-stepper { padding: 16px 0 20px; }
  .m3-step { gap: 6px; padding: 0 3px; }
  .m3-step-indicator { width: 34px; height: 34px; font-size: 12px; }
  .m3-step-indicator svg { width: 17px; height: 17px; }
  .m3-step-label { font-size: 10.5px; line-height: 1.2; }
  .m3-step:not(:last-child)::after { top: 17px; left: calc(50% + 20px); right: calc(-50% + 20px); }
}

@media (max-width: 600px) {
  .m3-stepper {
    display: block;
    padding: 4px 0 8px;
    margin: 0;
    list-style: none;
    overflow: visible;
  }
  .m3-step {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    padding: 0 0 20px 0;
    min-width: 0;
    position: relative;
    text-align: left;
  }
  .m3-step:last-child { padding-bottom: 0; }
  .m3-step:not(:last-child)::after { display: none; }
  .m3-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 32px;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--md-outline-variant);
    z-index: 0;
    pointer-events: none;
  }
  .m3-step.is-complete:not(:last-child)::before { background: var(--md-primary); }
  .m3-step-indicator { width: 32px; height: 32px; font-size: 13px; flex-shrink: 0; margin: 0; position: relative; z-index: 1; }
  .m3-step-indicator svg { width: 16px; height: 16px; }
  .m3-step-label { font-size: 13px; line-height: 32px; font-weight: 500; color: var(--md-on-surface-variant); min-width: 0; flex: 1; padding: 0; margin: 0; }
  .m3-step.is-active .m3-step-label { color: var(--md-primary); font-weight: 600; }
  .m3-step.is-complete .m3-step-label { color: var(--md-on-surface); }
}

/* ============================================================
   CARDS
   ============================================================ */
.md-card {
  background: var(--md-surface-container-low);
  border-radius: var(--md-shape-md);
  padding: 20px;
  margin-bottom: 16px;
}

.md-card.md-card--outlined {
  background: var(--md-surface-container-lowest);
  border: 1px solid var(--md-outline-variant);
}

.md-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.md-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--md-shape-sm);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-card-icon svg { width: 24px; height: 24px; }
.md-card-icon.ok   { background: var(--md-success-container); color: var(--md-on-success-container); }
.md-card-icon.warn { background: var(--md-warning-container); color: var(--md-on-warning-container); }
.md-card-icon.er   { background: var(--md-error-container);   color: var(--md-on-error-container); }

.md-card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  line-height: 1.35;
  margin: 0 0 2px;
}

.md-card-sub {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin: 0;
  line-height: 1.45;
}

/* ============================================================
   DATA GRID
   ============================================================ */
.md-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
}

.md-data-cell { display: flex; flex-direction: column; gap: 2px; }

.md-data-cell-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}

.md-data-cell-value {
  font-size: 14px;
  color: var(--md-on-surface);
  font-variant-numeric: tabular-nums;
}

.md-data-cell-value.mono {
  font-family: 'Roboto Mono', ui-monospace, Menlo, monospace;
  font-size: 13px;
}

/* ============================================================
   CHIPS
   ============================================================ */
.md-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--md-shape-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .4px;
  line-height: 1;
  white-space: nowrap;
}

.md-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.md-chip.ok   { background: var(--md-success-container); color: var(--md-on-success-container); }
.md-chip.warn { background: var(--md-warning-container); color: var(--md-on-warning-container); }
.md-chip.er   { background: var(--md-error-container);   color: var(--md-on-error-container); }
.md-chip.neu  { background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); }

.md-chip .chip-dot.is-pulse {
  animation: mdPulse 1.8s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes mdPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 6px transparent; opacity: .7; }
}

/* ============================================================
   BANNERS
   ============================================================ */
.md-banner {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--md-shape-md);
  margin-bottom: 16px;
  align-items: flex-start;
}

.md-banner.ok   { background: var(--md-success-container); color: var(--md-on-success-container); }
.md-banner.warn { background: var(--md-warning-container); color: var(--md-on-warning-container); }
.md-banner.er   { background: var(--md-error-container);   color: var(--md-on-error-container); }

.md-banner-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}

.md-banner-icon svg { width: 22px; height: 22px; }

.md-banner-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
}

.md-banner-text {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
  opacity: .92;
}

/* ============================================================
   BO CARD
   ============================================================ */
.md-bo-card {
  border-radius: var(--md-shape-md);
  padding: 16px 18px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.md-bo-card.ok   { background: var(--md-success-container); border-color: #A5D6A7; color: var(--md-on-success-container); }
.md-bo-card.warn { background: var(--md-warning-container); border-color: #FFCC80; color: var(--md-on-warning-container); }
.md-bo-card.er   { background: var(--md-error-container);   border-color: #F87171; color: var(--md-on-error-container); }

.md-bo-card .bo-ico {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--md-shape-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-bo-card.ok   .bo-ico { background: var(--md-success); color: #fff; }
.md-bo-card.warn .bo-ico { background: #F57C00;           color: #fff; }
.md-bo-card.er   .bo-ico { background: var(--md-error);   color: #fff; }
.md-bo-card .bo-ico svg { width: 24px; height: 24px; }

.md-bo-card .bo-info { flex: 1; min-width: 200px; }
.md-bo-card .bo-info strong { display: block; font-size: 14px; font-weight: 600; }
.md-bo-card .bo-info span { display: block; font-size: 12px; margin-top: 2px; opacity: .85; line-height: 1.45; }
.md-bo-card .bo-amount { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 6px; }

/* ============================================================
   AVATARS
   ============================================================ */
.bo-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 10px;
  min-height: 44px;
  position: relative;
}

.bo-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-left: -12px;
  border: 2px solid #fff;
  background: var(--md-surface-container-highest);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
  transition: transform .18s ease;
}

.bo-avatar:first-child { margin-left: 0; }
.bo-avatar:hover { transform: translateY(-2px) scale(1.05); z-index: 60; }
.bo-avatar:focus { outline: none; }
.bo-avatar:focus-visible { box-shadow: 0 0 0 3px rgba(0, 165, 167, .35), 0 1px 3px rgba(0, 0, 0, .10); }

.bo-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #E9EFEF;
}

.bo-avatar-fallback {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.bo-avatar-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--md-success);
  z-index: 2;
  box-sizing: content-box;
}

.bo-avatar-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  animation: boDotPulse 1.8s cubic-bezier(.4, 0, .6, 1) infinite;
  z-index: -1;
}

.bo-avatar-dot.is-warn { background: #F57C00; }
.bo-avatar-dot.is-er   { background: var(--md-error); }

@keyframes boDotPulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50%      { transform: scale(2.1); opacity: 0; }
}

.bo-avatars.is-single .bo-avatar { width: 48px; height: 48px; margin-left: 0; }
.bo-avatars.is-single .bo-avatar-dot { width: 13px; height: 13px; }

.bo-avatar-more {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-left: -12px;
  border: 2px solid #fff;
  background: var(--md-inverse-surface);
  color: var(--md-inverse-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ============================================================
   POPOVERS
   ============================================================ */
.md-card-pop,
.bo-avatar-pop {
  position: fixed;
  top: 0;
  left: 0;
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 32, 34, .08);
  border-radius: 16px;
  padding: 16px;
  text-align: left;
  cursor: default;
  box-shadow:
    0 24px 48px -14px rgba(0, 32, 34, .26),
    0 10px 20px -10px rgba(0, 32, 34, .16),
    0 0 0 1px rgba(255, 255, 255, .6) inset;
  z-index: 2147483600;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(.96);
  transition:
    opacity .18s cubic-bezier(.4, 0, .2, 1),
    transform .22s cubic-bezier(.34, 1.4, .64, 1),
    visibility 0s linear .18s;
}

.bo-avatar-pop { width: 300px; max-width: calc(100vw - 32px); }
.md-card-pop   { width: 360px; max-width: calc(100vw - 32px); }

.md-card-pop.is-visible,
.bo-avatar-pop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s, 0s, 0s;
}

.bo-pop-arrow,
.md-card-pop-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #FFFFFF !important;
  transform: rotate(45deg);
  border-radius: 2px;
  pointer-events: none;
  z-index: 10000000;
}

[data-placement="top"] > .bo-pop-arrow,
[data-placement="top"] > .md-card-pop-arrow {
  bottom: -7px;
  border-right: 1px solid rgba(0, 32, 34, .08);
  border-bottom: 1px solid rgba(0, 32, 34, .08);
}

[data-placement="bottom"] > .bo-pop-arrow,
[data-placement="bottom"] > .md-card-pop-arrow {
  top: -7px;
  border-left: 1px solid rgba(0, 32, 34, .08);
  border-top: 1px solid rgba(0, 32, 34, .08);
}

/* Avatar popover content */
.bo-pop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bo-pop-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
}

.bo-pop-avatar img,
.bo-pop-avatar .bo-avatar-fallback {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #E9EFEF;
}

.bo-pop-avatar-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--md-success);
  box-sizing: content-box;
  z-index: 1;
}

.bo-pop-avatar-dot.is-warn { background: #F57C00; }
.bo-pop-avatar-dot.is-er   { background: var(--md-error); }

.bo-pop-meta { flex: 1; min-width: 0; }

.bo-pop-name {
  font-size: 14px;
  font-weight: 600;
  color: #002022;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-pop-role {
  font-size: 11.5px;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-pop-status {
  font-size: 10px;
  padding: 4px 9px;
  flex-shrink: 0;
}

.bo-pop-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--md-surface-container-low);
  border-radius: 8px;
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-bottom: 12px;
  overflow: hidden;
}

.bo-pop-contact svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.bo-pop-contact span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.bo-pop-sla {
  padding: 12px;
  background: linear-gradient(135deg, #F4FBFB 0%, #EEF5F5 100%);
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
}

.bo-pop-sla-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}

.bo-pop-sla-score {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.bo-pop-sla-score.ok   { color: #2E7D32; }
.bo-pop-sla-score.warn { color: #E65100; }
.bo-pop-sla-score.er   { color: #BA1A1A; }

.bo-pop-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bo-pop-gauge {
  --pct-color: #2E7D32;
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--pct-color) var(--pct, 0%),
    rgba(0, 32, 34, .08) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.bo-pop-gauge.ok   { --pct-color: #2E7D32; }
.bo-pop-gauge.warn { --pct-color: #F57C00; }
.bo-pop-gauge.er   { --pct-color: #BA1A1A; }

.bo-pop-gauge::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 32, 34, .08) inset;
}

.bo-pop-gauge > span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  color: #002022;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

.bo-pop-bars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bo-pop-bar {
  display: grid;
  grid-template-columns: 62px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.bo-pop-bar-lbl {
  color: var(--md-on-surface-variant);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-pop-bar-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 32, 34, .08);
  overflow: hidden;
}

.bo-pop-bar-track > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}

.bo-pop-bar-track > i.ok   { background: linear-gradient(90deg, #4ADE80, #2E7D32); }
.bo-pop-bar-track > i.warn { background: linear-gradient(90deg, #FB923C, #F57C00); }
.bo-pop-bar-track > i.er   { background: linear-gradient(90deg, #F87171, #BA1A1A); }

.bo-pop-bar-pct {
  text-align: right;
  font-weight: 600;
  color: #002022;
  font-variant-numeric: tabular-nums;
}

.bo-pop-foot {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: .3px;
  color: var(--md-on-surface-variant);
  text-align: center;
  text-transform: uppercase;
  opacity: .7;
}

@media (max-width: 600px) {
  .bo-avatars { min-height: 38px; padding-right: 6px; }
  .bo-avatar { width: 38px; height: 38px; margin-left: -10px; border-width: 2px; }
  .bo-avatars.is-single .bo-avatar { width: 42px; height: 42px; }
  .bo-avatar-dot { width: 11px; height: 11px; }
  .bo-avatar-fallback { font-size: 12px; }
  .bo-avatar-more { width: 38px; height: 38px; margin-left: -10px; font-size: 11px; }
  .bo-pop-gauge { width: 58px; height: 58px; }
  .bo-pop-gauge > span { font-size: 12.5px; }
  .bo-pop-bar { grid-template-columns: 54px 1fr 30px; font-size: 10.5px; }
  .bo-pop-name { font-size: 13.5px; }
  .bo-pop-avatar { width: 42px; height: 42px; }
}

/* ============================================================
   CARD POPOVER — shared content blocks
   ============================================================ */
.bo-why-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.bo-why-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFE0B2, #FFB74D);
  color: #7A3E00;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 152, 0, .25);
}

.bo-why-icon svg { width: 22px; height: 22px; }

.bo-why-meta { flex: 1; min-width: 0; }

.bo-why-title {
  font-size: 14px;
  font-weight: 700;
  color: #002022;
  line-height: 1.3;
}

.bo-why-sub {
  font-size: 11.5px;
  color: var(--md-on-surface-variant);
  margin-top: 3px;
  line-height: 1.4;
}

.bo-why-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: #FFF3E0;
  border: 1px solid #FFCC80;
  border-radius: 10px;
  font-size: 11.5px;
  color: #7A3E00;
  line-height: 1.45;
  margin-bottom: 12px;
}

.bo-why-alert svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.bo-why-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .55px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  margin: 0 0 8px;
}

.bo-why-access {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  border: 1px solid #FFCC80;
  border-radius: 12px;
  margin-bottom: 12px;
}

.bo-why-gauge {
  --pct-color: #BA1A1A;
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--pct-color) var(--pct, 0%),
    rgba(0, 32, 34, .08) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.bo-why-gauge::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 32, 34, .08) inset;
}

.bo-why-gauge > span {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: #BA1A1A;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

.bo-why-access-meta { flex: 1; min-width: 0; }

.bo-why-access-title {
  font-size: 12px;
  font-weight: 700;
  color: #7A3E00;
  line-height: 1.3;
  letter-spacing: .1px;
}

.bo-why-access-sub {
  font-size: 11px;
  color: #7A3E00;
  opacity: .85;
  margin-top: 3px;
  line-height: 1.4;
}

.bo-why-metrics {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 12px;
}

.bo-why-metric { display: flex; flex-direction: column; gap: 4px; }

.bo-why-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #002022;
  font-weight: 500;
}

.bo-why-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.bo-why-badge.ok   { background: #DCFCE7; color: #166534; }
.bo-why-badge.warn { background: #FFE0B2; color: #7A3E00; }
.bo-why-badge.er   { background: #FFDAD6; color: #BA1A1A; }

.bo-why-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 32, 34, .08);
  overflow: hidden;
}

.bo-why-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}

.bo-why-bar > i.ok   { background: linear-gradient(90deg, #4ADE80, #2E7D32); }
.bo-why-bar > i.warn { background: linear-gradient(90deg, #FB923C, #F57C00); }
.bo-why-bar > i.er   { background: linear-gradient(90deg, #F87171, #BA1A1A); }

.bo-why-timeline {
  padding: 12px;
  background: var(--md-surface-container-low);
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  margin-bottom: 12px;
}

.bo-why-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 32, 34, .08);
  overflow: hidden;
  margin-bottom: 8px;
}

.bo-why-track > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #4ADE80, #00A5A7);
  border-radius: 999px;
}

.bo-why-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--md-on-surface-variant);
  font-variant-numeric: tabular-nums;
}

.bo-why-ticks span { flex: 1; text-align: center; }
.bo-why-ticks span:first-child { text-align: left; }
.bo-why-ticks span:last-child { text-align: right; }

.bo-why-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  padding: 11px 12px;
  background: var(--md-surface-container-low);
  border-radius: 10px;
  margin-bottom: 10px;
}

.bo-why-fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.bo-why-fact .k {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}

.bo-why-fact .v {
  font-size: 11.5px;
  font-weight: 600;
  color: #002022;
  line-height: 1.3;
}

.bo-why-fact .v.mono {
  font-family: 'Roboto Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
}

.bo-why-foot {
  font-size: 9.5px;
  letter-spacing: .35px;
  color: var(--md-on-surface-variant);
  text-align: center;
  text-transform: uppercase;
  opacity: .75;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .bo-why-facts { grid-template-columns: 1fr; }
}

/* ============================================================
   CARD POPOVER WRAPPER
   ============================================================ */
.md-card-pop-wrap {
  position: relative;
  cursor: help;
  transition: box-shadow .2s ease, transform .2s ease;
}

.md-card-pop-wrap:hover {
  box-shadow: 0 8px 22px -8px rgba(0, 32, 34, .22);
}

.md-card-pop-wrap:focus { outline: none; }

.md-card-pop-wrap:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .35), 0 8px 22px -8px rgba(0, 32, 34, .22);
}

/* Theme variants */
.md-card-pop--green .bo-why-icon {
  background: linear-gradient(135deg, #A7F3D0, #4ADE80);
  color: #052E16;
  box-shadow: 0 2px 6px rgba(46, 125, 50, .25);
}
.md-card-pop--green .bo-why-alert { background: #DCFCE7; border-color: #A5D6A7; color: #052E16; }
.md-card-pop--green .bo-why-access { background: linear-gradient(135deg, #DCFCE7 0%, #A7F3D0 100%); border-color: #A5D6A7; }
.md-card-pop--green .bo-why-gauge { --pct-color: #2E7D32; }
.md-card-pop--green .bo-why-gauge > span { color: #2E7D32; }
.md-card-pop--green .bo-why-access-title,
.md-card-pop--green .bo-why-access-sub { color: #052E16; }

.md-card-pop--teal .bo-why-icon {
  background: linear-gradient(135deg, #6FF6FE, #00A5A7);
  color: #002022;
  box-shadow: 0 2px 6px rgba(0, 165, 167, .28);
}
.md-card-pop--teal .bo-why-alert { background: #E0F7FA; border-color: #80DEEA; color: #00454A; }
.md-card-pop--teal .bo-why-access { background: linear-gradient(135deg, #E0F7FA 0%, #B2EBF2 100%); border-color: #80DEEA; }
.md-card-pop--teal .bo-why-gauge { --pct-color: #00A5A7; }
.md-card-pop--teal .bo-why-gauge > span { color: #008B8D; }
.md-card-pop--teal .bo-why-access-title,
.md-card-pop--teal .bo-why-access-sub { color: #00454A; }

.md-card-pop--amber .bo-why-icon {
  background: linear-gradient(135deg, #FFE0B2, #FFB74D);
  color: #7A3E00;
  box-shadow: 0 2px 6px rgba(255, 152, 0, .25);
}
.md-card-pop--amber .bo-why-alert { background: #FFF3E0; border-color: #FFCC80; color: #7A3E00; }
.md-card-pop--amber .bo-why-access { background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%); border-color: #FFCC80; }
.md-card-pop--amber .bo-why-gauge { --pct-color: #BA1A1A; }
.md-card-pop--amber .bo-why-gauge > span { color: #BA1A1A; }
.md-card-pop--amber .bo-why-access-title,
.md-card-pop--amber .bo-why-access-sub { color: #7A3E00; }

.md-card-pop--er .bo-why-icon {
  background: linear-gradient(135deg, #FFDAD6, #F87171);
  color: #410002;
  box-shadow: 0 2px 6px rgba(186, 26, 26, .25);
}
.md-card-pop--er .bo-why-alert { background: #FFDAD6; border-color: #F87171; color: #410002; }
.md-card-pop--er .bo-why-access { background: linear-gradient(135deg, #FFDAD6 0%, #FFB4AB 100%); border-color: #F87171; }
.md-card-pop--er .bo-why-gauge { --pct-color: #BA1A1A; }
.md-card-pop--er .bo-why-gauge > span { color: #BA1A1A; }
.md-card-pop--er .bo-why-access-title,
.md-card-pop--er .bo-why-access-sub { color: #410002; }

.md-banner.md-card-pop-wrap { position: relative; }

.gfield_type_uaesa_cipc_ar_selector { position: relative !important; }

.md-bo-card,
.md-card,
.md-bo-card.ok,
.md-bo-card.warn,
.md-banner { opacity: 1 !important; }

/* ============================================================
   FEE STRIP / GLASS PANEL
   ============================================================ */
.md-fee-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--md-surface-container-low);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-shape-sm);
  font-size: 12px;
  color: var(--md-on-surface-variant);
  flex-wrap: wrap;
}

.md-fee-strip .md-fee-strip-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.md-fee-strip .md-fee-strip-icon svg { width: 14px; height: 14px; fill: currentColor; }

.md-fee-strip .md-fee-strip-label {
  font-size: 10.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 600;
}

.md-fee-strip .md-fee-strip-value {
  font-weight: 600;
  color: var(--md-on-surface);
  font-variant-numeric: tabular-nums;
}

.md-fee-strip .md-fee-strip-sep { color: var(--md-outline); }

.md-glass-panel {
  background: #FFFFFF;
  border-radius: var(--md-shape-md);
  padding: 0;
  margin-bottom: 16px;
  box-shadow: none;
}

.md-table-wrap {
  border-radius: 12px;
  border: 1px solid var(--md-outline-variant);
  overflow: hidden;
  background: #FFFFFF;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #002022;
}

.md-table thead th {
  background: var(--md-surface-container-low);
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  border-bottom: 1px solid var(--md-outline-variant);
  white-space: nowrap;
}

.md-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--md-surface-container-high);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  color: #002022;
  background: #FFFFFF;
}

.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover:not(.is-blocked) td { background: var(--md-surface-container-low); }

.md-table tbody tr.is-filed td { background: rgba(220, 252, 231, .55); }
.md-table tbody tr.is-filed .year-name strong { color: #052E16; }
.md-table tbody tr.is-filed .year-name strong::after { content: ' ✓'; color: #2E7D32; }
.md-table tbody tr.is-filed .amt-total { color: rgba(0, 32, 34, .55); text-decoration: line-through; }

.md-table tbody tr.is-selected td { background: rgba(204, 232, 233, .55); }

.md-table tbody tr.is-blocked td {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 218, 214, .55) 0,
    rgba(255, 218, 214, .55) 8px,
    rgba(255, 255, 255, .6) 8px,
    rgba(255, 255, 255, .6) 16px
  );
  opacity: .85;
}

.year-name strong { font-size: 13.5px; font-weight: 600; color: #002022; }
.year-name span { display: block; font-size: 11px; color: rgba(0, 32, 34, .65); margin-top: 2px; font-weight: 400; letter-spacing: .1px; }

.amt-pen { font-weight: 500; color: #7A0F0F; }
.amt-pen .pen-meta { display: block; font-size: 10.5px; color: rgba(0, 32, 34, .65); font-weight: 400; margin-top: 1px; letter-spacing: .2px; }
.amt-total { font-weight: 700; color: #002022; font-size: 13.5px; }

/* .dash — scoped so it never leaks into dashboard widgets */
.uaesa-cipc-wizard .dash,
.md-dialog .dash { color: rgba(0, 32, 34, .5) !important; }

/* ============================================================
   BAND SELECT
   ============================================================ */
.md-band-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 180px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  background: #FFFFFF;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233F4849'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-on-surface);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  min-height: 36px;
}

.md-band-select:hover { border-color: var(--md-primary); }

.md-band-select:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .18);
}

.md-band-select.is-override {
  border-color: var(--md-primary);
  background-color: #F4FBFB;
  color: var(--md-primary);
  font-weight: 600;
}

.md-band-select:disabled {
  background-color: var(--md-surface-container-low);
  color: var(--md-on-surface-variant);
  cursor: not-allowed;
  opacity: .7;
}

.md-band-meta {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--md-primary);
  margin-top: 4px;
}

.md-band-static {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CHECKBOX / LOCK CHIP
   ============================================================ */
.md-lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--md-success);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--md-shape-full);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.md-lock-chip svg { width: 10px; height: 10px; }

.md-check {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #4A6365;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  flex-shrink: 0;
  margin: 0;
  display: block;
  background: rgba(255, 255, 255, .9);
  accent-color: var(--md-primary);
}

.md-check:hover:not(:disabled) { border-color: var(--md-primary); }
.md-check:checked { background: var(--md-primary); border-color: var(--md-primary); }

.md-check:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.md-check:disabled { cursor: not-allowed; opacity: .5; }

/* ============================================================
   TOTALS
   ============================================================ */
.md-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--md-outline-variant);
  border-radius: var(--md-shape-md);
  overflow: hidden;
  border: 1px solid var(--md-outline-variant);
  margin-top: 16px;
}

.md-total-cell {
  background: var(--md-surface-container-lowest);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.md-total-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}

.md-total-value {
  font-size: 20px;
  font-weight: 500;
  color: var(--md-on-surface);
  font-variant-numeric: tabular-nums;
}

.md-total-cell.grand { background: var(--md-success-container); }
.md-total-cell.grand .md-total-value { color: var(--md-on-success-container); font-weight: 600; }
.md-total-cell.pen .md-total-value { color: var(--md-error); }

/* ============================================================
   BUTTONS
   ============================================================ */
.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-shape-full);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .1px;
  border: none;
  cursor: pointer;
  transition: box-shadow .15s, background .15s;
  white-space: nowrap;
}

.md-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.md-btn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.md-btn:not(:disabled):active { transform: scale(.98); }

.md-btn--filled { background: #00A5A7; color: #FFFFFF; }
.md-btn--filled:not(:disabled):hover { box-shadow: var(--md-elev-2); background: #008B8D; }
.md-btn--outlined { background: transparent; color: #00A5A7; border: 1px solid #00A5A7; }
.md-btn--outlined:not(:disabled):hover { background: rgba(0, 165, 167, .08); }
.md-btn--text { background: transparent; color: #00A5A7; padding: 0 12px; }
.md-btn--text:not(:disabled):hover { background: rgba(0, 165, 167, .08); }

/* ============================================================
   STEP PANELS
   ============================================================ */
.m3-step-panel { display: none; }
.m3-step-panel.is-active { display: block; animation: mdStepIn .28s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes mdStepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.m3-step-panel.back { animation: mdStepBack .28s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes mdStepBack { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

.m3-step-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--md-outline-variant);
  flex-wrap: wrap;
}

.m3-step-footer .spacer { flex: 1; }
.m3-step-footer .hint { font-size: 12px; color: var(--md-on-surface-variant); }

@keyframes mdFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   SNACKBAR
   ============================================================ */
.md-snackbar-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.md-snackbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--md-inverse-surface, #2B3232) !important;
  color: var(--md-inverse-on-surface, #ECF2F2) !important;
  border-radius: var(--md-shape-xs, 4px) !important;
  box-shadow: var(--md-elev-3, 0 4px 8px rgba(0, 0, 0, .10)) !important;
  font-size: 14px;
  line-height: 1.4;
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.md-snackbar.show { transform: translateY(0); }
.md-snackbar.ok   { border-left: 3px solid var(--md-success, #2E7D32) !important; }
.md-snackbar.er   { border-left: 3px solid var(--md-error, #BA1A1A) !important; }
.md-snackbar.work { border-left: 3px solid #E65100 !important; }

.md-snackbar__icon { width: 22px; height: 22px; flex-shrink: 0; }
.md-snackbar__msg { flex: 1; }

.md-snackbar__action {
  background: none;
  border: none;
  color: var(--md-primary-container, #6FF6FE) !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--md-shape-xs);
}

.md-snackbar__action:hover { background: rgba(255, 255, 255, .08); }

/* ============================================================
   MOBILE / DESKTOP TOGGLES
   ============================================================ */
.md-mob-only { display: none !important; }
.md-desk-only { display: block !important; }

@media (max-width: 720px) {
  .md-desk-only { display: none !important; }
  .md-mob-only { display: block !important; }
  .md-glass-panel { padding: 0; border-radius: var(--md-shape-sm); }
}

/* ============================================================
   MOBILE LIST
   ============================================================ */
.md-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.md-m-row {
  display: grid;
  grid-template-columns: 44px 1fr 36px;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.md-m-row:active { transform: scale(.985); }
.md-m-row.is-filed { background: #F1F8E9; }
.md-m-row.is-filed .md-m-top strong { color: #2E7D32; }
.md-m-row.is-filed .md-m-top strong::after { content: ' ✓'; color: #2E7D32; }
.md-m-row.is-selected { background: var(--md-secondary-container); }
.md-m-row.is-blocked {
  opacity: .85;
  background: repeating-linear-gradient(45deg, #FEF2F2 0, #FEF2F2 8px, #FFF7F7 8px, #FFF7F7 16px);
}

.md-m-check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
}

.md-m-check .md-check { width: 22px; height: 22px; border-width: 2px; background: #fff; }
.md-m-check .md-check:checked::after { left: 6px; top: 2px; width: 6px; height: 10px; }
.md-m-check .md-lock-chip { font-size: 9px; padding: 4px 7px; gap: 3px; flex-direction: column; line-height: 1.1; }
.md-m-check .md-lock-chip svg { width: 12px; height: 12px; }

.md-m-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.md-m-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.md-m-top strong { font-size: 14px; font-weight: 600; color: #002022; white-space: nowrap; }
.md-m-top .md-m-total { font-size: 14px; font-weight: 700; color: #002022; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.md-m-top .md-m-total.dash { color: rgba(0, 32, 34, .5); }

.md-m-band {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--md-surface-container-low);
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  transition: background .15s, border-color .15s;
}

.md-m-band.is-override { background: #F4FBFB; border-color: var(--md-primary); }
.md-m-band--locked { background: #F1F8E9; border-color: #A5D6A7; }

.md-m-band-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 5px;
}

.md-m-band-lbl .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--md-outline);
}

.md-m-band.is-override .md-m-band-lbl,
.md-m-band.is-override .md-m-band-lbl .dot { color: var(--md-primary); background: var(--md-primary); }
.md-m-band--locked .md-m-band-lbl,
.md-m-band--locked .md-m-band-lbl .dot { color: #2E7D32; background: #2E7D32; }

.md-m-band-value {
  font-size: 12.5px;
  font-weight: 500;
  color: #2E7D32;
  font-variant-numeric: tabular-nums;
}

.md-m-band .md-band-select { max-width: none; width: 100%; font-size: 12.5px; padding: 8px 30px 8px 10px; min-height: 38px; }

.md-m-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.md-m-hint {
  font-size: 10.5px;
  letter-spacing: .3px;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.md-m-info {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--md-outline-variant);
  background: #fff;
  color: #00A5A7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
  position: relative;
}

.md-m-info::before { content: ''; position: absolute; inset: -6px; }
.md-m-info:hover { background: rgba(0, 165, 167, .08); transform: scale(1.05); }
.md-m-info svg { width: 18px; height: 18px; fill: currentColor; }

/* ============================================================
   MOBILE SHEET
   ============================================================ */
.md-m-sheet {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.md-m-sheet.open { display: flex !important; }

.md-m-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  animation: mdFadeIn .2s ease both;
}

.md-m-sheet-body {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: #F4FBFB;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .22);
  padding: 10px 20px 26px;
  animation: mdSheetUp .28s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes mdSheetUp {
  from { transform: translateY(24px); opacity: .6; }
  to   { transform: translateY(0); opacity: 1; }
}

.md-m-sheet-handle {
  width: 44px; height: 5px;
  background: rgba(0, 32, 34, .18);
  border-radius: 999px;
  margin: 0 auto 14px;
}

.md-m-sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.md-m-sheet-head h4 { margin: 0; font-size: 17px; font-weight: 700; color: #002022; }
.md-m-sheet-head .md-m-sheet-total { font-size: 17px; font-weight: 700; color: #00A5A7; font-variant-numeric: tabular-nums; }

.md-m-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 16px;
}

.md-m-sheet-cell { display: flex; flex-direction: column; gap: 2px; }

.md-m-sheet-cell .lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}

.md-m-sheet-cell .val {
  font-size: 14px;
  font-weight: 600;
  color: #002022;
  font-variant-numeric: tabular-nums;
}

.md-m-sheet-cell .val.pen { color: #BA1A1A; }

/* SLA bar */
.md-sla {
  margin: 6px 0 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
}

.md-sla-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  margin-bottom: 8px;
}

.md-sla-bar {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(0, 32, 34, .08);
  border-radius: 999px;
  overflow: hidden;
}

.md-sla-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: #2E7D32;
  transition: width .3s ease;
}

.md-sla-bar.lv1 > span { background: #2E7D32; }
.md-sla-bar.lv2 > span { background: #F57C00; }
.md-sla-bar.lv3 > span { background: #E65100; }
.md-sla-bar.lv4 > span { background: #BA1A1A; }

.md-sla-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--md-on-surface-variant);
  font-variant-numeric: tabular-nums;
}

.md-sla-meta { margin-top: 6px; font-size: 12px; color: #002022; font-weight: 500; }

.md-m-sheet-close {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #00A5A7;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}

.md-m-sheet-close:hover { background: #008B8D; }

/* ============================================================
   SMALL MOBILE
   ============================================================ */
@media (max-width: 600px) {
  .md-card { padding: 16px; border-radius: var(--md-shape-sm); }
  .md-card-header { gap: 10px; margin-bottom: 14px; }
  .md-card-icon { width: 36px; height: 36px; }
  .md-card-icon svg { width: 20px; height: 20px; }
  .md-data-grid { grid-template-columns: 1fr; gap: 12px 0; }
  .md-totals { grid-template-columns: 1fr 1fr; }
  .md-total-value { font-size: 17px; }
  .md-banner { padding: 14px; gap: 10px; }
  .md-banner-icon { width: 36px; height: 36px; }
  .md-banner-icon svg { width: 20px; height: 20px; }
  .md-banner-title { font-size: 13px; }
  .md-banner-text { font-size: 12px; }
  .md-bo-card { padding: 14px; gap: 10px; }
  .md-bo-card .bo-ico { width: 38px; height: 38px; }
  .md-bo-card .bo-ico svg { width: 20px; height: 20px; }
  .md-bo-card .bo-info { min-width: 100%; }
  .m3-step-footer { flex-direction: column-reverse; align-items: stretch; }
  .m3-step-footer .md-btn { width: 100%; }
  .m3-step-footer .hint { text-align: center; order: -1; }
  .md-dialog { border-radius: var(--md-shape-lg); max-height: 94vh; }
}

/* ============================================================
   MAIN MOBILE BLOCK — must live after base mobile rules
   ============================================================ */
@media (max-width: 720px) {
  .md-m-row { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 8px; padding: 10px 10px; border-radius: 12px; }

  .md-m-check { width: 100%; position: relative; }
  .md-m-check::before { content: ''; position: absolute; inset: -6px; }
  .md-m-check .md-check { width: 22px; height: 22px; margin: 0 auto; }
  .md-m-check .md-lock-chip { flex-direction: row; gap: 3px; font-size: 9px; letter-spacing: .3px; padding: 4px 5px; border-radius: 6px; line-height: 1; white-space: nowrap; }
  .md-m-check .md-lock-chip svg { width: 10px; height: 10px; }

  .md-m-main { gap: 6px; min-width: 0; }
  .md-m-top { display: flex; align-items: baseline; gap: 6px; }
  .md-m-top strong { font-size: 13.5px; white-space: nowrap; }
  .md-m-top .md-m-total { font-size: 13.5px; margin-left: auto; white-space: nowrap; }

  .md-m-bottom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 2px; }
  .md-m-bottom .md-chip { font-size: 10px; padding: 4px 8px; min-width: 0; }
  .md-m-bottom .md-chip .chip-dot { width: 5px; height: 5px; }
  .md-m-hint { font-size: 10px; margin-left: auto; white-space: nowrap; }

  .md-m-info { width: 32px; height: 32px; }
  .md-m-info svg { width: 16px; height: 16px; }

  .md-m-sheet-body { padding: 8px 16px 20px; max-height: 88vh; border-radius: 20px 20px 0 0; }
  .md-m-sheet-handle { margin-bottom: 10px; }
  .md-m-sheet-head { margin-bottom: 10px; }
  .md-m-sheet-head h4 { font-size: 16px; }
  .md-m-sheet-head .md-m-sheet-total { font-size: 16px; }
  .md-m-sheet-grid { gap: 8px 12px; margin-bottom: 12px; }
  .md-m-sheet-cell .lbl { font-size: 10px; }
  .md-m-sheet-cell .val { font-size: 13.5px; }
  .md-sla { padding: 10px 12px; margin: 4px 0 12px; border-radius: 10px; }
  .md-sla-label { font-size: 10.5px; margin-bottom: 6px; }
  .md-sla-bar { height: 10px; }
  .md-sla-ticks { font-size: 9.5px; margin-top: 4px; }
  .md-sla-meta { font-size: 11.5px; margin-top: 4px; }
  .md-m-sheet-close { height: 42px; font-size: 13.5px; }

  .md-totals { grid-template-columns: 1fr 1fr; }
  .md-total-cell { padding: 10px 12px; }
  .md-total-label { font-size: 10px; letter-spacing: .5px; }
  .md-total-value { font-size: 16px; }

  .m3-step-footer { gap: 8px; padding-top: 16px; margin-top: 16px; }
  .m3-step-footer .md-btn { height: 42px; font-size: 13.5px; }
}

@media (max-width: 380px) {
  .md-m-row { grid-template-columns: 40px 1fr 34px; padding: 10px; gap: 8px; }
  .md-m-check .md-check { width: 20px; height: 20px; }
  .md-m-check .md-check:checked::after { left: 5px; top: 1px; width: 6px; height: 10px; }
  .md-m-info { width: 34px; height: 34px; }
  .md-m-info svg { width: 16px; height: 16px; }
  .md-m-top strong { font-size: 13px; }
  .md-m-top .md-m-total { font-size: 13px; }
  .md-m-band .md-band-select { font-size: 12px; padding: 7px 26px 7px 9px; min-height: 36px; }
  .m3-step { gap: 10px; padding-bottom: 16px; }
  .m3-step-indicator { width: 28px; height: 28px; font-size: 12px; }
  .m3-step-label { font-size: 12px; line-height: 28px; }
  .m3-step:not(:last-child)::before { left: 14px; top: 28px; }
}

@media (max-width: 360px) {
  .md-m-row { grid-template-columns: 28px minmax(0, 1fr) 30px; gap: 6px; padding: 9px 8px; }
  .md-m-check .md-check { width: 20px; height: 20px; }
  .md-m-check .md-check:checked::after { left: 5px; top: 1px; width: 6px; height: 10px; }
  .md-m-check .md-lock-chip { font-size: 8px; padding: 3px 4px; }
  .md-m-check .md-lock-chip svg { display: none; }
  .md-m-info { width: 30px; height: 30px; }
  .md-m-info svg { width: 14px; height: 14px; }
  .md-m-top strong { font-size: 13px; }
  .md-m-top .md-m-total { font-size: 13px; }
  .md-m-sheet-body { padding: 8px 14px 18px; }
  .md-m-sheet-grid { gap: 6px 10px; }
  .md-m-sheet-cell .val { font-size: 13px; }
}

/* ============================================================
   BUTTON STYLE OVERRIDES (hard reset + variants)
   ============================================================ */
.md-btn,
button.md-btn,
input.md-btn,
a.md-btn,
.gform_wrapper .md-btn,
.uaesa-cipc-wizard .md-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.md-btn--filled,
button.md-btn--filled,
input.md-btn--filled,
a.md-btn--filled,
.gform_wrapper .md-btn--filled,
.uaesa-cipc-wizard .md-btn--filled {
  background: #00A5A7 !important;
  background-color: #00A5A7 !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.md-btn--filled:not(:disabled):hover,
button.md-btn--filled:not(:disabled):hover,
input.md-btn--filled:not(:disabled):hover,
a.md-btn--filled:not(:disabled):hover {
  background: #008B8D !important;
  background-color: #008B8D !important;
  background-image: none !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .08) !important;
}

.md-btn--outlined,
button.md-btn--outlined,
input.md-btn--outlined,
a.md-btn--outlined,
.gform_wrapper .md-btn--outlined,
.uaesa-cipc-wizard .md-btn--outlined {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #00A5A7 !important;
  border: 1px solid #00A5A7 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.md-btn--outlined:not(:disabled):hover,
button.md-btn--outlined:not(:disabled):hover,
input.md-btn--outlined:not(:disabled):hover,
a.md-btn--outlined:not(:disabled):hover {
  background: rgba(0, 165, 167, .08) !important;
  background-color: rgba(0, 165, 167, .08) !important;
  color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

.md-btn--text,
button.md-btn--text,
input.md-btn--text,
a.md-btn--text,
.gform_wrapper .md-btn--text,
.uaesa-cipc-wizard .md-btn--text {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #00A5A7 !important;
  border: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.md-btn--text:not(:disabled):hover,
button.md-btn--text:not(:disabled):hover,
input.md-btn--text:not(:disabled):hover,
a.md-btn--text:not(:disabled):hover {
  background: rgba(0, 165, 167, .08) !important;
  background-color: rgba(0, 165, 167, .08) !important;
  color: #00A5A7 !important;
}

.md-btn:disabled,
button.md-btn:disabled,
input.md-btn:disabled,
a.md-btn:disabled,
.md-btn[disabled],
.gform_wrapper .md-btn:disabled,
.uaesa-cipc-wizard .md-btn:disabled {
  background: #00A5A7 !important;
  background-color: #00A5A7 !important;
  background-image: none !important;
  color: #FFFFFF !important;
  opacity: .38 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.md-btn--outlined:disabled,
button.md-btn--outlined:disabled,
input.md-btn--outlined:disabled,
a.md-btn--outlined:disabled,
.md-btn--text:disabled,
button.md-btn--text:disabled,
input.md-btn--text:disabled,
a.md-btn--text:disabled {
  background: transparent !important;
  background-color: transparent !important;
  color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

.md-btn::before,
.md-btn::after,
.gform_wrapper .md-btn::before,
.gform_wrapper .md-btn::after,
.uaesa-cipc-wizard .md-btn::before,
.uaesa-cipc-wizard .md-btn::after {
  background: none !important;
  background-image: none !important;
  border: none !important;
  content: none !important;
  display: none !important;
}

.md-btn svg {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

.md-btn--outlined svg,
.md-btn--text svg {
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* ============================================================
   FOCUS RING OVERRIDES
   ============================================================ */
.md-check,
.uaesa-cipc-check,
.uaesa-cipc-wizard input[type="checkbox"],
.uaesa-cipc-wizard input[type="radio"],
.gform_wrapper .uaesa-cipc-wizard input[type="checkbox"],
.gform_wrapper .uaesa-cipc-wizard input[type="radio"] {
  accent-color: #00A5A7 !important;
}

.uaesa-cipc-wizard *:focus,
.uaesa-cipc-wizard *:focus-visible,
.gform_wrapper .uaesa-cipc-wizard *:focus,
.gform_wrapper .uaesa-cipc-wizard *:focus-visible {
  outline-color: #00A5A7 !important;
  -webkit-focus-ring-color: #00A5A7 !important;
}

.md-btn:focus,
.md-btn:focus-visible,
button.md-btn:focus,
button.md-btn:focus-visible,
input.md-btn:focus,
input.md-btn:focus-visible,
a.md-btn:focus,
a.md-btn:focus-visible,
.gform_wrapper .md-btn:focus,
.gform_wrapper .md-btn:focus-visible,
.uaesa-cipc-wizard .md-btn:focus,
.uaesa-cipc-wizard .md-btn:focus-visible {
  outline: 2px solid #00A5A7 !important;
  outline-offset: 2px !important;
  outline-color: #00A5A7 !important;
  -webkit-focus-ring-color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

.md-btn--filled:focus,
.md-btn--filled:focus-visible {
  background: #008B8D !important;
  color: #FFFFFF !important;
  outline-color: #00A5A7 !important;
  box-shadow: 0 0 0 4px rgba(0, 165, 167, .25) !important;
}

.md-btn--outlined:focus,
.md-btn--outlined:focus-visible {
  background: rgba(0, 165, 167, .08) !important;
  color: #00A5A7 !important;
  border-color: #00A5A7 !important;
  outline-color: #00A5A7 !important;
  box-shadow: 0 0 0 4px rgba(0, 165, 167, .25) !important;
}

.md-btn--text:focus,
.md-btn--text:focus-visible {
  background: rgba(0, 165, 167, .08) !important;
  color: #00A5A7 !important;
  outline-color: #00A5A7 !important;
  box-shadow: 0 0 0 4px rgba(0, 165, 167, .25) !important;
}

.md-check:focus,
.md-check:focus-visible,
.uaesa-cipc-check:focus,
.uaesa-cipc-check:focus-visible,
input[type="checkbox"].md-check:focus,
input[type="checkbox"].md-check:focus-visible,
.uaesa-cipc-wizard input[type="checkbox"]:focus,
.uaesa-cipc-wizard input[type="checkbox"]:focus-visible,
.gform_wrapper .uaesa-cipc-wizard input[type="checkbox"]:focus,
.gform_wrapper .uaesa-cipc-wizard input[type="checkbox"]:focus-visible {
  outline: 2px solid #00A5A7 !important;
  outline-offset: 2px !important;
  outline-color: #00A5A7 !important;
  -webkit-focus-ring-color: #00A5A7 !important;
  border-color: #00A5A7 !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .30) !important;
}

.md-check:checked,
.uaesa-cipc-check:checked,
input[type="checkbox"].md-check:checked,
.uaesa-cipc-wizard input[type="checkbox"]:checked {
  background: #00A5A7 !important;
  background-color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

.md-check:checked:hover:not(:disabled),
.uaesa-cipc-check:checked:hover:not(:disabled) {
  background: #008B8D !important;
  border-color: #008B8D !important;
}

.uaesa-cipc-wizard button:focus,
.uaesa-cipc-wizard button:focus-visible,
.uaesa-cipc-wizard a:focus,
.uaesa-cipc-wizard a:focus-visible,
.uaesa-cipc-wizard input:focus,
.uaesa-cipc-wizard input:focus-visible,
.uaesa-cipc-wizard select:focus,
.uaesa-cipc-wizard select:focus-visible,
.uaesa-cipc-wizard textarea:focus,
.uaesa-cipc-wizard textarea:focus-visible,
.gform_wrapper .uaesa-cipc-wizard button:focus,
.gform_wrapper .uaesa-cipc-wizard button:focus-visible,
.gform_wrapper .uaesa-cipc-wizard a:focus,
.gform_wrapper .uaesa-cipc-wizard a:focus-visible,
.gform_wrapper .uaesa-cipc-wizard input:focus,
.gform_wrapper .uaesa-cipc-wizard input:focus-visible {
  outline-color: #00A5A7 !important;
  -webkit-focus-ring-color: #00A5A7 !important;
}

.md-btn,
button.md-btn,
input.md-btn,
a.md-btn,
.md-check,
.uaesa-cipc-check,
.uaesa-cipc-wizard button,
.uaesa-cipc-wizard a,
.uaesa-cipc-wizard input,
.uaesa-cipc-wizard label {
  -webkit-tap-highlight-color: rgba(0, 165, 167, .15) !important;
}

.uaesa-cipc-wizard *:focus:not(.md-btn):not(.md-check):not(.uaesa-cipc-check):not(input[type="checkbox"]):not(select) {
  outline-color: #00A5A7 !important;
  box-shadow: none !important;
}

.uaesa-cipc-wizard select:focus,
.uaesa-cipc-wizard select:focus-visible {
  outline-color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

/* ============================================================
   v5 ADDITIONS — BO complete badge
   ============================================================ */
.md-bo-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #2E7D32;
  color: #FFF;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.md-bo-complete-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: statusPulse 1.8s infinite;
}

/* ============================================================
   v5 ADDITIONS — Dialog / overlay primitives
   ============================================================ */
.md-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.md-overlay.open { display: flex; }

.md-dialog {
  background: #FFF;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px -14px rgba(0, 32, 34, .26);
  animation: dialogIn .25s;
  display: flex;
  flex-direction: column;
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

.md-dialog-head {
  padding: 20px 22px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: sticky;
  top: 0;
  background: #FFF;
  z-index: 2;
  border-bottom: 1px solid transparent;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.md-dialog-head .ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--md-primary-container, #6FF6FE) !important;
  color: var(--md-on-primary-container, #002022) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.md-dialog-head .ic svg { width: 22px; height: 22px; }
.md-dialog-title { font-size: 17px; font-weight: 600; color: #002022; margin: 0 0 4px; }
.md-dialog-sub { font-size: 12.5px; color: #3F4849; margin: 0; line-height: 1.5; }
.md-dialog-body { padding: 4px 22px 16px; flex: 1; min-height: 0; }

.md-dialog-actions {
  padding: 12px 22px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: #FFF;
  border-radius: 0 0 16px 16px;
  border-top: 1px solid var(--md-outline-variant, #BEC8C8) !important;
  flex-shrink: 0;
}

/* ============================================================
   v5 ADDITIONS — Form primitives inside dialogs
   ============================================================ */
.md-field { margin-bottom: 14px; }

.md-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #3F4849;
  margin-bottom: 5px;
}

.md-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #161D1D;
  background: #FFF;
  box-sizing: border-box;
}

.md-input:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .18);
}

.md-input.is-invalid {
  border-color: #BA1A1A;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, .12);
}

.md-field-hint { font-size: 10.5px; color: #6F7979; margin-top: 4px; }
.md-field-error { font-size: 10.5px; color: #BA1A1A; margin-top: 4px; display: none; }
.md-field.has-error .md-field-error { display: block; }

.md-radio-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.md-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--md-outline-variant);
  border-radius: 12px;
  cursor: pointer;
  background: #FFF;
}

.md-radio-card:hover { border-color: var(--md-primary); background: #F4FBFB; }
.md-radio-card.is-selected { border-color: var(--md-primary); background: #F4FBFB; }

.md-radio-card input[type="radio"] {
  accent-color: #00A5A7;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 2px 0 0 0;
}

.md-radio-card-body { flex: 1; min-width: 0; }
.md-radio-card-title { font-size: 13.5px; font-weight: 600; color: #002022; line-height: 1.3; }
.md-radio-card-sub { font-size: 11.5px; color: #6F7979; margin-top: 3px; line-height: 1.45; }
.md-radio-card.is-selected .md-radio-card-title { color: var(--md-primary); }

.md-restore-note {
  padding: 10px 14px;
  background: var(--md-warning-container);
  color: var(--md-on-warning-container);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.md-restore-note strong { color: #5C3400; }

/* ============================================================
   Restoration history table (dialog)
   ============================================================ */
#restore-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.md-ar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}

.md-ar-table th {
  text-align: left;
  padding: 8px 6px;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #6F7979;
  border-bottom: 1px solid #BEC8C8;
}

.md-ar-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #E3E9E9;
  vertical-align: top;
}

.md-ar-table tr:last-child td { border-bottom: none; }

.md-ar-table input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #BEC8C8;
  border-radius: 6px;
  font-family: inherit;
}

.md-ar-table input:disabled { background: #EEF5F5; opacity: .55; }
.md-ar-table input.is-invalid { border-color: #BA1A1A; }

.md-ar-table .col-filed { width: 90px; }
.md-ar-table .col-ref,
.md-ar-table .col-cust,
.md-ar-table .col-date { width: 130px; }

/* ============================================================
   v5 ADDITIONS — Step 3 summary
   ============================================================ */
.md-action-panel {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #E0F7FA 0%, #F4FBFB 100%);
  border: 1px dashed #80DEEA;
  border-radius: 14px;
}

.md-action-panel .md-btn { height: 48px; padding: 0 32px; font-size: 15px; }

.md-summary-list {
  margin-top: 16px;
  padding: 14px 16px;
  background: #F1F8E9;
  border: 1px solid #A5D6A7;
  border-radius: 10px;
}

.md-summary-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #2E7D32;
  margin-bottom: 8px;
}

.md-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12.5px;
  color: #052E16;
}

.md-summary-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  margin-top: 6px;
  border-top: 1px solid #A5D6A7;
  font-size: 14px;
  font-weight: 700;
  color: #052E16;
}

/* ============================================================
   v5 ADDITIONS — Mobile band override + locked variants
   ============================================================ */
.md-m-band.is-override { background: #F4FBFB; border-color: var(--md-primary); }

/* ============================================================
   v5.1 — DIALOG VISIBILITY & CONTRAST OVERRIDES
   ============================================================ */

/* 1) Danger button */
.md-btn--danger,
button.md-btn--danger,
input.md-btn--danger,
a.md-btn--danger,
.gform_wrapper .md-btn--danger,
.uaesa-cipc-wizard .md-btn--danger {
  background: #BA1A1A !important;
  background-color: #BA1A1A !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border: 1px solid #BA1A1A !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .08) !important;
}

.md-btn--danger:not(:disabled):hover,
button.md-btn--danger:not(:disabled):hover,
input.md-btn--danger:not(:disabled):hover,
a.md-btn--danger:not(:disabled):hover {
  background: #8B0F0F !important;
  background-color: #8B0F0F !important;
  border-color: #8B0F0F !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 4px 10px rgba(0, 0, 0, .10) !important;
}

.md-btn--danger:focus,
.md-btn--danger:focus-visible {
  outline: 2px solid #BA1A1A !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(186, 26, 26, .25) !important;
}

.md-btn--danger:disabled,
button.md-btn--danger:disabled,
input.md-btn--danger:disabled,
a.md-btn--danger:disabled {
  background: #BA1A1A !important;
  background-color: #BA1A1A !important;
  color: #FFFFFF !important;
  opacity: .45 !important;
  cursor: not-allowed !important;
}

/* 2) Dialog action buttons */
.md-dialog .md-btn {
  min-height: 40px;
  font-size: 14px;
  letter-spacing: .1px;
  font-family: inherit;
}

.md-dialog .md-btn--outlined {
  background: #F4FBFB !important;
  background-color: #F4FBFB !important;
  border: 1px solid #00A5A7 !important;
  color: #00696B !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 165, 167, .08) !important;
}

.md-dialog .md-btn--outlined:not(:disabled):hover {
  background: rgba(0, 165, 167, .14) !important;
  background-color: rgba(0, 165, 167, .14) !important;
  color: #00A5A7 !important;
  border-color: #00A5A7 !important;
}

.md-dialog .md-btn--filled {
  background: #00A5A7 !important;
  background-color: #00A5A7 !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .08) !important;
}

.md-dialog .md-btn--filled:not(:disabled):hover {
  background: #008B8D !important;
  background-color: #008B8D !important;
  color: #FFFFFF !important;
}

/* 3) Dialog header */
.md-dialog-title { color: #002022 !important; font-weight: 700 !important; }
.md-dialog-sub { color: #1F2A2A !important; font-weight: 500 !important; }

/* 4) Table in dialogs */
.md-dialog .md-table {
  border: 1px solid #6F7979;
  border-radius: 10px;
  overflow: hidden;
}

.md-dialog .md-table thead th {
  background: #DDE4E4 !important;
  color: #002022 !important;
  font-weight: 700 !important;
  letter-spacing: .5px;
  border-bottom: 2px solid #6F7979 !important;
}

.md-dialog .md-table tbody td {
  border-bottom: 1px solid #BEC8C8 !important;
  color: #002022 !important;
}

.md-dialog .md-table tbody tr:hover:not(.is-blocked) td { background: #F4FBFB !important; }
.md-dialog .md-table tbody tr.is-selected td { background: #CCE8E9 !important; }
.md-dialog .md-table tbody tr.is-filed td { background: rgba(220, 252, 231, .85) !important; }
.md-dialog .md-table tbody tr.is-blocked td {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 218, 214, .85) 0, rgba(255, 218, 214, .85) 8px,
    rgba(255, 255, 255, .85) 8px, rgba(255, 255, 255, .85) 16px
  ) !important;
  opacity: 1 !important;
}

/* 5) AR table (restoration dialog) */
.md-dialog .md-ar-table {
  border: 1px solid #6F7979;
  border-radius: 10px;
  overflow: hidden;
  background: #FFF;
}

.md-dialog .md-ar-table th {
  background: #DDE4E4 !important;
  color: #002022 !important;
  font-weight: 700 !important;
  padding: 10px 8px !important;
  border-bottom: 2px solid #6F7979 !important;
  letter-spacing: .5px;
}

.md-dialog .md-ar-table td {
  padding: 10px 8px !important;
  border-bottom: 1px solid #BEC8C8 !important;
  color: #002022 !important;
}

.md-dialog .md-ar-table tr:last-child td { border-bottom: none !important; }
.md-dialog .md-ar-table tr:hover td { background: #F4FBFB !important; }

.md-dialog .md-ar-table input {
  border: 1px solid #6F7979 !important;
  color: #002022 !important;
  background: #FFF !important;
  font-weight: 500 !important;
  min-height: 32px;
}

.md-dialog .md-ar-table input:focus {
  border-color: #00A5A7 !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .20) !important;
  outline: none !important;
}

.md-dialog .md-ar-table input:disabled {
  background: #F4FBFB !important;
  color: #4A6365 !important;
  opacity: 1 !important;
  border-color: #BEC8C8 !important;
  cursor: not-allowed !important;
}

.md-dialog .md-ar-table input.is-invalid {
  border-color: #BA1A1A !important;
  background: #FFFBFA !important;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, .15) !important;
}

.md-dialog .md-ar-table label { color: #002022 !important; font-weight: 500 !important; }

/* ============================================================
   v5.1.1 — Restoration Yes/No radios (compact)
   ============================================================ */
.md-dialog .md-ar-table td.col-filed { vertical-align: middle; }

.md-dialog .md-ar-table td.col-filed label {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  font-weight: 500 !important;
  color: #002022 !important;
  cursor: pointer;
  user-select: none;
}

.md-dialog .md-ar-table td.col-filed label:last-child { margin-bottom: 0 !important; }

.md-dialog .md-ar-table td.col-filed input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 14px;
  height: 14px;
  min-width: 14px; min-height: 14px;
  max-width: 14px; max-height: 14px;
  flex: 0 0 14px;
  padding: 0;
  margin: 0;
  border: 1.5px solid #6F7979 !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1;
  vertical-align: middle;
}

.md-dialog .md-ar-table td.col-filed input[type="radio"]:hover { border-color: #00A5A7 !important; }
.md-dialog .md-ar-table td.col-filed input[type="radio"]:checked { border-color: #00A5A7 !important; }

.md-dialog .md-ar-table td.col-filed input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00A5A7;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.md-dialog .md-ar-table td.col-filed input[type="radio"]:focus-visible {
  outline: 2px solid #00A5A7;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .25);
}

@media (min-width: 601px) {
  .md-dialog .md-ar-table .col-filed { width: 78px; }
}

/* 6) Radio cards (BO confirmation dialog) */
.md-dialog .md-radio-card {
  border: 2px solid #6F7979 !important;
  background: #FAFCFC !important;
}

.md-dialog .md-radio-card:hover {
  border-color: #00A5A7 !important;
  background: #F4FBFB !important;
}

.md-dialog .md-radio-card.is-selected {
  border-color: #00A5A7 !important;
  background: #F4FBFB !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .12) !important;
}

.md-dialog .md-radio-card-title { color: #002022 !important; font-weight: 700 !important; }
.md-dialog .md-radio-card.is-selected .md-radio-card-title { color: #00696B !important; }
.md-dialog .md-radio-card-sub { color: #2B3232 !important; }

/* 7) Inputs */
.md-dialog .md-input {
  border: 1px solid #6F7979 !important;
  color: #002022 !important;
  background: #FFF !important;
  font-weight: 500 !important;
}

.md-dialog .md-input:focus {
  border-color: #00A5A7 !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .20) !important;
  outline: none !important;
}

.md-dialog .md-input.is-invalid {
  border-color: #BA1A1A !important;
  background: #FFFBFA !important;
}

.md-dialog .md-field label { color: #002022 !important; font-weight: 700 !important; }
.md-dialog .md-field-hint { color: #2B3232 !important; font-weight: 500; }
.md-dialog .md-field-error { color: #BA1A1A !important; font-weight: 600; }

/* 8) Restore note (amber) */
.md-dialog .md-restore-note {
  background: #FFF3E0 !important;
  color: #5C3400 !important;
  border: 1px solid #F57C00 !important;
  font-weight: 500 !important;
}

.md-dialog .md-restore-note strong { color: #3D1F00 !important; font-weight: 700 !important; }

/* 9) Chips in dialogs */
.md-dialog .md-chip { font-weight: 700 !important; letter-spacing: .5px; }
.md-dialog .md-chip.ok   { background: #C8E6C9 !important; color: #1B5E20 !important; }
.md-dialog .md-chip.warn { background: #FFE0B2 !important; color: #7A3E00 !important; }
.md-dialog .md-chip.er   { background: #FFCDD2 !important; color: #8B0000 !important; }
.md-dialog .md-chip.neu  { background: #DDE4E4 !important; color: #1F2A2A !important; }

/* 10) Band select in dialogs */
.md-dialog .md-band-select {
  border: 1px solid #6F7979 !important;
  color: #002022 !important;
  font-weight: 600 !important;
  background-color: #FFF !important;
}

.md-dialog .md-band-select:hover,
.md-dialog .md-band-select:focus {
  border-color: #00A5A7 !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .18) !important;
}

.md-dialog .md-band-select.is-override {
  border-color: #00A5A7 !important;
  background-color: #E0F7FA !important;
  color: #00696B !important;
}

/* 11) Checkboxes in dialogs */
.md-dialog .md-check { border: 2px solid #4A6365 !important; background: #FFF !important; }
.md-dialog .md-check:checked { background: #00A5A7 !important; border-color: #00A5A7 !important; }

/* 12) Totals grid in year modal */
.md-dialog .md-totals { border: 1px solid #6F7979 !important; }
.md-dialog .md-total-cell { background: #FFF !important; }
.md-dialog .md-total-label { color: #2B3232 !important; font-weight: 700 !important; }
.md-dialog .md-total-value { color: #002022 !important; font-weight: 700 !important; }
.md-dialog .md-total-cell.pen .md-total-value { color: #8B0F0F !important; }
.md-dialog .md-total-cell.grand { background: #C8E6C9 !important; }
.md-dialog .md-total-cell.grand .md-total-value { color: #1B5E20 !important; }

/* 13) Text buttons (reset / select all / clear) */
.md-dialog .md-btn--text {
  color: #00696B !important;
  font-weight: 600 !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
}

.md-dialog .md-btn--text:not(:disabled):hover {
  background: rgba(0, 165, 167, .14) !important;
  color: #00A5A7 !important;
}

/* 14) Mobile dialog */
@media (max-width: 600px) {
  .md-dialog .md-btn { min-height: 44px; font-size: 14.5px; }
  .md-dialog-actions { gap: 10px; }
  .md-dialog-actions .md-btn { width: 100%; }

  .md-dialog .md-ar-table th.col-filed,
  .md-dialog .md-ar-table td.col-filed,
  .md-dialog .md-ar-table th.col-ref,
  .md-dialog .md-ar-table td.col-ref,
  .md-dialog .md-ar-table th.col-cust,
  .md-dialog .md-ar-table td.col-cust,
  .md-dialog .md-ar-table th.col-date,
  .md-dialog .md-ar-table td.col-date { width: auto !important; }

  .md-dialog .md-ar-table input { min-width: 0; font-size: 12px; }
  .md-dialog .md-ar-table th,
  .md-dialog .md-ar-table td { padding: 8px 6px !important; font-size: 11.5px; }
}

/* ============================================================
   v5.2 — CONFLICT HARDENING
   ============================================================ */
.gform_wrapper { position: static !important; }
.gform_fields { position: static !important; }
.gfield_type_uaesa_cipc_ar_selector,
.uaesa-cipc-wizard { position: relative !important; }

.dash { color: inherit; }

.md-dialog-head .ic {
  background: var(--md-primary-container, #6FF6FE) !important;
  color: var(--md-on-primary-container, #002022) !important;
}

.md-dialog-actions { border-top: 1px solid var(--md-outline-variant, #BEC8C8) !important; }

/* ============================================================
   v5.3 — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   v6 — Question panel, record-AR dialog, restore info
   ============================================================ */
.md-question-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #E0F7FA 0%, #F4FBFB 100%);
  border: 1px dashed #80DEEA;
  border-radius: 12px;
  margin-bottom: 16px;
}

.md-question-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--md-primary-container, #6FF6FE);
  color: var(--md-on-primary-container, #002022);
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-question-icon svg { width: 24px; height: 24px; }
.md-question-body { flex: 1; min-width: 200px; }

.md-question-title {
  font-size: 15px;
  font-weight: 600;
  color: #002022;
  margin: 0 0 4px;
  line-height: 1.35;
}

.md-question-sub {
  font-size: 12.5px;
  color: #3F4849;
  margin: 0;
  line-height: 1.5;
}

.md-question-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.md-question-actions .md-btn { flex: 1 1 200px; }

@media (max-width: 600px) {
  .md-question-panel { padding: 14px; gap: 10px; }
  .md-question-icon { width: 38px; height: 38px; }
  .md-question-icon svg { width: 20px; height: 20px; }
  .md-question-title { font-size: 14px; }
  .md-question-sub { font-size: 11.5px; }
  .md-question-actions { flex-direction: column; }
  .md-question-actions .md-btn { flex: 1 1 auto; width: 100%; }
}

/* Restore dialog — informational body */
.md-restore-info {
  font-size: 12px;
  color: #3F4849;
  line-height: 1.55;
  padding: 12px 14px;
  background: #F4FBFB;
  border: 1px solid var(--md-outline-variant, #BEC8C8);
  border-radius: 8px;
}

.md-restore-info p { margin: 0; }

.md-dialog .md-restore-info {
  background: #F4FBFB !important;
  color: #1F2A2A !important;
  border: 1px solid #6F7979 !important;
  font-weight: 500 !important;
}

/* Record-AR dialog — intro note + tables */
.md-record-note {
  padding: 10px 14px;
  background: #E0F7FA;
  color: #00454A;
  border: 1px solid #80DEEA;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.md-record-note strong { color: #002F32; }

#record-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

#record-table-wrap .md-ar-table {
  border: 1px solid #6F7979;
  border-radius: 10px;
  overflow: hidden;
  background: #FFF;
  border-collapse: separate;
  border-spacing: 0;
}

#record-table-wrap .md-ar-table th {
  background: #DDE4E4 !important;
  color: #002022 !important;
  font-weight: 700 !important;
  padding: 10px 8px !important;
  border-bottom: 2px solid #6F7979 !important;
  letter-spacing: .5px;
  font-size: 10.5px;
}

#record-table-wrap .md-ar-table td {
  padding: 9px 8px !important;
  border-bottom: 1px solid #BEC8C8 !important;
  color: #002022 !important;
}

#record-table-wrap .md-ar-table tr:last-child td { border-bottom: none !important; }
#record-table-wrap .md-ar-table tr:hover td { background: #F4FBFB !important; }
#record-table-wrap .md-ar-table td:first-child { white-space: nowrap; }

#record-table-wrap .md-ar-table input {
  width: 100%;
  padding: 7px 9px;
  font-size: 12.5px;
  min-height: 34px;
  border: 1px solid #6F7979 !important;
  border-radius: 6px;
  font-family: inherit;
  color: #002022 !important;
  background: #FFF !important;
  font-weight: 500 !important;
  box-sizing: border-box;
}

#record-table-wrap .md-ar-table input:focus {
  border-color: #00A5A7 !important;
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .20) !important;
  outline: none !important;
}

#record-table-wrap .md-ar-table input.is-invalid {
  border-color: #BA1A1A !important;
  background: #FFFBFA !important;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, .15) !important;
}

@media (max-width: 600px) {
  #record-table-wrap .md-ar-table th,
  #record-table-wrap .md-ar-table td {
    padding: 8px 6px !important;
    font-size: 11.5px;
  }
  #record-table-wrap .md-ar-table input {
    padding: 6px 8px;
    font-size: 12px;
    min-height: 32px;
  }
  .md-record-note { font-size: 11px; padding: 9px 12px; }
}

/* ============================================================
   v6.2 — Pre-flight "Confirm & Sign" card
   (legacy — kept for backwards compatibility; the current
   5-step wizard renders the sub-stepper inside step 4)
   ============================================================ */
.md-preflight-card {
  background: #fff;
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.md-preflight-card.done {
  background: linear-gradient(135deg, #F1F8E9 0%, #FAFDF5 100%);
  border-color: #A5D6A7;
}

.md-preflight-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #002022;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.md-preflight-title svg {
  width: 18px;
  height: 18px;
  color: var(--md-primary);
}

.md-preflight-card.done .md-preflight-title svg { color: #2E7D32; }

.md-preflight-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid #EEF5F5;
}

.md-preflight-row:first-of-type { border-top: none; padding-top: 0; }
.md-preflight-row:last-child { padding-bottom: 0; }

.md-preflight-row-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EEF5F5;
  color: #6F7979;
}

.md-preflight-row.done .md-preflight-row-icon {
  background: #DCFCE7;
  color: #2E7D32;
}

.md-preflight-row-icon svg { width: 22px; height: 22px; }
.md-preflight-row-meta { flex: 1; min-width: 0; }

.md-preflight-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #002022;
  line-height: 1.3;
}

.md-preflight-row-sub {
  font-size: 12px;
  color: #6F7979;
  line-height: 1.4;
  margin-top: 2px;
}

.md-preflight-row-sub strong { color: #052E16; }

.md-preflight-row-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.md-preflight-row-status.pending { background: #FFF3E0; color: #7A3E00; }
.md-preflight-row-status.done    { background: #DCFCE7; color: #052E16; }

.md-preflight-row-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.md-preflight-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.md-preflight-footer {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 165, 167, .08);
  border: 1px dashed #80DEEA;
  border-radius: 8px;
  font-size: 12px;
  color: #00454A;
  line-height: 1.5;
}

.md-preflight-card.done .md-preflight-footer {
  background: rgba(46, 125, 50, .08);
  border-color: #A5D6A7;
  color: #052E16;
}

@media (max-width: 640px) {
  .md-preflight-row { flex-wrap: wrap; gap: 10px; }
  .md-preflight-row-actions { width: 100%; margin-left: 56px; }
  .md-preflight-row-actions .md-btn { flex: 1; width: 100%; }
}

/* ============================================================
   v6.8 — Confirm & Sign sub-stepper
   (Terms → Signature → Ready)
   ============================================================ */
.md-substep-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0 0 20px;
  padding: 0 8px;
}

.md-substep {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
  min-width: 0;
}

.md-substep:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: #E5EAEA;
  z-index: 0;
  border-radius: 1px;
  transition: background .25s;
}

.md-substep.done:not(:last-child)::after {
  background: #00A5A7;
}

.md-substep-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E5EAEA;
  color: #6F7979;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: all .25s;
  line-height: 1;
  flex-shrink: 0;
}

.md-substep-dot svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.md-substep.active .md-substep-dot {
  background: #00A5A7;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 165, 167, .15);
}

.md-substep.done .md-substep-dot {
  background: #00A5A7;
  color: #fff;
}

.md-substep-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #6F7979;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-substep.active .md-substep-label { color: #00A5A7; }
.md-substep.done   .md-substep-label { color: #002022; }

.md-substep-body {
  border-top: 1px solid #EEF5F5;
  padding-top: 16px;
}

.md-substep-content-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.md-substep-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EEF5F5;
  color: #6F7979;
}

.md-substep-icon.done {
  background: #DCFCE7;
  color: #2E7D32;
}

.md-substep-icon svg {
  width: 22px;
  height: 22px;
}

.md-substep-meta {
  flex: 1;
  min-width: 200px;
}

.md-substep-title {
  font-size: 14px;
  font-weight: 600;
  color: #002022;
  line-height: 1.3;
}

.md-substep-sub {
  font-size: 12px;
  color: #6F7979;
  line-height: 1.4;
  margin-top: 3px;
}

.md-substep-sub strong { color: #052E16; }

.md-substep-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.md-substep-progress-footer {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(0, 165, 167, .08);
  border: 1px dashed #80DEEA;
  border-radius: 8px;
  font-size: 12px;
  color: #00454A;
  line-height: 1.5;
}

.md-substep-progress-footer.all-done {
  background: rgba(46, 125, 50, .08);
  border-color: #A5D6A7;
  color: #052E16;
}

@media (max-width: 640px) {
  .md-substep-label { font-size: 9.5px; }
  .md-substep-actions {
    width: 100%;
    margin-top: 6px;
  }
  .md-substep-actions .md-btn { flex: 1; }
}

/* ============================================================
   v6.9 — Question-mark popover trigger icon
   The `.md-card-pop-wrap` class is now applied to a small
   `?` icon instead of the entire card. Only the icon opens
   the popover; the card body is inert.
   ============================================================ */
.md-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--md-surface-container-highest);
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  user-select: none;
  transition: background .15s, color .15s, box-shadow .15s;
  font-family: inherit;
}

.md-help-icon:hover,
.md-help-icon:focus-visible {
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .20);
  outline: none;
}

/* Floating variant — pinned to the top-right corner of a card/banner */
.md-help-icon--float {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

/* Parent helper — establishes the positioning context and makes room
   for the floating `?` icon so it never overlaps the header text */
.has-help {
  position: relative;
}

.md-card.has-help > .md-card-header {
  padding-right: 44px;
}

.md-banner.has-help {
  padding-right: 46px;
}

/* When the `?` icon is inline (BO cards), no extra padding is needed —
   it simply sits at the end of the row after the button/badge */
.md-bo-card .md-help-icon {
  margin-left: 4px;
}

/* Small screens — nudge the floating icon slightly inward so it
   doesn't crowd the card header */
@media (max-width: 600px) {
  .md-help-icon--float {
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .md-card.has-help > .md-card-header {
    padding-right: 38px;
  }
  .md-banner.has-help {
    padding-right: 40px;
  }
}

/* ============================================================
   v7.0 — INLINE UAESA SIGNATURE SELECTOR (Step 4)
   Replaces the dead "Add Signature" button. Hover-to-preview
   popover, saved-signatures menu, inline error card.
   ============================================================ */

/* --- Wrap inside the sub-step --- */
.sig-substep-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.sig-substep-helper {
  font-size: 11.5px;
  color: var(--md-on-surface-variant);
  padding: 9px 12px;
  background: var(--md-surface-container-low);
  border: 1px solid var(--md-outline-variant);
  border-radius: 8px;
  line-height: 1.55;
}

.sig-substep-helper strong {
  color: var(--md-on-surface);
  font-weight: 600;
}

/* --- Selector wrap --- */
.uaesa-cipc-ar-sig-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  position: relative;
}

/* --- Trigger --- */
.uaesa-cipc-ar-sig-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
  background: var(--md-surface-container-lowest);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  user-select: none;
  position: relative;
}

.uaesa-cipc-ar-sig-trigger:hover {
  border-color: var(--md-primary);
  background: #F4FBFB;
  box-shadow: 0 2px 8px rgba(0, 165, 167, .10);
}

.uaesa-cipc-ar-sig-trigger:focus {
  outline: none;
}

.uaesa-cipc-ar-sig-trigger:focus-visible {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(0, 165, 167, .25);
}

.uaesa-cipc-ar-sig-trigger[data-state="captured"] {
  border-color: #A5D6A7;
  background: #F1F8E9;
}

.uaesa-cipc-ar-sig-trigger[data-state="captured"]:hover {
  background: #E8F5E9;
  box-shadow: 0 2px 8px rgba(46, 125, 50, .12);
}

.uaesa-cipc-ar-sig-trigger[data-state="empty"] {
  border-style: dashed;
}

.uaesa-cipc-ar-sig-trigger[data-state="empty"]:hover {
  border-style: solid;
}

/* --- Thumbnail --- */
.uaesa-cipc-ar-sig-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.uaesa-cipc-ar-sig-thumb svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.uaesa-cipc-ar-sig-thumb.is-captured {
  background: #fff;
  border: 1px solid #A5D6A7;
  padding: 4px;
}

.uaesa-cipc-ar-sig-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --- Meta --- */
.uaesa-cipc-ar-sig-meta {
  flex: 1;
  min-width: 0;
}

.uaesa-cipc-ar-sig-title {
  font-size: 14px;
  font-weight: 600;
  color: #002022;
  line-height: 1.25;
}

.uaesa-cipc-ar-sig-sub {
  font-size: 12px;
  color: var(--md-on-surface-variant);
  margin-top: 3px;
  line-height: 1.4;
}

.uaesa-cipc-ar-sig-sub strong {
  color: #052E16;
}

/* --- Chip --- */
.uaesa-cipc-ar-sig-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.uaesa-cipc-ar-sig-chip.ok {
  background: var(--md-success-container);
  color: var(--md-on-success-container);
}

.uaesa-cipc-ar-sig-chip.empty {
  background: var(--md-warning-container);
  color: var(--md-on-warning-container);
}

.uaesa-cipc-ar-sig-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: uaesaCipcSigPulse 1.8s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes uaesaCipcSigPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}

/* --- Arrow --- */
.uaesa-cipc-ar-sig-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--md-outline);
  transition: transform .2s;
}

.uaesa-cipc-ar-sig-trigger.is-open .uaesa-cipc-ar-sig-arrow {
  transform: rotate(180deg);
}

/* --- Dropdown menu --- */
.uaesa-cipc-ar-sig-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--md-outline-variant);
  border-radius: 12px;
  box-shadow: var(--md-elev-3);
  z-index: 40;
  overflow: hidden;
  display: none;
}

.uaesa-cipc-ar-sig-trigger.is-open + .uaesa-cipc-ar-sig-menu {
  display: block;
  animation: uaesaCipcSigMenuIn .16s cubic-bezier(.4, 0, .2, 1);
}

@keyframes uaesaCipcSigMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.uaesa-cipc-ar-sig-menu-head {
  padding: 10px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .55px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  background: var(--md-surface-container-low);
  border-bottom: 1px solid var(--md-outline-variant);
}

.uaesa-cipc-ar-sig-menu-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
}

.uaesa-cipc-ar-sig-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  outline: none;
}

.uaesa-cipc-ar-sig-menu-item:hover,
.uaesa-cipc-ar-sig-menu-item:focus {
  background: rgba(0, 165, 167, .07);
}

.uaesa-cipc-ar-sig-menu-item.is-selected {
  background: var(--md-secondary-container);
}

.uaesa-cipc-ar-sig-menu-thumb {
  width: 64px;
  height: 38px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--md-outline-variant);
  border-radius: 6px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.uaesa-cipc-ar-sig-menu-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.uaesa-cipc-ar-sig-menu-meta {
  flex: 1;
  min-width: 0;
}

.uaesa-cipc-ar-sig-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: #002022;
}

.uaesa-cipc-ar-sig-menu-sub {
  font-size: 11px;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
}

.uaesa-cipc-ar-sig-menu-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--md-primary);
  opacity: 0;
  transition: opacity .15s;
}

.uaesa-cipc-ar-sig-menu-item.is-selected .uaesa-cipc-ar-sig-menu-check {
  opacity: 1;
}

.uaesa-cipc-ar-sig-menu-divider {
  height: 1px;
  background: var(--md-outline-variant);
  margin: 6px 0;
}

.uaesa-cipc-ar-sig-menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--md-primary);
  transition: background .12s;
  outline: none;
}

.uaesa-cipc-ar-sig-menu-action:hover,
.uaesa-cipc-ar-sig-menu-action:focus {
  background: rgba(0, 165, 167, .07);
}

.uaesa-cipc-ar-sig-menu-action svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Inline error card (replaces silent snackbars) --- */
.uaesa-cipc-ar-sig-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--md-error-container);
  color: var(--md-on-error-container);
  border: 1px solid #F87171;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.uaesa-cipc-ar-sig-error strong {
  color: #6B0000;
  font-weight: 700;
}

/* --- Hover preview popover (portalled to <body>) --- */
.uaesa-cipc-ar-sig-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483600;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid rgba(0, 32, 34, .08);
  border-radius: 16px;
  padding: 18px;
  box-shadow:
    0 24px 48px -14px rgba(0, 32, 34, .26),
    0 10px 20px -10px rgba(0, 32, 34, .16),
    0 0 0 1px rgba(255, 255, 255, .6) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(.96);
  transition:
    opacity .18s cubic-bezier(.4, 0, .2, 1),
    transform .22s cubic-bezier(.34, 1.4, .64, 1),
    visibility 0s linear .18s;
}

.uaesa-cipc-ar-sig-preview.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s, 0s, 0s;
}

.uaesa-cipc-ar-sig-preview-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
  pointer-events: none;
}

.uaesa-cipc-ar-sig-preview[data-placement="top"] > .uaesa-cipc-ar-sig-preview-arrow {
  bottom: -7px;
  border-right: 1px solid rgba(0, 32, 34, .08);
  border-bottom: 1px solid rgba(0, 32, 34, .08);
}

.uaesa-cipc-ar-sig-preview[data-placement="bottom"] > .uaesa-cipc-ar-sig-preview-arrow {
  top: -7px;
  border-left: 1px solid rgba(0, 32, 34, .08);
  border-top: 1px solid rgba(0, 32, 34, .08);
}

.uaesa-cipc-ar-sig-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.uaesa-cipc-ar-sig-preview-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
}

.uaesa-cipc-ar-sig-preview-icon svg {
  width: 20px;
  height: 20px;
}

.uaesa-cipc-ar-sig-preview-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #002022;
}

.uaesa-cipc-ar-sig-preview-sub {
  font-size: 11.5px;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
}

.uaesa-cipc-ar-sig-preview-canvas {
  background: #fff;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  padding: 16px 20px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    linear-gradient(rgba(0, 165, 167, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 165, 167, .06) 1px, transparent 1px);
  background-size: 20px 20px;
}

.uaesa-cipc-ar-sig-preview-canvas img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  display: block;
}

.uaesa-cipc-ar-sig-preview-canvas .empty {
  color: var(--md-on-surface-variant);
  font-size: 12.5px;
  font-style: italic;
}

.uaesa-cipc-ar-sig-preview-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--md-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
}

.uaesa-cipc-ar-sig-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .4px;
}

.uaesa-cipc-ar-sig-preview-badge.ok {
  background: var(--md-success-container);
  color: var(--md-on-success-container);
}

.uaesa-cipc-ar-sig-preview-badge.empty {
  background: var(--md-warning-container);
  color: var(--md-on-warning-container);
}

.uaesa-cipc-ar-sig-preview-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .uaesa-cipc-ar-sig-trigger {
    flex-wrap: wrap;
    gap: 10px;
  }
  .uaesa-cipc-ar-sig-meta {
    flex: 1 1 140px;
    min-width: 0;
  }
  .uaesa-cipc-ar-sig-preview {
    width: calc(100vw - 24px);
  }
  .uaesa-cipc-ar-sig-menu-thumb {
    width: 52px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uaesa-cipc-ar-sig-preview,
  .uaesa-cipc-ar-sig-trigger,
  .uaesa-cipc-ar-sig-chip .dot,
  .uaesa-cipc-ar-sig-menu {
    transition: none;
    animation: none;
  }
}

/* ============================================================
   COIDA-SPECIFIC ADDITIONS
   ============================================================ */
/* UAESA COIDA Return of Earnings — scoped additions to the shared CIPC AR UI. */
.gfield_type_uaesa_coida_roe { position: relative !important; }
.uaesa-coida-field-container { width: 100%; }
.uaesa-coida-field-shell { position: relative; width: 100%; color: var(--md-on-surface, #202124); overflow: visible; }
.uaesa-coida-enterprise-picker { position: relative; z-index: 100600; width: 100%; max-width: 720px; margin: 0 0 12px; overflow: visible; }
.uaesa-coida-enterprise-field { width: 100%; }
.uaesa-coida-enterprise-message { margin: 8px 0 16px; color: var(--md-on-surface-variant, #5f6368); font-size: 13px; line-height: 1.5; }
.uaesa-coida-wizard { width: 100%; min-width: 0; clear: both; }
.uaesa-coida-card { overflow: visible; }
.uaesa-coida-card__header { /* Visual shell comes from the shared CIPC .md-card-header rules. */ }
.uaesa-coida-card__icon { font-size: 20px; }


.uaesa-coida-card__body { padding: 0; min-width: 0; }
.uaesa-coida-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.uaesa-coida-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.uaesa-coida-field--full { grid-column: 1 / -1; }
.uaesa-coida-field > label { display: block; margin: 0; color: var(--md-on-surface, #303134); font-size: 13px; line-height: 1.4; font-weight: 600; }
.uaesa-coida-field .required { color: #b3261e; }
.uaesa-coida-field .md-input,
.uaesa-coida-field input.md-input,
.uaesa-coida-field textarea.md-input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--md-outline, #79747e); border-radius: 6px; background: var(--md-surface, #fff); color: var(--md-on-surface, #202124); font: inherit; font-size: 14px; line-height: 1.4; box-shadow: none; }
.uaesa-coida-field textarea.md-input { min-height: 78px; resize: vertical; }
.uaesa-coida-field .md-input:focus { outline: 2px solid var(--md-primary, #00a5a7); outline-offset: 1px; border-color: transparent; }
.uaesa-coida-period-banner { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; padding: 14px 16px; border-radius: 8px; background: var(--md-surface-container, #f4f5f6); color: var(--md-on-surface-variant, #5f6368); font-size: 13px; }
.uaesa-coida-period-banner strong { flex-basis: 100%; color: var(--md-on-surface, #202124); }
.uaesa-coida-help { margin: 0 0 14px; color: var(--md-on-surface-variant, #5f6368); font-size: 13px; line-height: 1.55; }
.uaesa-coida-alert { margin: 14px 0; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.uaesa-coida-alert--info { color: #174ea6; background: #e8f0fe; border: 1px solid #d2e3fc; }
.uaesa-coida-alert--warning { color: #7a4b00; background: #fef7e0; border: 1px solid #fce8b2; }
.uaesa-coida-alert--success { color: #137333; background: #e6f4ea; border: 1px solid #ceead6; }
.uaesa-coida-error { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #f2b8b5; border-left: 4px solid #b3261e; border-radius: 6px; color: #8c1d18; background: #fce8e6; font-size: 13px; }
.uaesa-coida-table-wrap { max-width: 100%; overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--md-outline-variant, #dadce0); border-radius: 8px; }
.uaesa-coida-month-table { width: 100%; min-width: 820px; border-collapse: collapse; background: var(--md-surface, #fff); }
.uaesa-coida-month-table th,
.uaesa-coida-month-table td { padding: 8px 9px; border-bottom: 1px solid var(--md-outline-variant, #e0e0e0); text-align: left; vertical-align: middle; font-size: 12px; }
.uaesa-coida-month-table thead th { color: var(--md-on-surface, #202124); background: var(--md-surface-container, #f1f3f4); font-weight: 650; }
.uaesa-coida-month-table tbody th { width: 58px; color: var(--md-on-surface, #202124); background: var(--md-surface-container-low, #fafafa); font-weight: 650; }
.uaesa-coida-month-table input { box-sizing: border-box; width: 100%; min-width: 90px; height: 36px; padding: 6px 8px; border: 1px solid var(--md-outline, #79747e); border-radius: 5px; color: var(--md-on-surface, #202124); background: var(--md-surface, #fff); font-size: 13px; }
.uaesa-coida-month-table input:focus { outline: 2px solid var(--md-primary, #00a5a7); outline-offset: 1px; }
.uaesa-coida-grid--totals { margin-top: 12px; }
.uaesa-coida-total-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: var(--md-surface-container, #f4f5f6); color: var(--md-on-surface-variant, #5f6368); font-size: 13px; }
.uaesa-coida-total-banner strong { color: var(--md-on-surface, #202124); }
.uaesa-coida-words { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--md-outline, #79747e); border-radius: 7px; color: var(--md-on-surface-variant, #5f6368); font-size: 13px; }
.uaesa-coida-words strong { color: var(--md-on-surface, #202124); text-transform: capitalize; }
.uaesa-coida-variance { margin-top: 10px; }
.uaesa-coida-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; color: var(--md-on-surface, #303134); font-size: 13px; line-height: 1.5; cursor: pointer; }
.uaesa-coida-check input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--md-primary, #00a5a7); }
.uaesa-coida-divider { margin: 18px 0; border: 0; border-top: 1px solid var(--md-outline-variant, #dadce0); }
.uaesa-coida-uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.uaesa-coida-upload { display: flex; min-width: 0; flex-direction: column; gap: 7px; padding: 14px; border: 1px solid var(--md-outline-variant, #dadce0); border-radius: 8px; }
.uaesa-coida-upload label { display: flex; flex-direction: column; gap: 8px; color: var(--md-on-surface, #303134); font-size: 13px; font-weight: 600; }
.uaesa-coida-upload input[type="file"] { width: 100%; font-size: 12px; font-weight: 400; }
.uaesa-coida-upload small { color: var(--md-on-surface-variant, #5f6368); font-size: 11px; }
.uaesa-coida-upload-status { min-height: 18px; color: var(--md-primary, #008b8d); font-size: 12px; overflow-wrap: anywhere; }
.uaesa-coida-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uaesa-coida-review-cell { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 12px; border: 1px solid var(--md-outline-variant, #dadce0); border-radius: 7px; }
.uaesa-coida-review-cell small { color: var(--md-on-surface-variant, #5f6368); font-size: 11px; }
.uaesa-coida-review-cell strong { color: var(--md-on-surface, #202124); font-size: 13px; overflow-wrap: anywhere; }
.uaesa-coida-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.uaesa-coida-actions .spacer { flex: 1 1 auto; }
.uaesa-coida-dropdown { overflow: visible; }
.uaesa-coida-dropdown.is-focused { z-index: 100650; }
.uaesa-coida-dropdown .md-menu.open { z-index: 100700; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.uaesa-coida-menu-empty { padding: 12px 16px; color: var(--md-on-surface-variant, #5f6368); font-size: 13px; list-style: none; }
.uaesa-coida-field-shell .md-field-outlined__trigger { cursor: pointer; }
.uaesa-coida-field-shell .md-field-outlined__trigger:focus-visible { outline: 2px solid var(--md-primary, #00a5a7); outline-offset: 2px; }
.uaesa-coida-field-shell .md-menu li[data-value] { cursor: pointer; }
.uaesa-coida-field-shell .md-menu li[data-value]:focus { outline: 2px solid var(--md-primary, #00a5a7); outline-offset: -2px; }
@media (max-width: 782px) {


    .uaesa-coida-grid,
    .uaesa-coida-uploads,
    .uaesa-coida-review-grid { grid-template-columns: minmax(0, 1fr); }
    .uaesa-coida-field--full { grid-column: auto; }
    .uaesa-coida-period-banner { flex-direction: column; gap: 7px; }
    .uaesa-coida-actions { align-items: stretch; }
    .uaesa-coida-actions .md-btn { min-height: 42px; }
}
@media (max-width: 480px) {


    .uaesa-coida-total-banner { flex-direction: column; }
}

/* COIDA front-end dropdown hardening: preserve the CIPC menu presentation. */
.gfield_type_uaesa_coida_roe,
.gfield_type_uaesa_coida_roe .ginput_container,
.uaesa-coida-field-container,
.uaesa-coida-field-shell,
.uaesa-coida-enterprise-picker,
.uaesa-coida-enterprise-field,
.uaesa-coida-enterprise-field .md-field-outlined__container {
  overflow: visible !important;
}
.uaesa-coida-enterprise-picker,
.uaesa-coida-enterprise-field.is-focused { position: relative !important; z-index: 100600 !important; }
.uaesa-coida-enterprise-field .md-menu.open {
  display: block !important;
  z-index: 100700 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* v1.0.3 — compact auto-filled employer confirmation (additive only). */
.uaesa-coida-autofill-summary{margin-bottom:14px}
.uaesa-coida-missing{margin-top:16px;padding-top:14px;border-top:1px solid var(--md-sys-color-outline-variant,#ddd)}
.uaesa-coida-missing h4{margin:0 0 12px;font-size:14px}
.uaesa-coida-director-summary{margin:12px 0;padding:12px 14px;border-radius:12px;background:var(--md-sys-color-surface-container-low,#f7f7f7)}
