﻿/* =========================================================
   PageStylesShared.css
   Reusable page-level primitives
   ---------------------------------------------------------
   Scope:
   - Shared page spacing / workspace rhythm

   Notes:
   - Keep this file limited to reusable page patterns.
   - Do not place page-specific grid layouts or table layouts here.
   ========================================================= */


/* =========================================================
   Page that needs a scoped height/overflow host so the table region can own
   its internal scroll and keep the pager anchored above the footer.

   Example: This is defined in Products.razor.css instead of ProductsShared.razor.css
   because the .products-page-host class is applied in Products.razor, and
   Blazor CSS isolation only affects markup rendered by the matching component.
   ========================================================= */
.page-host-fill {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 5px;
}

  .page-host-fill > * {
    flex: 1 1 auto;
    min-height: 0;
  }

/* Transaction Context Header */
/* ---------------------------------------------------------
   Reusable compact business context and workflow summary.
   A navy top border anchors the header without increasing
   page scrolling or affecting anchored table pagination.
   --------------------------------------------------------- */

.transaction-context-header {
    flex: 0 0 auto;
    display: grid;
    align-items: stretch;
    min-width: 0;
    min-height: 32px;
    overflow: hidden;
    border: 1px solid rgba(29, 58, 109, 0.20);
    border-top: 2px solid var(--wam-honest-blue, #1D3A6D);
    border-radius: 10px;
    background: linear-gradient(90deg, #fff 50%, #f8fbff 100%);
    box-shadow: 0 2px 7px rgba(25, 35, 68, 0.07);
}

.transaction-context-header__cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 9px;
    overflow: hidden;
}

    .transaction-context-header__cell + .transaction-context-header__cell {
        border-left: 1px solid rgba(29, 58, 109, 0.14);
    }

.transaction-context-header__identity-line,
.transaction-context-header__cycle-line,
.transaction-context-header__value-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.transaction-context-header__manufacturer {
    flex: 0 1 auto;
    max-width: 110px;
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__identity-icon {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 11px;
    line-height: 1;
}

.transaction-context-header__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--text-900, #192344);
    font-size: 12.5px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__type {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 999px;
    background: #eaf1ff;
    color: #1d4ed8;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
}

.transaction-context-header__book {
    flex: 0 0 auto;
    color: mediumseagreen;
    font-size: 12px;
    line-height: 1;
}

.transaction-context-header__cycle-name {
    min-width: 0;
    overflow: hidden;
    color: mediumseagreen;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__period,
.transaction-context-header__reference {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
}

/* Review Summary Field Labels */
/* ---------------------------------------------------------
   Standardizes compact review labels across Promotion and
   Distributor Pricing without increasing banner height.
   --------------------------------------------------------- */

.latest-review-strip-field-label {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* Context Header Stage Information */
/* ---------------------------------------------------------
   Aligns the stage label and status help icon without
   increasing the compact header's vertical height.
   --------------------------------------------------------- */

.transaction-context-header__stage-heading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.transaction-context-header__label {
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    white-space: nowrap;
}

.transaction-context-header__value {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--text-900, #192344);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__secondary {
    min-width: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__value-row {
    gap: 8px;
}

.transaction-context-header__date {
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-size: 10.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context-header__action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

    .transaction-context-header__action:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

    .transaction-context-header__action:focus-visible {
        outline: 2px solid rgba(37, 99, 235, 0.35);
        outline-offset: 2px;
        border-radius: 2px;
    }

/* Shared Table Loading Overlay */
/* ---------------------------------------------------------
   Centers loading indicators over table content while keeping
   filters and anchored pagination in their existing positions.
   Intended for relatively positioned table scroll containers.
   --------------------------------------------------------- */

.page-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
}

/* =====================================
   Unsaved Changes Guard Modal
   ---------------------------------------------------------
   Shared modal used by edit/create pages to protect unsaved
   form data during internal navigation. The modal stays compact,
   centered, and visually consistent with the enterprise shell.
   ===================================== */

.unsaved-guard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.unsaved-guard-shell {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.unsaved-guard-card {
  width: min(520px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.unsaved-guard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.unsaved-guard-title {
  margin: 0;
  color: #0f2344;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.unsaved-guard-subtitle {
  margin: 6px 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.35;
}

.unsaved-guard-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
}

  .unsaved-guard-close:hover:not(:disabled) {
    background: #e2e8f0;
  }

  .unsaved-guard-close:disabled {
    opacity: 0.55;
  }

.unsaved-guard-body {
  padding: 18px 22px;
}

.unsaved-guard-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 12px;
  background: #fffbeb;
  color: #7c4a03;
  font-size: 0.88rem;
  line-height: 1.35;
}

  .unsaved-guard-alert .bi {
    margin-top: 1px;
    color: #b45309;
  }

.unsaved-guard-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
}

/* =====================================
   Unsaved Modal Close Guard Layer
   ---------------------------------------------------------
   Keeps modal-close confirmation prompts above nested modal
   shells such as Product Image Asset editors.
   ===================================== */

.unsaved-modal-close-guard-backdrop {
  z-index: 12990;
}

.unsaved-modal-close-guard-shell {
  z-index: 13000;
}


