/* --- CORE STYLES --- */
:root { 
    --bg:#f5f6f8; --card:#ffffff; --primary:#1f2937; --accent:#0ea5e9;
    --muted:#6b7280; --border:#e5e7eb; --danger: #ef4444; --success: #10b981; 
    --gold-text: #b45309; --silver-text: #475569; --plat-text: #0891b2; --pal-text: #4f46e5;
    --zebra-bg: #eff6ff; --custBtn-bg: #FAFAD2;
}
.field-error{
  color:#dc2626;
  font-size:.85rem;
  font-weight:600;
  margin-top:4px;
  line-height:1.25;
}
* { box-sizing:border-box; font-family:system-ui,-apple-system,sans-serif; }
html,
body,
button,
input,
select,
textarea{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
body { background:var(--bg); color:var(--primary); margin:0; }
/* C3: stable text sizing through tablet rotation; native page zoom stays enabled. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }

/*
  Phase 4.7B.2.R5.R3 — shared foreground database-write visibility.
  This non-focus-taking status layer blocks repeat operator submission while the
  shared request controller owns at least one foreground SQLapi POST.
*/
.mv-write-processing[hidden]{
  display:none !important;
}

.mv-write-processing{
  position:fixed;
  inset:0;
  z-index:2147483000;
  display:grid;
  place-items:start center;
  padding:
    max(14px,env(safe-area-inset-top))
    max(14px,env(safe-area-inset-right))
    max(14px,env(safe-area-inset-bottom))
    max(14px,env(safe-area-inset-left));
  pointer-events:auto;
  touch-action:none;
  overscroll-behavior:contain;
  cursor:progress;
}

.mv-write-processing__scrim{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.14);
  backdrop-filter:blur(1px);
  -webkit-backdrop-filter:blur(1px);
}

/* A completed request can keep its brief status acknowledgment visible without
   intercepting the next pointer action. A new pending lease removes this state. */
.mv-write-processing[data-mv-write-settling="1"],
.mv-write-processing[data-mv-write-settling="1"] *{
  pointer-events:none;
}

.mv-write-processing__status{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  max-width:min(92vw,34rem);
  padding:10px 16px;
  border:2px solid rgba(255,255,255,.82);
  border-radius:999px;
  background:#0f4c81;
  color:#fff;
  -webkit-text-fill-color:#fff;
  box-shadow:0 10px 28px rgba(15,23,42,.34);
  font-size:.9rem;
  font-weight:900;
  line-height:1.25;
  text-align:center;
  pointer-events:none;
}

.mv-write-processing__spinner{
  flex:0 0 auto;
  width:18px;
  height:18px;
  border:3px solid rgba(255,255,255,.42);
  border-top-color:#fff;
  border-radius:50%;
  animation:mv-write-processing-spin .72s linear infinite;
}

html[data-mv-write-processing="1"],
html[data-mv-write-processing="1"] body{
  cursor:progress;
}

@keyframes mv-write-processing-spin{
  to{transform:rotate(360deg);}
}

@media (max-width:600px){
  .mv-write-processing__status{
    width:100%;
    max-width:100%;
    border-radius:12px;
  }
}

@media (prefers-reduced-motion:reduce){
  .mv-write-processing__spinner{
    animation:none;
    border-color:#fff;
    border-right-color:transparent;
  }
}

@media (forced-colors:active){
  .mv-write-processing__scrim{background:Canvas;opacity:.28;}
  .mv-write-processing__status{forced-color-adjust:auto;border-color:ButtonText;}
}

@media print{
  .mv-write-processing{display:none !important;}
}

/*
  Phase 4.7B.2.R4.C1 — shared field-validation marker.
  The reusable alert controller applies this marker only to the field rejected
  by client/server validation and clears it on the operator's next edit.
*/
.mv-field-validation-error{
  border-color:var(--danger) !important;
  background:#fff7f7 !important;
  box-shadow:0 0 0 2px rgba(220,38,38,.14) !important;
}

.mv-field-validation-error-label{
  color:#991b1b !important;
}

.mv-field-validation-error:focus-visible{
  outline:3px solid rgba(220,38,38,.46) !important;
  outline-offset:2px;
}

/* ==========================================================
   Phase 4.7.DR.4.R2.2.C1.R2 - Entire-Application Cross-Device
   Button Press Feedback Restoration

   Shared visual-only press feedback for enabled button controls. No click,
   navigation, request, authorization, confirmation, or timing behavior changes.
   ========================================================== */
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"]{
  -webkit-tap-highlight-color:rgba(15,76,129,.20);
  touch-action:manipulation;
}

button:not(:disabled):not([aria-disabled="true"]):not(.inventory-col-resize-handle):not(.movement-col-resize-handle):active,
[role="button"]:not([aria-disabled="true"]):active,
input[type="button"]:not(:disabled):active,
input[type="submit"]:not(:disabled):active,
input[type="reset"]:not(:disabled):active{
  filter:brightness(.88) saturate(.96) !important;
  opacity:.96;
  box-shadow:
    0 3px 10px rgba(15,23,42,.26) inset,
    0 2px 5px rgba(15,23,42,.16) !important;
  transition:
    filter 35ms ease,
    opacity 35ms ease,
    box-shadow 35ms ease !important;
}

.btn:not(:disabled):not([aria-disabled="true"]):active{
  transform:translateY(3px) scale(.985);
}

@media (prefers-reduced-motion:reduce){
  .btn:not(:disabled):not([aria-disabled="true"]):active{
    transform:none;
  }
}

.container { max-width:900px; margin:auto; padding:1rem; background-color: #EDD272;  }
.credit { text-align:center; font-size:.75rem; color:var(--muted); margin-bottom:.4rem; }
/* ===== APP TITLE (3D, alive, not loud) ===== */
.app-title{
  position: relative;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--primary);
  margin: 0;
  padding-bottom: 6px;

  /* subtle 3D lift */
  text-shadow:
    0 1px 0 rgba(255,255,255,.65),
    0 3px 6px rgba(0,0,0,.18);
}

/* thin accent bar under title */
.title-accent{
  position:inherit;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width: 80%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--primary),
    var(--accent)
  );
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 3px 6px rgba(0,0,0,.25);
}

/* Mobile balance */
@media (max-width:600px){
  .app-title{
    font-size:1.45rem;
  }
  .title-accent{
    width:255px;
    height:3px;
  }
}


/* HEADER & BUTTONS */
header { text-align:center; margin-bottom:.25rem; }
header h1 { margin:0; font-size:1.6rem; }
.header-card{
  border-left: 6px solid #0f4c81; /* matches fetch button */
}
/* ===== HEADER META (3D pills) ===== */
.header-meta{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
/* Mobile-only Setup button pinned to the LEFT of the header title */
/* Help + Setup icons: hidden by default (desktop/tablet) */
/* Keep icon buttons hidden by default (desktop/tablet) */
.header-setup-btn,
.header-help-btn{
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;           /* helps visibility on mobile */
  color: #B30B0E;
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  touch-action: manipulation;
}

/* Mobile: setup left, title centered, help right; meta row below */
@media (max-width:600px){
  .header-top{
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    grid-template-areas:
      "setup   title   help"
      "meta    meta    meta"
      "company company company";
    align-items: center;
    column-gap: 8px;
  }

  .header-top .app-title{
    grid-area: title;
    justify-self: center;
  }

  .header-meta{
    grid-area: meta;
    margin-top: 6px;
  }

  .header-company{
    grid-area: company;
    width: 100%;
    margin-top: 8px;
    padding: 9px 11px;
  }

  #headerSetupBtn{
    display: inline-flex !important;
    grid-area: setup;
    justify-self: start;
    margin: -10px auto 0 !important;
    position: relative;
    z-index: 5;
  }

  #headerHelpBtn{
    display: inline-flex !important;
    grid-area: help;
    justify-self: end;
    margin: -10px auto 0 !important;
    position: relative;
    z-index: 5;
  }

  /* Hide the large desktop Help button on mobile (if you have it) */
  #mainHelpBtn{ display: none !important; }
}

.header-meta .meta-pill{
  white-space: nowrap;        /* keep each pill on one line */
}
/*.header-meta .meta-date{ flex: 0 0 auto; }
.header-meta .meta-user{ flex: 1 1 auto; min-width: 0; }*/


.meta-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 12px;
  border-radius: 4px;
  padding: 6px 11px;
  font-size: .85rem;
  font-weight: 750;
  color: var(--primary);
  background: #fff;
  border: 1px solid rgba(17,24,39,.10);

  /* 3D depth consistent with your cards/buttons */
  box-shadow:
    0 2px 6px rgba(0,0,0,.12),
    0 12px 24px rgba(0,0,0,.14);
  position: relative;
  overflow: hidden;
}

.meta-pill::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.55),
    rgba(255,255,255,0) 55%
  );
  opacity: .25;
  pointer-events:none;
}

.meta-pill::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 5px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  opacity: .95;
  pointer-events:none;
}

.meta-date{
  color: var(--muted);
  font-weight: 800;
}

.meta-user{
  background: #eff6ff;                 /* subtle blue tint */
  border-color: rgba(37,99,235,.20);
  color: #1e3a8a;
}

.header-company{
  width: min(100%, 560px);
  margin: 10px auto 0 auto;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid rgba(180,83,9,.22);
  border-left: 6px solid var(--gold-text);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8eb 0%, #fef3c7 100%);
  color: var(--primary);
  box-shadow:
    0 6px 18px rgba(0,0,0,.08),
    0 1px 0 rgba(255,255,255,.65) inset;
  position: relative;
  z-index: 1;
}

.header-company-label{
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-text);
  line-height: 1.15;
  margin-bottom: 4px;
}

.header-company-value{
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--primary);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Mobile spacing */
@media (max-width: 600px){
  .meta-pill{ font-size: .82rem; padding: 7px 10px; }
  .header-company-value{ font-size: .92rem; }
}

.header-company{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  margin:4px auto 0 auto;
  padding:2px 8px;
  max-width:min(100%, 520px);
  border:1px solid rgba(180,83,9,.42);
  border-radius:6px;
  background:rgba(255,248,235,.96);
  box-shadow:none;
}

.header-company-value{
  display:block;
  font-size:1.5rem;
  font-weight:900;
  line-height:1.15;
  color:var(--primary);
  text-align:center;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

@media (max-width: 600px){
  .header-company{
    margin-top:4px;
    padding:2px 7px;
    max-width:min(100%, 92vw);
  }

  .header-company-value{
    font-size:.96rem;
  }
}

/* ===== 3D HEADER CARD ===== */
.header-card{
  background: var(--card);
  border-radius: 2px;
  padding: 14px 16px 12px 16px;
  margin: 0 auto 12px auto;
  border: 1px solid rgba(17,24,39,.08);
  box-shadow:
    0 2px 6px rgba(0,0,0,.10),
    0 14px 28px rgba(0,0,0,.12);
  position: relative;
  overflow: hidden;
}

/* soft top highlight */
.header-card::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.60),
    rgba(255,255,255,0) 50%
  );
  opacity: .22;
  pointer-events:none;
}

/* bottom lip */
.header-card::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 6px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  opacity: .95;
  pointer-events:none;
}

.header-top{
  text-align: center;
  position: relative;
  z-index: 1;
}

.header-card h1{
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: .2px;
}

.header-date{
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
  margin-top: 4px;
}

.header-divider{
  height: 2px;
  background: rgba(229,231,235,0.9);
  margin: 5px auto 5px auto;
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.save-status{
  display:none;          /* IMPORTANT: do not reserve space when hidden */
  opacity:0;
  font-size:.75rem;
  color: var(--success);
  font-weight: 800;
  margin-top: 4px;       /* tighter when shown */
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}


/* Mobile: slightly tighter title */
@media (max-width: 600px){
  .header-card h1{ font-size: 1.38rem; }
}

.welcome-msg { font-size: 0.95rem; color: var(--primary); font-weight: 600; margin: 5px 0 10px 0; }

.btn-group-v { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 4px; }
.btn-row { display: flex; gap: 8px; width: 100%; justify-content: center; }
/* C6.R4: compact native command foundation. Semantic colors and decorative
   icons are owned by ui-controls.css. Keep the original button/handler node. */
.btn{
  box-sizing:border-box;position:relative;display:inline-flex;
  flex:0 1 auto;align-items:center;justify-content:center;gap:6px;
  min-height:36px;max-width:100%;padding:7px 12px;
  border:1px solid transparent;border-radius:2px;
  background:#0f4c81;color:#fff;-webkit-text-fill-color:currentColor;
  font-size:.875rem;font-weight:700;line-height:1.25;text-align:center;
  white-space:normal;overflow-wrap:normal;word-break:normal;
  cursor:pointer;box-shadow:none;transform:none;
  -webkit-appearance:none;appearance:none;touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(15,76,129,.20);
  transition:filter 90ms ease,box-shadow 90ms ease;
}
.load-btn{background:#087f5b;color:#fff;}
#posMenuOverlay .btn,#posMenuOverlay .btn span{
  -webkit-text-fill-color:currentColor!important;text-decoration:none!important;
}
@media (hover:hover) and (pointer:fine){
  .btn:not(:disabled):not([aria-disabled="true"]):hover{filter:brightness(.92);}
}
.btn:not(:disabled):not([aria-disabled="true"]):active{
  box-shadow:inset 0 2px 3px rgba(0,0,0,.24);filter:brightness(.84);transform:none;
}
.btn:focus-visible{outline:2px solid #1565a6;outline-offset:2px;}
.btn:disabled,.btn[aria-disabled="true"]{
  opacity:.55;cursor:not-allowed;transform:none;filter:none;box-shadow:none;
}
.btn[hidden]{display:none!important;}
@media (any-pointer:coarse),(max-width:600px){
  .btn{min-height:44px;min-width:44px;}
}

.fetch-btn { background:#0f4c81; color:var(--card); width:100%; max-width:408px; }
.save-btn { background:var(--mv-action-success-bg,#087f5b); color:#fff; }
.buy-btn { background:var(--mv-action-primary-bg,#0f4c81); color:#fff; }
.unlock-btn { background:var(--mv-action-primary-bg,#0f4c81); color:#fff; }
.email-btn { background:var(--pal-text); color:white; }
.print-btn { background:var(--mv-action-utility-bg,#405a77); color:#fff; }
.collapse-btn { background:var(--mv-action-utility-bg,#405a77); color:#fff; }
.setup-btn { background:var(--mv-action-primary-bg,#0f4c81); color:#fff; }
.history-btn { background:var(--mv-action-utility-bg,#405a77); border:1px solid transparent; color:#fff; }
.lock-btn { background:var(--mv-action-utility-bg,#405a77); border:1px solid transparent; color:#fff; }
.action-btn { padding: 4px 8px; font-size: 0.8rem; border-radius: 4px; border: none; cursor: pointer; color: white; margin: 0 2px; }
/* Tenant Subscription Management cards */
.tenant-billing-list-card{
  width:100%;
  text-align:left;
  margin-bottom:8px;
  background:#fff;
  color:inherit;
  border:1px solid var(--border);
  padding:12px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  border-radius:14px;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.tenant-billing-list-card:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.10);
}

.tenant-billing-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:nowrap;
}

.tenant-billing-card-title{
  flex:1 1 auto;
  min-width:0;
  margin:0;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:4px 6px;
  font-weight:900;
  line-height:1.25;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.tenant-billing-card-login{
  width:100%;
  margin:2px 0 4px 0;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:4px 6px;
  font-size:0.82rem;
  line-height:1.25;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.tenant-billing-field-label{
  font-weight:800;
  color:inherit;
}

.tenant-billing-field-value{
  color:inherit;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.tenant-billing-card-meta-item{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:4px 6px;
}

.tenant-billing-card-meta-item span{
  color:inherit;
}

.tenant-card-tone-success{
  color:#047857;
}

.tenant-card-tone-warning{
  color:#a16207;
}

.tenant-card-tone-archived{
  color:#c2410c;
}

.tenant-card-tone-danger{
  color:#b91c1c;
}

.tenant-billing-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  align-self:flex-start;
  margin-left:auto;
  min-height:28px;
  padding:5px 10px;
  border-radius:4px;
  font-size:0.74rem;
  font-weight:900;
  letter-spacing:.2px;
  border:1px solid transparent;
  white-space:nowrap;
  box-shadow:0 4px 12px rgba(15,23,42,.08);
}

.tenant-billing-card-contact{
  width:100%;
  font-size:0.82rem;
  color:var(--muted);
  line-height:1.25;
  margin:2px 0 8px 0;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.tenant-billing-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
  font-size:0.78rem;
  color:var(--muted);
  line-height:1.3;
}

.tenant-billing-card-meta strong{
  color:var(--primary);
  font-weight:800;
}

.tenant-billing-card-hint{
  margin-top:9px;
  font-size:0.76rem;
  font-weight:900;
  color:var(--gold-text);
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.tenant-billing-status-active{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

.tenant-billing-status-expired{
  background:#fef2f2;
  color:#b91c1c;
  border-color:#fecaca;
}

.tenant-billing-status-trialing{
  background:#fff7ed;
  color:#c2410c;
  border-color:#fed7aa;
}

.tenant-billing-status-pastdue{
  background:#fff7ed;
  color:#9a3412;
  border-color:#fdba74;
}

.tenant-billing-status-suspended,
.tenant-billing-status-canceled{
  background:#f3f4f6;
  color:#374151;
  border-color:#d1d5db;
}

.tenant-lifecycle-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:5px 10px;
  border-radius:4px;
  font-size:0.74rem;
  font-weight:900;
  letter-spacing:.2px;
  border:1px solid transparent;
  white-space:nowrap;
  box-shadow:0 4px 12px rgba(15,23,42,.08);
}

.tenant-billing-badge-success{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

.tenant-billing-badge-warning{
  background:#fefce8;
  color:#a16207;
  border-color:#fde68a;
}

.tenant-billing-badge-archived{
  background:#fff7ed;
  color:#c2410c;
  border-color:#fdba74;
}

.tenant-billing-badge-danger{
  background:#fef2f2;
  color:#b91c1c;
  border-color:#fecaca;
}

.tenant-lifecycle-active{
  background:#eff6ff;
  color:#1d4ed8;
  border-color:#bfdbfe;
}

.tenant-lifecycle-archived{
  background:#f3f4f6;
  color:#374151;
  border-color:#d1d5db;
}

.tenant-lifecycle-deleted{
  background:#fef2f2;
  color:#b91c1c;
  border-color:#fecaca;
}

.tenant-card-archived{
  border-left:4px solid #c2410c;
}

.tenant-card-deleted{
  border-left:4px solid #dc2626;
}

@media (max-width: 640px){
  .tenant-billing-list-card{
    padding:11px;
    border-radius:12px;
  }

  .tenant-billing-card-head{
    gap:8px;
    flex-wrap:nowrap;
    align-items:flex-start;
  }

  .tenant-billing-card-title{
    flex:1 1 auto;
    min-width:0;
    padding-right:6px;
  }

  .tenant-billing-card-meta{
    flex-direction:column;
    align-items:flex-start;
    gap:5px;
  }

  .tenant-billing-status{
    flex:0 0 auto;
    align-self:flex-start;
    min-height:26px;
    padding:4px 9px;
    font-size:0.72rem;
  }

  .tenant-billing-card-hint{
    margin-top:8px;
  }
}

@media (max-width: 640px){
  .tenant-billing-card-title,
  .tenant-billing-card-login,
  .tenant-billing-card-meta-item--renew{
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
  }

  .tenant-billing-card-meta{
    align-items:flex-start;
  }

  .tenant-billing-field-label,
  .tenant-billing-card-meta-item--renew strong{
    line-height:1.1;
  }

  .tenant-billing-field-value,
  .tenant-billing-card-meta-item--renew span{
    line-height:1.18;
  }
}

/* SOURCE BADGE */
.source-badge-container { text-align: center; margin: 6px 0 6px 0; }
.source-badge { 
    display: inline-block; padding: 6px 16px; border-radius: 4px; 
    font-size: 0.8rem; font-weight: 700; color: #fff; background: #9ca3af;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); letter-spacing: 0.3px;
}
.badge-spot,
.badge-fix { background: #2563eb; }

.badge-kitco { background: #92400e; }
.badge-grc { background: #7c3aed; }
.badge-manual { background: #1f2937; }
.badge-unsaved { background: #f59e0b; }
/* Source badge + clear icon button in one centered row */
.source-badge-row{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Small icon button that matches your 3D look */
.badge-icon-btn{
  width: 34px;
  height: 30px;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    0 2px 6px rgba(0,0,0,.12),
    0 12px 24px rgba(0,0,0,.14);

  position: relative;
  overflow: hidden;
  font-size: 16px;
  line-height: 1;
}

.badge-icon-btn::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 5px;
  background: rgba(0,0,0,.10);
  box-shadow: 0 -1px 0 rgba(255,255,255,.35) inset;
  pointer-events:none;
  opacity: .95;
}

.badge-icon-btn:active{
  transform: translateY(2px);
  box-shadow:
    0 3px 10px rgba(0,0,0,.18) inset,
    0 8px 16px rgba(0,0,0,.10);
}


/* INPUTS */
.inline-prices { display: flex; gap: .75rem; margin: 0.5rem 0; }
.price-box { 
    background:var(--card); border-radius:4px; padding:.75rem; flex: 1; 
    box-shadow:0 6px 18px rgba(0,0,0,.05); position: relative; overflow: hidden; 
    display: flex; flex-direction: column; justify-content: center;
}
/* ===== 3D INPUT CARDS (price-box) ===== */
.price-box{
  position: relative;
  border: 1px solid rgba(17,24,39,.08);
  box-shadow:
    0 2px 6px rgba(0,0,0,.10),
    0 14px 28px rgba(0,0,0,.12);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

/* Bottom “lip” like the 3D buttons */
.price-box::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 6px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  pointer-events:none;
  transition: height 120ms ease, opacity 120ms ease;
  opacity: .95;
}

/* Soft top highlight for “alive” look */
.price-box::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.60),
    rgba(255,255,255,0) 45%
  );
  opacity: .25;
  pointer-events:none;
  transition: opacity 120ms ease;
}

/* When user interacts (tap/click inside), lift slightly */
.price-box:focus-within{
  transform: translateY(-2px);
  box-shadow:
    0 10px 20px rgba(0,0,0,.14),
    0 26px 50px rgba(0,0,0,.16);
  filter: brightness(1.01);
}

/* Collapse the lip slightly while focused (pressed-in illusion) */
.price-box:focus-within::after{
  height: 3px;
  opacity: .8;
}

.price-box:focus-within::before{
  opacity: .35;
}
.price-box .metal-label{
  opacity: .95;
}


.metal-label { font-size:.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); }
.metal-prem-label { font-size: 0.7rem; font-weight: 600; opacity: 0.9; }
.price-box input { width:100%; border:none; outline:none; background:none; font-weight:800; font-size:1.5rem; margin-top: 2px; padding: 0; }
/* ===== INPUT FIELD FEEL ===== */
.price-box input{
  border-radius: 4px;
  padding: 6px 0;
  transition: transform 90ms ease, filter 90ms ease;
}

/* On mobile, focus should feel responsive */
.price-box input:focus{
  outline: none;
  transform: scale(1.01);
}

/* Optional: a subtle caret/focus glow that matches theme */
.price-box:focus-within{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(37,99,235,.16),
    0 10px 20px rgba(0,0,0,.14),
    0 26px 50px rgba(0,0,0,.16);
}

.gold-theme { color: var(--gold-text); }
.silver-theme { color: var(--silver-text); }
.plat-theme { color: var(--plat-text); }
.pal-theme { color: var(--pal-text); }

/* TABLES */
.calc-table, .admin-table { width:100%; border-collapse:collapse; background:var(--card); border-radius:4px; overflow:hidden; box-shadow:0 6px 18px rgba(0,0,0,.05); }
.calc-table th, .calc-table td, .admin-table th, .admin-table td { padding:.7rem; text-align:center; border-bottom:1px solid var(--border); }
/* ===== Compact CALC table rows (main page) ===== */
.calc-table th,
.calc-table td{
  padding: .42rem .50rem;   /* was effectively .7rem */
  line-height: 1.25;
  font-size: .92rem;
}
/* ================================
   USER MANAGEMENT (User List)
   - stable scroll container
   - sticky header with visible background
   - no horizontal drift
================================== */
/* User ID shown under username (no new column, no width change) */
.user-id-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.9;
  white-space: nowrap;
}

#userListOverlay .userlist-scroll{
  flex: 1;
  min-height: 0;                 /* critical in flex overlays */
  min-width: 0;
  overflow: auto;                /* vertical scroll lives here */
  overflow-x: hidden;            /* prevents horizontal page drift */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 15px 15px;          /* remove top padding so sticky header sits flush */
}

/* Table: keep it within device width */
#userListOverlay .admin-table{
  width: 100%;
  max-width: 100%;
  table-layout: fixed;           /* prevents column blowout */
  border-collapse: separate;     /* sticky header works more reliably */
  border-spacing: 0;
  overflow: visible;             /* override any global overflow:hidden */
}

/* Wrap long usernames safely */
#userListOverlay .admin-table th,
#userListOverlay .admin-table td{
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/* Sticky header while scrolling list rows */
#userListOverlay .admin-table thead th{
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, #f9fafb, #eef2f7); /* visible header bg */
  box-shadow:
    0 1px 0 rgba(255,255,255,.85) inset,
    0 2px 0 rgba(0,0,0,.04);
}

/* Action column: slightly wider + padding so buttons are not on the edge */
#userListOverlay .admin-table th:last-child,
#userListOverlay .admin-table td:last-child{
  width: 92px;
  text-align: center;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 14px;
}

@media (max-width: 600px){
  #userListOverlay .userlist-scroll{
    padding: 0 10px 12px;
  }

  #userListOverlay .admin-table th,
  #userListOverlay .admin-table td{
    padding: .45rem .35rem;
    font-size: .85rem;
  }

  #userListOverlay .admin-table th:last-child,
  #userListOverlay .admin-table td:last-child{
    width: 88px;
    padding-right: 12px;
  }
}
/* User Form (Add/Edit User): full-viewport backdrop + pinned action bar + internal scroll body */
#userFormOverlay{
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;                 /* IMPORTANT: avoid overlay scrolling; body scrolls */
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}

#userFormOverlay .modal-card{
  width: calc(100% - 24px);
  max-width: 920px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;                 /* IMPORTANT: prevents action bar from scrolling */
  text-align: left;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px){
  #userFormOverlay .modal-card{ max-width: none; }
}

/* Action bar is OUTSIDE the scroll body */
#userFormOverlay #userFormActionBar{
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  background: #fff;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
}

/* Scroll lives here */
#userFormOverlay #userFormBody{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: 10px;
}

#userFormOverlay.kb-open{
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 12px !important;
  padding-top: max(12px, env(safe-area-inset-top)) !important;
  padding-right: max(12px, env(safe-area-inset-right)) !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  padding-left: max(12px, env(safe-area-inset-left)) !important;
}

#userFormOverlay.kb-open .modal-card{
  margin-top: 10px !important;
  max-height: calc(100dvh - 24px) !important;
}

/* State <select> matches inputs */
#userFormOverlay .modal-card select{
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
/* ================================
   ContactS OVERLAY (Mobile-ready)
   ================================ */

#ContactsOverlay .userlist-scroll{
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 15px 15px;
}

#ContactsOverlay .admin-table{
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}

#ContactsOverlay .admin-table th,
#ContactsOverlay .admin-table td{
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#ContactsOverlay .admin-table thead th{
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, #f9fafb, #eef2f7);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 2px 0 rgba(0,0,0,0.04);
}

/* Name cell should look tappable */
.cust-name-link{
  display: inline-block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
}

/* Mobile: show ONLY ID#, Name, Action */
@media (max-width: 600px){

  /* tighter overlay width */
  #ContactsOverlay .overlay-card{ width: calc(100% - 16px); }

  #ContactsOverlay .userlist-scroll{ padding: 0 10px 12px; }

  #ContactsOverlay .admin-table th,
  #ContactsOverlay .admin-table td{
    padding: .45rem .40rem;
    font-size: .84rem;
  }

  /* Hide Phone (3), Email (4), City/State (5) */
  #ContactsOverlay .admin-table th:nth-child(3),
  #ContactsOverlay .admin-table td:nth-child(3),
  #ContactsOverlay .admin-table th:nth-child(4),
  #ContactsOverlay .admin-table td:nth-child(4),
  #ContactsOverlay .admin-table th:nth-child(5),
  #ContactsOverlay .admin-table td:nth-child(5){
    display: none;
  }

  /* Override your inline min-width styles on headers */
  #ContactsOverlay .admin-table th:nth-child(1),
  #ContactsOverlay .admin-table td:nth-child(1){
    min-width: 64px !important;
    width: 64px;
  }

  #ContactsOverlay .admin-table th:nth-child(2),
  #ContactsOverlay .admin-table td:nth-child(2){
    min-width: 140px !important;
  }

  #ContactsOverlay .admin-table th:nth-child(6),
  #ContactsOverlay .admin-table td:nth-child(6){
    min-width: 110px !important;
    width: 110px;
    white-space: nowrap;
    text-align: center;
  }
}

/* Mobile tightening */
@media (max-width: 600px){
  #userListOverlay .admin-table th,
  #userListOverlay .admin-table td{
    padding: .45rem .40rem;
    font-size: .82rem;
  }
  #userListOverlay .overlay-card{ width: calc(100% - 16px); }
}


/* Extra compact on very small screens (still readable) */
@media (max-width: 420px){
  .calc-table th,
  .calc-table td{
    padding: .34rem .38rem;
    font-size: .92rem;
  }
}

.calc-table tbody tr:nth-child(even) { background-color: var(--zebra-bg); }
.calc-table tbody tr:hover { background-color: #e0f2fe; }
/* ===== 3D TABLE CARD ===== */
.calc-table, .admin-table{
  position: relative;
  border: 1px solid rgba(17,24,39,.08);
  box-shadow:
    0 2px 6px rgba(0,0,0,.10),
    0 14px 28px rgba(0,0,0,.12);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

/* Bottom “lip” like your 3D buttons/inputs */
.calc-table::after, .admin-table::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 6px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  pointer-events:none;
  opacity: .95;
}

/* Light top highlight */
.calc-table::before, .admin-table::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 4px; /* matches your rounding */
  background: linear-gradient(to bottom,
    rgba(255,255,255,.55),
    rgba(255,255,255,0) 45%
  );
  opacity: .20;
  pointer-events:none;
}
/* ===== TABLE HEADER: raised bar ===== */
.calc-table thead th, .admin-table thead th{
  background: linear-gradient(to bottom, #f9fafb, #eef2f7);
  font-weight: 800;
  letter-spacing: .2px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}

    /* ===== ROW INTERACTIONS ===== */
.calc-table tbody tr{
  transition: background-color 120ms ease;
}

.calc-table tbody tr:active{
  background-color: #dbeafe;
}

.calc-table tbody tr:active{
  background-color: #dbeafe;
}

.calc-table td, .admin-table td{
  border-bottom: 1px solid var(--border);
}

.calc-table td + td, .calc-table th + th,
.admin-table td + td, .admin-table th + th{
  border-left: 1px solid rgba(229,231,235,.7);
}

/* ===== 3D TABLE WRAPPER (mobile-safe) ===== */
.table-card-3d{
  position: relative;
  background: var(--card);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(17,24,39,.08);
  box-shadow:
    0 2px 6px rgba(0,0,0,.10),
    0 14px 28px rgba(0,0,0,.12);
}

/* bottom lip */
.table-card-3d::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 6px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  pointer-events:none;
  opacity: .95;
}

/* soft top highlight */
.table-card-3d::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.55),
    rgba(255,255,255,0) 45%
  );
  opacity: .18;
  pointer-events:none;
}

/* keep your table clean inside wrapper */
.table-card-3d .calc-table{
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  box-shadow: none;  /* wrapper owns the shadow now */
  border-radius: 0;  /* wrapper owns the radius */
}

/* ===== HEADER: raised bar look ===== */
.table-card-3d .calc-table thead th{
  background: linear-gradient(to bottom, #f9fafb, #eef2f7);
  font-weight: 800;
  letter-spacing: .2px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset;
}

/* ===== MOBILE TAP FEEDBACK ON ROWS ===== */
.table-card-3d .calc-table tbody tr{
  transition: background-color 120ms ease;
}

.table-card-3d .calc-table tbody tr:active{
  background-color: #dbeafe;
}

/* Optional: subtle vertical separators for clarity */
.table-card-3d .calc-table th + th,
.table-card-3d .calc-table td + td{
  border-left: 1px solid rgba(229,231,235,.7);
}
/* ===== TABLE CARD: alive interaction ===== */

/* When user taps anywhere inside the table (mobile + desktop) */
.table-card-3d:active,
.table-card-3d:focus-within{
  transform: translateY(-2px);
  box-shadow:
    0 10px 20px rgba(0,0,0,.14),
    0 26px 50px rgba(0,0,0,.16);
  filter: brightness(1.01);
}

/* Pressed-in feel while actively tapping */
.table-card-3d:active::after{
  height: 3px;        /* bottom lip compresses */
  opacity: .75;
}

/* Slightly stronger top highlight when active */
.table-card-3d:focus-within::before{
  opacity: .28;
}

/* Smooth transition */
.table-card-3d{
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

.summary-row { display: none; }
/* Customer / POS credit breakdown cards */
.credit-breakdown-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap:8px;
  margin-top:10px;
  min-width:0;
}

.credit-breakdown-pill{
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.credit-breakdown-pill span{
  color:var(--muted);
  font-size:.78rem;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.credit-breakdown-pill strong{
  line-height:1.3;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.summary-stat--credit{
  border-color: rgba(16,185,129,.25);
}
/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal-card { background: white; padding: 2rem; border-radius: 4px; text-align: center; max-width: 400px; width: 90%; position: relative; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
/* CONTACT SUPPORT: layout + responsive */
#supportModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  max-height: calc(100vh - 24px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#supportModal .support-body{
  flex:1;
  overflow:auto;
  display:flex;
  flex-direction:column;
}
#supportModal .notes-group{
  flex:1;
  display:flex;
  flex-direction:column;
}
#supportModal #supportNotes{
  flex:1;
  min-height:140px;
  resize:none;
}
#supportModal .support-check{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  font-weight:650;
  font-size:0.85rem;
  text-align:left;
}
#supportModal .support-check input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  flex:0 0 auto;
}
#supportModal .support-check span{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

#supportModal .support-check-group{
  display:flex;
  flex-direction:column;
  gap:8px;
}
@media (max-width:600px){
  #supportModal .modal-card{ padding: 1.25rem; }
  #supportModal #supportNotes{ min-height: 180px; }
}
/* Contact DETAILS overlay: safe on small devices */
#ContactDetailOverlay{
  height: 100vh;
  height: 100dvh;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#ContactDetailOverlay .modal-card{
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
}

/* USER DETAILS overlay: safe on small devices (matches Contact Details) */
#userDetailOverlay{
  height: 100vh;
  height: 100dvh;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#userDetailOverlay .modal-card{
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
}

/* Audit report overlays: safe on small devices */
#duplicateAuditReportOverlay,
#customerAuditReportOverlay,
#contactAuditReportOverlay{
  align-items: flex-start;
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#duplicateAuditReportOverlay .modal-card,
#customerAuditReportOverlay .modal-card,
#contactAuditReportOverlay .modal-card{
  margin-top: 10px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

#duplicateAuditReportBody,
#customerAuditReportBody,
#contactAuditReportBody{
  max-height: none !important;
  overflow: visible !important;
}

/* Contact FORM overlays: New/Edit Contact + self-entry (SMS link)
   - prevents top/bottom cut-off on mobile/tablet
   - allows internal scrolling when keyboard is open
*/
#ContactFormOverlay,
#ContactSelfEntryOverlay{
  height: 100vh;
  height: 100dvh;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#ContactFormOverlay .modal-card,
#ContactSelfEntryOverlay .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 1.25rem;      /* tighter than default 2rem */
  text-align: left;       /* form reads better */
  align-items: flex-start;   /* prevents title/buttons being clipped */
  justify-content: center;

}
/* Remove extra space above the title inside these overlays */
#ContactFormOverlay h3,
#ContactSelfEntryOverlay h3{
  margin-top: 0;
  margin-bottom: 8px;
  padding-top: 0;
}
/* Tighten vertical spacing for form fields */
#ContactFormOverlay .form-group,
#ContactSelfEntryOverlay .form-group{
  margin-bottom: 10px;
}

#ContactFormOverlay .form-group label,
#ContactSelfEntryOverlay .form-group label{
  margin-bottom: 2px;
  display: block;
}

#ContactFormOverlay .form-group input:not([type="checkbox"]),
#ContactSelfEntryOverlay .form-group input:not([type="checkbox"]),
#ContactFormOverlay .form-group select,
#ContactSelfEntryOverlay .form-group select,
#ContactFormOverlay .form-group textarea,
#ContactSelfEntryOverlay .form-group textarea{
  padding: 8px;
}
#ContactSelfEntryResult{ text-align:center; }

@media (max-width: 900px){
  #ContactFormOverlay,
  #ContactSelfEntryOverlay{
    align-items: flex-start; /* move card to top on small screens */
    justify-content: center;
  }
}
/* Mobile: pin Contact modals higher so keyboard does not cover action buttons */
@media (max-width: 600px){
  #ContactFormOverlay,
  #ContactSelfEntryOverlay{
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  #ContactFormOverlay .modal-card,
  #ContactSelfEntryOverlay .modal-card{
    margin-top: 0;
    max-height: calc(100dvh - 12px);
  }
}
#ContactFormOverlay .field-error,
#ContactSelfEntryOverlay .field-error,
#ContactLinkModal .field-error{
  display:none;
  margin-top:4px;
  color:#dc2626;
  font-size:0.78rem;
  line-height:1.25;
  font-weight:700;
}

#ContactFormOverlay [aria-invalid="true"],
#ContactSelfEntryOverlay [aria-invalid="true"],
#ContactLinkModal [aria-invalid="true"]{
  border-color:#dc2626 !important;
  box-shadow:0 0 0 1px rgba(220,38,38,.12);
}

/* ==========================================================
   Phase 4.4C — Inventory Item field-level validation
   ========================================================== */
#addModal .field-error{
  display:none;
  margin-top:4px;
  color:#dc2626;
  font-size:0.78rem;
  line-height:1.25;
  font-weight:700;
  overflow-wrap:anywhere;
  word-break:break-word;
}

#addModal [aria-invalid="true"]{
  border-color:#dc2626 !important;
  box-shadow:0 0 0 1px rgba(220,38,38,.12);
}

.inventory-form-error{
  display:none;
  margin:0 0 10px 0;
  padding:10px 12px;
  border:1px solid #fecaca;
  border-left:5px solid #dc2626;
  border-radius:8px;
  background:#fef2f2;
  color:#991b1b;
  font-size:0.86rem;
  font-weight:800;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-form-error.is-visible{
  display:block;
}

@media (max-width:640px){
  .inventory-form-error{
    font-size:0.82rem;
    padding:9px 10px;
    margin-bottom:8px;
  }

  #addModal .field-error{
    font-size:0.76rem;
  }
}

/* ==========================================================
   Phase 4.4C-2 — Setup counter field-level validation
   ========================================================== */
#recordNumberingAccordion .setup-counter-field-error{
  display:none;
  margin-top:4px;
  color:#dc2626;
  font-size:0.78rem;
  line-height:1.25;
  font-weight:700;
  overflow-wrap:anywhere;
  word-break:break-word;
}

#recordNumberingAccordion [aria-invalid="true"]{
  border-color:#dc2626 !important;
  box-shadow:0 0 0 1px rgba(220,38,38,.12);
}

.setup-counter-form-error{
  display:none;
  margin:0 0 12px 0;
  padding:10px 12px;
  border:1px solid #fecaca;
  border-left:5px solid #dc2626;
  border-radius:10px;
  background:#fef2f2;
  color:#991b1b;
  font-size:0.86rem;
  font-weight:800;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.setup-counter-form-error.is-visible{
  display:block;
}

@media (max-width:640px){
  .setup-counter-form-error{
    font-size:0.82rem;
    padding:9px 10px;
    margin-bottom:10px;
  }

  #recordNumberingAccordion .setup-counter-field-error{
    font-size:0.76rem;
  }
}

/* Mobile: nudge Setup overlay card down a bit */
@media (max-width: 600px){
  #userListOverlay .overlay-card{
    margin-top: 18px;   /* adjust: 12–28px */
  }
}
/* HELP MODAL: responsive + scrollable body (prevents cut-off on desktop/mobile) */
#helpModal .modal-card{
  width: calc(100% - 24px);
  max-width: 720px;
  max-height: calc(100vh - 24px);
  padding: 0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#helpModal .help-header{
  padding: 15px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: relative;
}
#helpModal .help-body{
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}
#helpModal .help-footer{
  padding: 15px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
}
#helpModal .help-close-x{
  position:absolute;
  top:10px;
  right:12px;
  border:none;
  background:none;
  font-weight:900;
  font-size:1.1rem;
  cursor:pointer;
  line-height: 1;
}
#helpModal .help-close-x:active{ transform: translateY(1px); }
@media (max-width:600px){
  #helpModal .help-body{ padding: 16px; }
}

/* HELP ? CONTACT SUPPORT modal (message-only) */
#helpSupportModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  max-height: calc(100vh - 24px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#helpSupportModal .support-body{
  flex:1;
  overflow:auto;
  display:flex;
  flex-direction:column;
}
#helpSupportModal .notes-group{
  flex:1;
  display:flex;
  flex-direction:column;
}
#helpSupportModal #helpSupportText{
  flex:1;
  min-height: 180px;
  resize:none;
}
@media (max-width:600px){
  #helpSupportModal .modal-card{ padding: 1.25rem; }
  #helpSupportModal #helpSupportText{ min-height: 220px; }
}

.overlay-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.overlay-backdrop.active { display: flex; }
.overlay-card { background: #fff; width: 98%; max-width: 850px; max-height: 95vh; border-radius: 4px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.overlay-header { padding: 1rem; border-bottom: 1px solid var(--border); background: #f9fafb; display: flex; justify-content: space-between; align-items: center; }
/* ================================
   MOBILE: Pin User Management to top
   (reduces keyboard overlap)
   ================================ */
@media (max-width: 600px){

  /* User list overlay (User Management) */
  #userListOverlay.overlay-backdrop{
    align-items: flex-start;            /* move card to top */
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-right: max(6px, env(safe-area-inset-right));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
  }

  #userListOverlay .overlay-card{
    max-height: calc(100dvh - 12px);
    max-height: calc(100vh - 12px);
    margin: 0;
  }

  #userListOverlay .overlay-header{
    padding: .55rem .65rem;            /* tighter header */
  }

  #userListOverlay .overlay-header h2{
    margin: 0;
    font-size: 1.05rem;
  }

  /* User form modal (Add/Edit User) */
  #userFormOverlay{
    align-items: flex-start;            /* move modal to top */
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #userFormOverlay .modal-card{
    width: calc(100% - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 1.1rem;                    /* tighter than default 2rem */
    text-align: left;                   /* form reads better */
  }
}


/* General Refining helper/paste modals: responsive */
#grcTicksHelperModal .modal-card,
#grcPasteModal .modal-card{
    width: calc(100% - 24px);
    max-width: 720px;
    max-height: calc(100vh - 24px);
    padding: 1.25rem;
    overflow: auto;
}
.grc-action-row{
    display:flex;
    gap:10px;
    margin-top:14px;
    flex-wrap: wrap;
}
.grc-action-row .btn{ flex: 1 1 220px; }
@media (max-width: 600px){
    #grcTicksHelperModal .modal-card,
    #grcPasteModal .modal-card{
        padding: 1rem;
        border-radius: 4px;
        max-height: calc(100vh - 16px);
    }
    .grc-action-row{ flex-direction: column; }
    .grc-action-row .btn{ width: 100%; flex: 1 1 auto; }
    #grcPasteModal textarea{ min-height: 120px !important; }
}


/* HISTORY & CHART */
.history-table-container { overflow-y: auto; flex:1; }
.history-table { width:100%; border-collapse:separate; border-spacing: 0; }
.history-table th { background:#f3f4f6; position:sticky; top:0; z-index: 10; padding: 12px 4px; font-size: 0.75rem; border-bottom: 2px solid var(--border); }
.history-table td { padding: 10px 4px; text-align: center; font-size: 0.8rem; font-weight: 500; border-bottom: 1px solid var(--border); }
.history-date-col { font-size: 0.75rem !important; color: var(--muted); white-space: nowrap; }
.chart-container { display: none; padding: 10px; height: 300px; width: 100%; }

/* Mobile */
@media (max-width: 600px) { .history-prem-col { display: none; } }
.form-group { text-align:left; margin-bottom:15px; }
.form-group label { font-size:0.75rem; font-weight:bold; display: block; margin-bottom: 4px; }
.form-group input:not([type="checkbox"]), .form-group select, .form-group textarea { width:100%; padding:10px; border:1px solid var(--border); border-radius:4px; }
.form-group textarea { resize: vertical; }
.karat-chip { background: #e5e7eb; padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d1d5db; }
.karat-chip span.remove { color: var(--danger); cursor: pointer; font-weight: bold; font-size: 1.1rem; line-height: 0.8; }
/* PURCHASE ESTIMATOR (Main Page) */
.estimator-card{
  margin-bottom: 6px;
  padding: 0;
  overflow: hidden;
}

.estimator-card.is-open{
  overflow: visible;
}

.estimator-acc-btn{
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.estimator-acc-btn:focus-visible{
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(14,165,233,.18);
}

.estimator-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold-text);
  margin: 0;
  
  /* --- ENHANCED: Darker, sharper text lift for mobile --- */
  letter-spacing: 0.5px;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),  /* 1. Crisp white highlight */
    0 1px 2px rgba(0, 0, 0, 0.55),      /* 2. Sharp, dark ridge right under the text */
    0 4px 6px rgba(0, 0, 0, 0.30);      /* 3. Deeper, wider drop shadow for actual "lift" */
}

.estimator-acc-caret{
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.18s ease;
}

.estimator-card.is-open .estimator-acc-caret{
  transform: rotate(180deg);
}

.estimator-acc-body{
  padding: 0 12px 10px;
}

.estimator-sub{
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.3;
}

.estimator-grid{
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1.25fr)
    minmax(0, .95fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    92px;
  gap: 10px;
  align-items: end;
}

.estimator-grid .form-group{
  margin-bottom: 0;
  min-width: 0;
}

.estimator-grid .form-group label{
  white-space: nowrap;
}

.estimator-grid .form-group input:not([type="checkbox"]),
.estimator-grid .est-dd-btn,
.estimator-clear-btn{
  width: 100%;
  height: 44px;
  min-height: 44px;
}

.estimator-grid .form-group input:not([type="checkbox"]){
  padding: 10px 12px;
}

.estimator-grid .est-dd-btn{
  display: flex;
  align-items: center;
}

	.estimator-total label{
  color: var(--gold-text);
}
	
.estimator-total input{
  background: #f8fafc;
  color: var(--primary);
  font-weight: 900;
  letter-spacing: 0.2px;
}

.estimator-total input[readonly]{
  cursor: default;
}

.estimator-clear-btn{
  min-width: 0;
}

.estimator-help{
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 8px;
}

#estCommissionValue:disabled{
  background: #f3f4f6;
  color: var(--muted);
}

/* Tablet / small laptop */
@media (max-width: 900px){
  .estimator-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Small mobile */
@media (max-width: 600px){
    .estimator-acc-btn{
    padding: 10px 12px;
  }

  .estimator-acc-body{
    padding: 0 8px 8px;
  }

  .estimator-title{
    font-size: 1rem;
		letter-spacing: 0.1rem;
  }
  .estimator-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  

  .estimator-sub{
    font-size: 0.74rem;
  }

  .estimator-grid .form-group label{
    font-size: 0.68rem;
    line-height: 1.15;
    margin-bottom: 3px;
    white-space: nowrap;
  }

  .estimator-grid .form-group input:not([type="checkbox"]),
  .estimator-grid .est-dd-btn,
  .estimator-clear-btn{
    height: 40px;
    min-height: 40px;
  }

  .estimator-grid .form-group input:not([type="checkbox"]){
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .estimator-grid .est-dd-btn{
    padding: 8px 30px 8px 10px;
    font-size: 0.84rem;
  }

  .est-dd-caret{
    right: 9px;
    font-size: 0.9rem;
  }

  .est-dd-btn-text{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .estimator-clear-btn{
    padding: 0 8px;
    font-size: 0.84rem;
  }

  .estimator-help{
    font-size: 0.68rem;
    line-height: 1.25;
    margin-top: 7px;
  }

  .est-dd-menu{
    left: 0;
    right: auto;
    width: max-content;
    min-width: 100%;
    max-width: calc(100vw - 24px);
  }

  #estCommissionTypeDd .est-dd-menu{
    left: auto;
    right: 0;
  }

  .est-dd-option{
    white-space: nowrap;
  }
}
	
@media (max-width: 380px){
    .estimator-acc-btn{
    padding: 9px 10px;
  }

  .estimator-acc-body{
    padding: 0 7px 7px;
  }

  .estimator-grid{
    gap: 5px;
  }

  .estimator-grid .form-group label{
    font-size: 0.64rem;
  }

  .estimator-grid .form-group input:not([type="checkbox"]),
  .estimator-grid .est-dd-btn,
  .estimator-clear-btn{
    height: 38px;
    min-height: 38px;
  }

  .estimator-grid .form-group input:not([type="checkbox"]){
    padding: 7px 8px;
    font-size: 0.84rem;
  }

  .estimator-grid .est-dd-btn{
    padding: 7px 26px 7px 8px;
    font-size: 0.80rem;
  }

  .estimator-clear-btn{
    font-size: 0.78rem;
  }
}
/* PRINT RULES */
.history-print-header { display: none; }
@media print {
    .btn-group-v, .quick-filters, .modal-overlay, #saveStatus, .logout-btn, .setup-btn, .chart-toggle-row, .welcome-msg, .inline-prices, .chart-container, .admin-action-col, .summary-row { display: none !important; }

    
    /* 2. Hide Specific Elements Requested (Date Inputs) */
    .date-inputs-container { display: none !important; }
    
    /* 3. Hide Screen-Only Utils */
    .hide-on-print { display: none !important; }
    
    /* 4. CRITICAL FIX: Hide the Main Container (Calc Table) when History is Open */
    /* This prevents "24K Gold", "Silver", etc. from showing on the History printout */
    /*body:has(#historyOverlay.active) .container { display: none !important; }
    body:has(#historyOverlay.active) .calc-table { display: none !important; }*/
    /* When printing History, hide only the main (non-history) UI */
    body:has(#historyOverlay.active) .credit,
    body:has(#historyOverlay.active) header,
    body:has(#historyOverlay.active) .source-badge-container,
    body:has(#historyOverlay.active) .inline-prices,
    body:has(#historyOverlay.active) .table-card-3d {
      display: none !important;
    }

    /* Ensure History prints the TABLE view (prevents blank if user last viewed Chart) */
    body:has(#historyOverlay.active) #historyTableView { display: block !important; }
    body:has(#historyOverlay.active) #historyChartView { display: none !important; }

    /* Show Source badge on Daily print, but never on History print */
    body:has(#historyOverlay.active) .source-badge-container { display: none !important; }

    /* 5. Configure the History Overlay for Print */
    .overlay-backdrop.active { position: absolute; display: block; background: white; backdrop-filter: none; width: 100%; height: auto; }
    .overlay-card { width: 100%; max-height: none; box-shadow: none; border: none; overflow: visible; }
    
    /* 6. Reset Header for Print */
    .overlay-header { 
        display: block !important; 
        border: none !important; 
        padding-bottom: 0 !important;
    }

    /* 7. Custom Print Header Styles */
    .history-print-header { 
        display: block !important; 
        width: 100%; 
        text-align: center; 
        margin-bottom: 20px; 
    }
    .history-print-header h2 { 
        margin: 0 0 5px 0; 
        font-size: 1.6rem; 
        font-weight: bold; 
        color: #000; 
    }
    .history-print-header div { 
        font-size: 0.9rem; 
        color: #000; 
        margin-bottom: 2px; 
    }
    
    /* 8. Force Table Display */
    .history-table-container { overflow: visible !important; height: auto !important; }
    .history-prem-col { display: table-cell !important; } 
}

/* MODERN SELECT WRAPPER - Price List method list*/
.custom-select-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* CUSTOM SELECT STYLING */
#setSource {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary);
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    /* Custom Arrow using SVG Background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1.2rem;
}

#setSource:focus {
    outline: none;
    border-color: var(--gold-text);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}

#setSource:hover {
    border-color: var(--muted);
}

/* OPTION STYLING (Note: Limited browser support for styling opened list) */
#setSource option {
    padding: 10px;
    background: #fff;
    color: var(--primary);
}

/* MODERN TOGGLE LIST STYLES */
.source-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.source-item.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
}

.source-item:hover {
    background: #f3f4f6;
}

.source-item .check-mark {
    display: none;
    font-weight: bold;
}

.source-item.active .check-mark {
    display: block;
}
	
/* ESTIMATOR: TRUE CUSTOM DROPDOWNS */
.table-card-3d.estimator-card{
  overflow: visible;
  z-index: 2;
}

.est-dd{
  position: relative;
  width: 100%;
}

.est-dd-btn{
  width: 100%;
  min-height: 44px;
  padding: 10px 40px 10px 12px;
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  font-size: 0.93rem;
  font-weight: 700;
  position: relative;

  box-shadow:
    0 2px 6px rgba(0,0,0,.10),
    0 12px 24px rgba(0,0,0,.12);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.12s ease,
    filter 0.12s ease;
}

.est-dd-btn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 4px;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.55),
    rgba(255,255,255,0) 52%
  );
  pointer-events:none;
  opacity:.35;
}

.est-dd-btn::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:5px;
  border-bottom-left-radius:4px;
  border-bottom-right-radius:4px;
  background: rgba(0,0,0,.08);
  box-shadow: 0 -1px 0 rgba(255,255,255,.45) inset;
  pointer-events:none;
  opacity:.95;
}

.est-dd-btn:hover{
  border-color: rgba(17,24,39,.22);
  filter: brightness(1.01);
}

.est-dd.open .est-dd-btn,
.est-dd-btn:focus{
  outline:none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(14,165,233,.16),
    0 10px 20px rgba(0,0,0,.14),
    0 24px 44px rgba(0,0,0,.14);
  transform: translateY(-1px);
}

.est-dd-btn-text{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  position: relative;
  z-index: 1;
}

.est-dd-placeholder{
  color: var(--muted);
}

.est-dd-caret{
  position:absolute;
  right:12px;
  top:50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
  z-index: 1;
  transition: transform 0.16s ease;
}

.est-dd.open .est-dd-caret{
  transform: translateY(-50%) rotate(180deg);
}

.est-dd-menu{
  position:absolute;
  top: calc(100% + 6px);
  left:0;
  right:0;
  background:#fff;
  border:1px solid rgba(17,24,39,.10);
  border-radius: 4px;
  padding: 6px;
  max-height: 260px;
  overflow: auto;
  z-index: 80;

  box-shadow:
    0 10px 20px rgba(0,0,0,.14),
    0 26px 50px rgba(0,0,0,.16);
}

.est-dd-menu[hidden]{
  display:none;
}

.est-dd-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.est-dd-option{
  width:100%;
  border:1px solid var(--border);
  border-radius: 4px;
  background:#f9fafb;
  color: var(--primary);
  text-align:left;
  padding:10px 12px;
  font-size:0.9rem;
  font-weight:700;
  cursor:pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.est-dd-option:hover{
  background:#f3f4f6;
}

.est-dd-option.active{
  background:#eff6ff;
  border-color:#2563eb;
  color:#1e40af;
}

@media (max-width: 600px){
  .est-dd-btn{
    min-height: 42px;
    padding: 10px 38px 10px 11px;
    font-size: 0.90rem;
  }

  .est-dd-menu{
    max-height: 220px;
  }

  .est-dd-option{
    padding: 10px 11px;
    font-size: 0.88rem;
  }
}


.lbma-footnote{
  text-align:center;
  font-size:.75rem;
  color:var(--muted);
  margin-top:.25rem;
}
/* ===== CONFIRM MODAL – MATCH SAVE BUTTON DEPTH ===== */
#appConfirmModal .modal-card{
  border-radius: 4px; /* same family as Save button */
  box-shadow:
    0 1px 0 rgba(255,255,255,.65),        /* top highlight */
    0 4px 10px rgba(0,0,0,.22),           /* mid depth */
    0 18px 36px rgba(0,0,0,.28);           /* primary drop */
}
#appConfirmModal .modal-card{
  border: 1px solid rgba(17,24,39,.14);
}
/* Print-only spot snapshot */
/*.print-inline-prices { display: none; gap: .75rem; margin: .75rem 0 0 0; }*/  /* this line displays the additional blocks of prices on the main page */
.print-inline-prices { display: none !important; gap: .75rem; margin: .75rem 0 0 0; }
.print-value { font-weight: 800; font-size: 1.5rem; margin-top: 2px; }
.print-inline-prices .metal-prem-label { margin-top: 2px; font-size: 0.95rem; font-weight: 700; }
/* Show only on Daily print */
@page{
  size: letter;
  margin: 0.45in;
}

@media print {
  /* show print blocks only during print */
  .print-inline-prices { display: flex !important; }

  /* one-line = 4 columns during print */
  .print-inline-prices.one-line{
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .45rem !important;
  }
  .print-inline-prices.one-line .price-box{
    min-width: 0 !important;
  }

  /* Never show on History print */
  body:has(#historyOverlay.active) .print-inline-prices { display: none !important; }

  /* =========================
     DAILY PRINT: Compact + No 3D
     ========================= */

  .header-card,
  .meta-pill,
  .source-badge,
  .table-card-3d,
  .calc-table,
  .price-box{
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
    background: #fff !important;
  }

  .header-card::before, .header-card::after,
  .meta-pill::before, .meta-pill::after,
  .table-card-3d::before, .table-card-3d::after,
  .calc-table::before, .calc-table::after,
  .price-box::before, .price-box::after{
    content: none !important;
    display: none !important;
  }

  body{ background:#fff !important; }
  .container{ padding: 0 !important; }
  .credit{ margin-bottom: 4px !important; }

  .header-card{
    padding: 8px 10px !important;
    margin: 0 0 6px 0 !important;
    border: 1px solid #ddd !important;
  }

  .app-title{ font-size: 1.15rem !important; text-shadow:none !important; }
  .title-accent{ display:none !important; }

  
  .meta-pill{ padding: 4px 8px !important; font-size: .78rem !important; }

  .header-divider{ margin: 6px auto 6px auto !important; }

  .calc-table th, .calc-table td{
    padding: .35rem .3rem !important;
    font-size: .72rem !important;
  }

  .print-inline-prices{
    gap: .45rem !important;
    margin: .35rem 0 0 0 !important;
  }
  .print-inline-prices .price-box{
    padding: .45rem .55rem !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
  }
  .print-inline-prices .metal-label{
    font-size: .62rem !important;
    letter-spacing: .3px !important;
  }
  .print-inline-prices .metal-prem-label{
    font-size: .65rem !important;
    font-weight: 700 !important;
    margin-top: 1px !important;
  }
  .print-value{
    font-size: 1.10rem !important;
    margin-top: 1px !important;
  }

  .header-card, .table-card-3d, .print-inline-prices{
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Optional: if you still need it tighter, uncomment */
  body{ zoom: 0.92; }

}
.print-inline-prices { display: none !important; }

#messageModal { z-index: 10000 !important; }

/* R6.C1 company-policy password step-up: keyboard-safe on touch devices. */
#companyPolicyPasswordOverlay{
  align-items:flex-start;
  justify-content:center;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-top:max(12px, env(safe-area-inset-top));
  padding-right:max(12px, env(safe-area-inset-right));
  padding-bottom:max(12px, env(safe-area-inset-bottom));
  padding-left:max(12px, env(safe-area-inset-left));
}
#companyPolicyPasswordOverlay .modal-card{
  margin-top:12px;
  max-height:calc(100dvh - 24px);
  overflow:auto;
}

/* Keep showMessage modal visible above mobile keyboards */
#messageModal{
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
}

#messageModal .modal-card{
  margin-top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
	
/* Message modal: pin near the top on phones/tablets so the keyboard never covers it */
@media (max-width: 900px){
  #messageModal{
    align-items: flex-start;
    justify-content: center;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  #messageModal .modal-card{
    width: calc(100% - 24px);
    max-width: 520px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    margin-top: 10px;
  }
}

/* EMAIL REPORT modal: keep action buttons above mobile keyboard */
#emailModal{
  align-items: flex-start !important;
  justify-content: center !important;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
}

#emailModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  margin-top: 10px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 1.1rem;
  text-align: left;
}

@media (max-width: 600px){
  #emailModal{
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  #emailModal .modal-card{
    width: calc(100% - 16px);
    margin-top: 6px;
    max-height: calc(100dvh - 16px);
    padding: 1rem;
  }
}

html.setup-modal-open,
body.setup-modal-open{
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* ===== Setup Modal: responsive width for tablet / iPad / desktop ===== */
#setupModal{
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
}

#setupModal .modal-card{
  width: calc(100% - 24px);
  max-width: 980px;
  max-height: calc(100dvh - 24px);
  margin-top: 10px;
  text-align: left;
}

@media (max-width: 900px){
  #setupModal .modal-card{
    max-width: 820px;
  }
}

@media (max-width: 600px){
  #setupModal{
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  #setupModal .modal-card{
    width: calc(100% - 16px);
    max-width: 420px;
    max-height: calc(100dvh - 16px);
    margin-top: 6px;
  }
}

.sub-expired { color: var(--danger) !important; font-weight: 800; }
/* ===== Setup Modal: Accordion Card ===== */
.acc-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
  margin-top: 20px;
}

.acc-summary{
	/*text-align:match-parent;*/
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 800;
  color: var(--gold-text);
}

.acc-summary::-webkit-details-marker{ display:none; }

.acc-sub{
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.acc-caret{
  transition: transform 150ms ease;
  font-size: 1.05rem;
  color: var(--muted);
}

.acc-card[open] > .acc-summary .acc-caret{ transform: rotate(180deg); }

/* ===== Nested accordions inside Platform Maintenance ===== */
.acc-card--nested{
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.acc-card--nested:first-child{
  margin-top: 0;
}

.acc-card--nested > .acc-summary{
  padding: 10px 12px;
  background: #f9fafb;
}

.acc-card--nested > .acc-body{
  background: #f9fafb;
}

/* ==========================================================
   Phase 4.5D.0C.1 — Inventory Setup Sub-Accordion Cleanup
   Parent Inventory accordion now contains two focused sub-accordions:
   Inventory Locations and Freeze / Unfreeze Inventory.
   ========================================================== */

.inventory-setup-body{
  padding:12px 14px 14px;
  background:#fff;
}

.inventory-setup-sub-accordion{
  margin:0 0 10px 0;
  border-left:5px solid #0f4c81;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 3px 12px rgba(15,23,42,.06);
}

.inventory-setup-sub-accordion:last-child{
  margin-bottom:0;
}

.inventory-setup-sub-summary{
  padding:12px 14px;
  background:linear-gradient(180deg, #f8fafc 0%, #eef6ff 100%);
  color:#0f4c81;
}

.inventory-setup-sub-summary .acc-sub{
  color:#64748b;
}

.inventory-setup-sub-accordion[open] > .inventory-setup-sub-summary{
  border-bottom:1px solid rgba(15,76,129,.14);
}

.inventory-setup-sub-body{
  padding:12px;
  background:#f8fafc;
}

/* ==========================================================
   Phase 4.5D.3 — Inventory Reconciliation Setup Workflow
   Top-level unlock-protected admin repair workflow.
   ========================================================== */

.inventory-reconciliation-setup-accordion{
  border-left-color:#b45309;
}

.inventory-reconciliation-setup-body{
  background:#fff7ed;
}

.inventory-reconciliation-admin-lock-card,
.inventory-reconciliation-admin-panel{
  background:#fff;
  border:1px solid rgba(180,83,9,.22);
  border-radius:12px;
  padding:14px;
  box-shadow:0 4px 14px rgba(15,23,42,.06);
}

.inventory-reconciliation-admin-lock-title,
.inventory-reconciliation-admin-title{
  font-size:1rem;
  font-weight:900;
  color:#92400e;
  margin-bottom:4px;
}

.inventory-reconciliation-admin-lock-text,
.inventory-reconciliation-admin-sub,
.inventory-reconciliation-admin-note{
  font-size:.86rem;
  color:var(--muted);
  line-height:1.4;
}

.inventory-reconciliation-admin-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.inventory-reconciliation-action-row{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin-top:12px;
}

.inventory-reconciliation-freeze-status{
  border-radius:10px;
  padding:10px 12px;
  font-size:.88rem;
  font-weight:800;
  line-height:1.35;
  background:#f8fafc;
  color:#334155;
  border:1px solid var(--border);
}

.inventory-reconciliation-freeze-status.is-frozen{
  background:#ecfdf5;
  color:#047857;
  border-color:rgba(16,185,129,.35);
}

.inventory-reconciliation-freeze-status.is-not-frozen{
  background:#fff7ed;
  color:#b45309;
  border-color:rgba(180,83,9,.35);
}

.inventory-reconciliation-admin-status{
  margin-top:10px;
  border-radius:10px;
  padding:9px 11px;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
  background:#f8fafc;
  color:var(--muted);
  border:1px solid var(--border);
}

.inventory-reconciliation-admin-status--success{
  background:#ecfdf5;
  color:#047857;
  border-color:rgba(16,185,129,.35);
}

.inventory-reconciliation-admin-status--error{
  background:#fef2f2;
  color:#dc2626;
  border-color:rgba(239,68,68,.35);
}

.inventory-reconciliation-report-card,
.inventory-reconciliation-preview-card{
  width:min(96vw, 1180px);
  max-width:1180px;
  max-height:92dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.inventory-reconciliation-overlay-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--border);
  padding-bottom:10px;
  margin-bottom:10px;
}

.inventory-reconciliation-overlay-head h3{
  margin:0;
  font-size:1.25rem;
  font-weight:900;
  color:var(--gold-text);
  text-shadow:0 1px 2px rgba(0,0,0,.25);
}

.inventory-reconciliation-overlay-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.inventory-reconciliation-report-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:6px;
  color:var(--muted);
  font-size:.82rem;
  font-weight:700;
}

.inventory-reconciliation-report-body,
.inventory-reconciliation-preview-body{
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:3px;
}

.inventory-reconciliation-summary-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
  margin-bottom:12px;
}

.inventory-reconciliation-summary-grid > div{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
}

.inventory-reconciliation-summary-grid strong{
  display:block;
  color:var(--muted);
  font-size:.74rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.inventory-reconciliation-summary-grid span{
  display:block;
  margin-top:4px;
  font-size:1.1rem;
  font-weight:900;
  color:var(--primary);
}

/* Phase 4.5D.3 — Reconciliation Issue Scanner accordion-card layout */
.inventory-reconciliation-issue-card-list{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.inventory-reconciliation-issue-card{
  background:#fff;
  border:1px solid rgba(15,76,129,.16);
  border-left:6px solid #0f4c81;
  border-radius:12px;
  box-shadow:0 3px 10px rgba(15,23,42,.06);
  overflow:hidden;
}

.inventory-reconciliation-issue-card--critical{
  border-left-color:#dc2626;
}

.inventory-reconciliation-issue-card--high,
.inventory-reconciliation-issue-card--warning{
  border-left-color:#b45309;
}

.inventory-reconciliation-issue-card--medium{
  border-left-color:#d97706;
}

.inventory-reconciliation-issue-card--low,
.inventory-reconciliation-issue-card--info{
  border-left-color:#0f4c81;
}

.inventory-reconciliation-issue-card--accordion > summary{
  list-style:none;
}

.inventory-reconciliation-issue-card--accordion > summary::-webkit-details-marker{
  display:none;
}

.inventory-reconciliation-issue-summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:10px 11px;
  cursor:pointer;
  user-select:none;
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.inventory-reconciliation-issue-summary:hover{
  background:#f8fafc;
}

.inventory-reconciliation-issue-summary-left{
  min-width:0;
  flex:1 1 auto;
}

.inventory-reconciliation-issue-summary-right{
  display:flex;
  align-items:flex-start;
  gap:8px;
  flex:0 0 auto;
  max-width:48%;
}

.inventory-reconciliation-issue-eyebrow{
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  line-height:1.1;
}

.inventory-reconciliation-issue-title-line{
  margin-top:3px;
  display:flex;
  align-items:baseline;
  gap:5px;
  min-width:0;
  color:var(--primary);
  line-height:1.2;
}

.inventory-reconciliation-issue-title{
  font-size:.98rem;
  font-weight:950;
  color:var(--primary);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:220px;
}

.inventory-reconciliation-issue-title-desc{
  min-width:0;
  font-size:.84rem;
  font-weight:750;
  color:#334155;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inventory-reconciliation-issue-short-reason{
  margin-top:3px;
  font-size:.8rem;
  font-weight:750;
  color:var(--muted);
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inventory-reconciliation-issue-badges{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:flex-start;
}

.inventory-reconciliation-card-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:4px 8px;
  font-size:.68rem;
  font-weight:900;
  line-height:1.1;
  border:1px solid var(--border);
  white-space:nowrap;
}

.inventory-reconciliation-card-badge--code{
  border-radius:7px;
  background:#f8fafc;
  color:#334155;
  max-width:210px;
  overflow:hidden;
  text-overflow:ellipsis;
}

.inventory-reconciliation-card-badge--difference{
  font-variant-numeric:tabular-nums;
}

.inventory-reconciliation-card-badge--critical{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

.inventory-reconciliation-card-badge--high,
.inventory-reconciliation-card-badge--warning{
  color:#9a3412;
  background:#fff7ed;
  border-color:#fed7aa;
}

.inventory-reconciliation-card-badge--medium{
  color:#92400e;
  background:#fffbeb;
  border-color:#fde68a;
}

.inventory-reconciliation-card-badge--low,
.inventory-reconciliation-card-badge--info{
  color:#1e40af;
  background:#eff6ff;
  border-color:#bfdbfe;
}

.inventory-reconciliation-card-badge--success{
  color:#047857;
  background:#ecfdf5;
  border-color:#a7f3d0;
}

.inventory-reconciliation-issue-caret{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  flex:0 0 20px;
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-weight:900;
  line-height:1;
  border:1px solid var(--border);
  transition:transform .18s ease;
}

.inventory-reconciliation-issue-card[open] .inventory-reconciliation-issue-caret{
  transform:rotate(180deg);
}

.inventory-reconciliation-issue-accordion-body{
  padding:10px 11px 11px;
  border-top:1px solid rgba(15,23,42,.08);
  background:#fff;
}

.inventory-reconciliation-issue-facts{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:7px;
}

.inventory-reconciliation-issue-fact,
.inventory-reconciliation-issue-metric{
  border:1px solid var(--border);
  border-radius:9px;
  background:#f8fafc;
  padding:7px 8px;
  min-width:0;
}

.inventory-reconciliation-issue-fact-label,
.inventory-reconciliation-issue-metric-label{
  font-size:.66rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--muted);
  line-height:1.1;
}

.inventory-reconciliation-issue-fact-value,
.inventory-reconciliation-issue-metric-value{
  margin-top:3px;
  font-size:.84rem;
  font-weight:850;
  color:var(--primary);
  line-height:1.2;
  overflow-wrap:anywhere;
}

.inventory-reconciliation-issue-metrics{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:7px;
  margin-top:8px;
}

.inventory-reconciliation-issue-metric{
  background:#fff;
}

.inventory-reconciliation-issue-metric-value{
  font-size:.98rem;
  font-weight:950;
}

.inventory-reconciliation-issue-metric--attention{
  border-color:rgba(180,83,9,.35);
  background:#fff7ed;
}

.inventory-reconciliation-issue-metric--attention .inventory-reconciliation-issue-metric-value{
  color:#b45309;
}

.inventory-reconciliation-issue-diagnostics{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:8px;
}

.inventory-reconciliation-issue-diagnostic{
  border:1px solid rgba(15,76,129,.14);
  border-radius:9px;
  background:#ffffff;
  padding:9px;
}

.inventory-reconciliation-issue-diagnostic-label{
  font-size:.7rem;
  font-weight:950;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#0f4c81;
  line-height:1.1;
}

.inventory-reconciliation-issue-diagnostic-value{
  margin-top:5px;
  font-size:.86rem;
  font-weight:750;
  color:var(--primary);
  line-height:1.35;
  overflow-wrap:anywhere;
}

.inventory-reconciliation-issue-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:9px;
}

.inventory-reconciliation-issue-actions .inventory-reconciliation-preview-btn{
  width:auto;
  min-width:150px;
}

@media (min-width:701px) and (max-width:1050px){
  .inventory-reconciliation-report-card{
    width:calc(100vw - 18px);
    max-width:none;
  }

  .inventory-reconciliation-issue-summary-right{
    max-width:52%;
  }

  .inventory-reconciliation-issue-facts,
  .inventory-reconciliation-issue-metrics{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:700px){
  .inventory-reconciliation-report-card{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .inventory-reconciliation-issue-card{
    border-radius:10px;
  }

  .inventory-reconciliation-issue-summary{
    flex-direction:column;
    gap:8px;
    padding:9px;
  }

  .inventory-reconciliation-issue-summary-right{
    width:100%;
    max-width:100%;
    justify-content:space-between;
    align-items:flex-start;
  }

  .inventory-reconciliation-issue-badges{
    justify-content:flex-start;
    flex:1 1 auto;
  }

  .inventory-reconciliation-issue-title-line{
    display:block;
  }

  .inventory-reconciliation-issue-title{
    display:block;
    max-width:100%;
  }

  .inventory-reconciliation-issue-title-desc{
    display:block;
    margin-top:2px;
    white-space:normal;
  }

  .inventory-reconciliation-issue-short-reason{
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }

  .inventory-reconciliation-issue-facts,
  .inventory-reconciliation-issue-metrics{
    grid-template-columns:1fr;
  }

  .inventory-reconciliation-issue-actions{
    justify-content:stretch;
  }

  .inventory-reconciliation-issue-actions .inventory-reconciliation-preview-btn{
    width:100%;
    min-width:0;
  }
}

.inventory-reconciliation-table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}

.inventory-reconciliation-table th,
.inventory-reconciliation-table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
  font-size:.84rem;
}

.inventory-reconciliation-table th{
  position:sticky;
  top:0;
  background:#f8fafc;
  z-index:1;
  font-weight:900;
  color:#0f4c81;
}

.inventory-reconciliation-empty{
  padding:14px;
  border:1px dashed var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:var(--muted);
  font-weight:800;
}

.inventory-reconciliation-apply-summary{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  margin-bottom:12px;
  font-size:.88rem;
  line-height:1.4;
}

.inventory-repair-preview-apply-row{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

.inventory-reconciliation-manual-editor{
  margin-top:12px;
  border:1px solid rgba(180,83,9,.22);
  border-radius:12px;
  background:#fff;
  padding:10px;
}

.inventory-reconciliation-manual-title{
  font-weight:900;
  color:#92400e;
  margin-bottom:4px;
}

.inventory-reconciliation-manual-table input[type="number"]{
  width:100%;
  min-width:90px;
  padding:8px 9px;
  border:1px solid var(--border);
  border-radius:8px;
  font-weight:800;
}

.inventory-reconciliation-sync-main-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  font-size:.88rem;
  font-weight:800;
  color:var(--primary);
}

/* ==========================================================
   Phase 4.5D.3A - Inventory Reconciliation UI Hardening
   Permanent compact scanner rows, no clipped badges, card-based
   preview/apply rows, and full-screen tablet/mobile overlays.
   ========================================================== */

.inventory-reconciliation-report-body,
.inventory-reconciliation-preview-body{
  min-width:0;
  overflow-x:hidden;
}

.inventory-reconciliation-issue-card-list{
  gap:6px;
}

.inventory-reconciliation-issue-card{
  border-radius:10px;
  box-shadow:0 2px 7px rgba(15,23,42,.05);
}

.inventory-reconciliation-issue-summary{
  align-items:center;
  padding:7px 9px;
  gap:8px;
}

.inventory-reconciliation-issue-summary-left{
  min-width:0;
}

.inventory-reconciliation-issue-summary-right{
  min-width:0;
  max-width:min(50%, 560px);
}

.inventory-reconciliation-issue-title-line{
  margin-top:1px;
}

.inventory-reconciliation-issue-title{
  max-width:260px;
}

.inventory-reconciliation-issue-title-desc{
  max-width:none;
}

.inventory-reconciliation-issue-short-reason{
  margin-top:2px;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.22;
}

.inventory-reconciliation-issue-badges{
  min-width:0;
}

.inventory-reconciliation-card-badge{
  min-width:0;
  max-width:100%;
}

.inventory-reconciliation-card-badge--code{
  max-width:none;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:break-word;
  text-align:center;
}

.inventory-reconciliation-issue-accordion-body{
  padding:8px 9px 9px;
}

.inventory-reconciliation-issue-facts,
.inventory-reconciliation-issue-metrics{
  gap:6px;
}

.inventory-reconciliation-issue-fact,
.inventory-reconciliation-issue-metric{
  padding:5px 7px;
  border-radius:8px;
}

.inventory-reconciliation-issue-diagnostics{
  gap:6px;
  margin-top:7px;
}

.inventory-reconciliation-issue-diagnostic{
  padding:7px 8px;
  border-radius:8px;
}

.inventory-reconciliation-issue-diagnostic-value{
  margin-top:3px;
  line-height:1.28;
}

.inventory-reconciliation-issue-actions{
  margin-top:7px;
}

.inventory-reconciliation-preview-card{
  width:min(96vw, 1180px);
  max-width:1180px;
}

.inventory-reconciliation-apply-card{
  width:min(96vw, 920px);
  max-width:920px;
  max-height:92dvh;
  display:flex;
  flex-direction:column;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.inventory-reconciliation-apply-card textarea{
  width:100%;
  max-width:100%;
  resize:vertical;
}

.inventory-reconciliation-apply-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:12px;
  flex-wrap:wrap;
}

.inventory-reconciliation-location-row-list,
.inventory-reconciliation-manual-card-list,
.inventory-reconciliation-default-location-list{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  min-width:0;
}

.inventory-reconciliation-location-row-card,
.inventory-reconciliation-manual-card,
.inventory-reconciliation-default-location-card{
  min-width:0;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  padding:9px;
  box-shadow:0 1px 3px rgba(15,23,42,.05);
}

.inventory-reconciliation-location-row-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  min-width:0;
  margin-bottom:7px;
}

.inventory-reconciliation-location-row-title,
.inventory-reconciliation-manual-card-location{
  min-width:0;
  font-weight:950;
  color:var(--primary);
  line-height:1.25;
  overflow-wrap:anywhere;
}

.inventory-reconciliation-location-row-state{
  flex:0 0 auto;
  border:1px solid var(--border);
  border-radius:999px;
  padding:3px 7px;
  font-size:.7rem;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
}

.inventory-reconciliation-location-row-state--success{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

.inventory-reconciliation-location-row-state--warning{
  background:#fff7ed;
  color:#9a3412;
  border-color:#fed7aa;
}

.inventory-reconciliation-mini-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:7px;
  min-width:0;
}

.inventory-reconciliation-mini-grid--manual{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  margin-top:8px;
}

.inventory-reconciliation-mini-stat{
  min-width:0;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f8fafc;
  padding:7px 8px;
}

.inventory-reconciliation-mini-stat--warning{
  background:#fff7ed;
  border-color:#fed7aa;
}

.inventory-reconciliation-mini-stat--input{
  background:#fff;
}

.inventory-reconciliation-mini-stat-label{
  display:block;
  font-size:.68rem;
  font-weight:950;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  line-height:1.12;
  margin-bottom:3px;
}

.inventory-reconciliation-mini-stat-value{
  display:block;
  font-size:.95rem;
  font-weight:950;
  color:var(--primary);
  line-height:1.2;
  overflow-wrap:anywhere;
}

.inventory-reconciliation-mini-stat input[type="number"]{
  width:100%;
  min-width:0;
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 9px;
  font-weight:900;
  font-size:1rem;
  color:var(--primary);
  background:#fff;
}

.inventory-reconciliation-mini-grid--default{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  margin-top:8px;
}

.inventory-reconciliation-default-location-card{
  margin-top:10px;
}

.inventory-reconciliation-default-location-select-wrap{
  margin-top:10px;
}

.inventory-reconciliation-default-location-select{
  width:100%;
  min-width:0;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:var(--primary);
  padding:9px 10px;
  font-size:.95rem;
  font-weight:800;
}

.inventory-reconciliation-location-row-notes{
  margin-top:7px;
  border:1px dashed var(--border);
  border-radius:8px;
  background:#f8fafc;
  padding:7px 8px;
}

.inventory-reconciliation-location-row-notes-label{
  font-size:.68rem;
  font-weight:950;
  color:#0f4c81;
  text-transform:uppercase;
  letter-spacing:.04em;
  line-height:1.12;
}

.inventory-reconciliation-location-row-notes-value{
  margin-top:3px;
  font-size:.82rem;
  font-weight:750;
  color:var(--primary);
  line-height:1.28;
  overflow-wrap:anywhere;
}

@media (min-width:701px) and (max-width:1180px){
  #inventoryReconciliationRepairPreviewOverlay,
  #inventoryReconciliationApplyOverlay{
    align-items:stretch !important;
    justify-content:stretch !important;
    padding:8px !important;
  }

  .inventory-reconciliation-preview-card,
  .inventory-reconciliation-apply-card{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
    height:calc(100dvh - 16px) !important;
    max-height:calc(100dvh - 16px) !important;
  }

  .inventory-reconciliation-issue-summary{
    align-items:stretch;
    flex-direction:column;
  }

  .inventory-reconciliation-issue-summary-right{
    width:100%;
    max-width:100%;
    justify-content:space-between;
  }

  .inventory-reconciliation-issue-title,
  .inventory-reconciliation-issue-title-desc{
    max-width:none;
  }

  .inventory-reconciliation-card-badge--code{
    text-align:left;
  }
}

@media (max-width:700px){
  .inventory-reconciliation-action-row{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
  }

  .inventory-reconciliation-action-row .btn{
    width:100%;
    flex:1 1 auto;
    min-height:44px;
  }

  #inventoryReconciliationRepairPreviewOverlay,
  #inventoryReconciliationApplyOverlay{
    align-items:stretch !important;
    justify-content:stretch !important;
    padding:0 !important;
  }

  .inventory-reconciliation-preview-card,
  .inventory-reconciliation-apply-card{
    width:100vw !important;
    max-width:none !important;
    height:100dvh !important;
    max-height:100dvh !important;
    border-radius:0 !important;
  }

  .inventory-reconciliation-preview-body,
  .inventory-reconciliation-apply-card{
    padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-reconciliation-apply-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .inventory-reconciliation-apply-actions .btn{
    width:100%;
    min-height:44px;
  }

  .inventory-reconciliation-location-row-head{
    flex-direction:column;
    align-items:stretch;
  }

  .inventory-reconciliation-location-row-state{
    width:max-content;
    max-width:100%;
    white-space:normal;
  }

  .inventory-reconciliation-mini-grid,
  .inventory-reconciliation-mini-grid--manual{
    grid-template-columns:1fr;
  }
}

@media (max-width:700px){
  .inventory-reconciliation-summary-grid{
    grid-template-columns:1fr 1fr;
  }

  .inventory-reconciliation-overlay-head{
    flex-direction:column;
  }

  .inventory-reconciliation-overlay-actions{
    width:100%;
  }

  .inventory-reconciliation-overlay-actions .btn{
    flex:1;
  }
}

.inventory-setup-location-card{
  background:#fff !important;
  border-color:rgba(15,76,129,.16) !important;
  box-shadow:0 2px 8px rgba(15,23,42,.04);
}

/* Phase 4.5D.2F — Inventory Locations UI Professionalization */
.inventory-location-manager-panel{
  border:1px solid rgba(15,76,129,.16);
  border-radius:14px;
  padding:12px;
  background:#fff;
}

.inventory-location-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
  padding-bottom:10px;
  border-bottom:1px solid rgba(15,76,129,.12);
}

.inventory-location-panel-title{
  font-size:1rem;
  font-weight:900;
  color:#0f4c81;
  line-height:1.2;
}

.inventory-location-panel-subtitle{
  margin-top:3px;
  font-size:.82rem;
  font-weight:650;
  color:var(--muted);
  line-height:1.35;
}

.inventory-location-panel-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  min-width:min(100%, 310px);
}

.inventory-location-action-btn{
  flex:1 1 145px;
  min-width:145px;
}

.inventory-location-panel-actions .inventory-location-action-btn:not(.save-btn){
  background:#0f4c81;
  color:#fff;
}

.inventory-location-filter-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
  padding:10px;
  border:1px solid rgba(15,76,129,.12);
  border-radius:12px;
  background:#f8fafc;
}

.inventory-location-filter-btn{
  flex:0 1 118px;
  min-width:108px;
  background:#64748b;
  color:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.10);
}

.inventory-location-filter-btn.is-selected{
  background:#0f4c81;
  color:#fff;
  box-shadow:
    0 0 0 2px rgba(15,76,129,.16),
    0 8px 18px rgba(15,76,129,.18);
}

.inventory-location-filter-summary{
  flex:1 1 240px;
  color:var(--muted);
  font-size:.8rem;
  font-weight:800;
  line-height:1.3;
}

.inventory-location-status{
  margin-top:10px;
  padding:8px 10px;
  border:1px solid rgba(15,76,129,.14);
  border-radius:10px;
  background:#f8fafc;
  font-size:.85rem;
  font-weight:750;
  line-height:1.35;
}

.inventory-location-status-error{
  border-color:rgba(239,68,68,.26);
  background:#fef2f2;
}

.inventory-location-status-success{
  border-color:rgba(16,185,129,.26);
  background:#ecfdf5;
}

.inventory-location-status-info{
  border-color:rgba(15,76,129,.18);
  background:#eff6ff;
}

.inventory-location-status-overlay{
  margin-top:4px;
}

.inventory-location-phone-hint{
  margin-top:5px;
  font-size:.76rem;
  font-weight:650;
  line-height:1.3;
  color:var(--muted);
}

.inventory-location-phone-hint.is-success{
  color:#065f46;
}

.inventory-location-phone-hint.is-error{
  color:var(--danger);
}

.inventory-location-phone-hint.is-info{
  color:var(--muted);
}

.inventory-location-clear-field-wrap{
  width:100%;
  position:relative;
}

.inventory-location-clear-input{
  padding-right:44px !important;
}

.inventory-location-clear-field-wrap .inventory-location-field-clear-btn{
  right:8px;
  width:26px;
  height:26px;
  min-width:26px;
  min-height:26px;
  font-size:13px;
  color:#991b1b;
  -webkit-text-fill-color:#991b1b;
}

.inventory-location-clear-field-wrap .inventory-location-field-clear-btn:hover,
.inventory-location-clear-field-wrap .inventory-location-field-clear-btn:focus{
  color:#7f1d1d;
  -webkit-text-fill-color:#7f1d1d;
  background:#fff7ed;
  border-color:rgba(153,27,27,.24);
}

.inventory-location-panel-note{
  margin-top:8px;
  font-size:.78rem;
  color:var(--muted);
  font-weight:650;
  line-height:1.35;
}

.inventory-default-location-panel{
  border:1px solid rgba(15,76,129,.16);
  border-radius:14px;
  padding:12px;
  background:#fff;
}

.inventory-default-location-grid{
  display:grid;
  grid-template-columns:minmax(240px, 1fr) auto;
  gap:12px;
  align-items:end;
  margin-top:12px;
}

.inventory-default-location-grid .form-group{
  margin-bottom:0;
  min-width:0;
}

.inventory-default-location-grid .form-group label{
  display:block;
  margin-bottom:4px;
  line-height:1.15;
}

.inventory-default-location-grid #companyInventoryNewItemDefaultLocation,
.inventory-default-location-actions .btn{
  min-height:42px;
}

.inventory-default-location-actions{
  display:flex;
  justify-content:flex-end;
  align-items:flex-end;
  align-self:end;
  padding-bottom:0;
}

.inventory-default-location-actions .btn{
  min-width:190px;
  height:42px;
  padding-top:0;
  padding-bottom:0;
  line-height:1.15;
  white-space:nowrap;
}

.inventory-location-list-scroll{
  display:grid;
  gap:10px;
  margin-top:12px;
  max-height:min(52vh, 560px);
  overflow-y:auto;
  padding:2px 4px 2px 0;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

.inventory-location-list-scroll::-webkit-scrollbar{
  width:8px;
}

.inventory-location-list-scroll::-webkit-scrollbar-thumb{
  background:rgba(15,76,129,.24);
  border-radius:999px;
}

.inventory-location-empty{
  padding:12px;
  border:1px dashed var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  font-weight:700;
}

.inventory-location-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.04);
}

.inventory-location-card-main{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.inventory-location-card-info{
  min-width:0;
  flex:1 1 260px;
}

.inventory-location-card-title{
  font-weight:900;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.inventory-location-card-meta,
.inventory-location-card-stock,
.inventory-location-card-detail{
  font-size:.82rem;
  color:var(--muted);
  margin-top:4px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.inventory-location-card-stock{
  font-weight:750;
  color:#334155;
}

.inventory-location-card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  flex:0 1 320px;
}

.inventory-location-list-btn{
  flex:1 1 112px;
  min-width:112px;
}

.inventory-location-card-actions .inventory-location-list-edit-btn{
  background:#0f4c81 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border:1px solid #0f4c81 !important;
}

.inventory-location-card-actions .inventory-location-list-edit-btn::after{
  background:rgba(0,0,0,.20) !important;
}

.inventory-location-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  border-radius:999px;
  padding:4px 10px;
  font-size:.78rem;
  font-weight:900;
  color:#fff;
}

.inventory-location-badge.is-active{
  background:#065f46;
}

.inventory-location-badge.is-inactive{
  background:#b45309;
}

.inventory-location-delete-btn{
  background:#991b1b;
  color:#fff;
}

.inventory-location-delete-btn--blocked{
  background:#e5e7eb !important;
  color:#6b7280 !important;
  -webkit-text-fill-color:#6b7280 !important;
  cursor:pointer;
  box-shadow:none;
  opacity:.94;
}

.inventory-location-delete-note{
  color:#92400e;
  font-weight:750;
}

.inventory-location-delete-action{
  color:#0f4c81;
  font-weight:750;
}

.inventory-location-delete-usage-list{
  display:grid;
  gap:4px;
  padding:8px 10px;
  border:1px solid #fed7aa;
  border-radius:9px;
  background:#fff7ed;
  color:#7c2d12;
  font-size:.85rem;
  line-height:1.35;
}

.inventory-location-overlay{
  align-items:center;
  justify-content:center;
  padding:14px;
}

.inventory-location-type-overlay{
  z-index:2600;
}

.inventory-location-type-overlay .inventory-location-modal-card{
  margin:auto;
}

.inventory-location-modal-card{
  width:min(760px, calc(100vw - 24px));
  max-height:calc(100dvh - 28px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
}

/* ==========================================================
   Phase 4.5D.2G — Custom Inventory Location Type Overlay
   ========================================================== */
.inventory-location-type-modal-card{
  width:min(440px, calc(100vw - 24px));
  max-height:calc(100dvh - 28px);
}

.inventory-location-type-form{
  display:grid;
  gap:12px;
}

.inventory-location-type-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:4px;
}

.inventory-location-type-actions .btn{
  flex:1 1 160px;
}

.inventory-location-type-status{
  display:none;
  margin:0;
  padding:8px 10px;
  border:1px solid rgba(15,76,129,.18);
  border-radius:10px;
  background:#eff6ff;
  color:var(--muted);
  font-size:.84rem;
  font-weight:800;
  line-height:1.35;
}

.inventory-location-type-status.is-visible{
  display:block;
}

.inventory-location-type-status.is-error{
  border-color:rgba(239,68,68,.26);
  background:#fef2f2;
  color:#991b1b;
}

.inventory-location-type-status.is-success{
  border-color:rgba(16,185,129,.26);
  background:#ecfdf5;
  color:#065f46;
}

@media (max-width:600px){
  .inventory-location-type-modal-card{
    width:calc(100vw - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-location-type-actions{
    flex-direction:column;
  }

  .inventory-location-type-actions .btn{
    width:100%;
    flex:1 1 auto;
  }
}

.inventory-location-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px 12px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.inventory-location-modal-head h3{
  margin:0;
  color:var(--gold-text);
  font-size:1.15rem;
  font-weight:900;
  line-height:1.2;
}

.inventory-location-modal-subtitle{
  margin-top:3px;
  color:var(--muted);
  font-size:.84rem;
  font-weight:650;
  line-height:1.35;
}

.inventory-location-modal-close{
  width:34px;
  height:34px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:var(--danger);
  font-size:1rem;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.inventory-location-modal-body{
  overflow:auto;
  padding:14px 16px;
  -webkit-overflow-scrolling:touch;
}

.inventory-location-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px 12px;
  margin-bottom:10px;
}

.inventory-location-form-grid:last-child{
  margin-bottom:0;
}

.inventory-location-grid-wide{
  grid-column:1 / -1;
}

.inventory-location-form-section-title{
  margin:12px 0 8px;
  padding-top:10px;
  border-top:1px solid rgba(15,76,129,.12);
  color:#0f4c81;
  font-size:.86rem;
  font-weight:900;
}

.inventory-location-modal-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:12px 16px 14px;
  border-top:1px solid var(--border);
  background:#fff;
}

.inventory-location-modal-actions .btn{
  flex:1 1 150px;
}

@media (max-width:700px){
  .inventory-location-panel-head{
    align-items:stretch;
  }

  .inventory-location-panel-actions{
    width:100%;
    min-width:0;
    justify-content:stretch;
  }

  .inventory-location-action-btn,
  .inventory-location-filter-btn{
    min-width:0;
  }

  .inventory-location-filter-row{
    align-items:stretch;
  }

  .inventory-location-filter-summary{
    flex-basis:100%;
  }

  .inventory-location-list-scroll{
    max-height:48vh;
  }

  .inventory-location-card-actions{
    width:100%;
    flex:1 1 100%;
    justify-content:stretch;
  }

  .inventory-location-list-btn,
  .inventory-location-badge{
    flex:1 1 120px;
  }

  .inventory-default-location-grid,
  .inventory-location-form-grid{
    grid-template-columns:1fr;
  }

  .inventory-default-location-actions{
    justify-content:stretch;
  }

  .inventory-default-location-actions .btn{
    width:100%;
    min-width:0;
  }

  .inventory-location-modal-card{
    width:min(100%, calc(100vw - 16px));
    max-height:calc(100dvh - 16px);
  }

  .inventory-location-modal-head,
  .inventory-location-modal-body,
  .inventory-location-modal-actions{
    padding-left:12px;
    padding-right:12px;
  }
}

@media (max-width:420px){
  .inventory-location-overlay{
    padding:8px;
  }

  .inventory-location-modal-actions .btn,
  .inventory-location-panel-actions .btn{
    flex:1 1 100%;
  }

  .inventory-location-list-scroll{
    max-height:44vh;
  }
}

.inventory-setup-freeze-body .inventory-freeze-panel{
  margin-top:0;
}

/* Phase 4.5D.0F UI cleanup - nested Freeze sub-accordions */
.inventory-freeze-subaccordion-stack{
  display:grid;
  gap:10px;
}

.inventory-freeze-child-accordion{
  margin:0;
  border-left:4px solid rgba(15,76,129,.72);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}

.inventory-freeze-child-summary{
  padding:11px 12px;
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color:#0f4c81;
}

.inventory-freeze-child-summary .acc-sub{
  color:#64748b;
}

.inventory-freeze-child-accordion[open] > .inventory-freeze-child-summary{
  border-bottom:1px solid rgba(15,76,129,.14);
}

.inventory-freeze-child-body{
  padding:12px;
  background:#ffffff;
}

.inventory-freeze-child-body .inventory-freeze-report-panel{
  margin-top:0;
  padding-top:0;
  border-top:0;
}

@media (max-width:600px){
  .inventory-setup-body{
    padding:10px;
  }

  .inventory-setup-sub-summary{
    padding:11px 12px;
  }

  .inventory-setup-sub-body{
    padding:10px;
  }

  .inventory-setup-sub-summary .acc-sub{
    font-size:.78rem;
    line-height:1.25;
  }
}

/* ===== Setup: Record Numbering & POS Counters ===== */
.numbering-intro{
  margin-bottom: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.numbering-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.numbering-card{
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fafb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.numbering-card-title{
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.25;
}

.numbering-card .form-group{
  min-width: 0;
}

.numbering-card .form-group label{
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.numbering-card input{
  width: 100%;
}

.numbering-card input[readonly]{
  background:#fff;
  color:var(--primary);
  -webkit-text-fill-color:var(--primary);
  opacity:1;
  cursor:not-allowed;
}

.numbering-lock-row{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:8px;
  font-size:0.8rem;
  line-height:1.3;
  font-weight:800;
  color:var(--primary);
  cursor:pointer;
}

.numbering-lock-row input{
  width:auto;
  min-width:16px;
  margin-top:2px;
}

.numbering-help{
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

@media (max-width: 640px){
  .numbering-grid{
    grid-template-columns: 1fr;
  }

  .numbering-card{
    padding: 11px;
  }
}

.acc-body{
  padding: 12px;
  border-top: 1px solid var(--border);
}
/* ============================================================
   HELP MODAL: FIX CUT-OFF ON SMALL DEVICES (e.g., Samsung S23)
   - Use dynamic viewport units (dvh) so Chrome address bar
     does not cause the top/bottom to be clipped.
   - Add padding + allow overlay scroll as a safety net.
   ============================================================ */
#helpModal, #helpSupportModal{
  height: 100vh;
  height: 100dvh;
}

#helpModal.modal-overlay,
#helpSupportModal.modal-overlay{
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#helpModal .modal-card,
#helpSupportModal .modal-card{
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
}

#helpModal .help-close-x{
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
/* =========================================
   MAIN PAGE: Compact Metal Price Cards ONLY
   (affects .inline-prices rows, not print row)
   ========================================= */
.inline-prices{
  gap: .55rem;          /* was .75rem */
  margin: .30rem 0;     /* was 0.5rem 0 */
}

.inline-prices .price-box{
  padding: .55rem .65rem;     /* was .75rem */
  justify-content: flex-start; /* was center (looks taller) */
}

/* Slightly smaller label + number for compact height */
.inline-prices .metal-label{
  font-size: .68rem;     /* was .75rem */
  letter-spacing: .35px; /* was 0.5px */
}

.inline-prices .price-box input{
  font-size: 1.25rem;  /* was 1.5rem */
  line-height: 1.08;
  margin-top: 1px;     /* was 2px */
  padding: 2px 0;      /* was 6px 0 */
}

/* Mobile: a touch tighter */
@media (max-width: 600px){
  .inline-prices{ gap: .5rem; margin: .25rem 0; }
  .inline-prices .price-box{ padding: .5rem .6rem; }
  .inline-prices .price-box input{ font-size: 1.18rem; }
}
/* ============================================================
   LOGIN OVERLAY: mobile keyboard safe
   - Top-align instead of vertical center
   - Allow scrolling inside overlay when keyboard is open
   - Reduce card padding on small screens
   ============================================================ */
/* R8: the login card fits inside the safe area, including keyboard-sized
   viewports. Normal spacing is additional to the OS inset, not a replacement. */
#loginOverlay{
  --mv-login-safe-top:env(safe-area-inset-top,0px);
  --mv-login-safe-right:env(safe-area-inset-right,0px);
  --mv-login-safe-bottom:env(safe-area-inset-bottom,0px);
  --mv-login-safe-left:env(safe-area-inset-left,0px);
  align-items:flex-start !important;
  justify-content:center !important;
  box-sizing:border-box;width:100%;
  height:100vh;height:100dvh;
  padding:12px;
  padding:calc(12px + var(--mv-login-safe-top)) calc(12px + var(--mv-login-safe-right))
          calc(12px + var(--mv-login-safe-bottom)) calc(12px + var(--mv-login-safe-left));
  overflow-y:auto;-webkit-overflow-scrolling:touch;
}

#loginOverlay .modal-card{
  box-sizing:border-box;flex:0 1 420px;width:100%;max-width:420px;min-width:0;
  margin:10px 0;padding:1.25rem 1.1rem;
  max-height:calc(100vh - 44px - var(--mv-login-safe-top) - var(--mv-login-safe-bottom));
  max-height:calc(100dvh - 44px - var(--mv-login-safe-top) - var(--mv-login-safe-bottom));
  overflow:auto;
  border:1px solid #8fa7bd;border-top:3px solid #0f4c81;border-radius:4px;
  box-shadow:0 8px 24px rgba(15,35,55,.16);
}

@media (max-width: 600px){
  #loginOverlay .modal-card{ padding: 1rem; }
  #loginOverlay .form-group{ margin-bottom: 10px; }
  #loginOverlay .form-group input:not([type="checkbox"]){
    padding: 9px;
  }
  #loginOverlay h2{ margin-bottom: 10px; }
}
/* ===== FORGOT / RESET PASSWORD: keyboard-safe (mobile) ===== */
#forgotModal,
#forgotCodeModal,
#forgotResumeModal,
#forgotPasswordModal,
#trialResumeModal,
#trialPasswordModal{
  align-items: flex-start;                 /* move card up */
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;                        /* allow scrolling when keyboard is open */
  -webkit-overflow-scrolling: touch;
}

#forgotModal .modal-card,
#forgotCodeModal .modal-card,
#forgotResumeModal .modal-card,
#forgotPasswordModal .modal-card,
#trialResumeModal .modal-card,
#trialPasswordModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;                        /* matches your inline max-width */
  margin-top: 10px;

  /* reduce height + allow internal scroll */
  padding: 1.25rem 1.1rem;                 /* smaller than default 2rem */
  max-height: calc(100dvh - 24px);         /* uses dynamic viewport height */
  overflow: auto;
}

#fpStatus,
#forgotResumeStatus{
  color: var(--danger) !important;
  font-weight: 700 !important;
  line-height: 1.35;
}

@media (max-width: 600px){
  #forgotModal .modal-card,
  #forgotCodeModal .modal-card,
  #forgotResumeModal .modal-card,
  #forgotPasswordModal .modal-card,
  #trialResumeModal .modal-card,
  #trialPasswordModal .modal-card{
    padding: 1rem;
  }
}
/* ===== TRIAL SIGNUP: keyboard-safe (mobile) ===== */
#trialCodeHint{
  text-align: center;
  white-space: pre-line; /* keeps your \n line breaks */
}
#trialModal,
#trialCodeModal{
  align-items: flex-start;                 /* move card up */
  justify-content: center;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;                        /* allow scrolling when keyboard is open */
  -webkit-overflow-scrolling: touch;
}

#trialModal .modal-card,
#trialCodeModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  margin-top: 10px;

  padding: 1.25rem 1.1rem;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  text-align: left;
}

/* Two-column layout where space allows; single column on mobile */
#trialModal .trial-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
#trialModal .trial-grid .form-group{ margin-bottom: 0; }

@media (max-width: 600px){
  #trialModal .modal-card,
  #trialCodeModal .modal-card{
    padding: 1rem;
  }
  #trialModal .trial-grid{
    grid-template-columns: 1fr;
    margin-bottom: 10px;
  }
}
	
/* ================================
   TRIAL MODAL: sticky action bar + scrollable fields
   - Buttons stay visible under the title
   - Fields scroll normally
=================================== */
#trialModal .modal-card{
  /* Use our internal padding; avoid double padding from the generic modal-card rules */
  padding: 0 !important;
}

/* Sticky header (title + buttons) */
#trialModal .trial-fixed-head{
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  padding: 1.25rem 1.1rem 12px;
  border-bottom: 1px solid var(--border);
}

/* Buttons row under the title */
#trialModal .trial-fixed-actions{
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Scrollable content (all form fields) */
#trialModal .trial-scroll-body{
  padding: 12px 1.1rem 1.25rem;
}

/* ================================
   TRIAL CONTRACT / BILLING SECTION
   ================================ */
#trialModal .trial-contract-card{
  margin: 0 0 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fafb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

#trialModal .trial-contract-title{
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--gold-text);
  margin-bottom: 8px;
  line-height: 1.25;
}

#trialModal .trial-billing-blurb{
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--primary);
}

#trialModal .trial-agreement-box{
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

#trialModal .trial-agreement-version{
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

#trialModal .trial-agreement-summary{
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--primary);
}

#trialModal .trial-agreement-note{
  margin-top: 8px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--muted);
}

#trialModal .trial-check-row{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}

#trialModal .trial-check-row input[type="checkbox"]{
  margin-top: 2px;
  transform: scale(1.05);
}

#trialModal .trial-check-row span{
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--primary);
  font-weight: 700;
}

#trialModal .trial-agreement-hint{
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

#trialModal .trial-agreement-hint.is-ready{
  color: var(--success);
  font-weight: 800;
}

/* Mobile spacing */
@media (max-width: 600px){
  #trialModal .trial-fixed-head{
    padding: 1rem 1rem 10px;
  }
  #trialModal .trial-scroll-body{
    padding: 10px 1rem 1rem;
  }
}
	
/* TEXT LINK MODAL (ContactLinkModal): keyboard-safe on mobile */
#ContactLinkModal{
  height: 100vh;
  height: 100dvh;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  overflow-y: auto;                 /* allow scrolling when keyboard is open */
  -webkit-overflow-scrolling: touch;
}

#ContactLinkModal .modal-card{
  width: calc(100% - 24px);
  max-width: 520px;
  margin-top: 10px;

  padding: 1.25rem 1.1rem;          /* tighter than default 2rem */
  max-height: calc(100dvh - 24px);  /* dynamic viewport height */
  overflow: auto;
  text-align: left;
}

/* On small screens, move the card toward the top (prevents keyboard overlap) */
@media (max-width: 900px){
  #ContactLinkModal{
    align-items: flex-start;
    justify-content: center;
  }
}
/* Mobile/touch: hide the large Setup button (keep the top icon) */
@media (max-width:600px), (hover:none) and (pointer:coarse){
  button.btn.setup-btn{
    display: none !important;
  }
}
/* iPad/tablet (touch): ensure Setup/Help icons are visible */
@media (hover: none) and (pointer: coarse) and (min-width: 601px){
  #headerSetupBtn,
  #headerHelpBtn{
    display: inline-flex !important;
    position: absolute;
    top: 2px;
    margin: 0 !important;   /* overrides the mobile negative margin */
    z-index: 5;
  }
  #headerSetupBtn{ left: 0; }
  #headerHelpBtn{ right: 0; }
    /* Hide the large main Help button on iPad/tablets */
  #mainHelpBtn{ display: none !important; }
}
.user-name-link{
  display:inline-block;
  width:100%;
  cursor:pointer;
  background:transparent;
  border:none;
  padding:0;
  margin:0;
  text-align:left;
  font:inherit;
  font-weight:800;
  color: var(--primary);
  text-decoration: none;
}
.user-name-link:active{ opacity: .7; }

.user-name-link:hover{ opacity: .85; }
.readonly-box{
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
/* =========================================
   FIX: Estimate Labels on Mobile Portrait
   ========================================= */

/* On mobile devices in portrait mode (up to 600px wide) */
@media (max-width: 600px) and (orientation: portrait) {
    
    /* 1. Ensure the parent label element remains visible */
    .estimator-grid .form-group label {
        display: block !important;
        margin-bottom: 4px;
    }

    /* 2. Hide the full-length text so it fits the screen */
    .estimator-grid .est-label-full {
        display: none !important;
    }

    /* 3. Force the short text versions (Wt, K/M, Comm) to display */
    .estimator-grid .est-label-short {
        display: inline-block !important;
    }
}

/* Ensure the short labels remain hidden on desktop and landscape mode */

@media (min-width: 601px) {
    .estimator-grid .est-label-short {
        display: none !important;
    }
}

/* Tenant and Billing */

  .tenant-billing-overlay{
    display:none;
    z-index:9800;
    padding:0;
    align-items:stretch;
    justify-content:stretch;
  }
  .tenant-billing-card{
    padding:0;
    width:100vw;
    max-width:100vw;
    height:100dvh;
    max-height:100dvh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    position:relative;
    border-radius:0;
    margin:0;
  }
  .tenant-billing-head{
    padding:12px 14px;
    border-bottom:1px solid var(--border);
    background:#fff;
    position:sticky;
    top:0;
    z-index:5;
  }
  .tenant-billing-title{
    margin:0;
    text-align:center;
    font-size:1.32rem;
    font-weight:900;
    color:var(--gold-text);
    text-shadow:0 1px 2px rgba(0,0,0,.35);
    letter-spacing:.2px;
  }
  .tenant-billing-subtitle{
    margin-top:6px;
    font-size:.82rem;
    color:var(--muted);
    text-align:center;
    line-height:1.35;
  }
  .tenant-billing-body{
    padding:12px 14px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    flex:1;
    background:var(--bg, #f5f6f8);
  }
  .tenant-billing-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:10px;
  }
  .tenant-billing-stack{
    display:grid;
    gap:10px;
  }
  .tenant-billing-info{
    border:1px solid var(--border);
    border-radius:14px;
    padding:12px;
    background:#fff;
    box-shadow:0 6px 18px rgba(15,23,42,.06);
    min-width:0;
  }
  .tenant-billing-info label{
    display:block;
    font-size:.76rem;
    color:var(--muted);
    margin-bottom:6px;
    font-weight:700;
  }
  .tenant-billing-value{
    font-weight:900;
    line-height:1.35;
    color:#111827;
    word-break:break-word;
    overflow-wrap:anywhere;
  }
  .tenant-billing-note{
    white-space:pre-wrap;
    word-break:break-word;
    overflow-wrap:anywhere;
    line-height:1.45;
    min-height:66px;
  }
  .tenant-detail-acc-card{
    border:1px solid var(--border);
    border-radius:14px;
    background:#fff;
    box-shadow:0 6px 18px rgba(15,23,42,.06);
    overflow:hidden;
  }
  .tenant-detail-acc-summary{
    list-style:none;
    cursor:pointer;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding:12px;
    background:#fff;
  }
  .tenant-detail-acc-summary::-webkit-details-marker{ display:none; }
  .tenant-detail-acc-summary-main{
    min-width:0;
    flex:1 1 auto;
  }
  .tenant-detail-acc-title{
    font-weight:800;
    color:var(--gold-text);
    line-height:1.25;
  }
  .tenant-detail-acc-sub{
    margin-top:2px;
    font-size:0.82rem;
    color:var(--muted);
    line-height:1.35;
  }
  .tenant-detail-acc-summary-side{
    display:flex;
    align-items:flex-start;
    gap:8px;
    flex:0 0 auto;
  }
  .tenant-detail-acc-caret{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:18px;
    color:var(--muted);
    font-size:1.05rem;
    transition:transform 150ms ease;
  }
  .tenant-detail-acc-card[open] > .tenant-detail-acc-summary .tenant-detail-acc-caret{
    transform:rotate(180deg);
  }
  .tenant-detail-acc-body{
    padding:0 12px 12px;
    background:#fff;
  }
  .tenant-billing-actions{
    display:flex;
    gap:10px;
    padding:12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top:1px solid var(--border);
    background:#fff;
    position:sticky;
    bottom:0;
    z-index:5;
  }
  .tenant-billing-actions .btn{
    flex:1;
    max-width:none;
    padding:10px 12px;
  }
  .tenant-billing-edit-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:10px;
  }
  .tenant-billing-edit-grid .form-group,
  .tenant-billing-stack .form-group{
    min-width:0;
  }
  @media (max-width: 640px) {
    .tenant-billing-head,
    .tenant-billing-body,
    .tenant-billing-actions{
      padding-left:12px;
      padding-right:12px;
    }
    .tenant-billing-title{
      font-size:1.18rem;
    }
    .tenant-billing-grid,
    .tenant-billing-edit-grid{
      grid-template-columns:1fr;
    }
    .tenant-detail-acc-summary,
    .tenant-detail-acc-body{
      padding-left:11px;
      padding-right:11px;
    }
    .tenant-detail-acc-summary-side{
      gap:6px;
    }
  }

	  /* ==========================================================
     Phase 4.5D.7.R3.3
     Tenant Admin mobile portrait action layout
     ========================================================== */

  .tenant-admin-action-grid{
    display:flex;
    flex-wrap:wrap;
    align-items:stretch;
    gap:8px;
    width:100%;
  }

  /*
    Narrow portrait devices only.

    Desktop, tablet, and landscape layouts continue using the
    existing flexible button row.
  */
  @media (max-width: 480px) and (orientation: portrait){

    #tenantDetailSectionTenantAdmin .tenant-admin-action-grid{
      display:grid;
      grid-template-columns:repeat(3, minmax(0, 1fr));
      grid-template-rows:repeat(2, minmax(64px, auto));
      gap:8px;
      width:100%;
      align-items:stretch;
    }

    #tenantDetailSectionTenantAdmin
    .tenant-admin-action-grid > .tenant-admin-action{
      width:100%;
      max-width:none;
      min-width:0;
      min-height:64px;
      margin:0;
      padding:8px 5px 10px;
      flex:none;

      font-size:.76rem;
      font-weight:800;
      line-height:1.15;
      text-align:center;

      white-space:normal !important;
      overflow-wrap:anywhere;
      word-break:normal;
      hyphens:none;
    }

    /* Portrait row 1 */
    #tenantDetailSectionTenantAdmin .tenant-admin-action--edit{
      grid-column:1;
      grid-row:1;
    }

    #tenantDetailSectionTenantAdmin .tenant-admin-action--unlock{
      grid-column:2;
      grid-row:1;
    }

    #tenantDetailSectionTenantAdmin .tenant-admin-action--copy{
      grid-column:3;
      grid-row:1;
    }

    /* Portrait row 2 */
    #tenantDetailSectionTenantAdmin .tenant-admin-action--reset{
      grid-column:1;
      grid-row:2;
    }

    #tenantDetailSectionTenantAdmin .tenant-admin-action--send{
      grid-column:2;
      grid-row:2;
    }

    #tenantDetailSectionTenantAdmin .tenant-admin-action--resend{
      grid-column:3;
      grid-row:2;
    }
  }

	@media (min-width: 1025px) and (hover:hover) and (pointer:fine) {
		.tenant-billing-overlay{
			padding:18px;
			align-items:center;
			justify-content:center;
		}

		.tenant-billing-card{
			width:min(980px, calc(100vw - 36px));
			max-width:min(980px, calc(100vw - 36px));
			height:min(920px, calc(100dvh - 36px));
			max-height:calc(100dvh - 36px);
			margin:0 auto;
			border-radius:18px;
			border:1px solid rgba(17,24,39,.10);
			box-shadow:0 24px 64px rgba(15,23,42,.22);
		}

		.tenant-billing-head,
		.tenant-billing-body,
		.tenant-billing-actions{
			padding-left:16px;
			padding-right:16px;
		}

		.tenant-billing-grid,
		.tenant-billing-edit-grid{
			grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
		}

		.tenant-detail-acc-summary,
		.tenant-detail-acc-body{
			padding-left:14px;
			padding-right:14px;
		}
	}

	.tenant-billing-toolbar{
		display:flex;
		align-items:flex-start;
		justify-content:space-between;
		gap:10px;
		flex-wrap:wrap;
		margin:-2px 0 10px;
	}

.tenant-billing-filter-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.tenant-billing-filter-row + .tenant-billing-filter-row{
  margin-top:8px;
}

.tenant-filter-chip{
  flex:0 0 auto;
  width:auto;
  max-width:none;
  min-height:36px;
  padding:8px 12px;
  font-size:0.82rem;
}

.tenant-filter-chip.is-active{
  background:var(--gold-text);
  color:#fff;
  border-color:transparent;
}

.tenant-filter-reset{
  background:#f9fafb;
}

.tenant-billing-toolbar-actions{
  display:flex;
  justify-content:flex-end;
  margin-left:auto;
}

.tenant-filter-refresh-btn{
  flex:0 0 auto;
  width:auto;
  max-width:none;
}

.tenant-billing-list-summary{
  min-height:18px;
  margin:6px 0 10px;
  font-size:0.78rem;
  font-weight:800;
  color:var(--muted);
  line-height:1.3;
}

@media (max-width: 640px){
  .tenant-billing-toolbar{
    align-items:stretch;
  }

  .tenant-billing-filter-row{
    width:100%;
  }

  .tenant-billing-toolbar-actions{
    width:100%;
    margin-left:0;
  }

  .tenant-filter-refresh-btn{
    width:100%;
    max-width:none;
  }
}

	.tenant-search-wrap{
  position:relative;
}

.tenant-search-input{
  padding-right:44px !important;
}

.tenant-search-clear-btn{
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border:1px solid rgba(17,24,39,.10);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:900;
  line-height:1;
  padding:0;
  z-index:2;
  box-shadow:0 2px 6px rgba(0,0,0,.10);
}

.tenant-search-clear-btn:hover{
  color:var(--primary);
  background:#f9fafb;
}

.tenant-search-clear-btn:active{
  transform:translateY(calc(-50% + 1px));
}	

/* ==========================================================
   Phase 4.5D.2J-TU.1 - Tenant Management Reports & Utilities
   ========================================================== */
.tenant-management-parent-body{
  display:grid;
  gap:10px;
}

.tenant-utility-body{
  display:grid;
  gap:10px;
}

.tenant-utility-grid{
  grid-template-columns:repeat(2, minmax(0,1fr));
}

.tenant-utility-card{
  text-align:left;
  min-height:96px;
}

.tenant-database-info-card{
  width:min(1180px, calc(100vw - 24px));
  max-width:1180px;
  height:min(92dvh, calc(100dvh - 28px));
  max-height:calc(100dvh - 28px);
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.tenant-database-info-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:2px;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}


.tenant-database-info-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
  flex:0 0 auto;
}

.tenant-database-info-subtitle{
  margin-top:4px;
  font-size:.84rem;
  color:var(--muted);
  font-weight:700;
  line-height:1.3;
}

.tenant-database-info-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.tenant-database-info-filters{
  display:grid;
  grid-template-columns:1.5fr repeat(4, minmax(130px, .8fr));
  gap:10px;
  margin-top:12px;
  flex:0 0 auto;
  overflow:visible;
}

.tenant-db-native-select-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  border:0 !important;
  overflow:hidden !important;
  clip:rect(0 0 0 0) !important;
  white-space:nowrap !important;
}

.tenant-db-custom-select{
  position:relative;
  width:100%;
  min-width:0;
  z-index:1;
}

.tenant-db-custom-select.is-open{
  z-index:30;
}

.tenant-db-custom-select-trigger{
  width:100%;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--primary);
  font-weight:800;
  font-size:.9rem;
  padding:9px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  text-align:left;
  cursor:pointer;
  touch-action:manipulation;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}

.tenant-db-custom-select-trigger:hover,
.tenant-db-custom-select-trigger:focus-visible,
.tenant-db-custom-select.is-open .tenant-db-custom-select-trigger{
  outline:none;
  border-color:#0f4c81;
  box-shadow:0 0 0 3px rgba(15,76,129,.12);
}

.tenant-db-custom-select-value{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.tenant-db-custom-select-chevron{
  flex:0 0 auto;
  font-weight:900;
  color:#0f4c81;
  transition:transform .16s ease;
}

.tenant-db-custom-select.is-open .tenant-db-custom-select-chevron{
  transform:rotate(180deg);
}

.tenant-db-custom-select-menu{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 4px);
  z-index:7600;
  max-height:min(260px, 48dvh);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid rgba(15,76,129,.24);
  border-radius:12px;
  background:#fff;
  box-shadow:0 14px 30px rgba(15,23,42,.18);
  padding:6px;
}

.tenant-db-custom-select-option{
  width:100%;
  min-height:38px;
  border:0;
  background:#fff;
  color:var(--primary);
  text-align:left;
  padding:9px 10px;
  border-radius:9px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  touch-action:manipulation;
  font-size:.86rem;
  font-weight:850;
  line-height:1.2;
}

.tenant-db-custom-select-option:hover,
.tenant-db-custom-select-option:focus-visible,
.tenant-db-custom-select-option.is-selected{
  outline:none;
  background:#eff6ff;
  color:#0f4c81;
}

.tenant-db-custom-select-option:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.tenant-db-custom-select-check{
  flex:0 0 auto;
  font-weight:900;
  color:#0f4c81;
}

.tenant-db-custom-select-empty{
  padding:10px;
  color:var(--muted);
  font-size:.84rem;
  font-weight:800;
}


.tenant-database-field-picker{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f9fafb;
  overflow:hidden;
  flex:0 0 auto;
}

.tenant-database-field-picker summary{
  cursor:pointer;
  padding:9px 11px;
  font-weight:900;
  color:#0f4c81;
  list-style:none;
  touch-action:manipulation;
}

.tenant-database-field-picker summary::-webkit-details-marker{
  display:none;
}

.tenant-database-field-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:8px;
  padding:10px;
  border-top:1px solid var(--border);
  background:#fff;
}

.tenant-database-field-option{
  display:flex;
  align-items:center;
  gap:7px;
  border:1px solid #e5e7eb;
  border-radius:9px;
  padding:7px 8px;
  background:#fff;
  font-size:.82rem;
  font-weight:800;
  min-width:0;
}

.tenant-database-field-option span{
  min-width:0;
  overflow-wrap:anywhere;
}

.tenant-database-required-pill{
  margin-left:auto;
  font-size:.68rem;
  color:#92400e;
  background:#fff7ed;
  border:1px solid #fed7aa;
  border-radius:999px;
  padding:2px 6px;
  white-space:nowrap;
}

.tenant-database-info-command-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
  flex:0 0 auto;
}

.tenant-database-info-status{
  margin-top:10px;
  border-radius:10px;
  padding:9px 11px;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
  flex:0 0 auto;
}

.tenant-database-info-status--info{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1e3a8a;
}

.tenant-database-info-status--success{
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
}

.tenant-database-info-status--error{
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.tenant-database-info-meta{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(6, minmax(0,1fr));
  gap:8px;
  border:1px solid #dbeafe;
  border-left:5px solid #0f4c81;
  border-radius:12px;
  background:#eff6ff;
  padding:10px;
  font-size:.8rem;
  font-weight:750;
  line-height:1.3;
  flex:0 0 auto;
}

.tenant-database-info-meta > div{
  min-width:0;
  overflow-wrap:anywhere;
}

.tenant-database-info-scroll-rail{
  position:sticky;
  top:0;
  z-index:18;
  display:none;
  height:20px;
  margin:10px 0 4px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  background:linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border:1px solid rgba(15,76,129,.18);
  border-radius:10px;
  box-shadow:0 4px 12px rgba(15,23,42,.08);
  scrollbar-gutter:stable;
}

.tenant-database-info-scroll-rail-inner{
  height:1px;
  min-width:100%;
}

.tenant-database-info-table-wrap{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  overscroll-behavior-y:auto;
  background:#fff;
  flex:0 0 auto;
  min-width:0;
  max-width:100%;
  min-height:180px;
  max-height:none;
  scrollbar-gutter:stable;
}

.tenant-database-info-table{
  width:max-content;
  min-width:100%;
  border-collapse:collapse;
  font-size:.84rem;
}

.tenant-database-info-table th,
.tenant-database-info-table td{
  border-bottom:1px solid #e5e7eb;
  border-right:1px solid #eef2f7;
  padding:8px 9px;
  text-align:left;
  vertical-align:top;
  white-space:nowrap;
}

.tenant-database-info-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f3f4f6;
  color:#111827;
  font-weight:900;
}

.tenant-database-info-table td{
  color:#1f2937;
  font-weight:650;
}

.tenant-database-info-table tbody tr:nth-child(even){
  background:#f9fafb;
}

.tenant-database-print-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:8px 12px;
  font-size:.9rem;
  line-height:1.4;
}

@media (max-width:900px){
  .tenant-utility-grid{
    grid-template-columns:1fr;
  }

  .tenant-database-info-card{
    width:calc(100vw - 16px);
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .tenant-database-info-head{
    flex-direction:column;
    align-items:stretch;
  }

  .tenant-database-info-actions{
    justify-content:stretch;
  }

  .tenant-database-info-actions .btn{
    flex:1 1 130px;
  }

  .tenant-database-info-filters{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .tenant-database-field-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .tenant-database-info-meta,
  .tenant-database-print-summary{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:600px){
  .tenant-database-info-card{
    width:calc(100vw - 10px);
    height:calc(100dvh - 10px);
    max-height:calc(100dvh - 10px);
    padding:10px;
  }


  .tenant-database-info-filters{
    grid-template-columns:1fr;
    gap:8px;
  }

  .tenant-database-field-grid{
    grid-template-columns:1fr;
  }

  .tenant-database-info-command-row .btn{
    flex:1 1 100%;
  }

  .tenant-database-info-table{
    width:max-content;
    min-width:820px;
    font-size:.78rem;
  }

  .tenant-database-info-table th,
  .tenant-database-info-table td{
    padding:7px 8px;
  }
}

/* End of Tenant and Billing */

/* ==========================================================
   Phase 4.5D.5.1.R2 — Smart Reconciliation Health Summary
   Privacy-safe platform summary + tenant admin banners
   ========================================================== */

.tenant-recon-health-banner{
  display:none;
  margin:12px auto 16px;
  max-width:1180px;
  border:1px solid #f59e0b;
  border-left:6px solid #d97706;
  border-radius:14px;
  background:#fffbeb;
  color:#78350f;
  padding:12px 14px;
  box-shadow:0 8px 22px rgba(15,23,42,.10);
}

.tenant-recon-health-banner__inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.tenant-recon-health-banner__title{
  font-weight:900;
  font-size:1rem;
  line-height:1.2;
  margin-bottom:4px;
}

.tenant-recon-health-banner__text{
  font-size:.88rem;
  font-weight:800;
  line-height:1.35;
}

.tenant-recon-health-banner__meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.tenant-recon-health-banner__pill{
  display:inline-flex;
  border:1px solid rgba(180,83,9,.35);
  border-radius:999px;
  background:#fff7ed;
  padding:3px 7px;
  font-size:.72rem;
  font-weight:900;
}

.tenant-recon-health-banner__actions{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:8px;
  width:min(100%, 340px);
  min-width:320px;
  align-self:stretch;
  justify-content:stretch;
}

.tenant-recon-health-banner__actions .btn{
  width:100%;
  max-width:none;
  min-height:42px;
  white-space:normal;
  line-height:1.15;
  flex:0 0 auto;
}

.platform-recon-health-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}

.platform-recon-health-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.platform-recon-health-title-wrap{
  min-width:0;
  flex:1 1 auto;
}

.platform-recon-health-title{
  font-weight:900;
  color:var(--primary);
  font-size:1rem;
  line-height:1.2;
}

.platform-recon-health-subtitle{
  margin-top:3px;
  font-size:.84rem;
  color:var(--muted);
  font-weight:800;
  line-height:1.35;
}

.platform-recon-health-filters{
  display:grid;
  grid-template-columns:
    minmax(112px, 135px)
    minmax(136px, 155px)
    minmax(170px, 240px)
    minmax(72px, auto)
    minmax(82px, auto)
    minmax(76px, auto);
  gap:8px;
  align-items:end;
  margin-top:4px;
}

.platform-recon-health-field{
  margin:0;
  min-width:0;
}

.platform-recon-health-field label{
  white-space:nowrap;
}

.platform-recon-health-field--tenant{
  max-width:240px;
}

.platform-recon-health-field--search{
  min-width:210px;
}

.platform-recon-health-select,
.platform-recon-health-input{
  width:100%;
  height:42px;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  background-color:#fff;
  color:var(--primary);
  font-size:.86rem;
  font-weight:800;
  line-height:1.2;
  padding:9px 34px 9px 10px;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
  -webkit-appearance:none;
  appearance:none;
}

.platform-recon-health-select{
  background-image:
    linear-gradient(45deg, transparent 50%, #475569 50%),
    linear-gradient(135deg, #475569 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 12px) 18px;
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
  cursor:pointer;
}

.platform-recon-health-select:disabled{
  background-color:#f3f4f6;
  color:#9ca3af;
  cursor:not-allowed;
  opacity:1;
}

.platform-recon-health-input{
  padding-right:12px;
}

.platform-recon-health-select:focus,
.platform-recon-health-input:focus{
  outline:2px solid rgba(15,76,129,.22);
  border-color:#0f4c81;
}

.platform-recon-health-action-btn{
  width:auto;
  max-width:none;
  min-height:42px;
  white-space:nowrap;
  padding-left:12px;
  padding-right:12px;
}

@media(min-width:761px){
  .platform-recon-health-field--scope{
    grid-column:1;
    grid-row:1;
  }

  .platform-recon-health-field--status{
    grid-column:2;
    grid-row:1;
  }

  .platform-recon-health-field--tenant{
    grid-column:3;
    grid-row:1;
  }

  .platform-recon-health-action-btn--run{
    grid-column:4;
    grid-row:1;
  }

  .platform-recon-health-action-btn--clear{
    grid-column:5;
    grid-row:1;
  }

  .platform-recon-health-action-btn--print{
    grid-column:6;
    grid-row:1;
  }

  .platform-recon-health-field--search{
    grid-column:1 / -1;
    grid-row:2;
    min-width:0;
    max-width:none;
  }
}

.platform-recon-health-table-wrap{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  --platform-recon-id-col-width:52px;
  --platform-recon-company-col-width:240px;
  --platform-recon-company-col-min-width:220px;
}

.platform-recon-health-table{
  width:100%;
  min-width:860px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  font-size:.8rem;
  --platform-recon-id-col-width:52px;
  --platform-recon-company-col-width:240px;
  --platform-recon-company-col-min-width:220px;
}

.platform-recon-health-table th,
.platform-recon-health-table td{
  padding:8px 6px;
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  text-align:left;
  vertical-align:top;
  overflow-wrap:normal;
  word-break:normal;
}

.platform-recon-health-table th:last-child,
.platform-recon-health-table td:last-child{
  border-right:0;
}

.platform-recon-health-table th{
  background:#f8fafc;
  color:#334155;
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.035em;
  line-height:1.18;
}

.platform-recon-health-table th:nth-child(1),
.platform-recon-health-table td:nth-child(1){
  width:var(--platform-recon-company-col-width, 240px);
  min-width:var(--platform-recon-company-col-min-width, 220px);
}

.platform-recon-health-table th:nth-child(1){
  white-space:nowrap;
}
.platform-recon-health-table th:nth-child(2),
.platform-recon-health-table td:nth-child(2){
  width:var(--platform-recon-id-col-width, 52px);
  text-align:center;
  white-space:nowrap;
  padding-left:4px;
  padding-right:4px;
}

.platform-recon-health-table th:nth-child(3),
.platform-recon-health-table td:nth-child(3){
  width:76px;
  text-align:center;
}

.platform-recon-health-table th:nth-child(4),
.platform-recon-health-table td:nth-child(4){
  width:68px;
  text-align:center;
}

.platform-recon-health-table th:nth-child(5),
.platform-recon-health-table td:nth-child(5){
  width:190px;
  max-width:190px;
}

.platform-recon-health-table th:nth-child(6),
.platform-recon-health-table td:nth-child(6){
  width:92px;
}

.platform-recon-health-table th:nth-child(7),
.platform-recon-health-table td:nth-child(7){
  width:96px;
}

.platform-recon-health-company-cell{
  display:grid;
  gap:6px;
  align-items:start;
  min-width:0;
}

.platform-recon-health-company-link{
  appearance:none;
  -webkit-appearance:none;
  display:block;
  width:100%;
  min-width:0;
  border:0;
  background:transparent;
  color:var(--primary);
  padding:0;
  margin:0;
  text-align:left;
  font:inherit;
  font-weight:900;
  line-height:1.2;
  cursor:pointer;
  text-decoration:none;
  white-space:normal;
  overflow-wrap:normal;
  word-break:normal;
  hyphens:manual;
}

.platform-recon-health-company-link:hover,
.platform-recon-health-company-link:focus-visible{
  text-decoration:underline;
  outline:none;
}

.platform-recon-health-inline-notify{
  width:100%;
  max-width:142px;
  min-height:34px;
  padding:.42rem .46rem;
  font-size:.72rem;
  white-space:nowrap;
}

.platform-recon-health-category-list{
  display:flex;
  flex-wrap:wrap;
  gap:3px;
  max-width:100%;
}

.platform-recon-health-category-list span{
  display:inline-flex;
  max-width:100%;
  border:1px solid #cbd5e1;
  border-radius:999px;
  padding:2px 5px;
  background:#f8fafc;
  font-size:.66rem;
  font-weight:900;
  line-height:1.15;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.platform-recon-health-detail-overlay{
  display:none;
  position:fixed;
  inset:0;
  z-index:7600;
  background:rgba(15,23,42,.58);
  padding:max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  align-items:stretch;
  justify-content:center;
}

.platform-recon-health-detail-overlay.active{
  display:flex;
}

.platform-recon-health-detail-card{
  width:min(100%, 720px);
  max-height:100%;
  background:#fff;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 22px 60px rgba(15,23,42,.30);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.platform-recon-health-detail-head{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-bottom:1px solid var(--border);
  background:#f8fafc;
}

.platform-recon-health-detail-head h3{
  margin:0;
  color:var(--primary);
  font-size:1rem;
  font-weight:900;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.platform-recon-health-detail-close{
  width:auto;
  max-width:none;
  flex:0 0 auto;
}

.platform-recon-health-detail-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:12px;
}

.platform-recon-health-detail-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.platform-recon-health-detail-item{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
}

.platform-recon-health-detail-item--full{
  grid-column:1 / -1;
}

.platform-recon-health-detail-label{
  font-size:.72rem;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:4px;
}

.platform-recon-health-detail-value{
  font-size:.92rem;
  font-weight:900;
  color:var(--primary);
  line-height:1.25;
  overflow-wrap:anywhere;
}

.platform-recon-health-detail-empty{
  color:var(--muted);
  font-weight:800;
}

.platform-recon-health-detail-actions{
  margin-top:12px;
  display:grid;
  gap:8px;
}

.platform-recon-health-detail-actions .btn{
  width:100%;
}
.platform-recon-health-status{
  margin-top:8px;
  font-size:.84rem;
  font-weight:900;
  line-height:1.35;
}

.platform-recon-health-status--error{
  color:#b91c1c;
}

.platform-recon-health-status--success{
  color:#166534;
}

.platform-recon-health-status--info{
  color:#334155;
}

@media(min-width:761px) and (max-width:1180px){
  .platform-recon-health-filters{
    grid-template-columns:
      minmax(108px, 130px)
      minmax(128px, 150px)
      minmax(150px, 1fr)
      minmax(72px, 88px)
      minmax(82px, 94px)
      minmax(76px, 90px);
  }

  .platform-recon-health-action-btn{
    width:100%;
  }
}

/*
   Phase 4.5D.5.1.R4.2
   Tablet / iPad portrait only.
   Do not affect desktop or tablet/iPad landscape.
*/
@media(min-width:761px) and (max-width:1180px) and (orientation:portrait){
  .platform-recon-health-filters{
    grid-template-columns:
      minmax(108px, 1fr)
      minmax(128px, 1fr)
      minmax(150px, 1.25fr);
    max-width:100%;
    overflow:hidden;
  }

  .platform-recon-health-field--scope{
    grid-column:1;
    grid-row:1;
  }

  .platform-recon-health-field--status{
    grid-column:2;
    grid-row:1;
  }

  .platform-recon-health-field--tenant{
    grid-column:3;
    grid-row:1;
    max-width:none;
  }

  .platform-recon-health-action-btn--run{
    grid-column:1;
    grid-row:2;
  }

  .platform-recon-health-action-btn--clear{
    grid-column:2;
    grid-row:2;
  }

  .platform-recon-health-action-btn--print{
    grid-column:3;
    grid-row:2;
  }

  .platform-recon-health-field--search{
    grid-column:1 / -1;
    grid-row:3;
    width:min(100%, 520px);
    max-width:520px;
    min-width:0;
    justify-self:start;
  }

  .platform-recon-health-field--search .platform-recon-health-input{
    width:100%;
    max-width:100%;
  }
}

@media(max-width:760px){
  .tenant-recon-health-banner{
    margin:10px 8px 14px;
    padding:11px;
  }

  .tenant-recon-health-banner__inner{
    display:block;
  }

  .tenant-recon-health-banner__actions{
    width:100%;
    min-width:0;
    margin-top:10px;
  }

  .tenant-recon-health-banner__actions .btn{
    width:100%;
  }

  .platform-recon-health-card{
    padding:12px;
  }

  .platform-recon-health-toolbar{
    display:block;
  }

  .platform-recon-health-filters{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .platform-recon-health-field--tenant,
  .platform-recon-health-field--search{
    max-width:none;
    min-width:0;
  }

  .platform-recon-health-action-btn{
    width:100%;
  }

  .platform-recon-health-table-wrap{
    overflow-x:hidden;
  }

  .platform-recon-health-table{
    width:100%;
    min-width:100%;
    table-layout:fixed;
  }

  .platform-recon-health-table th,
  .platform-recon-health-table td{
    padding:9px 8px;
    overflow-wrap:normal;
    word-break:normal;
  }

  .platform-recon-health-table th:nth-child(n+3),
  .platform-recon-health-table td:nth-child(n+3){
    display:none;
  }

  .platform-recon-health-table th:nth-child(1),
  .platform-recon-health-table td:nth-child(1){
    width:calc(100% - var(--platform-recon-id-col-width, 52px));
    min-width:0;
  }

  .platform-recon-health-table th:nth-child(2),
  .platform-recon-health-table td:nth-child(2){
    width:var(--platform-recon-id-col-width, 52px);
    min-width:var(--platform-recon-id-col-width, 52px);
    max-width:var(--platform-recon-id-col-width, 52px);
    padding-left:4px;
    padding-right:4px;
    text-align:center;
    white-space:nowrap;
  }

  .platform-recon-health-inline-notify{
    display:none !important;
  }

  .platform-recon-health-company-link{
    display:block;
    text-decoration:underline;
    text-underline-offset:2px;
    white-space:normal;
    overflow-wrap:break-word;
    word-break:normal;
    hyphens:auto;
  }

  .platform-recon-health-detail-card{
    width:100%;
    height:100%;
    max-height:none;
    border-radius:14px;
  }

  .platform-recon-health-detail-grid{
    grid-template-columns:1fr;
  }
}

/*
   Phase 4.7.S5.P10 cutover cleanup.
   Small-device Company | ID table stability.
   Keep Company wide enough to prevent single-character wrapping; allow a
   controlled horizontal scroll instead of crushing the Company column.
*/
@media(max-width:760px){
  .platform-recon-health-table-wrap{
    --platform-recon-id-col-width:56px;
    --platform-recon-company-col-min-width:220px;
    overflow-x:auto;
  }

  .platform-recon-health-table{
    width:100%;
    min-width:calc(var(--platform-recon-company-col-min-width, 220px) + var(--platform-recon-id-col-width, 56px));
    table-layout:fixed;
    --platform-recon-id-col-width:56px;
    --platform-recon-company-col-min-width:220px;
  }

  .platform-recon-health-table col.platform-recon-health-col-company{
    width:calc(100% - var(--platform-recon-id-col-width, 56px)) !important;
    min-width:var(--platform-recon-company-col-min-width, 220px) !important;
  }

  .platform-recon-health-table col.platform-recon-health-col-id{
    width:var(--platform-recon-id-col-width, 56px) !important;
  }

  .platform-recon-health-table col.platform-recon-health-col-mobile-hidden{
    width:0 !important;
    visibility:collapse;
  }

  .platform-recon-health-table th:nth-child(1),
  .platform-recon-health-table td:nth-child(1){
    width:auto !important;
    min-width:var(--platform-recon-company-col-min-width, 220px) !important;
    max-width:none !important;
  }

  .platform-recon-health-table th:nth-child(1){
    white-space:nowrap;
  }

  .platform-recon-health-table td:nth-child(1){
    white-space:normal;
  }

  .platform-recon-health-table th:nth-child(2),
  .platform-recon-health-table td:nth-child(2){
    width:var(--platform-recon-id-col-width, 56px) !important;
    min-width:var(--platform-recon-id-col-width, 56px) !important;
    max-width:var(--platform-recon-id-col-width, 56px) !important;
    text-align:center;
    white-space:nowrap;
  }

  .platform-recon-health-company-link{
    overflow-wrap:normal !important;
    word-break:normal !important;
    hyphens:manual;
  }

  .platform-recon-health-empty-row td:nth-child(1){
    width:auto !important;
    min-width:var(--platform-recon-company-col-min-width, 220px) !important;
    max-width:none !important;
  }

  .platform-recon-health-empty-message{
    display:block;
    color:var(--muted);
    font-weight:800;
    line-height:1.25;
    overflow-wrap:break-word;
    word-break:normal;
  }

  .platform-recon-health-empty-id{
    color:var(--muted);
    font-weight:900;
  }

  .platform-recon-health-table td[colspan="7"]{
    width:100% !important;
    min-width:100% !important;
    max-width:100% !important;
    text-align:center !important;
  }
}

/* === Staff Management Accordion === */
#adminMgmtBtn .acc-body{
  display:grid;
  gap:10px;
}

#adminMgmtBtn .tenant-billing-toolbar{
  margin:6px 0 10px;
}

.staff-mgmt-list{
  max-height:340px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px;
  background:#f9fafb;
  -webkit-overflow-scrolling:touch;
}

.staff-mgmt-card{
  margin-bottom:8px;
}

.staff-mgmt-card:last-child{
  margin-bottom:0;
}

.staff-mgmt-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:nowrap;
}

.staff-mgmt-card-main{
  flex:1 1 220px;
  min-width:0;
}

.staff-mgmt-username-btn{
  appearance:none;
  -webkit-appearance:none;
  border:none;
  background:transparent;
  padding:0;
  margin:0;
  font:inherit;
  font-weight:900;
  line-height:1.25;
  color:var(--primary);
  cursor:pointer;
  text-align:left;
  word-break:break-word;
  overflow-wrap:anywhere;
  text-decoration:none;
}

.staff-mgmt-username-btn.is-active{
  color:var(--success);
}

.staff-mgmt-username-btn.is-inactive{
  color:var(--danger);
}

.staff-mgmt-username-btn:hover{
  text-decoration:underline;
}

.staff-mgmt-username-btn:focus-visible{
  outline:2px solid rgba(14,165,233,.35);
  outline-offset:2px;
  border-radius:4px;
}

.staff-mgmt-card-name{
  font-size:0.82rem;
  color:var(--muted);
  line-height:1.25;
  margin:4px 0 0 0;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.staff-mgmt-delete-btn{
  flex:0 0 auto;
  width:36px;
  min-width:36px;
  height:36px;
  padding:0;
  font-size:1rem;
  line-height:1;
  align-self:flex-start;
}

.staff-mgmt-empty{
  padding:12px;
  text-align:center;
  color:var(--muted);
  font-weight:700;
  background:#fff;
  border:1px dashed var(--border);
  border-radius:12px;
}

@media (max-width:640px){
  #adminMgmtBtn .tenant-billing-toolbar{
    margin:8px 0 10px;
  }

  .staff-mgmt-list{
    max-height:300px;
    padding:7px;
  }

  .staff-mgmt-delete-btn{
    width:34px;
    min-width:34px;
    height:34px;
  }
}

/* === end of Staff Management Accordion == */

/* ============================================================
   DATABASE MAINTENANCE REPORT OVERLAY
   - mobile safe on short devices
   - fixed top action area
   - scroll only the report content
   ============================================================ */
#dbMaintReportOverlay{
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;

  align-items: flex-start !important;
  justify-content: center !important;

  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));

  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#dbMaintReportOverlay .db-maint-report-card{
  width: min(960px, calc(100vw - 24px));
  max-width: 960px;
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);

  margin: 0 auto;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

#dbMaintReportOverlay .db-maint-report-head{
  flex: 0 0 auto;
  background: #fff;
  padding: 12px 12px 0 12px;
  position: relative;
  z-index: 2;
}

#dbMaintReportOverlay .db-maint-report-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#dbMaintReportOverlay .db-maint-report-actions .btn{
  flex: 1 1 180px;
  min-height: 44px;
}

#dbMaintReportOverlay .db-maint-report-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 12px 12px;
}

#dbMaintReportTitle{
  margin: 6px 0 10px 0 !important;
}

#dbMaintReportMeta{
  margin-bottom: 12px;
}

#dbMaintReportBody{
  overflow: visible;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

@media (max-width: 1024px){
  #dbMaintReportOverlay{
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  #dbMaintReportOverlay .db-maint-report-card{
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100vh - 16px);
    max-height: calc(100svh - 16px);
    max-height: calc(100dvh - 16px);
  }

  #dbMaintReportOverlay .db-maint-report-head{
    padding: 10px 10px 0 10px;
  }

  #dbMaintReportOverlay .db-maint-report-scroll{
    padding: 0 10px 10px 10px;
  }

  #dbMaintReportOverlay .db-maint-report-actions{
    gap: 8px;
  }

  #dbMaintReportOverlay .db-maint-report-actions .btn{
    flex: 1 1 100%;
    min-height: 44px;
  }
}

/* ==========================================================
   Phase 4.4D — Inventory Duplicate Audit report
   ========================================================== */
.inventory-audit-summary-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:6px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  background:#fafafa;
}

.inventory-audit-section{
  margin-top:14px;
}

.inventory-audit-section-title{
  font-weight:900;
  color:var(--gold-text);
  margin-bottom:6px;
}

.inventory-audit-empty{
  margin-top:6px;
  color:var(--muted);
  line-height:1.35;
}

.inventory-audit-note{
  margin:6px 0 8px;
  color:var(--muted);
  font-size:0.84rem;
  line-height:1.35;
}

.inventory-audit-group-card{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  background:#fff;
}

.inventory-audit-table-wrap{
  overflow-x:auto;
  overflow-y:visible;
  margin-top:8px;
  -webkit-overflow-scrolling:touch;
}

.inventory-audit-table{
  width:100%;
  border-collapse:collapse;
  min-width:820px;
  background:#fff;
}

.inventory-audit-table th,
.inventory-audit-table td{
  border:1px solid #ddd;
  padding:6px;
  text-align:left;
  vertical-align:top;
  font-size:0.82rem;
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-audit-table th{
  background:#f5f5f5;
  font-weight:900;
  color:var(--primary);
}

@media (max-width:640px){
  .inventory-audit-summary-grid{
    grid-template-columns:1fr;
    font-size:0.82rem;
  }

  .inventory-audit-table th,
  .inventory-audit-table td{
    font-size:0.78rem;
    padding:5px;
  }
}

/* ==========================================================
   Phase 4.4D.1 — Inventory Duplicate Audit mobile report layout
   Keeps report header/actions visible and makes only the body scroll.
   ========================================================== */
#inventoryDuplicateAuditReportOverlay{
  align-items:center;
  justify-content:center;
  padding:12px;
  overflow:hidden;
  overscroll-behavior:contain;
}

#inventoryDuplicateAuditReportOverlay > .modal-card{
  display:flex;
  flex-direction:column;
  width:min(96vw,1120px) !important;
  max-width:1120px !important;
  max-height:calc(100dvh - 24px);
  overflow:hidden;
}

#inventoryDuplicateAuditReportTitle{
  flex:0 0 auto;
  margin-bottom:8px !important;
  line-height:1.15;
  overflow-wrap:anywhere;
  word-break:break-word;
}

#inventoryDuplicateAuditReportMeta{
  flex:0 0 auto;
  min-height:0;
}

#inventoryDuplicateAuditReportBody{
  flex:1 1 auto;
  min-height:0;
  max-height:none !important;
  overflow:auto !important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

#inventoryDuplicateAuditReportBody + div{
  flex:0 0 auto;
  margin-top:10px !important;
  padding-top:8px;
  border-top:1px solid var(--border);
  background:var(--card);
}

@media (max-width:640px){
  #inventoryDuplicateAuditReportOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }

  #inventoryDuplicateAuditReportOverlay > .modal-card{
    width:100vw !important;
    max-width:none !important;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
    padding:10px;
  }

  #inventoryDuplicateAuditReportTitle{
    font-size:1.02rem !important;
    line-height:1.12 !important;
    margin:0 0 6px 0 !important;
    text-shadow:none !important;
  }

  #inventoryDuplicateAuditReportMeta{
    font-size:0.76rem !important;
    line-height:1.22 !important;
  }

  #inventoryDuplicateAuditReportMeta .inventory-audit-summary-grid{
    padding:7px 8px;
    gap:4px;
    border-radius:8px;
  }

  #inventoryDuplicateAuditReportBody{
    margin-top:8px !important;
    padding-bottom:4px;
  }

  #inventoryDuplicateAuditReportBody + div{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:8px !important;
    margin-top:8px !important;
    padding-top:8px;
  }

  #inventoryDuplicateAuditReportBody + div .btn{
    width:100%;
    min-width:0;
    padding:10px 8px;
    font-size:0.82rem;
    white-space:nowrap;
  }

  .inventory-audit-section{
    margin-top:10px;
  }

  .inventory-audit-section-title{
    font-size:0.9rem;
    line-height:1.2;
    margin-bottom:5px;
  }

  .inventory-audit-group-card{
    padding:8px;
    margin-top:8px;
    border-radius:8px;
  }

  .inventory-audit-note,
  .inventory-audit-empty{
    font-size:0.78rem;
    line-height:1.25;
  }

  .inventory-audit-table-wrap{
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
  }

  .inventory-audit-table{
    min-width:760px;
  }
}

/* ==========================================================
   Inventory Reports Tab Shell — validated through Phase 4.7.R5
   Company-scoped Inventory report foundation, shown directly inside
   the shared Reports workspace tab.
   ========================================================== */
.inventory-reports-header-btn{
  background:#334155 !important;
  color:#fff !important;
}

.inventory-reports-shell{
  margin:-2px 0 14px;
  border:1px solid rgba(15,76,129,.22);
  border-radius:12px;
  background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.08);
  overflow:hidden;
}

.inventory-reports-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:linear-gradient(180deg, #f8fafc 0%, #eef6ff 100%);
  border-bottom:1px solid rgba(15,76,129,.16);
}

.inventory-reports-title{
  font-size:1rem;
  font-weight:900;
  color:#0f4c81;
  line-height:1.15;
}

.inventory-reports-subtitle{
  margin-top:3px;
  font-size:0.8rem;
  font-weight:700;
  color:var(--muted);
  line-height:1.25;
}

.inventory-reports-body{
  padding:12px 14px 14px;
}

.inventory-reports-scope-card{
  border:1px solid #dbeafe;
  border-left:5px solid #0f4c81;
  background:#eff6ff;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
}

.inventory-reports-scope-title{
  font-weight:900;
  color:#0f4c81;
  margin-bottom:4px;
  line-height:1.2;
}

.inventory-reports-scope-text{
  font-size:0.84rem;
  color:var(--primary);
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-reports-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}

.inventory-report-card{
  display:block;
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
  cursor:pointer;
  color:var(--primary);
  box-shadow:0 1px 3px rgba(15,23,42,.08);
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  min-height:92px;
}

.inventory-report-card:hover,
.inventory-report-card:focus{
  outline:none;
  border-color:#0f4c81;
  box-shadow:0 3px 10px rgba(15,76,129,.14);
  transform:translateY(-1px);
}

.inventory-report-card-title{
  display:block;
  font-size:0.88rem;
  font-weight:900;
  color:#0f4c81;
  line-height:1.18;
}

.inventory-report-card-desc{
  display:block;
  margin-top:5px;
  font-size:0.76rem;
  color:var(--muted);
  line-height:1.28;
}

.inventory-reports-status{
  margin-top:12px;
  border-radius:9px;
  padding:9px 11px;
  font-size:0.84rem;
  line-height:1.35;
  font-weight:800;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-reports-status--info{
  background:#f8fafc;
  border:1px solid #cbd5e1;
  color:#334155;
}

.inventory-reports-status--success{
  background:#ecfdf5;
  border:1px solid #a7f3d0;
  color:#047857;
}

.inventory-reports-status--error{
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#b91c1c;
}

@media (max-width:900px){
  .inventory-reports-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:640px){
  .inventory-reports-shell{
    margin:0 0 12px;
    border-radius:10px;
  }

  .inventory-reports-head{
    padding:10px 11px;
    align-items:flex-start;
  }

  .inventory-reports-title{
    font-size:0.95rem;
  }

  .inventory-reports-subtitle{
    font-size:0.76rem;
  }

  .inventory-reports-body{
    padding:10px 11px 12px;
  }

  .inventory-reports-scope-card{
    padding:9px 10px;
  }

  .inventory-reports-scope-text{
    font-size:0.78rem;
  }

  .inventory-reports-grid{
    grid-template-columns:1fr;
    gap:8px;
  }

  .inventory-report-card{
    min-height:0;
    padding:9px 10px;
  }

  .inventory-report-card-title{
    font-size:0.84rem;
  }

  .inventory-report-card-desc{
    font-size:0.74rem;
  }

  .inventory-reports-status{
    font-size:0.78rem;
    padding:8px 9px;
  }
}

/* ==========================================================
   Phase 4.5B — Company Inventory Report Overlay + Print Layout
   Company-scoped Inventory page reports.
   ========================================================== */
.inventory-company-report-content{
  width:min(96vw, 1120px);
  max-width:1120px;
  height:min(92dvh, 880px);
  max-height:92dvh;
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.inventory-company-report-head{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:start;
  padding:14px 16px 12px;
  border-bottom:1px solid var(--border);
  background:#fff;
}

.inventory-company-report-head h3{
  margin:0;
  line-height:1.15;
  color:#0f4c81;
}

.inventory-company-report-meta{
  margin-top:5px;
  color:var(--muted);
  font-size:0.82rem;
  line-height:1.35;
}

.inventory-company-report-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.inventory-company-report-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:12px 16px 16px;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

.inventory-company-report-empty{
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:var(--muted);
  line-height:1.35;
}

.inventory-company-report-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}

.inventory-company-report-summary-card{
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
}

.inventory-company-report-summary-label{
  font-size:0.72rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  font-weight:900;
  line-height:1.15;
}

.inventory-company-report-summary-value{
  margin-top:4px;
  font-size:1rem;
  color:var(--primary);
  font-weight:900;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.inventory-company-report-table-wrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}

.inventory-company-report-table{
  width:100%;
  min-width:920px;
  border-collapse:collapse;
}

.inventory-company-report-table th,
.inventory-company-report-table td{
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  padding:7px 8px;
  text-align:left;
  vertical-align:top;
  font-size:0.82rem;
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-company-report-table th{
  background:#f3f4f6;
  color:var(--primary);
  font-weight:900;
  position:sticky;
  top:0;
  z-index:1;
}

.inventory-company-report-table tr:last-child td{
  border-bottom:none;
}

.inventory-company-report-table th:last-child,
.inventory-company-report-table td:last-child{
  border-right:none;
}

@media (max-width:700px){
  #inventoryCompanyReportOverlay.active{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }

  .inventory-company-report-content{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .inventory-company-report-head{
    grid-template-columns:1fr;
    gap:8px;
    padding:10px 11px;
  }

  .inventory-company-report-head h3{
    font-size:1rem;
  }

  .inventory-company-report-meta{
    font-size:0.76rem;
  }

  .inventory-company-report-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .inventory-company-report-actions .btn{
    width:100%;
    min-width:0;
    padding:10px 8px;
    font-size:0.82rem;
  }

  .inventory-company-report-body{
    padding:10px 11px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-company-report-summary{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .inventory-company-report-summary-card{
    padding:8px 9px;
  }

  .inventory-company-report-summary-label{
    font-size:0.66rem;
  }

  .inventory-company-report-summary-value{
    font-size:0.9rem;
  }

  .inventory-company-report-table{
    min-width:820px;
  }

  .inventory-company-report-table th,
  .inventory-company-report-table td{
    font-size:0.76rem;
    padding:6px;
  }
}

/* ==========================================================
   Phase 4.5B.1 — Company Inventory Report layout refinement
   Desktop/tablet width expansion.
   Small mobile behavior remains unchanged.
   ========================================================== */

/* Desktop / large laptop:
   Use nearly the full browser width so wide inventory reports fit better. */
@media (min-width:1181px){
  .inventory-company-report-content{
    width:calc(100vw - 32px) !important;
    max-width:1680px !important;
    height:min(92dvh, 900px);
    max-height:92dvh;
  }

  .inventory-company-report-head{
    padding:12px 14px 10px;
  }

  .inventory-company-report-body{
    padding:10px 12px 12px;
  }

  .inventory-company-report-summary{
    gap:8px;
    margin-bottom:10px;
  }

  .inventory-company-report-summary-card{
    padding:8px 10px;
  }

  .inventory-company-report-table-wrap{
    width:100%;
    max-width:100%;
  }

  .inventory-company-report-table{
    min-width:0 !important;
    width:100%;
    table-layout:auto;
  }

  .inventory-company-report-table th,
  .inventory-company-report-table td{
    padding:6px 7px;
    font-size:0.8rem;
    line-height:1.18;
  }
}

/* Tablet / iPad:
   Use the full usable device width and reduce padding.
   This does not affect Samsung S23/small mobile because that is <=700px. */
@media (min-width:701px) and (max-width:1180px){
  #inventoryCompanyReportOverlay.active{
    align-items:stretch;
    justify-content:stretch;
    padding:8px;
  }

  .inventory-company-report-content{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-company-report-head{
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    padding:10px 10px 8px;
  }

  .inventory-company-report-head h3{
    font-size:1.08rem;
    line-height:1.12;
  }

  .inventory-company-report-meta{
    font-size:0.76rem;
    line-height:1.22;
    margin-top:3px;
  }

  .inventory-company-report-actions{
    gap:6px;
  }

  .inventory-company-report-actions .btn{
    padding:9px 10px;
    font-size:0.82rem;
    white-space:nowrap;
  }

  .inventory-company-report-body{
    padding:8px 8px 10px;
  }

  .inventory-company-report-summary{
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:7px;
    margin-bottom:8px;
  }

  .inventory-company-report-summary-card{
    padding:7px 8px;
    border-radius:8px;
  }

  .inventory-company-report-summary-label{
    font-size:0.66rem;
  }

  .inventory-company-report-summary-value{
    font-size:0.9rem;
    margin-top:2px;
  }

  .inventory-company-report-table-wrap{
    width:100%;
    max-width:100%;
    overflow:auto;
  }

  .inventory-company-report-table{
    min-width:0 !important;
    width:100%;
    table-layout:auto;
  }

  .inventory-company-report-table th,
  .inventory-company-report-table td{
    padding:5px 6px;
    font-size:0.74rem;
    line-height:1.16;
  }
}

/* ==========================================================
   Phase 4.5B.2 — Small mobile report fitment refinement
   Keeps current mobile behavior, but improves usable space.
   ========================================================== */
@media (max-width:700px){
  .inventory-company-report-head{
    padding:8px 9px 7px;
    gap:6px;
  }

  .inventory-company-report-head h3{
    font-size:0.96rem;
    line-height:1.08;
  }

  .inventory-company-report-meta{
    font-size:0.72rem;
    line-height:1.18;
    margin-top:2px;
  }

  .inventory-company-report-actions{
    gap:6px;
  }

  .inventory-company-report-actions .btn{
    min-height:38px;
    padding:8px 7px;
    font-size:0.78rem;
  }

  .inventory-company-report-body{
    padding:8px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-company-report-summary{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px;
    margin-bottom:8px;
  }

  .inventory-company-report-summary-card{
    padding:6px 7px;
    border-radius:7px;
  }

  .inventory-company-report-summary-label{
    font-size:0.61rem;
    line-height:1.05;
  }

  .inventory-company-report-summary-value{
    font-size:0.84rem;
    line-height:1.1;
    margin-top:2px;
  }

  .inventory-company-report-table-wrap{
    position:relative;
    max-width:100%;
    overflow-x:auto;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }

  .inventory-company-report-table-wrap::before{
    content:"Swipe table left/right";
    position:sticky;
    left:0;
    display:block;
    width:max-content;
    max-width:100%;
    margin:0 0 5px 0;
    padding:4px 7px;
    border-radius:999px;
    background:#f8fafc;
    border:1px solid var(--border);
    color:var(--muted);
    font-size:0.68rem;
    font-weight:800;
    line-height:1;
    z-index:2;
  }

  .inventory-company-report-table{
    min-width:760px;
  }

  .inventory-company-report-table th,
  .inventory-company-report-table td{
    padding:5px 5px;
    font-size:0.72rem;
    line-height:1.12;
  }
}
/* ==========================================================
   Phase 4.5D.2K-E tenant Missing Location / Qty layout
   Compact table with Barcode retained and full-width guidance row.
   ========================================================== */
.inventory-mlq-table{
  min-width:990px;
  table-layout:fixed;
}

.inventory-mlq-item-col{ width:90px; }
.inventory-mlq-barcode-col{ width:100px; }
.inventory-mlq-desc-col{ width:280px; }
.inventory-mlq-type-col{ width:128px; }
.inventory-mlq-num-col{ width:74px; }
.inventory-mlq-location-col{ width:100px; }

.inventory-mlq-secondary{
  margin-top:2px;
  font-size:0.72rem;
  line-height:1.18;
  color:var(--muted);
  font-weight:800;
}

.inventory-mlq-num-cell{
  text-align:right;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.inventory-mlq-guidance-row td{
  background:#f8fafc;
  border-top:0;
  padding:7px 9px;
}

.inventory-mlq-guidance-block + .inventory-mlq-guidance-block{
  margin-top:7px;
  padding-top:6px;
  border-top:1px solid rgba(17,24,39,.10);
}

.inventory-mlq-guidance-label{
  display:block;
  margin-bottom:2px;
  font-size:0.68rem;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--gold-text);
}

.inventory-mlq-guidance-text{
  color:var(--primary);
  font-size:0.82rem;
  line-height:1.28;
  font-weight:700;
}

.inventory-mlq-issue-text,
.inventory-mlq-fix-text{
  color:var(--primary);
}

@media (max-width:700px){
  .inventory-mlq-table{
    min-width:930px;
  }
}
/* ==========================================================
   Phase 4.5B.3 — Company Inventory Report Filters
   Shared filters for company-scoped Inventory Reports.
   ========================================================== */
.inventory-report-filters-card{
  border:1px solid #dbeafe;
  border-left:5px solid #0f4c81;
  background:#f8fafc;
  border-radius:10px;
  padding:11px 12px;
  margin-bottom:12px;
}

.inventory-report-filters-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:10px;
}

.inventory-report-filters-title{
  font-weight:900;
  color:#0f4c81;
  line-height:1.2;
}

.inventory-report-filters-subtitle{
  margin-top:3px;
  font-size:0.8rem;
  font-weight:700;
  color:var(--muted);
  line-height:1.25;
}

.inventory-report-reset-btn{
  flex:0 0 auto;
  width:auto;
  min-width:118px;
  white-space:nowrap;
  padding:8px 10px;
}

.inventory-report-filter-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:9px 10px;
  align-items:end;
}

.inventory-report-filter-grid .form-group{
  margin:0;
  min-width:0;
}

.inventory-report-filter-grid label{
  display:block;
  font-size:0.74rem;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:4px;
  line-height:1.1;
}

.inventory-report-filter-grid input,
.inventory-report-filter-grid select{
  min-height:40px;
  font-size:0.88rem;
}

.inventory-report-filter-wide{
  grid-column:span 2;
}

.inventory-company-report-filter-list{
  display:flex;
  flex-wrap:wrap;
  gap:5px 6px;
  align-items:center;
  margin-top:5px;
}

.inventory-company-report-filter-list strong{
  margin-right:2px;
}

.inventory-company-report-filter-list span{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  padding:2px 7px;
  border:1px solid #d1d5db;
  border-radius:999px;
  background:#fff;
  color:var(--primary);
  font-size:0.76rem;
  font-weight:800;
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:break-word;
}

@media (max-width:1180px){
  .inventory-report-filter-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .inventory-report-filter-wide{
    grid-column:1 / -1;
  }
}

@media (max-width:700px){
  .inventory-report-filters-card{
    padding:9px 10px;
    margin-bottom:10px;
  }

  .inventory-report-filters-head{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .inventory-report-reset-btn{
    width:100%;
  }

  .inventory-report-filter-grid{
    grid-template-columns:1fr;
    gap:8px;
  }

  .inventory-report-filter-grid input,
  .inventory-report-filter-grid select{
    min-height:42px;
    font-size:0.86rem;
  }

  .inventory-company-report-filter-list{
    align-items:flex-start;
  }

  .inventory-company-report-filter-list span{
    font-size:0.72rem;
  }
}

/* ==========================================================
   Phase 4.5C — Platform Admin Global Inventory Reports
   Reuses company inventory report layout with platform scope.
   ========================================================== */
.platform-global-inventory-controls .inventory-report-filters-card{
  margin-top:12px;
}

.platform-global-inventory-controls .inventory-reports-grid{
  margin-top:12px;
}

#platformGlobalInventoryReportOverlay{
  align-items:center;
  justify-content:center;
  padding:12px;
  overflow:hidden;
  overscroll-behavior:contain;
}

#platformGlobalInventoryReportOverlay .platform-global-inventory-report-card{
  width:calc(100vw - 32px) !important;
  max-width:1680px !important;
  height:min(92dvh, 900px);
  max-height:92dvh;
}

.platform-global-inventory-summary{
  grid-template-columns:repeat(4, minmax(0,1fr));
}

.platform-global-inventory-table{
  min-width:1120px;
}

.platform-global-inventory-summary--mlq{
  grid-template-columns:repeat(6, minmax(0,1fr));
}

.platform-global-mlq-table{
  min-width:930px;
  table-layout:fixed;
}

.platform-global-mlq-company-col{ width:140px; }
.platform-global-mlq-item-col{ width:86px; }
.platform-global-mlq-desc-col{ width:260px; }
.platform-global-mlq-type-col{ width:120px; }
.platform-global-mlq-num-col{ width:72px; }
.platform-global-mlq-location-col{ width:100px; }

.platform-global-mlq-primary{
  font-weight:900;
  color:var(--primary);
}

.platform-global-mlq-secondary{
  margin-top:2px;
  font-size:0.72rem;
  line-height:1.18;
  color:var(--muted);
  font-weight:800;
}

.platform-global-mlq-num-cell{
  text-align:right;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.platform-global-mlq-guidance-row td{
  background:#f8fafc;
  border-top:0;
  padding:7px 9px;
}

.platform-global-mlq-guidance-block + .platform-global-mlq-guidance-block{
  margin-top:7px;
  padding-top:6px;
  border-top:1px solid rgba(17,24,39,.10);
}

.platform-global-mlq-guidance-label{
  display:block;
  margin-bottom:2px;
  font-size:0.68rem;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--gold-text);
}

.platform-global-mlq-guidance-text{
  color:var(--primary);
  font-size:0.82rem;
  line-height:1.28;
  font-weight:700;
}

.platform-global-mlq-issue-text,
.platform-global-mlq-fix-text{
  color:var(--primary);
}

@media (min-width:701px) and (max-width:1180px){
  #platformGlobalInventoryReportOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:8px;
  }

  #platformGlobalInventoryReportOverlay .platform-global-inventory-report-card{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .platform-global-inventory-summary{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }
}

@media (max-width:700px){
  #platformGlobalInventoryReportOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }

  #platformGlobalInventoryReportOverlay .platform-global-inventory-report-card{
    width:100vw !important;
    max-width:none !important;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .platform-global-inventory-summary{
    grid-template-columns:1fr 1fr;
  }

  .platform-global-inventory-table{
    min-width:960px;
  }
}

/* Phase 4.5C.1P.3G — Platform Admin Company Access Management */
.platform-admin-access-summary{
  border:1px solid rgba(180,83,9,.28);
  border-left:5px solid var(--gold-text);
  border-radius:14px;
  background:#fffaf0;
  padding:12px;
  margin-bottom:12px;
  line-height:1.35;
}

.platform-admin-access-summary-title{
  font-weight:900;
  color:var(--gold-text);
  font-size:1rem;
  margin-bottom:4px;
}

.platform-admin-access-summary-line{
  color:var(--primary);
  font-size:.82rem;
}

.platform-admin-access-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(170px, 1fr));
  gap:10px;
}

.platform-admin-access-card{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
  box-shadow:0 2px 8px rgba(0,0,0,.05);
}

.platform-admin-access-label{
  color:var(--muted);
  font-size:.74rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:4px;
}

.platform-admin-access-value{
  color:var(--primary);
  font-weight:900;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.platform-admin-access-value.is-blocked{
  color:var(--danger);
}

.platform-admin-access-form{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
  margin-top:12px;
}

.platform-admin-access-wide{
  grid-column:1/-1;
}

@media (max-width:700px){
  .platform-admin-access-grid,
  .platform-admin-access-form{
    grid-template-columns:1fr;
  }
}

/* ==========================================================
   Phase 4.5C.1 — Tenant Inventory Reports UI Alignment
   Keeps the existing Inventory Reports accordion as the tenant
   report center and aligns report workflow notes with Phase 4.5C.
   ========================================================== */
/*.inventory-report-workflow-card{
  margin-top:12px;
  margin-bottom:0;
  background:#fff7ed;
  border-color:#fed7aa;
  border-left-color:var(--gold-text);
}*/

.inventory-company-report-company-name{
  color:#047857;
  font-weight:900;
}

.inventory-company-report-workflow-note{
  border:1px solid #fed7aa;
  border-left:5px solid var(--gold-text);
  background:#fff7ed;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
  color:var(--primary);
}

.inventory-company-report-workflow-note-title{
  font-weight:900;
  color:var(--gold-text);
  line-height:1.2;
  margin-bottom:6px;
}

.inventory-company-report-workflow-note ol{
  margin:0 0 0 18px;
  padding:0;
  font-size:0.84rem;
  line-height:1.35;
}

.inventory-company-report-workflow-note li{
  margin:2px 0;
}

@media (max-width:700px){
  .inventory-company-report-workflow-note{
    padding:8px 9px;
    margin-bottom:8px;
  }

  .inventory-company-report-workflow-note ol{
    font-size:0.76rem;
    line-height:1.28;
  }
}

/* ==========================================================
   Phase 4.5C.2 — Company Access Policy Framework
   Tenant-admin-owned permission catalog, access groups,
   group members, and user-level overrides.
   ========================================================== */
.access-policy-intro-card{
  border:1px solid var(--border);
  border-left:5px solid var(--gold-text);
  background:#fff7ed;
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}
.access-policy-intro-title{
  font-weight:900;
  color:var(--gold-text);
  margin-bottom:5px;
}
.access-policy-intro-text{
  font-size:.84rem;
  line-height:1.38;
  color:var(--primary);
}
.access-policy-toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:flex-end;
  margin:10px 0 12px;
}
.access-policy-toolbar .form-group{
  flex:1 1 220px;
  margin-bottom:0;
}
.access-policy-toolbar .btn{
  flex:1 1 160px;
}
.access-policy-section-title{
  font-weight:900;
  margin:12px 0 8px;
  color:var(--primary);
}

/* ==========================================================
   Phase 4.5C.1P.1 — Access Policy Compact Section Navigation
   Compact sub-sections only. No access-policy behavior changes.
   ========================================================== */

.access-policy-compact-nav{
  display:grid;
  gap:10px;
  margin-top:10px;
}

.access-policy-compact-section{
  border:1px solid var(--border);
  border-left:5px solid #0f4c81;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 3px 12px rgba(15,23,42,.05);
}

.access-policy-compact-section > summary{
  list-style:none;
}

.access-policy-compact-section > summary::-webkit-details-marker{
  display:none;
}

.access-policy-compact-summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  cursor:pointer;
  background:linear-gradient(180deg,#f8fafc 0%,#eef6ff 100%);
  color:var(--primary);
}

.access-policy-compact-title{
  font-weight:900;
  line-height:1.2;
  color:#0f4c81;
}

.access-policy-compact-sub{
  margin-top:3px;
  font-size:.78rem;
  line-height:1.3;
  color:var(--muted);
}

.access-policy-compact-caret{
  flex:0 0 auto;
  font-weight:900;
  color:#0f4c81;
  transition:transform .16s ease;
}

.access-policy-compact-section[open] > .access-policy-compact-summary{
  border-bottom:1px solid rgba(15,76,129,.14);
}

.access-policy-compact-section[open] > .access-policy-compact-summary .access-policy-compact-caret{
  transform:rotate(180deg);
}

.access-policy-compact-body{
  padding:12px;
  background:#fff;
}

.access-policy-compact-body > .access-policy-default-reset-card{
  margin:0;
}

.access-policy-compact-body .access-policy-category-card:last-child,
.access-policy-compact-body .access-policy-group-card:last-child{
  margin-bottom:0;
}

@media (max-width:700px){
  .access-policy-compact-summary{
    padding:10px;
  }

  .access-policy-compact-body{
    padding:10px;
  }

  .access-policy-compact-sub{
    font-size:.75rem;
  }
}

.access-policy-category-card,
.access-policy-group-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  margin-bottom:10px;
  box-shadow:0 4px 14px rgba(15,23,42,.06);
}
.access-policy-category-title,
.access-policy-group-title{
  font-weight:900;
  color:var(--primary);
  margin-bottom:8px;
}

.access-policy-category-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.access-policy-category-desc{
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
  margin-top:-4px;
}

.access-policy-category-count{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  border:1px solid #dbeafe;
  background:#eff6ff;
  color:#1d4ed8;
  border-radius:999px;
  padding:4px 8px;
  font-size:.7rem;
  font-weight:900;
  white-space:nowrap;
}

.access-policy-catalog-toolbar{
  display:grid;
  grid-template-columns:minmax(180px, 1.8fr) minmax(140px, 1fr) minmax(120px, .8fr) minmax(130px, .8fr) auto;
  gap:8px;
  align-items:end;
  border:1px solid #dbeafe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:12px;
  padding:10px;
  margin-bottom:10px;
}

.access-policy-catalog-toolbar .form-group{
  margin:0;
}

.access-policy-catalog-toolbar-actions{
  display:flex;
  align-items:end;
  justify-content:flex-end;
}

.access-policy-catalog-toolbar-actions .btn{
  min-height:38px;
  white-space:nowrap;
}

.access-policy-catalog-counts{
  margin:0 0 10px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:800;
}

.access-policy-permission-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
}
.access-policy-permission-card{
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  padding:10px;
  text-align:left;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:var(--primary);
}
.access-policy-permission-card:hover{
  background:#eff6ff;
  border-color:#bfdbfe;
}
.access-policy-permission-title{
  font-weight:900;
  line-height:1.2;
}
.access-policy-permission-key{
  font-size:.72rem;
  color:var(--muted);
  overflow-wrap:anywhere;
}

.access-policy-permission-desc{
  font-size:.75rem;
  color:#4b5563;
  line-height:1.3;
}

.access-policy-permission-tags{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:2px;
}

.access-policy-risk{
  display:inline-flex;
  width:max-content;
  padding:3px 7px;
  border-radius:999px;
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
  background:#f3f4f6;
  color:var(--primary);
}
.access-policy-risk--high{ background:#fff7ed; color:#c2410c; }
.access-policy-risk--critical{ background:#fef2f2; color:#b91c1c; }
.access-policy-risk--medium{ background:#eff6ff; color:#1e40af; }
.access-policy-group-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:8px;
}
.access-policy-group-desc{
  font-size:.8rem;
  color:var(--muted);
  line-height:1.3;
}
.access-policy-badge{
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  background:#eff6ff;
  color:#1e40af;
  font-size:.72rem;
  font-weight:900;
  white-space:nowrap;
}
.access-policy-member-list{
  display:grid;
  gap:6px;
}
.access-policy-member-row{
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size:.84rem;
  line-height:1.25;
}
.access-policy-empty{
  color:var(--muted);
  font-size:.84rem;
  line-height:1.35;
  padding:8px;
  border:1px dashed var(--border);
  border-radius:10px;
  background:#f9fafb;
}
.access-policy-status{
  display:none;
  margin-top:10px;
  font-size:.85rem;
  line-height:1.35;
}
#companyAccessPolicyPermissionOverlay{
  align-items:center;
  justify-content:center;
  padding:12px;
  overflow:hidden;
}
#companyAccessPolicyPermissionOverlay .access-policy-overlay-card{
  width:min(96vw, 980px);
  max-width:980px;
  height:min(92dvh, 820px);
  max-height:92dvh;
  padding:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.access-policy-overlay-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:14px 16px 10px;
  border-bottom:1px solid var(--border);
  background:#fff;
}
.access-policy-overlay-head h3{
  margin:0;
  line-height:1.15;
}
.access-policy-overlay-meta{
  margin-top:6px;
  font-size:.82rem;
  color:var(--muted);
  line-height:1.35;
}
.access-policy-admin-note{
  margin-top:6px;
  padding:7px 9px;
  background:#ecfdf5;
  color:#047857;
  border:1px solid #a7f3d0;
  border-radius:8px;
  font-weight:800;
}
.access-policy-overlay-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:12px 16px 16px;
  -webkit-overflow-scrolling:touch;
}
.access-policy-overlay-section{
  margin-bottom:14px;
}
.access-policy-overlay-section h4{
  margin:0 0 8px;
  color:var(--primary);
}
.access-policy-rule-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 150px;
  gap:10px;
  align-items:center;
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  padding:10px;
  margin-bottom:8px;
}
.access-policy-rule-row select{
  width:100%;
  min-height:40px;
}
.access-policy-user-rule-row input{
  margin-top:6px;
}
.access-policy-user-override-hint{
  font-size:.8rem;
  color:var(--muted);
  line-height:1.35;
  margin-bottom:8px;
}
@media (max-width:900px){
  .access-policy-catalog-toolbar{
    grid-template-columns:1fr 1fr;
  }

  .access-policy-catalog-search,
  .access-policy-catalog-toolbar-actions{
    grid-column:1/-1;
  }

  .access-policy-catalog-toolbar-actions .btn{
    width:100%;
  }
}

@media (max-width:700px){
  .access-policy-permission-grid{
    grid-template-columns:1fr;
  }

  .access-policy-catalog-toolbar{
    grid-template-columns:1fr;
  }

  .access-policy-category-head{
    align-items:flex-start;
    flex-direction:column;
  }
  #companyAccessPolicyPermissionOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }
  #companyAccessPolicyPermissionOverlay .access-policy-overlay-card{
    width:100vw;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }
  .access-policy-overlay-head{
    padding:12px;
  }
  .access-policy-overlay-body{
    padding:10px 12px 14px;
  }
  .access-policy-rule-row{
    grid-template-columns:1fr;
  }
}
/* ==========================================================
   Phase 4.5C.2.1 — Access Policy Unlock Hardening
   Sensitive Access Policy content remains hidden until the
   company admin password unlock succeeds.
   ========================================================== */
.access-policy-lock-card{
  border:1px solid #bfdbfe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:12px;
  padding:11px 12px;
  margin:10px 0 12px;
  color:var(--primary);
}

.access-policy-lock-title{
  font-weight:900;
  color:#1e40af;
  margin-bottom:4px;
}

.access-policy-lock-text{
  font-size:.84rem;
  line-height:1.35;
  color:#1f2937;
}
.access-policy-unlocked-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #bbf7d0;
  border-left:5px solid #10b981;
  background:#ecfdf5;
  border-radius:12px;
  padding:10px 12px;
  margin:0 0 12px;
}

.access-policy-unlocked-title{
  font-weight:900;
  color:#047857;
  margin-bottom:2px;
}

.access-policy-unlocked-sub{
  color:#065f46;
  font-size:.78rem;
  line-height:1.3;
}

.access-policy-unlock-modal{
  max-width:460px;
}

.access-policy-unlock-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.access-policy-unlock-modal-actions .btn{
  min-width:120px;
}

.access-policy-unlock-overlay-status{
  font-size:.85rem;
  font-weight:800;
  line-height:1.35;
  margin-top:8px;
}

@media (max-width:700px){
  .access-policy-unlocked-toolbar{
    align-items:stretch;
    flex-direction:column;
  }

  .access-policy-unlocked-toolbar .btn,
  .access-policy-unlock-modal-actions .btn{
    width:100%;
  }
}

/* ==========================================================
   Phase 4.5D.0D-P.5A — Platform Maintenance Unlock Overlay
   ========================================================== */
.platform-maintenance-locked-card > .acc-body,
.platform-admin-company-access-locked-card > .acc-body,
.tenant-management-locked-card > .acc-body{
  position:relative;
}

.platform-maintenance-unlocked-toolbar,
.platform-admin-company-access-unlocked-toolbar,
.tenant-management-unlocked-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #fed7aa;
  border-left:5px solid #b45309;
  background:#fff7ed;
  border-radius:12px;
  padding:10px 12px;
  margin:0 0 12px;
}

/* Phase 4.7.DR.4.R2.2.C1.R1 - keep the unlocked message and lock
   control adjacent. The C1 tablet column layout previously retained a 420px
   flex basis on the text wrapper, which created a large blank vertical gap. */
.platform-maintenance-unlocked-toolbar{
  align-items:flex-start;
  justify-content:flex-start;
  gap:8px;
}

.platform-maintenance-unlocked-copy{
  flex:0 1 640px;
  min-width:0;
  max-width:640px;
}

#platformMaintenanceLockBtn,
.platform-maintenance-lock-btn{
  flex:0 0 auto;
  width:auto;
  min-width:240px;
  max-width:100%;
  white-space:normal;
  line-height:1.25;
  padding-left:1rem;
  padding-right:1rem;
  margin:0;
}

@media (max-width:1024px){
  .platform-maintenance-unlocked-toolbar{
    align-items:stretch;
    flex-direction:column;
    gap:6px;
  }

  .platform-maintenance-unlocked-copy{
    flex:0 0 auto;
    width:100%;
    max-width:none;
  }

  #platformMaintenanceLockBtn,
  .platform-maintenance-lock-btn{
    width:100%;
    min-width:0;
    max-width:none;
    flex:0 0 auto;
  }
}
.platform-maintenance-unlocked-title,
.platform-admin-company-access-unlocked-title,
.tenant-management-unlocked-title{
  font-weight:900;
  color:#92400e;
  margin-bottom:2px;
}

.platform-maintenance-unlocked-sub,
.platform-admin-company-access-unlocked-sub,
.tenant-management-unlocked-sub{
  color:#7c2d12;
  font-size:.78rem;
  line-height:1.35;
}

.platform-maintenance-lock-status,
.platform-maintenance-unlock-overlay-status,
.platform-admin-company-access-lock-status,
.platform-admin-company-access-unlock-overlay-status,
.tenant-management-lock-status,
.tenant-management-unlock-overlay-status{
  font-size:.85rem;
  font-weight:800;
  line-height:1.35;
  margin-top:8px;
}

/* Phase 4.7.DR.4.R2.2.C1.R1 - visible recovery refresh activity. */
.platform-recovery-refresh-btn{
  gap:8px;
}

.platform-recovery-refresh-spinner{
  display:none;
  width:15px;
  height:15px;
  flex:0 0 15px;
  border:2px solid currentColor;
  border-right-color:transparent;
  border-radius:50%;
}

.platform-recovery-refresh-btn.is-loading .platform-recovery-refresh-spinner{
  display:inline-block;
  animation:platform-recovery-refresh-spin .75s linear infinite;
}

@keyframes platform-recovery-refresh-spin{
  to{ transform:rotate(360deg); }
}

@media (prefers-reduced-motion:reduce){
  .platform-recovery-refresh-btn.is-loading .platform-recovery-refresh-spinner{
    animation-duration:1.5s;
  }
}

.platform-maintenance-child-auth-note,
.tenant-management-child-auth-note{
  border:1px solid #dbeafe;
  border-left:4px solid #2563eb;
  background:#eff6ff;
  color:#1e3a8a;
  border-radius:10px;
  padding:9px 10px;
  font-size:.8rem;
  font-weight:800;
  line-height:1.35;
  margin:0 0 10px;
}

.platform-maintenance-unlock-modal,
.platform-admin-company-access-unlock-modal,
.tenant-management-unlock-modal{
  max-width:480px;
}

.platform-maintenance-unlock-modal-actions,
.platform-admin-company-access-unlock-modal-actions,
.tenant-management-unlock-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.platform-maintenance-unlock-modal-actions .btn,
.platform-admin-company-access-unlock-modal-actions .btn,
.tenant-management-unlock-modal-actions .btn{
  min-width:120px;
}

.tenant-management-unlocked-toolbar{
  align-items:flex-start;
}

.tenant-management-unlocked-toolbar > div{
  flex:1 1 auto;
  min-width:0;
}

.tenant-management-unlocked-toolbar > .btn{
  flex:0 0 auto;
  min-width:215px;
  width:auto;
  max-width:none;
  white-space:nowrap;
}

@media (max-width:700px){
  .platform-maintenance-unlocked-toolbar,
	.platform-admin-company-access-unlocked-toolbar,
  .tenant-management-unlocked-toolbar{
    align-items:stretch;
    flex-direction:column;
  }

  .platform-maintenance-unlocked-toolbar .btn,
  .platform-admin-company-access-unlocked-toolbar .btn,
  .tenant-management-unlocked-toolbar .btn,
  .platform-maintenance-unlock-modal-actions .btn,
  .platform-admin-company-access-unlock-modal-actions .btn,
  .tenant-management-unlock-modal-actions .btn{
    width:100%;
  }
}

/* Phase 4.5C.1P.4 — Optional Safe Purge of Retired Role-Default Access Groups */
.access-policy-retired-purge-card{
  border:1px solid #fecaca;
  border-left:5px solid #991b1b;
  background:#fff7f7;
  border-radius:14px;
  padding:12px;
  margin-top:14px;
}

.access-policy-retired-purge-preview{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:12px;
  margin-top:12px;
}

.access-policy-retired-purge-summary{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
  gap:10px;
  margin-bottom:12px;
}

.access-policy-retired-purge-result{
  border:1px solid #bbf7d0;
  border-left:5px solid #10b981;
  background:#ecfdf5;
  color:#065f46;
  border-radius:12px;
  padding:10px;
  font-size:.84rem;
  font-weight:800;
  margin-bottom:12px;
}

.access-policy-retired-purge-section-title{
  font-weight:900;
  color:var(--primary);
  margin:12px 0 8px;
}

.access-policy-retired-purge-list{
  display:grid;
  gap:8px;
}

.access-policy-retired-purge-row{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
}

.access-policy-retired-purge-row.is-safe{
  border-left:5px solid #10b981;
}

.access-policy-retired-purge-row.is-blocked{
  border-left:5px solid #f59e0b;
  background:#fffbeb;
}

.access-policy-retired-purge-row-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.access-policy-retired-purge-name{
  font-weight:900;
  color:var(--primary);
}

.access-policy-retired-purge-meta{
  color:var(--muted);
  font-size:.75rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.access-policy-retired-purge-counts{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.access-policy-retired-purge-counts span{
  display:inline-flex;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  border-radius:999px;
  padding:3px 7px;
  font-size:.72rem;
  font-weight:800;
}

.access-policy-retired-purge-reason{
  margin-top:8px;
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
}

.access-policy-purge-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:4px 8px;
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
}

.access-policy-purge-badge--safe{
  background:#ecfdf5;
  color:#047857;
}

.access-policy-purge-badge--blocked{
  background:#fef3c7;
  color:#92400e;
}

@media (max-width:700px){
  .access-policy-retired-purge-row-head{
    flex-direction:column;
  }

  .access-policy-purge-badge{
    width:100%;
  }
}

/* ==========================================================
   Phase 4.5C.3 — Inventory Report Access Policy Enforcement
   Tenant report cards are shown only when the user has access.
   Backend remains the source of truth.
   ========================================================== */
.inventory-report-card.is-hidden{
  display:none !important;
}

.inventory-reports-no-access{
  border:1px solid #bfdbfe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  color:#1f2937;
  border-radius:12px;
  padding:12px 14px;
  font-size:.88rem;
  font-weight:800;
  line-height:1.35;
  margin-top:12px;
}

@media (max-width:700px){
  .inventory-reports-no-access{
    padding:10px 11px;
    font-size:.8rem;
  }
}

/* ==========================================================
   Phase 4.5C.3.1 — Role-Based Default Access Group Sync
   Role defaults seed membership only; permissions still come
   from Access Policy groups and user-level overrides.
   ========================================================== */
.access-policy-group-badges{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:6px;
}

.access-policy-badge--default-role{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#047857;
}

.access-policy-default-role-chip{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid #bbf7d0;
  background:#ecfdf5;
  color:#047857;
  font-size:.68rem;
  font-weight:900;
  line-height:1.1;
  vertical-align:middle;
  white-space:nowrap;
}

@media (max-width:700px){
  .access-policy-group-badges{
    justify-content:flex-start;
  }

  .access-policy-default-role-chip{
    display:inline-flex;
    margin-left:4px;
    margin-top:2px;
  }
}

/* ==========================================================
   Phase 4.5C.3.1A — Reset Default Group Membership Tool
   Protected preview/apply workflow for restoring active staff
   to role-based default groups without changing permissions.
   ========================================================== */
.access-policy-default-reset-card{
  margin:14px 0;
  padding:12px;
  border:1px solid #fed7aa;
  border-left:5px solid var(--gold-text);
  background:#fff7ed;
  border-radius:12px;
  color:var(--primary);
}

.access-policy-default-reset-title{
  font-weight:900;
  color:var(--gold-text);
  margin-bottom:4px;
}

.access-policy-default-reset-text{
  font-size:.84rem;
  line-height:1.35;
  color:#374151;
}

.access-policy-default-reset-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:stretch;
  margin-top:8px;
}

.access-policy-default-reset-actions .btn{
  flex:1 1 220px;
  max-width:none;
}

.access-policy-default-reset-preview{
  margin-top:12px;
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:10px;
  padding:10px;
}

.access-policy-default-reset-preview-title{
  font-weight:900;
  color:var(--primary);
  margin-bottom:8px;
}

.access-policy-default-reset-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.access-policy-default-reset-summary-card{
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#f9fafb;
  padding:8px;
  font-size:.78rem;
  line-height:1.35;
}

.access-policy-default-reset-summary-title{
  font-weight:900;
  color:var(--gold-text);
  margin-bottom:4px;
}

.access-policy-default-reset-total{
  margin-top:8px;
  padding:8px;
  border-radius:9px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  font-size:.82rem;
  font-weight:800;
}

.access-policy-default-reset-list{
  margin-top:8px;
  display:grid;
  gap:6px;
}

.access-policy-default-reset-row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fff;
  padding:8px;
  font-size:.78rem;
}

.access-policy-default-reset-row > div:last-child{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  text-align:right;
}

.access-policy-default-reset-action{
  display:inline-flex;
  align-items:center;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:.68rem;
  font-weight:900;
  white-space:nowrap;
}

.access-policy-default-reset-group{
  font-size:.72rem;
  font-weight:900;
  color:var(--primary);
}

.access-policy-default-reset-none{
  margin-top:8px;
  padding:8px;
  border-radius:9px;
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  color:#047857;
  font-size:.82rem;
  font-weight:900;
}

@media (max-width:700px){
  .access-policy-default-reset-summary{
    grid-template-columns:1fr;
  }

  .access-policy-default-reset-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .access-policy-default-reset-row > div:last-child{
    justify-content:flex-start;
    text-align:left;
  }
}

/* ==========================================================
   Phase 4.5C.3.1A.1 — Default Group Reset Audit Viewer & Print
   Read-only audit history for default role-group reset events.
   ========================================================== */
.access-policy-default-audit-card{
  margin-top:12px;
  padding:12px;
  border:1px solid #bfdbfe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:12px;
}

.access-policy-reset-audit-history{
  margin-top:12px;
  border:1px solid #dbeafe;
  background:#fff;
  border-radius:10px;
  padding:10px;
}

.access-policy-reset-audit-title{
  font-weight:900;
  color:#1e40af;
  margin-bottom:4px;
}

.access-policy-reset-audit-note{
  font-size:.8rem;
  color:#4b5563;
  line-height:1.35;
  margin-bottom:8px;
}

.access-policy-reset-audit-list{
  display:grid;
  gap:8px;
}

.access-policy-reset-audit-item{
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  overflow:hidden;
}

.access-policy-reset-audit-item summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px;
  font-size:.82rem;
  line-height:1.35;
}

.access-policy-reset-audit-item summary::-webkit-details-marker{
  display:none;
}

.access-policy-reset-audit-counts{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  color:#047857;
  font-size:.72rem;
  font-weight:900;
  white-space:nowrap;
}

.access-policy-reset-audit-detail{
  border-top:1px solid #e5e7eb;
  padding:10px;
  background:#f9fafb;
}

.access-policy-reset-audit-meta-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.access-policy-reset-audit-meta-grid > div{
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fff;
  padding:8px;
  font-size:.76rem;
  line-height:1.25;
}

.access-policy-reset-audit-meta-grid span{
  display:block;
  color:var(--muted);
  font-weight:800;
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:3px;
}

.access-policy-reset-audit-meta-grid strong{
  color:var(--primary);
  overflow-wrap:anywhere;
}

.access-policy-reset-audit-affected-title{
  margin:10px 0 6px;
  font-size:.8rem;
  font-weight:900;
  color:var(--primary);
}

.access-policy-reset-audit-affected-list{
  display:grid;
  gap:6px;
}

.access-policy-reset-audit-affected-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fff;
  padding:8px;
  font-size:.76rem;
}

.access-policy-reset-audit-affected-row > div:last-child{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
  text-align:right;
}

.access-policy-audit-print-shell{
  display:none;
}

@media (max-width:700px){
  .access-policy-reset-audit-item summary{
    align-items:flex-start;
    flex-direction:column;
  }

  .access-policy-reset-audit-counts{
    white-space:normal;
  }

  .access-policy-reset-audit-meta-grid{
    grid-template-columns:1fr;
  }

  .access-policy-reset-audit-affected-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .access-policy-reset-audit-affected-row > div:last-child{
    justify-content:flex-start;
    text-align:left;
  }
}

@media print{
  body > *{
    visibility:hidden !important;
  }

  .access-policy-audit-print-shell,
  .access-policy-audit-print-shell *{
    visibility:visible !important;
  }

  .access-policy-audit-print-shell{
    display:block !important;
    position:absolute;
    left:0;
    top:0;
    width:100%;
    background:#fff;
    color:#111827;
    padding:0;
    font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .access-policy-audit-print-page{
    padding:18px;
  }

  .access-policy-audit-print-page h1{
    margin:0 0 6px;
    font-size:20px;
    color:#111827;
  }

  .access-policy-audit-print-subtitle,
  .access-policy-audit-print-generated{
    font-size:11px;
    color:#4b5563;
    margin-bottom:8px;
  }

  .access-policy-audit-print-record{
    break-inside:avoid;
    page-break-inside:avoid;
    border:1px solid #d1d5db;
    border-radius:8px;
    padding:10px;
    margin:10px 0;
  }

  .access-policy-audit-print-record h3{
    margin:0 0 8px;
    font-size:15px;
    color:#111827;
  }

  .access-policy-audit-print-record h4{
    margin:10px 0 5px;
    font-size:13px;
    color:#111827;
  }

  .access-policy-audit-print-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:5px 10px;
    font-size:11px;
  }

  .access-policy-audit-print-record table{
    width:100%;
    border-collapse:collapse;
    font-size:11px;
  }

  .access-policy-audit-print-record th,
  .access-policy-audit-print-record td{
    border:1px solid #d1d5db;
    padding:5px;
    text-align:left;
    vertical-align:top;
  }

  .access-policy-audit-print-record th{
    background:#f3f4f6;
    font-weight:900;
  }
}

/* ==========================================================
   Phase 4.5C.3.1A.1B — Compact Reset Audit Filters + Reliable Print
   Keeps audit tools compact in Setup and moves printing to
   an isolated iframe document.
   ========================================================== */
.access-policy-audit-compact-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  align-items:stretch;
  margin-top:8px;
}

.access-policy-audit-compact-actions .btn{
  flex:1 1 118px;
  min-height:36px;
  max-width:none;
  padding:7px 9px;
  font-size:.78rem;
}

.access-policy-audit-filter-drawer{
  margin-top:8px;
  padding:9px;
  border:1px solid #dbeafe;
  background:#fff;
  border-radius:10px;
}

.access-policy-audit-filter-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.access-policy-audit-filter-grid .form-group{
  margin-bottom:0;
}

.access-policy-audit-filter-grid label{
  font-size:.72rem;
  font-weight:900;
  color:var(--muted);
}

.access-policy-audit-filter-presets{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.access-policy-audit-filter-presets .btn{
  flex:1 1 86px;
  min-height:34px;
  max-width:none;
  padding:6px 8px;
  font-size:.74rem;
}

.access-policy-reset-audit-compact-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  font-size:.8rem;
  color:var(--primary);
}

.access-policy-reset-audit-compact-head > div > div{
  color:var(--muted);
  font-size:.74rem;
  margin-top:2px;
}

.access-policy-reset-audit-compact-head .btn{
  flex:0 0 auto;
  min-height:32px;
  padding:6px 9px;
  font-size:.74rem;
}

.access-policy-reset-audit-summary-main{
  min-width:0;
}

.access-policy-reset-audit-reason{
  color:var(--primary);
  font-weight:700;
  overflow-wrap:anywhere;
}

.access-policy-reset-audit-admin{
  color:var(--muted);
  font-size:.74rem;
  margin-top:2px;
}

.access-policy-reset-audit-detail-actions{
  display:flex;
  justify-content:flex-end;
  margin-bottom:8px;
}

.access-policy-reset-audit-detail-actions .btn{
  min-height:34px;
  padding:6px 10px;
  font-size:.76rem;
}

@media (max-width:700px){
  .access-policy-audit-compact-actions .btn{
    flex:1 1 calc(50% - 7px);
    min-height:38px;
  }

  .access-policy-audit-filter-grid{
    grid-template-columns:1fr;
  }

  .access-policy-audit-filter-presets .btn{
    flex:1 1 calc(33.333% - 6px);
    min-height:36px;
  }

  .access-policy-reset-audit-compact-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .access-policy-reset-audit-compact-head .btn{
    width:100%;
  }

  .access-policy-reset-audit-detail-actions{
    justify-content:stretch;
  }

  .access-policy-reset-audit-detail-actions .btn{
    width:100%;
  }
}

@media (max-width:430px){
  .access-policy-audit-compact-actions .btn{
    flex:1 1 calc(50% - 7px);
    font-size:.74rem;
    padding:7px 6px;
  }

  .access-policy-audit-filter-presets .btn{
    flex:1 1 calc(50% - 6px);
  }
}

/* ==========================================================
   Phase 4.5C.3.2 — Staff Role Catalog
   Compact role catalog inside Staff Management.
   ========================================================== */
.staff-role-catalog-card{
  margin-top:10px;
  background:#f8fafc;
  border-color:#dbeafe;
}

.staff-role-catalog-body{
  padding-top:10px;
}

.staff-role-catalog-intro{
  border:1px solid #dbeafe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:10px;
  padding:9px 10px;
  color:var(--primary);
  font-size:.82rem;
  line-height:1.35;
}

.staff-role-catalog-intro strong{
  display:block;
  color:#1e40af;
  margin-bottom:3px;
}

.staff-role-catalog-toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0;
}

.staff-role-catalog-toolbar .btn{
  flex:1 1 150px;
  max-width:none;
  min-height:36px;
  padding:7px 9px;
  font-size:.78rem;
}

.staff-role-catalog-list{
  display:grid;
  gap:8px;
}

.staff-role-card{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto auto;
  gap:8px;
  align-items:center;
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:10px;
  padding:9px;
}

.staff-role-card.is-inactive{
  opacity:.72;
  background:#f9fafb;
}

.staff-role-title{
  font-weight:900;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.staff-role-key{
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  margin-top:1px;
  overflow-wrap:anywhere;
}

.staff-role-desc,
.staff-role-default-group,
.staff-role-mapping,
.staff-role-delete-note{
  color:#4b5563;
  font-size:.74rem;
  line-height:1.3;
  margin-top:2px;
}

.staff-role-default-group{
  color:#047857;
  font-weight:800;
}

.staff-role-mapping{
  border:1px solid #e5e7eb;
  border-radius:9px;
  padding:6px 8px;
  background:#f8fafc;
  color:#475569;
  font-weight:800;
}

.staff-role-mapping.is-mapped{
  border-color:#bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
}

.staff-role-mapping.is-unmapped{
  border-color:#fed7aa;
  background:#fff7ed;
  color:#9a3412;
}

.staff-role-delete-note{
  color:#b91c1c;
  font-weight:850;
}

.staff-role-meta{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.staff-role-badge{
  display:inline-flex;
  align-items:center;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  color:var(--primary);
  font-size:.68rem;
  font-weight:900;
  white-space:nowrap;
}

.staff-role-badge.is-system{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1d4ed8;
}

.staff-role-badge.is-custom{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#b45309;
}

.staff-role-badge.is-active{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#047857;
}

.staff-role-badge.is-inactive{
  background:#fef2f2;
  border-color:#fecaca;
  color:#b91c1c;
}

.staff-role-badge.is-count{
  background:#f8fafc;
  border-color:#e5e7eb;
  color:#475569;
}

.staff-role-badge.is-mapped{
  background:#eef2ff;
  border-color:#c7d2fe;
  color:#3730a3;
}

.staff-role-actions{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
}

.staff-role-actions .btn{
  min-height:34px;
  padding:6px 9px;
  font-size:.74rem;
}

.staff-role-delete-btn{
  background:var(--danger) !important;
  color:#fff !important;
}

.staff-role-delete-btn:disabled{
  background:#e5e7eb !important;
  color:#6b7280 !important;
  border-color:#d1d5db !important;
  cursor:not-allowed;
  opacity:.78;
}

.staff-role-empty{
  padding:10px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  color:var(--muted);
  font-size:.82rem;
  font-weight:800;
}

.staff-role-form-note{
  border:1px solid #dbeafe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:10px;
  padding:9px 10px;
  font-size:.82rem;
  color:#1f2937;
  line-height:1.35;
  margin-bottom:10px;
}

.staff-role-form-help{
  color:var(--muted);
  font-size:.74rem;
  line-height:1.3;
  margin-top:4px;
}

.staff-role-assignment-sync-notice{
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:8px 10px;
  margin:0 0 10px 0;
  font-size:.8rem;
  font-weight:800;
  line-height:1.35;
  background:#f8fafc;
  color:#475569;
}

.staff-role-assignment-sync-notice.is-mapped{
  border-color:#bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
}

.staff-role-assignment-sync-notice.is-unmapped{
  border-color:#fed7aa;
  background:#fff7ed;
  color:#9a3412;
}

.staff-role-form-status{
  margin-top:8px;
  padding:8px;
  border-radius:9px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  color:var(--primary);
  font-size:.8rem;
  font-weight:800;
  line-height:1.35;
}

#staffRoleFormOverlay input[readonly],
#staffRoleFormOverlay select:disabled{
  background:#f9fafb;
  color:var(--muted);
  -webkit-text-fill-color:var(--muted);
  opacity:1;
  cursor:not-allowed;
}

@media (max-width:760px){
  .staff-role-card{
    grid-template-columns:1fr;
    align-items:stretch;
  }

  .staff-role-meta,
  .staff-role-actions{
    justify-content:flex-start;
  }

  .staff-role-actions .btn{
    width:100%;
  }
}

@media (max-width:430px){
  .staff-role-catalog-toolbar .btn{
    flex:1 1 100%;
  }
}

/* ==========================================================
   Staff Management Loader / Refresh Feedback
   Permanent Staff Management load-state handling.
   ========================================================== */
.staff-mgmt-loading{
  padding:10px;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:#eff6ff;
  color:#1e40af;
  font-size:.82rem;
  font-weight:900;
  text-align:center;
}

.btn.is-loading,
.tenant-filter-refresh-btn.is-loading{
  opacity:.72;
  cursor:progress;
  pointer-events:none;
  position:relative;
}

.btn.is-loading::after,
.tenant-filter-refresh-btn.is-loading::after{
  content:"";
  width:12px;
  height:12px;
  margin-left:7px;
  border:2px solid rgba(255,255,255,.65);
  border-top-color:rgba(31,41,55,.8);
  border-radius:50%;
  animation:staffRefreshSpin .75s linear infinite;
}

@keyframes staffRefreshSpin{
  to{ transform:rotate(360deg); }
}

/* ==========================================================
   Phase 4.5C.3.2A — Dynamic Default Group Sync Audit Viewer
   ========================================================== */
.staff-role-sync-status{
  border:1px solid #dbeafe;
  border-left:5px solid #2563eb;
  background:#eff6ff;
  border-radius:10px;
  padding:8px 10px;
  margin:8px 0 10px;
  font-size:.8rem;
  font-weight:800;
  line-height:1.35;
  color:#1f2937;
}

.staff-role-sync-status.is-success{
  border-color:#bbf7d0;
  border-left-color:#16a34a;
  background:#f0fdf4;
  color:#166534;
}

.staff-role-sync-status.is-error{
  border-color:#fecaca;
  border-left-color:#dc2626;
  background:#fef2f2;
  color:#991b1b;
}

.staff-role-sync-status.is-warn{
  border-color:#fde68a;
  border-left-color:#d97706;
  background:#fffbeb;
  color:#92400e;
}

.staff-role-sync-audit-card{
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:12px;
  padding:10px;
  margin-top:12px;
}

.staff-role-sync-audit-title{
  font-weight:900;
  color:var(--primary);
  margin-bottom:3px;
}

.staff-role-sync-audit-text{
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
}

.staff-role-sync-audit-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.staff-role-sync-audit-actions .btn{
  flex:1 1 135px;
  min-height:34px;
  padding:6px 9px;
  font-size:.74rem;
}

.staff-role-sync-audit-history{
  margin-top:10px;
}

.staff-role-sync-audit-list{
  display:grid;
  gap:8px;
}

.staff-role-sync-audit-item{
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#f9fafb;
  padding:0;
  overflow:hidden;
}

.staff-role-sync-audit-item summary{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  cursor:pointer;
  padding:9px 10px;
  font-size:.78rem;
  color:var(--primary);
}

.staff-role-sync-audit-item summary strong{
  display:block;
  font-weight:900;
  color:var(--primary);
}

.staff-role-sync-audit-item summary em{
  display:block;
  font-style:normal;
  color:var(--muted);
  font-size:.72rem;
  margin-top:2px;
}

.staff-role-sync-audit-item[open]{
  background:#fff;
}

.staff-role-sync-audit-item .access-policy-audit-detail-grid{
  padding:0 10px 10px;
}

@media (max-width:700px){
  .staff-role-sync-audit-actions .btn{
    flex:1 1 calc(50% - 6px);
  }

  .staff-role-sync-audit-item summary{
    flex-direction:column;
  }
}

@media (max-width:430px){
  .staff-role-sync-audit-actions .btn{
    flex:1 1 100%;
  }
}

/* Phase 4.5C.3.2A.2 — Default Group Sync Audit Viewer Filters */
.staff-role-sync-audit-filter-panel{
  margin-top:10px;
}

.staff-role-sync-audit-filter-grid{
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
}

.staff-role-sync-audit-filter-grid select,
.staff-role-sync-audit-filter-grid input[type="date"]{
  min-height:36px;
}

.staff-role-sync-audit-quick-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 0;
}

.staff-role-sync-audit-quick-row .btn{
  flex:1 1 130px;
  min-height:34px;
  padding:6px 9px;
  font-size:.74rem;
}

@media (max-width:600px){
  .staff-role-sync-audit-filter-grid{
    grid-template-columns:1fr;
  }

  .staff-role-sync-audit-quick-row .btn{
    flex:1 1 calc(50% - 6px);
  }
}

@media (max-width:430px){
  .staff-role-sync-audit-quick-row .btn{
    flex:1 1 100%;
  }
}

/* ==========================================================
   Phase 4.5D.0B — Freeze UI + Smart Scope Selector
   Custom controls only. No browser default dropdown/select list.
   ========================================================== */

.inventory-freeze-panel{
  margin-top:14px;
  border:1px solid rgba(15,76,129,.22);
  border-left:6px solid #0f4c81;
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
  padding:14px;
  box-shadow:0 3px 12px rgba(15,23,42,.08);
}

.inventory-freeze-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.inventory-freeze-title{
  font-size:1.02rem;
  font-weight:900;
  color:#0f4c81;
  line-height:1.2;
}

.inventory-freeze-subtitle,
.inventory-freeze-mini,
.freeze-mini-note{
  font-size:.8rem;
  color:var(--muted);
  line-height:1.35;
  margin-top:3px;
}

.inventory-freeze-head-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.inventory-freeze-warning{
  border:1px solid #fde68a;
  border-left:5px solid #b45309;
  border-radius:10px;
  background:#fffbeb;
  color:#7c2d12;
  font-size:.84rem;
  font-weight:700;
  line-height:1.35;
  padding:9px 11px;
  margin-bottom:12px;
}

.inventory-freeze-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.inventory-freeze-grid input,
.inventory-freeze-grid textarea,
.inventory-freeze-panel textarea{
  width:100%;
}

.freeze-inline-disabled{
  display:flex;
  gap:6px;
  align-items:center;
}

.freeze-inline-disabled input:disabled{
  background:#f3f4f6;
  color:#6b7280;
  -webkit-text-fill-color:#6b7280;
  opacity:1;
}

.freeze-check-card{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border:1px solid #dbeafe;
  border-radius:12px;
  background:#eff6ff;
  padding:10px 12px;
  margin:10px 0 12px;
  cursor:pointer;
  touch-action:manipulation;
}

.freeze-check-box{
  width:22px;
  height:22px;
  flex:0 0 22px;
  border:2px solid #0f4c81;
  border-radius:6px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.12) inset;
  position:relative;
  margin-top:1px;
}

.freeze-check-card.is-checked .freeze-check-box{
  background:#0f4c81;
}

.freeze-check-card.is-checked .freeze-check-box::after{
  content:"\2713";
  position:absolute;
  left:4px;
  top:-3px;
  font-size:1.15rem;
  font-weight:900;
  color:#fff;
}

.freeze-check-card strong{
  display:block;
  font-weight:900;
  color:#0f4c81;
  line-height:1.2;
}

.freeze-check-card small{
  display:block;
  color:var(--muted);
  font-weight:700;
  line-height:1.3;
  margin-top:2px;
}

.freeze-custom-select{
  position:relative;
  width:100%;
}

.freeze-select-trigger{
  width:100%;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--primary);
  font-weight:800;
  font-size:.92rem;
  padding:9px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  text-align:left;
  cursor:pointer;
  touch-action:manipulation;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.freeze-select-trigger:hover,
.freeze-select-trigger[aria-expanded="true"]{
  border-color:#0f4c81;
  box-shadow:0 0 0 3px rgba(15,76,129,.12);
}

.freeze-select-trigger.is-disabled,
.freeze-select-trigger:disabled{
  opacity:.58;
  cursor:not-allowed;
  background:#f3f4f6;
}

.freeze-select-chevron{
  font-weight:900;
  color:#0f4c81;
  flex:0 0 auto;
}

.freeze-select-menu{
  display:none;
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 4px);
  z-index:7200;
  max-height:240px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid rgba(15,76,129,.24);
  border-radius:12px;
  background:#fff;
  box-shadow:0 14px 30px rgba(15,23,42,.18);
  padding:6px;
}

.freeze-select-menu.is-open{
  display:block;
}

.freeze-select-option{
  width:100%;
  border:0;
  background:#fff;
  color:var(--primary);
  text-align:left;
  padding:9px 10px;
  border-radius:9px;
  cursor:pointer;
  display:block;
  touch-action:manipulation;
}

.freeze-select-option:hover,
.freeze-select-option:focus{
  outline:none;
  background:#eff6ff;
}

.freeze-select-option span{
  display:block;
  font-size:.9rem;
  font-weight:850;
  line-height:1.2;
}

.freeze-select-option small{
  display:block;
  margin-top:2px;
  font-size:.76rem;
  font-weight:700;
  color:var(--muted);
  line-height:1.25;
}

.freeze-scope-disabled{
  opacity:.62;
}

.inventory-freeze-status{
  margin-top:10px;
  border-radius:10px;
  padding:9px 11px;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
}

.inventory-freeze-status-info{
  background:#eff6ff;
  color:#0f4c81;
  border:1px solid #bfdbfe;
}

.inventory-freeze-status-success{
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
}

.inventory-freeze-status-error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.inventory-freeze-preview{
  margin-top:10px;
  border:1px solid #bfdbfe;
  border-left:5px solid #0f4c81;
  border-radius:12px;
  background:#eff6ff;
  padding:10px 12px;
}

.inventory-freeze-preview-title{
  font-weight:900;
  color:#0f4c81;
  margin-bottom:6px;
}

.inventory-freeze-preview-row{
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size:.86rem;
  line-height:1.35;
  margin-top:4px;
}

.inventory-freeze-preview-row strong{
  flex:0 0 auto;
}

.inventory-freeze-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.inventory-freeze-actions .btn{
  flex:1 1 180px;
}

.inventory-freeze-active-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid var(--border);
}

.inventory-freeze-section-title{
  font-size:.95rem;
  font-weight:900;
  color:var(--primary);
}

.inventory-freeze-active-list{
  display:grid;
  gap:10px;
  margin-top:10px;
}

.inventory-freeze-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  font-size:.86rem;
  font-weight:700;
  padding:12px;
}

.inventory-freeze-card{
  border:1px solid var(--border);
  border-radius:13px;
  background:#fff;
  padding:12px;
  box-shadow:0 2px 8px rgba(15,23,42,.06);
}

.inventory-freeze-card.is-releasing{
  opacity:.72;
}

.inventory-freeze-card-actions .btn:disabled{
  opacity:.65;
  cursor:wait;
}

.inventory-freeze-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}

.inventory-freeze-number{
  font-size:.78rem;
  font-weight:900;
  color:#0f4c81;
  letter-spacing:.02em;
}

.inventory-freeze-card-title{
  font-size:.98rem;
  font-weight:900;
  color:var(--primary);
  margin-top:2px;
  overflow-wrap:anywhere;
}

.inventory-freeze-badge{
  border-radius:999px;
  padding:4px 10px;
  font-size:.76rem;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
}

.inventory-freeze-badge.hard{
  background:#991b1b;
}

.inventory-freeze-badge.soft{
  background:#b45309;
}

.inventory-freeze-badge.view{
  background:#0f4c81;
}

.inventory-freeze-card-meta{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px 12px;
  margin-top:8px;
  font-size:.82rem;
  color:var(--primary);
  line-height:1.35;
}

.inventory-freeze-card-meta div{
  overflow-wrap:anywhere;
}

.inventory-freeze-card-reason{
  margin-top:8px;
  border-left:4px solid #dbeafe;
  background:#f8fafc;
  border-radius:8px;
  padding:8px 9px;
  font-size:.82rem;
  color:var(--muted);
  line-height:1.35;
  overflow-wrap:anywhere;
}

.inventory-freeze-card-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

@media (max-width:820px){
  .inventory-freeze-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .inventory-freeze-card-meta{
    grid-template-columns:1fr;
  }
}

@media (max-width:600px){
  .inventory-freeze-panel{
    padding:12px;
    border-radius:12px;
  }

  .inventory-freeze-head{
    display:block;
  }

  .inventory-freeze-head-actions{
    margin-top:10px;
  }

  .inventory-freeze-head-actions .btn,
  .inventory-freeze-actions .btn,
  .inventory-freeze-card-actions .btn{
    width:100%;
    flex:1 1 100%;
  }

  .inventory-freeze-grid{
    grid-template-columns:1fr;
  }

  .freeze-select-menu{
    max-height:220px;
  }

  .inventory-freeze-preview-row{
    display:block;
  }
}

/* ==========================================================
   Phase 4.5D.0F - Freeze Reports + Print
   Reuses the app's in-page report/print overlay pattern.
   ========================================================== */
.inventory-freeze-report-panel{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid var(--border);
}

.inventory-freeze-report-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.inventory-freeze-report-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px 10px;
  align-items:end;
  border:1px solid #dbeafe;
  border-left:5px solid #0f4c81;
  border-radius:12px;
  background:#f8fafc;
  padding:11px 12px;
}

.inventory-freeze-report-grid .form-group{
  margin:0;
  min-width:0;
}

.inventory-freeze-report-grid label{
  display:block;
  font-size:.73rem;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:4px;
  line-height:1.1;
}

.inventory-freeze-report-grid input,
.inventory-freeze-report-grid select{
  min-height:40px;
  font-size:.88rem;
}

.inventory-freeze-report-wide{
  grid-column:span 2;
}

.inventory-freeze-report-actions,
.inventory-freeze-report-overlay-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

#inventoryFreezeReportOverlay{
  align-items:center;
  justify-content:center;
  padding:12px;
  overflow:hidden;
  overscroll-behavior:contain;
}

#inventoryFreezeReportOverlay .inventory-freeze-report-card{
  width:calc(100vw - 32px) !important;
  max-width:1380px !important;
  height:min(92dvh, 900px);
  max-height:92dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.inventory-freeze-report-overlay-head{
  flex:0 0 auto;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
}

.inventory-freeze-report-meta{
  margin-top:8px;
  font-size:.85rem;
  color:var(--muted);
  line-height:1.35;
}

.inventory-freeze-report-filter-list{
  display:flex;
  flex-wrap:wrap;
  gap:5px 6px;
  align-items:center;
  margin-top:5px;
}

.inventory-freeze-report-filter-list strong{
  margin-right:2px;
}

.inventory-freeze-report-filter-list span{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  padding:2px 7px;
  border:1px solid #d1d5db;
  border-radius:999px;
  background:#fff;
  color:var(--primary);
  font-size:.76rem;
  font-weight:800;
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-freeze-report-body{
  flex:1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:12px 2px 4px;
}

.inventory-freeze-report-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.inventory-freeze-report-summary-card{
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 10px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.04);
}

.inventory-freeze-report-summary-label{
  font-size:.68rem;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.03em;
  line-height:1.1;
}

.inventory-freeze-report-summary-value{
  margin-top:3px;
  font-size:1rem;
  font-weight:900;
  color:var(--primary);
  line-height:1.15;
}

.inventory-freeze-report-table-wrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  max-width:100%;
}

.inventory-freeze-report-table{
  width:100%;
  min-width:1120px;
  border-collapse:collapse;
  background:#fff;
}

.inventory-freeze-report-table th,
.inventory-freeze-report-table td{
  border:1px solid #d1d5db;
  padding:7px;
  text-align:left;
  vertical-align:top;
  font-size:.8rem;
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.inventory-freeze-report-table th{
  background:#f3f4f6;
  font-weight:900;
  color:var(--primary);
}

.inventory-freeze-report-number{
  font-weight:900;
  color:#0f4c81;
  white-space:nowrap;
}

.inventory-freeze-report-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:3px 8px;
  color:#fff;
  font-size:.72rem;
  font-weight:900;
  line-height:1.15;
  white-space:nowrap;
}

.inventory-freeze-report-status.active{
  background:#991b1b;
}

.inventory-freeze-report-status.released{
  background:#047857;
}

.inventory-freeze-report-status.other{
  background:#6b7280;
}

.inventory-freeze-report-notes{
  min-width:220px;
}

.inventory-freeze-report-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  font-size:.86rem;
  font-weight:700;
  padding:12px;
}

@media (min-width:701px) and (max-width:1180px){
  .inventory-freeze-report-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .inventory-freeze-report-wide{
    grid-column:1/-1;
  }

  #inventoryFreezeReportOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:8px;
  }

  #inventoryFreezeReportOverlay .inventory-freeze-report-card{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-freeze-report-summary{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
  }

  .inventory-freeze-report-summary-card{
    padding:8px 9px;
  }

  .inventory-freeze-report-summary-label{
    font-size:.64rem;
  }

  .inventory-freeze-report-summary-value{
    font-size:.94rem;
  }
}

@media (max-width:700px){
  .inventory-freeze-report-grid{
    grid-template-columns:1fr;
    padding:9px 10px;
  }

  .inventory-freeze-report-wide{
    grid-column:1/-1;
  }

  .inventory-freeze-report-grid input,
  .inventory-freeze-report-grid select{
    min-height:42px;
    font-size:.86rem;
  }

  .inventory-freeze-report-actions .btn,
  .inventory-freeze-report-overlay-actions .btn{
    width:100%;
    flex:1 1 100%;
    min-height:42px;
  }

  #inventoryFreezeReportOverlay{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }

  #inventoryFreezeReportOverlay .inventory-freeze-report-card{
    width:100vw !important;
    max-width:none !important;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .inventory-freeze-report-overlay-head{
    padding-bottom:8px;
  }

  .inventory-freeze-report-meta{
    font-size:.74rem;
    line-height:1.22;
  }

  .inventory-freeze-report-filter-list{
    align-items:flex-start;
  }

  .inventory-freeze-report-filter-list span{
    font-size:.7rem;
  }

  .inventory-freeze-report-body{
    padding:9px 0 4px;
  }

  .inventory-freeze-report-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    margin-bottom:9px;
  }

  .inventory-freeze-report-summary-card{
    padding:7px 8px;
  }

  .inventory-freeze-report-summary-label{
    font-size:.61rem;
  }

  .inventory-freeze-report-summary-value{
    font-size:.86rem;
  }

  .inventory-freeze-report-table-wrap::before{
    content:"Swipe table left/right";
    position:sticky;
    left:0;
    display:block;
    width:max-content;
    max-width:100%;
    margin:0 0 5px 0;
    padding:4px 7px;
    border-radius:999px;
    background:#f8fafc;
    border:1px solid var(--border);
    color:var(--muted);
    font-size:.68rem;
    font-weight:800;
    line-height:1;
    z-index:2;
  }

  .inventory-freeze-report-table{
    min-width:980px;
  }

  .inventory-freeze-report-table th,
  .inventory-freeze-report-table td{
    padding:5px;
    font-size:.72rem;
    line-height:1.14;
  }
}

/* Phase 4.5D.0B fix — keep all-inventory scope visible and add item picker buttons */

.inventory-freeze-panel.freeze-all-active .inventory-freeze-warning{
  border-left-color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
  color:#7f1d1d;
}

.freeze-scope-disabled{
  opacity:.62;
}

.freeze-scope-disabled .freeze-select-trigger,
.freeze-scope-disabled .freeze-binocular-btn{
  cursor:not-allowed;
}

.freeze-input-readonly{
  background:#f3f4f6 !important;
  color:#6b7280 !important;
  -webkit-text-fill-color:#6b7280 !important;
  opacity:1 !important;
}

.freeze-item-pick-row{
  display:flex;
  align-items:stretch;
  gap:6px;
  width:100%;
}

.freeze-item-pick-row input[type="text"]{
  flex:1 1 auto;
  min-width:0;
}

.freeze-binocular-btn{
  flex:0 0 42px;
  min-height:42px;
  border:1px solid rgba(15,76,129,.28);
  border-radius:10px;
  background:#eff6ff;
  color:#0f4c81;
  font-size:1.2rem;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  touch-action:manipulation;
}

.freeze-binocular-btn:hover,
.freeze-binocular-btn:focus{
  outline:none;
  background:#dbeafe;
  box-shadow:0 0 0 3px rgba(15,76,129,.12);
}

@media (max-width:600px){
  .freeze-binocular-btn{
    flex-basis:44px;
  }
}

/* Phase 4.5D.0B fix-b — custom All Inventory button state only */
button.freeze-check-card{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  font:inherit;
  text-align:left;
}

button.freeze-check-card.is-checked .freeze-check-box{
  background:#0f4c81;
}

button.freeze-check-card.is-checked .freeze-check-box::after{
  content: "\2713";
  position:absolute;
  left:4px;
  top:-3px;
  font-size:1.15rem;
  font-weight:900;
  color:#fff;
}

button.freeze-check-card:hover,
button.freeze-check-card:focus{
  outline:none;
  border-color:#0f4c81;
  box-shadow:0 0 0 3px rgba(15,76,129,.12);
}

/* Phase 4.5D.0C - inventory freeze item lookup overlay */
html.inventory-freeze-lookup-open,
body.inventory-freeze-lookup-open{
  overflow:hidden !important;
  overscroll-behavior:none;
}

#inventoryFreezeSingleItemLabel[readonly]{
  background:#fff;
  color:var(--primary);
  -webkit-text-fill-color:var(--primary);
  opacity:1;
  cursor:not-allowed;
}

.freeze-binocular-btn:disabled,
.freeze-binocular-btn.is-disabled{
  opacity:.55;
  cursor:not-allowed;
  background:#f3f4f6;
  color:#6b7280;
  box-shadow:none;
}

.inventory-freeze-lookup-overlay{
  position:fixed;
  inset:0;
  z-index:7600;
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:14px;
  padding-top:max(14px, env(safe-area-inset-top));
  padding-right:max(14px, env(safe-area-inset-right));
  padding-bottom:max(14px, env(safe-area-inset-bottom));
  padding-left:max(14px, env(safe-area-inset-left));
  background:rgba(15,23,42,.62);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.inventory-freeze-lookup-card{
  width:min(100%, 760px);
  max-height:calc(100dvh - 28px);
  background:#fff;
  color:var(--primary);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(0,0,0,.28);
  border:1px solid rgba(15,76,129,.18);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.inventory-freeze-lookup-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px 12px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.inventory-freeze-lookup-title{
  font-size:1.06rem;
  font-weight:900;
  color:#0f4c81;
  line-height:1.2;
}

.inventory-freeze-lookup-subtitle{
  margin-top:4px;
  font-size:.82rem;
  font-weight:700;
  color:var(--muted);
  line-height:1.35;
}

.inventory-freeze-lookup-close{
  flex:0 0 38px;
  width:38px;
  height:38px;
  border:1px solid rgba(15,76,129,.18);
  border-radius:10px;
  background:#fff;
  color:#991b1b;
  font-size:1.1rem;
  font-weight:900;
  cursor:pointer;
  touch-action:manipulation;
}

.inventory-freeze-lookup-close:hover,
.inventory-freeze-lookup-close:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(15,76,129,.12);
}

.inventory-freeze-lookup-search-row{
  display:grid;
  grid-template-columns:1fr 42px auto;
  gap:8px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  align-items:stretch;
}

.inventory-freeze-lookup-search-row input{
  width:100%;
  min-width:0;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 11px;
  font-size:.94rem;
  font-weight:800;
  color:var(--primary);
}

.inventory-freeze-lookup-clear{
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:#991b1b;
  font-weight:900;
  cursor:pointer;
  touch-action:manipulation;
}

.inventory-freeze-lookup-status{
  margin:10px 16px 0;
  border-radius:10px;
  padding:8px 10px;
  font-size:.84rem;
  font-weight:800;
  line-height:1.35;
}

.inventory-freeze-lookup-status-info{
  background:#eff6ff;
  color:#0f4c81;
  border:1px solid #bfdbfe;
}

.inventory-freeze-lookup-status-success{
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
}

.inventory-freeze-lookup-status-error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.inventory-freeze-lookup-results{
  display:grid;
  gap:9px;
  padding:12px 16px 16px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.inventory-freeze-lookup-row{
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  border-radius:13px;
  background:#fff;
  padding:11px 12px;
  cursor:pointer;
  touch-action:manipulation;
  color:var(--primary);
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}

.inventory-freeze-lookup-row:hover,
.inventory-freeze-lookup-row:focus{
  outline:none;
  border-color:#0f4c81;
  background:#eff6ff;
  box-shadow:0 0 0 3px rgba(15,76,129,.10);
}

.inventory-freeze-lookup-mainline{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.inventory-freeze-lookup-itemno{
  font-size:.98rem;
  font-weight:950;
  color:#0f4c81;
  overflow-wrap:anywhere;
}

.inventory-freeze-lookup-badge{
  flex:0 0 auto;
  border-radius:999px;
  padding:3px 9px;
  font-size:.72rem;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
}

.inventory-freeze-lookup-badge.active{
  background:#065f46;
}

.inventory-freeze-lookup-badge.archived{
  background:#991b1b;
}

.inventory-freeze-lookup-desc{
  margin-top:5px;
  font-size:.9rem;
  font-weight:850;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.inventory-freeze-lookup-subline,
.inventory-freeze-lookup-locations{
  margin-top:4px;
  font-size:.79rem;
  font-weight:700;
  color:var(--muted);
  line-height:1.3;
  overflow-wrap:anywhere;
}

.inventory-freeze-lookup-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:7px;
}

.inventory-freeze-lookup-meta span{
  border:1px solid #dbeafe;
  border-radius:999px;
  background:#f8fafc;
  color:#0f4c81;
  font-size:.74rem;
  font-weight:900;
  padding:3px 8px;
}

.inventory-freeze-lookup-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  background:#f8fafc;
  color:var(--muted);
  font-size:.88rem;
  font-weight:800;
  padding:14px;
  text-align:center;
}

@media (max-width:600px){
  .inventory-freeze-lookup-overlay{
    padding:8px;
    padding-top:max(8px, env(safe-area-inset-top));
    padding-right:max(8px, env(safe-area-inset-right));
    padding-bottom:max(8px, env(safe-area-inset-bottom));
    padding-left:max(8px, env(safe-area-inset-left));
  }

  .inventory-freeze-lookup-card{
    width:100%;
    max-height:calc(100dvh - 16px);
    border-radius:14px;
  }

  .inventory-freeze-lookup-head,
  .inventory-freeze-lookup-search-row,
  .inventory-freeze-lookup-results{
    padding-left:12px;
    padding-right:12px;
  }

  .inventory-freeze-lookup-search-row{
    grid-template-columns:1fr 42px;
  }

  .inventory-freeze-lookup-search-row .btn{
    grid-column:1 / -1;
    width:100%;
  }

  .inventory-freeze-lookup-mainline{
    display:block;
  }

  .inventory-freeze-lookup-badge{
    display:inline-flex;
    margin-top:6px;
  }
}

/* ==========================================================
   Phase 4.5C.1P.2 — Safe Custom Access Group Lifecycle
   Custom group edit/deactivate/delete controls and audit review.
   ========================================================== */
.access-policy-badge--active{
  background:#ecfdf5;
  color:#047857;
  border-color:#bbf7d0;
}

.access-policy-badge--inactive{
  background:#fef2f2;
  color:#991b1b;
  border-color:#fecaca;
}

.access-policy-system-group-note{
  margin:8px 0 10px;
  padding:8px 10px;
  border:1px solid #dbeafe;
  border-radius:9px;
  background:#eff6ff;
  color:#1e40af;
  font-size:.78rem;
  font-weight:800;
  line-height:1.35;
}

.access-policy-group-manage{
  margin:8px 0 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  overflow:hidden;
}

.access-policy-group-manage > summary{
  list-style:none;
  cursor:pointer;
  padding:8px 10px;
  color:#0f4c81;
  font-size:.8rem;
  font-weight:900;
}

.access-policy-group-manage > summary::-webkit-details-marker{
  display:none;
}

.access-policy-group-manage-body{
  border-top:1px solid var(--border);
  padding:10px;
  background:#fff;
}

.access-policy-group-manage-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:stretch;
}

.access-policy-group-manage-actions .btn{
  flex:1 1 130px;
  min-height:36px;
  padding:7px 9px;
  font-size:.78rem;
}

.access-policy-group-audit-filter-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.access-policy-group-audit-change-detail{
  margin-top:8px;
  padding:9px;
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fff;
  color:var(--primary);
  font-size:.78rem;
  font-weight:750;
  line-height:1.35;
  overflow-wrap:anywhere;
}

@media (max-width:700px){
  .access-policy-group-manage-actions .btn{
    flex:1 1 100%;
  }

  .access-policy-group-audit-filter-grid{
    grid-template-columns:1fr;
  }
}

/* ==========================================================
   Phase 4.5C.1P.3A — Access Policy Model Label Cleanup
   Clarifies role-default, system, and custom access-group labels only.
   ========================================================== */
.access-policy-badge--role-default-group{
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
}

.access-policy-badge--system-access-group{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
}

.access-policy-badge--custom-access-group{
  background:#f5f3ff;
  color:#5b21b6;
  border:1px solid #ddd6fe;
}

.access-policy-rule-row-meta{
  margin-top:3px;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  line-height:1.25;
}

/* ==========================================================
   Phase 4.5D.1 - Reconciliation Issue Scanner + Report Viewer
   Password unlock card, severity badges, and mobile-safe report UI.
   ========================================================== */

.inventory-report-card--sensitive{
  border-left:5px solid #b45309;
}

.inventory-reconciliation-lock-card{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  border:1px solid #fde68a;
  border-left:5px solid #b45309;
  background:#fffbeb;
  border-radius:12px;
  padding:11px 12px;
  margin:12px 0;
}

.inventory-reconciliation-lock-title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-weight:900;
  color:#92400e;
}

.inventory-reconciliation-lock-state{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:3px 8px;
  font-size:.72rem;
  font-weight:900;
  background:#fef3c7;
  color:#92400e;
  border:1px solid #fcd34d;
}

.inventory-reconciliation-is-unlocked .inventory-reconciliation-lock-state{
  background:#ecfdf5;
  color:#047857;
  border-color:#bbf7d0;
}

.inventory-reconciliation-lock-text{
  margin-top:4px;
  font-size:.84rem;
  line-height:1.35;
  color:#78350f;
  font-weight:750;
}

.inventory-reconciliation-lock-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.inventory-reconciliation-lock-status,
.inventory-reconciliation-unlock-status{
  margin-top:8px;
  font-size:.8rem;
  font-weight:800;
  line-height:1.25;
}

.inventory-reconciliation-lock-status--error,
.inventory-reconciliation-unlock-status--error{
  color:var(--danger);
}

.inventory-reconciliation-lock-status--success,
.inventory-reconciliation-unlock-status--success{
  color:var(--success);
}

.inventory-reconciliation-lock-status--info,
.inventory-reconciliation-unlock-status--info{
  color:var(--muted);
}

.inventory-reconciliation-unlock-field input{
  min-height:42px;
}

.inventory-reconciliation-severity,
.inventory-reconciliation-code{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:3px 8px;
  font-size:.72rem;
  font-weight:900;
  border:1px solid var(--border);
  white-space:nowrap;
}

.inventory-reconciliation-code{
  border-radius:7px;
  background:#f8fafc;
  color:#334155;
}

.inventory-reconciliation-severity--critical{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

.inventory-reconciliation-severity--high{
  color:#9a3412;
  background:#fff7ed;
  border-color:#fed7aa;
}

.inventory-reconciliation-severity--medium{
  color:#92400e;
  background:#fffbeb;
  border-color:#fde68a;
}

.inventory-reconciliation-severity--low,
.inventory-reconciliation-severity--info{
  color:#1e40af;
  background:#eff6ff;
  border-color:#bfdbfe;
}

@media (max-width:700px){
  .inventory-reconciliation-lock-card{
    flex-direction:column;
    align-items:stretch;
  }

  .inventory-reconciliation-lock-actions .btn{
    flex:1 1 100%;
    width:100%;
    min-height:42px;
  }
}
/* ==========================================================
   Phase 4.5D.2 - Repair Detail Overlay + Repair Preview
   Preview-only stock-layer review. No stock-changing controls.
   ========================================================== */

#inventoryRepairPreviewOverlay.active{
  z-index:1250;
  align-items:center;
  justify-content:center;
  padding:12px;
}

.inventory-repair-preview-content{
  width:min(96vw, 1180px);
  max-width:1180px;
  height:min(92dvh, 900px);
  max-height:92dvh;
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.inventory-repair-preview-head{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:start;
  padding:14px 16px 12px;
  border-bottom:1px solid var(--border);
  background:#fff;
}

.inventory-repair-preview-head h3{
  margin:0;
  line-height:1.15;
  color:#0f4c81;
  overflow-wrap:anywhere;
}

.inventory-repair-preview-subtitle{
  margin-top:4px;
  color:var(--muted);
  font-size:.84rem;
  font-weight:750;
  line-height:1.3;
}

.inventory-repair-preview-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.inventory-repair-preview-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:12px 16px 16px;
  background:#f8fafc;
}

.inventory-repair-preview-status-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:12px;
}

.inventory-repair-preview-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:4px 9px;
  font-size:.74rem;
  font-weight:900;
  border:1px solid var(--border);
  background:#fff;
  color:var(--primary);
}

.inventory-repair-preview-badge--success{
  color:#047857;
  background:#ecfdf5;
  border-color:#bbf7d0;
}

.inventory-repair-preview-badge--warning,
.inventory-repair-preview-badge--high,
.inventory-repair-preview-badge--medium{
  color:#92400e;
  background:#fffbeb;
  border-color:#fde68a;
}

.inventory-repair-preview-badge--critical{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

.inventory-repair-preview-badge--info,
.inventory-repair-preview-badge--low{
  color:#1e40af;
  background:#eff6ff;
  border-color:#bfdbfe;
}

.inventory-repair-preview-section{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:12px;
  margin-bottom:12px;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
}

.inventory-repair-preview-section-title{
  font-weight:900;
  color:#0f4c81;
  margin-bottom:10px;
  line-height:1.2;
}

.inventory-repair-preview-grid,
.inventory-repair-preview-total-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}

.inventory-repair-preview-field{
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  padding:9px 10px;
  min-width:0;
}

.inventory-repair-preview-field--wide{
  grid-column:1 / -1;
}

.inventory-repair-preview-field-label,
.inventory-repair-preview-mini-label{
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
  line-height:1.15;
}

.inventory-repair-preview-field-value{
  margin-top:4px;
  color:var(--primary);
  font-weight:900;
  overflow-wrap:anywhere;
  line-height:1.25;
}

.inventory-repair-preview-issue-box{
  border:1px dashed #f59e0b;
  border-radius:10px;
  background:#fffbeb;
  padding:10px;
  color:#78350f;
  line-height:1.35;
}

.inventory-repair-preview-guidance{
  margin-top:10px;
  padding:9px 10px;
  border:1px solid #fed7aa;
  border-radius:9px;
  background:#fff7ed;
  color:#7c2d12;
  font-weight:750;
}

.inventory-repair-preview-issue-box ul,
.inventory-repair-preview-notes{
  margin:8px 0 0 18px;
  padding:0;
}

.inventory-repair-preview-code-list{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:8px;
}

.inventory-repair-preview-code-list span{
  display:inline-flex;
  border:1px solid #fcd34d;
  background:#fff7ed;
  color:#92400e;
  border-radius:7px;
  padding:3px 7px;
  font-size:.72rem;
  font-weight:900;
}

.inventory-repair-preview-table-wrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}

.inventory-repair-preview-table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}

.inventory-repair-preview-table th,
.inventory-repair-preview-table td{
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  padding:7px 8px;
  text-align:left;
  vertical-align:top;
  font-size:.82rem;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.inventory-repair-preview-table th{
  background:#f3f4f6;
  color:var(--primary);
  font-weight:900;
  position:sticky;
  top:0;
  z-index:1;
}

.inventory-repair-preview-table tr:last-child td{
  border-bottom:none;
}

.inventory-repair-preview-table th:last-child,
.inventory-repair-preview-table td:last-child{
  border-right:none;
}

.inventory-repair-preview-options{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}

.inventory-repair-preview-option{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
  box-shadow:0 1px 3px rgba(15,23,42,.05);
}

.inventory-repair-preview-option--guidance-only{
  border-color:#fed7aa;
  background:#fff7ed;
}

.inventory-repair-preview-option-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:6px;
}

.inventory-repair-preview-option-title{
  font-weight:900;
  color:var(--primary);
  line-height:1.2;
}

.inventory-repair-preview-option-summary{
  color:var(--muted);
  font-size:.84rem;
  font-weight:700;
  line-height:1.35;
}

/* Phase 4.5D.3D-P.4C — One-Row Mismatch Physical Count Decision Guidance */
.inventory-repair-preview-decision-tip{
  margin-top:7px;
  padding:7px 9px;
  border:1px solid #bfdbfe;
  border-radius:9px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:.82rem;
  font-weight:900;
  line-height:1.3;
}

/* Phase 4.5D.3D-P.4C — Manual Reconcile Safety Note Visibility */
.inventory-reconciliation-manual-required-note{
  margin-top:9px;
  padding:9px 10px;
  border:1px solid #fed7aa;
  border-left:5px solid #f59e0b;
  border-radius:9px;
  background:#fff7ed;
  color:#9a3412;
  font-size:.82rem;
  font-weight:800;
  line-height:1.35;
}

.inventory-reconciliation-manual-required-title{
  font-size:.76rem;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:3px;
}

.inventory-repair-preview-before-after{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:8px;
}

.inventory-repair-preview-before-after > div{
  border:1px solid var(--border);
  border-radius:9px;
  background:#f8fafc;
  padding:8px;
  font-size:.82rem;
  line-height:1.3;
}

.inventory-repair-preview-notes{
  color:var(--primary);
  font-size:.8rem;
  line-height:1.32;
}

.inventory-repair-preview-phase-note,
.inventory-repair-preview-empty{
  border:1px dashed var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:var(--muted);
  padding:10px;
  font-size:.84rem;
  font-weight:750;
  line-height:1.35;
}

.inventory-repair-preview-phase-note{
  margin-top:10px;
  border-color:#bfdbfe;
  background:#eff6ff;
  color:#1e40af;
}

.inventory-repair-preview-option-action{
  margin-top:10px;
  border-top:1px solid rgba(15,23,42,.08);
  padding-top:8px;
  font-size:.8rem;
  font-weight:900;
  color:#0f4c81;
}

.inventory-repair-preview-option-action span{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:3px 8px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
}

.inventory-repair-preview-option-action div{
  margin-top:5px;
  color:var(--muted);
  font-weight:750;
  line-height:1.3;
}

.inventory-repair-preview-option-action--disabled{
  color:#9a3412;
}

.inventory-repair-preview-option-action--disabled span{
  background:#ffedd5;
  border-color:#fed7aa;
}

.inventory-repair-preview-option-apply-btn{
  width:auto;
  min-width:160px;
  flex:0 0 auto;
  padding:.52rem .85rem;
  font-size:.82rem;
  white-space:nowrap;
}

.inventory-repair-preview-option-action .inventory-repair-preview-option-apply-btn{
  margin:0;
}

@media (max-width:700px){
  .inventory-repair-preview-option-apply-btn{
    width:100%;
  }
}

.inventory-reconciliation-action-cell{
  min-width:132px;
}

.inventory-reconciliation-preview-btn{
  background:#0f4c81;
  color:#fff;
  padding:7px 9px;
  font-size:.78rem;
  white-space:nowrap;
  width:100%;
}

@media print{
  .inventory-report-screen-only{
    display:none !important;
  }
}

@media (min-width:701px) and (max-width:1180px){
  #inventoryRepairPreviewOverlay.active{
    align-items:stretch;
    justify-content:stretch;
    padding:8px;
  }

  .inventory-repair-preview-content{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-repair-preview-head{
    padding:10px;
  }

  .inventory-repair-preview-body{
    padding:10px;
  }

  .inventory-repair-preview-options{
    grid-template-columns:1fr;
  }
}

@media (max-width:700px){
  #inventoryRepairPreviewOverlay.active{
    align-items:stretch;
    justify-content:stretch;
    padding:0;
  }

  .inventory-repair-preview-content{
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .inventory-repair-preview-head{
    grid-template-columns:1fr;
    gap:8px;
    padding:10px 11px;
  }

  .inventory-repair-preview-head h3{
    font-size:1rem;
  }

  .inventory-repair-preview-actions .btn{
    width:100%;
    min-height:42px;
  }

  .inventory-repair-preview-body{
    padding:10px 11px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .inventory-repair-preview-grid,
  .inventory-repair-preview-total-grid,
  .inventory-repair-preview-options,
  .inventory-repair-preview-before-after{
    grid-template-columns:1fr;
  }

  .inventory-repair-preview-table{
    min-width:760px;
  }
}

/* ==========================================================
   Phase 4.5D.2B - Reconciliation Scanner / Repair Preview
   Responsive Layout + Print Hardening
   Consolidated scanner table, repair preview overlay, and print-safe rules.
   ========================================================== */

#inventoryCompanyReportOverlay.active,
#inventoryRepairPreviewOverlay.active{
  overflow:hidden;
  overscroll-behavior:none;
}

.inventory-company-report-content,
.inventory-repair-preview-content{
  min-width:0;
}

.inventory-company-report-body,
.inventory-repair-preview-body{
  min-width:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

.inventory-repair-preview-head > div:first-child{
  min-width:0;
}

.inventory-repair-preview-actions{
  min-width:0;
}

.inventory-repair-preview-print-btn{
  background:#0f4c81;
  color:#fff;
}

.inventory-company-report-table-wrap,
.inventory-repair-preview-table-wrap{
  max-width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  position:relative;
}

.inventory-company-report-table th,
.inventory-repair-preview-table th{
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
}

.inventory-company-report-table td,
.inventory-repair-preview-table td{
  word-break:normal !important;
  overflow-wrap:break-word !important;
}

.inventory-reconciliation-report-table{
  min-width:1880px !important;
  width:100%;
  table-layout:fixed !important;
}

.inventory-reconciliation-report-table th,
.inventory-reconciliation-report-table td{
  font-size:.78rem;
  line-height:1.18;
}

.inventory-reconciliation-report-table .inventory-report-col-severity{
  width:94px;
  min-width:94px;
}

.inventory-reconciliation-report-table .inventory-report-col-issue-code{
  width:240px !important;
  min-width:240px !important;
  max-width:240px !important;
}

.inventory-reconciliation-report-table td.inventory-report-col-issue-code{
  overflow:hidden !important;
}

.inventory-reconciliation-report-table .inventory-report-col-issue-code .inventory-reconciliation-code{
  max-width:100% !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  line-height:1.08 !important;
  text-align:center !important;
  padding-left:6px !important;
  padding-right:6px !important;
}

.inventory-reconciliation-report-table .inventory-report-col-item-number{
  width:145px;
  min-width:145px;
}

.inventory-reconciliation-report-table .inventory-report-col-barcode{
  width:110px;
  min-width:110px;
}

.inventory-reconciliation-report-table .inventory-report-col-description{
  width:260px;
  min-width:260px;
  white-space:normal !important;
}

.inventory-reconciliation-report-table .inventory-report-col-status{
  width:90px;
  min-width:90px;
}

.inventory-reconciliation-report-table .inventory-report-col-qty,
.inventory-reconciliation-report-table .inventory-report-col-location-stock-qty,
.inventory-reconciliation-report-table .inventory-report-col-difference,
.inventory-reconciliation-report-table .inventory-report-col-location-row-count{
  width:105px;
  min-width:105px;
  text-align:right;
}

.inventory-reconciliation-report-table .inventory-report-col-location-stock-qty{
  width:140px;
  min-width:140px;
}

.inventory-reconciliation-report-table .inventory-report-col-location{
  width:145px;
  min-width:145px;
}

.inventory-reconciliation-report-table .inventory-report-col-affected-locations{
  width:260px;
  min-width:260px;
  white-space:normal !important;
}

.inventory-reconciliation-report-table .inventory-report-col-issue-reason,
.inventory-reconciliation-report-table .inventory-report-col-recommended-fix{
  width:300px;
  min-width:300px;
  white-space:normal !important;
}

.inventory-reconciliation-report-table .inventory-report-col-repair-preview{
  width:138px;
  min-width:138px;
}

.inventory-reconciliation-report-table .inventory-reconciliation-severity{
  white-space:nowrap !important;
}

.inventory-reconciliation-report-table .inventory-reconciliation-code{
  white-space:normal !important;
}

.inventory-reconciliation-report-table-wrap::after,
.inventory-repair-preview-table-wrap::after{
  content:"Scroll table left/right";
  position:sticky;
  left:8px;
  bottom:6px;
  display:inline-flex;
  margin:6px 0 0;
  padding:4px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-size:.68rem;
  font-weight:900;
  box-shadow:0 1px 4px rgba(15,23,42,.08);
  pointer-events:none;
}

.inventory-repair-preview-content{
  width:min(98vw, 1540px) !important;
  max-width:1540px !important;
}

.inventory-repair-preview-section,
.inventory-repair-preview-option{
  min-width:0;
}

.inventory-repair-preview-table{
  min-width:980px !important;
  table-layout:fixed !important;
}

.inventory-repair-preview-table th,
.inventory-repair-preview-table td{
  font-size:.8rem;
  line-height:1.22;
}

.inventory-repair-preview-table th:nth-child(1),
.inventory-repair-preview-table td:nth-child(1){
  width:190px;
  min-width:190px;
}

.inventory-repair-preview-table th:nth-child(2),
.inventory-repair-preview-table td:nth-child(2){
  width:230px;
  min-width:230px;
}

.inventory-repair-preview-table th:nth-child(3),
.inventory-repair-preview-table td:nth-child(3),
.inventory-repair-preview-table th:nth-child(4),
.inventory-repair-preview-table td:nth-child(4),
.inventory-repair-preview-table th:nth-child(5),
.inventory-repair-preview-table td:nth-child(5){
  width:92px;
  min-width:92px;
  text-align:right;
  white-space:nowrap !important;
}

.inventory-repair-preview-table th:nth-child(6),
.inventory-repair-preview-table td:nth-child(6){
  width:360px;
  min-width:360px;
  white-space:normal !important;
}

.inventory-repair-preview-print-note{
  border:1px solid #bfdbfe;
  border-radius:10px;
  background:#eff6ff;
  color:#1e40af;
  padding:10px;
  margin:0 0 12px 0;
  font-size:.84rem;
  font-weight:800;
  line-height:1.35;
}

@media (min-width:1181px){
  .inventory-company-report-content{
    width:calc(100vw - 28px) !important;
    max-width:1860px !important;
  }

  .inventory-repair-preview-content{
    width:calc(100vw - 36px) !important;
    max-width:1580px !important;
  }
}

@media (min-width:701px) and (max-width:1180px){
  .inventory-company-report-content,
  .inventory-repair-preview-content{
    width:calc(100vw - 16px) !important;
    max-width:none !important;
  }

  .inventory-reconciliation-report-table{
    min-width:1880px !important;
  }

  .inventory-repair-preview-table{
    min-width:980px !important;
  }
}

@media (max-width:700px){
  .inventory-company-report-content,
  .inventory-repair-preview-content{
    width:100vw !important;
    max-width:none !important;
  }

  .inventory-repair-preview-actions{
    width:100%;
    justify-content:stretch;
  }

  .inventory-repair-preview-actions .btn{
    flex:1 1 100%;
  }

  .inventory-company-report-table-wrap,
  .inventory-repair-preview-table-wrap{
    overflow-x:auto !important;
    overflow-y:auto !important;
  }

  .inventory-reconciliation-report-table{
    min-width:1840px !important;
  }

  .inventory-repair-preview-table{
    min-width:940px !important;
  }

  .inventory-reconciliation-report-table th,
  .inventory-reconciliation-report-table td{
    font-size:.72rem;
    line-height:1.14;
  }

  .inventory-repair-preview-table th,
  .inventory-repair-preview-table td{
    font-size:.74rem;
    line-height:1.16;
  }
}

@media print{
  .inventory-report-screen-only,
  .inventory-repair-preview-actions,
  .inventory-reconciliation-report-table-wrap::after,
  .inventory-repair-preview-table-wrap::after{
    display:none !important;
    visibility:hidden !important;
  }

  .inventory-print-shell--reconciliation-repair-preview .inventory-repair-preview-print-note,
  .inventory-print-shell--reconciliation-repair-preview .inventory-repair-preview-section,
  .inventory-print-shell--reconciliation-repair-preview .inventory-repair-preview-option{
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }
}
/* ==========================================================
   Phase 4.5D.1A - iOS/iPadOS Top-Level Direct Print Host
   Permanent same-page window.print() architecture
   ========================================================== */

/*
  Important for iOS/iPadOS:
  Do not use display:none for the print host on screen. Safari can snapshot
  the element before print media fully reflows, which can produce a blank/black
  preview. Keep the host attached to the top-level DOM, off-screen, and visible
  to layout; print media then moves it into the printable page.
*/
.inventory-ios-report-print-host{
  display:block;
  position:fixed;
  left:-200vw;
  top:0;
  width:100vw;
  max-width:100vw;
  min-height:100vh;
  overflow:visible;
  pointer-events:none;
  z-index:-1;
  visibility:visible;
  background:#fff;
  color:#111827;
}

.inventory-ios-report-print-host,
.inventory-ios-report-print-host *{
  box-sizing:border-box;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}

@media print{
  body.inventory-ios-report-print-active{
    background:#fff !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }

  body.inventory-ios-report-print-active > *:not(#inventoryIOSReportPrintHost){
    display:none !important;
    visibility:hidden !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost *{
    visibility:visible !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost{
    display:block !important;
    position:static !important;
    left:auto !important;
    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    inset:auto !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    z-index:auto !important;
    background:#fff !important;
    color:#111827 !important;
    padding:0 !important;
    margin:0 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost *{
    box-sizing:border-box !important;
    font-family:Arial, Helvetica, sans-serif !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:12px !important;
    color:#111827 !important;
    background:#fff !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell h1{
    text-align:center !important;
    font-size:17px !important;
    line-height:1.2 !important;
    font-weight:900 !important;
    margin:0 0 8px 0 !important;
    color:#111827 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-meta{
    border:1px solid #d1d5db !important;
    border-radius:8px !important;
    padding:8px 10px !important;
    background:#fafafa !important;
    margin:0 0 10px 0 !important;
    font-size:10px !important;
    line-height:1.28 !important;
    color:#111827 !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-summary{
    display:grid !important;
    grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
    gap:6px !important;
    margin:0 0 10px 0 !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-summary-card{
    min-width:0 !important;
    border:1px solid #d1d5db !important;
    border-radius:8px !important;
    padding:7px 8px !important;
    background:#fff !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-summary-label{
    font-size:8px !important;
    line-height:1.1 !important;
    font-weight:900 !important;
    letter-spacing:.02em !important;
    text-transform:uppercase !important;
    color:#6b7280 !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-summary-value{
    margin-top:3px !important;
    font-size:12px !important;
    line-height:1.1 !important;
    font-weight:900 !important;
    color:#111827 !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-workflow-note{
    border:1px solid #d1d5db !important;
    border-radius:8px !important;
    padding:8px 10px !important;
    background:#fafafa !important;
    margin:0 0 10px 0 !important;
    font-size:9px !important;
    line-height:1.3 !important;
    color:#374151 !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-workflow-note-title{
    font-weight:900 !important;
    color:#111827 !important;
    margin-bottom:3px !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-workflow-note ol,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-workflow-note ul{
    margin:4px 0 0 16px !important;
    padding:0 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-report-screen-only{
    display:none !important;
    visibility:hidden !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-table-wrap{
    overflow:visible !important;
    border:0 !important;
    border-radius:0 !important;
    background:#fff !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-company-report-table,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost table{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    border-collapse:collapse !important;
    table-layout:fixed !important;
    font-size:7.2px !important;
    line-height:1.14 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost thead{
    display:table-header-group !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost tfoot{
    display:table-footer-group !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost tr,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost th,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost td{
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost th,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost td{
    border:1px solid #d1d5db !important;
    padding:2px 2px !important;
    text-align:left !important;
    vertical-align:top !important;
    color:#111827 !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost th{
    background:#f3f4f6 !important;
    font-weight:900 !important;
    font-size:6.2px !important;
    line-height:1.05 !important;
    white-space:normal !important;
    overflow-wrap:normal !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-reconciliation-severity,
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-reconciliation-code{
    display:inline-flex !important;
    max-width:100% !important;
    border:1px solid #94a3b8 !important;
    border-radius:999px !important;
    padding:1px 3px !important;
    font-size:5.8px !important;
    line-height:1.05 !important;
    font-weight:900 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    text-align:center !important;
    background:#fff !important;
    color:#111827 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-reconciliation-code{
    border-radius:4px !important;
  }
	
	/* Phase 4.5D.3D-P.4B — Manual Reconcile Smart Main Qty Sync Guidance */
.inventory-reconciliation-smart-sync-status{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  line-height:1.35;
}

.inventory-reconciliation-smart-sync-title{
  font-weight:900;
  margin-bottom:4px;
}

.inventory-reconciliation-smart-sync-status--success{
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
}

.inventory-reconciliation-smart-sync-status--warning{
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#9a3412;
}

.inventory-reconciliation-smart-sync-status--error{
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
}

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues table{
    font-size:6.35px !important;
    line-height:1.1 !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues th{
    font-size:5.8px !important;
    padding:2px 2px !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues td{
    padding:2px 2px !important;
  }

  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-severity{width:5.5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-issue-code{width:10.5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-item-number{width:7% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-barcode{width:5.5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-description{width:12% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-status{width:5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-qty{width:4.5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-location-stock-qty{width:6% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-difference{width:5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-location{width:6% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-location-row-count{width:5% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-affected-locations{width:9% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-issue-reason{width:10% !important;}
  body.inventory-ios-report-print-active #inventoryIOSReportPrintHost .inventory-print-shell--reconciliation-issues .inventory-report-col-recommended-fix{width:9% !important;}
}

/* ==========================================================
   Phase 4.5D.2G.1 - Custom Location Type Edit / Deactivate / Safe Delete
   UI refinement: overlay-level Cancel, compact cards, centered actions.
   Final edit-button color fix: Edit is a blue action button, not history/white.
   ========================================================== */
.inventory-location-type-manager-overlay{
  z-index:2600 !important;
}

.inventory-location-type-overlay{
  z-index:2750 !important;
}

.inventory-location-type-overlay .inventory-location-modal-card{
  margin:auto;
}

.inventory-location-type-manager-card{
  width:min(760px, calc(100vw - 24px));
  max-height:calc(100dvh - 28px);
}

.inventory-location-type-manager-head{
  padding-right:0;
}

.inventory-location-type-manager-body{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.inventory-location-type-manager-actions{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:center;
  width:100%;
  margin:0 auto 2px auto;
}

.inventory-location-type-manager-top-btn{
  flex:0 1 150px;
  min-width:118px;
  max-width:170px;
}

.inventory-location-type-manager-refresh-btn{
  background:#F8E03F !important;
  color:#000 !important;
  -webkit-text-fill-color:#000 !important;
  border:1px solid #d6bd21 !important;
}

.inventory-location-type-manager-refresh-btn::after{
  background:rgba(0,0,0,.16) !important;
}

.inventory-location-type-manager-actions .history-btn{
  color:var(--primary) !important;
  -webkit-text-fill-color:var(--primary) !important;
}

.inventory-location-type-manager-list{
  display:grid;
  gap:8px;
}

.inventory-location-type-manager-card-row{
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 10px;
  background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.04);
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(178px, 228px);
  align-items:start;
  gap:10px;
}

.inventory-location-type-manager-card-main{
  min-width:0;
  text-align:left;
  align-self:center;
}

.inventory-location-type-manager-card-title{
  font-size:.94rem;
  line-height:1.2;
  font-weight:900;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.inventory-location-type-manager-card-meta,
.inventory-location-type-code-note{
  margin-top:2px;
  font-size:.78rem;
  color:var(--muted);
  font-weight:700;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.inventory-location-type-manager-card-actions{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:6px;
  align-items:center;
  justify-self:end;
  width:100%;
  max-width:228px;
}

.inventory-location-type-manager-status-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:6px;
  grid-column:1 / -1;
  align-items:center;
}

.inventory-location-type-manager-edit-btn,
.inventory-location-type-manager-delete-btn{
  grid-column:1 / -1;
}

.inventory-location-type-manager-btn{
  min-width:0;
  width:100%;
  min-height:34px;
  padding:.45rem .58rem;
  font-size:.82rem;
  line-height:1.12;
  white-space:normal;
}

/* Edit is an action button. Keep this outside all media queries. */
.inventory-location-type-manager-card-actions .inventory-location-type-manager-edit-btn{
  background:#0f4c81 !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border:1px solid #0f4c81 !important;
}

/* Keep the 3D lip visible over the blue Edit button. */
.inventory-location-type-manager-card-actions .inventory-location-type-manager-edit-btn::after{
  background:rgba(0,0,0,.20) !important;
}

.inventory-location-type-manager-card-actions .inventory-location-badge{
  width:100%;
  min-height:34px;
  padding:4px 8px;
  font-size:.74rem;
}

.inventory-location-type-manager-card-actions .history-btn{
  color:var(--primary) !important;
  -webkit-text-fill-color:var(--primary) !important;
}

@media (max-width:700px){
  .inventory-location-type-manager-card{
    width:calc(100vw - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-location-type-manager-actions{
    gap:8px;
    flex-wrap:nowrap;
  }

  .inventory-location-type-manager-top-btn{
    flex:1 1 0;
    min-width:0;
    max-width:170px;
  }

  .inventory-location-type-manager-card-row{
    grid-template-columns:1fr;
    gap:8px;
    padding:9px;
  }

  .inventory-location-type-manager-card-actions{
    justify-self:stretch;
    max-width:none;
  }
}

@media (max-width:430px){
  .inventory-location-type-manager-actions{
    gap:6px;
  }

  .inventory-location-type-manager-top-btn{
    font-size:.78rem;
    padding:.42rem .44rem;
  }

  .inventory-location-type-manager-card-title{
    font-size:.9rem;
  }

  .inventory-location-type-manager-card-meta{
    font-size:.76rem;
  }

  .inventory-location-type-manager-btn,
  .inventory-location-type-manager-card-actions .inventory-location-badge{
    min-height:32px;
    font-size:.78rem;
    padding:.42rem .48rem;
  }
}

/* Phase 4.5D.3D-P.4D — Verified Physical Count Repair Option */
.inventory-reconciliation-verified-count-panel{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #bfdbfe;
  border-left:5px solid #3b82f6;
  border-radius:10px;
  background:#eff6ff;
  color:#1e3a8a;
  line-height:1.35;
}

.inventory-reconciliation-verified-count-title{
  font-weight:950;
  margin-bottom:4px;
}

.inventory-reconciliation-verified-count-help{
  margin:5px 0 8px;
  color:#1e40af;
  font-size:.82rem;
  font-weight:800;
  line-height:1.35;
}

.inventory-reconciliation-verified-count-status{
  margin-top:8px;
}

/* Phase 4.5D.4 — Completed Repair Receipt + Print */
.inventory-repair-receipt-overlay{
  align-items:center;
  justify-content:center;
  padding:12px;
  z-index:9950 !important;
}

.inventory-repair-receipt-card{
  width:min(100%, 980px);
  max-height:92vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.inventory-repair-receipt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid var(--border);
  padding-bottom:8px;
  margin-bottom:8px;
}

.inventory-repair-receipt-head h3{
  margin:0;
  font-size:1.05rem;
  font-weight:950;
  color:var(--primary);
}

.inventory-repair-receipt-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 10px;
}

.inventory-repair-receipt-body{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:2px;
}

.inventory-repair-receipt{
  background:#fff;
  color:var(--primary);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
}

.inventory-repair-receipt-hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border:1px solid #dbeafe;
  border-left:6px solid #2563eb;
  border-radius:12px;
  background:#eff6ff;
  padding:12px;
  margin-bottom:12px;
}

.inventory-repair-receipt-kicker{
  font-size:.72rem;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#1d4ed8;
  margin-bottom:3px;
}

.inventory-repair-receipt-title{
  font-size:1.15rem;
  font-weight:950;
  color:#111827;
  word-break:break-word;
}

.inventory-repair-receipt-badge{
  flex:0 0 auto;
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
  border-radius:999px;
  padding:5px 9px;
  font-size:.78rem;
  font-weight:950;
}

.inventory-repair-receipt-section{
  break-inside:avoid;
  page-break-inside:avoid;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  margin-top:10px;
  background:#fff;
}

.inventory-repair-receipt-section-title{
  font-size:.78rem;
  font-weight:950;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#374151;
  margin-bottom:8px;
}

.inventory-repair-receipt-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.inventory-repair-receipt-field{
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fafafa;
  padding:8px;
  min-width:0;
}

.inventory-repair-receipt-field--wide{
  grid-column:1 / -1;
}

.inventory-repair-receipt-label{
  font-size:.68rem;
  font-weight:950;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:3px;
}

.inventory-repair-receipt-value{
  font-size:.9rem;
  font-weight:800;
  line-height:1.3;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.inventory-repair-receipt-note{
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fafafa;
  padding:9px;
  font-size:.88rem;
  line-height:1.4;
}

.inventory-repair-receipt-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.inventory-repair-receipt-table{
  width:100%;
  min-width:620px;
  border-collapse:collapse;
  font-size:.82rem;
}

.inventory-repair-receipt-table th,
.inventory-repair-receipt-table td{
  border:1px solid #e5e7eb;
  padding:7px;
  text-align:left;
  vertical-align:top;
}

.inventory-repair-receipt-table th{
  background:#f8fafc;
  font-weight:950;
}

@media (max-width:700px){
  .inventory-repair-receipt-card{
    max-height:94vh;
  }

  .inventory-repair-receipt-grid{
    grid-template-columns:1fr;
  }

  .inventory-repair-receipt-hero{
    flex-direction:column;
  }

  .inventory-repair-receipt-actions .btn{
    width:100%;
  }
}

@media print{
  .inventory-repair-receipt-actions,
  .inventory-repair-receipt-close{
    display:none !important;
  }

  .inventory-repair-receipt{
    border:none;
    padding:0;
  }

  .inventory-repair-receipt-card,
  .inventory-repair-receipt-body{
    max-height:none !important;
    overflow:visible !important;
  }
}

/* Phase 4.5D.4.R2 — Compact Completed Repair Receipt Layout + Print Cleanup */
.inventory-repair-receipt-overlay{
  padding:clamp(6px, 1.5vw, 18px) !important;
}

.inventory-repair-receipt-card{
  width:min(98vw, 1180px) !important;
  max-width:1180px !important;
  max-height:94dvh !important;
}

.inventory-repair-receipt-body{
  padding:0 2px 4px 0;
}

.inventory-repair-receipt--compact{
  padding:12px;
}

.inventory-repair-receipt-hero--compact{
  margin-bottom:8px;
  padding:10px 12px;
}

.inventory-repair-receipt-hero--compact .inventory-repair-receipt-kicker{
  font-size:.68rem;
}

.inventory-repair-receipt-hero--compact .inventory-repair-receipt-title{
  font-size:1rem;
  line-height:1.2;
}

.inventory-repair-receipt-summary-line{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:0 0 8px;
  padding:7px 9px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#f8fafc;
  font-size:.86rem;
  font-weight:800;
  line-height:1.25;
}

.inventory-repair-receipt-section--compact{
  margin-top:8px;
  padding:8px;
}

.inventory-repair-receipt-grid--summary{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.inventory-repair-receipt-before-after-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  align-items:start;
}

.inventory-repair-receipt-before-after-grid .inventory-repair-receipt-section{
  min-width:0;
}

.inventory-repair-receipt-note--compact{
  display:grid;
  gap:3px;
  padding:8px;
  font-size:.84rem;
}

.inventory-repair-receipt--compact .inventory-repair-receipt-table{
  min-width:0 !important;
  width:100%;
  table-layout:fixed;
}

.inventory-repair-receipt--compact .inventory-repair-receipt-table th,
.inventory-repair-receipt--compact .inventory-repair-receipt-table td{
  padding:6px;
  font-size:.78rem;
  line-height:1.22;
}

.inventory-repair-receipt--compact .inventory-repair-receipt-table th:nth-child(1),
.inventory-repair-receipt--compact .inventory-repair-receipt-table td:nth-child(1){
  width:34%;
}

.inventory-repair-receipt--compact .inventory-repair-receipt-table th:nth-child(2),
.inventory-repair-receipt--compact .inventory-repair-receipt-table td:nth-child(2),
.inventory-repair-receipt--compact .inventory-repair-receipt-table th:nth-child(3),
.inventory-repair-receipt--compact .inventory-repair-receipt-table td:nth-child(3),
.inventory-repair-receipt--compact .inventory-repair-receipt-table th:nth-child(4),
.inventory-repair-receipt--compact .inventory-repair-receipt-table td:nth-child(4){
  width:13%;
  text-align:right;
}

.inventory-repair-receipt--compact .inventory-repair-receipt-table th:nth-child(5),
.inventory-repair-receipt--compact .inventory-repair-receipt-table td:nth-child(5){
  width:27%;
}

@media (max-width:900px){
  .inventory-repair-receipt-card{
    width:99vw !important;
    max-width:99vw !important;
    max-height:96dvh !important;
  }

  .inventory-repair-receipt-before-after-grid{
    grid-template-columns:1fr;
  }

  .inventory-repair-receipt-grid--summary{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:560px){
  .inventory-repair-receipt-card{
    width:100vw !important;
    max-width:100vw !important;
    max-height:100dvh !important;
    border-radius:0 !important;
  }

  .inventory-repair-receipt--compact{
    padding:9px;
  }

  .inventory-repair-receipt-grid--summary{
    grid-template-columns:1fr;
  }

  .inventory-repair-receipt--compact .inventory-repair-receipt-table{
    font-size:.72rem;
  }

  .inventory-repair-receipt--compact .inventory-repair-receipt-table th,
  .inventory-repair-receipt--compact .inventory-repair-receipt-table td{
    padding:5px 4px;
  }
}

@media print{
  .inventory-repair-receipt,
  .inventory-repair-receipt--compact{
    width:100% !important;
    max-width:100% !important;
    padding:0 !important;
    border:0 !important;
  }

  .inventory-repair-receipt-hero{
    padding:6px 8px !important;
    margin-bottom:6px !important;
    border-left-width:4px !important;
  }

  .inventory-repair-receipt-kicker{
    font-size:8px !important;
    line-height:1.1 !important;
  }

  .inventory-repair-receipt-title{
    font-size:11px !important;
    line-height:1.15 !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
  }

  .inventory-repair-receipt-badge{
    font-size:8px !important;
    padding:3px 6px !important;
  }

  .inventory-repair-receipt-summary-line{
    padding:5px 6px !important;
    margin-bottom:6px !important;
    font-size:8.8px !important;
    line-height:1.2 !important;
  }

  .inventory-repair-receipt-section{
    padding:6px !important;
    margin-top:6px !important;
    border-radius:6px !important;
    page-break-inside:avoid !important;
    break-inside:avoid !important;
  }

  .inventory-repair-receipt-section-title{
    font-size:8px !important;
    margin-bottom:4px !important;
  }

  .inventory-repair-receipt-grid,
  .inventory-repair-receipt-grid--summary{
    grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
    gap:4px !important;
  }

  .inventory-repair-receipt-field{
    padding:4px !important;
    border-radius:5px !important;
  }

  .inventory-repair-receipt-label{
    font-size:6.5px !important;
    margin-bottom:2px !important;
  }

  .inventory-repair-receipt-value{
    font-size:8px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-note{
    font-size:8px !important;
    line-height:1.2 !important;
    padding:5px !important;
  }

  .inventory-repair-receipt-before-after-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:6px !important;
  }

  .inventory-repair-receipt-before-after-grid--tables{
    grid-template-columns:1fr 1fr !important;
  }

  .inventory-repair-receipt-table-wrap{
    overflow:visible !important;
  }

  .inventory-repair-receipt-table{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    table-layout:fixed !important;
    font-size:7.5px !important;
    line-height:1.12 !important;
  }

  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    padding:3px 2px !important;
    word-break:normal !important;
    overflow-wrap:anywhere !important;
  }

  .inventory-repair-receipt-table th:nth-child(1),
  .inventory-repair-receipt-table td:nth-child(1){
    width:34% !important;
  }

  .inventory-repair-receipt-table th:nth-child(2),
  .inventory-repair-receipt-table td:nth-child(2),
  .inventory-repair-receipt-table th:nth-child(3),
  .inventory-repair-receipt-table td:nth-child(3),
  .inventory-repair-receipt-table th:nth-child(4),
  .inventory-repair-receipt-table td:nth-child(4){
    width:13% !important;
    text-align:right !important;
  }

  .inventory-repair-receipt-table th:nth-child(5),
  .inventory-repair-receipt-table td:nth-child(5){
    width:27% !important;
  }
}

/* Phase 4.5D.4.R4 — Receipt single-close fallback + readable top-level print */
.inventory-repair-receipt-head .inventory-repair-receipt-close{
  display:none !important;
}

@media print{
  .inventory-repair-receipt,
  .inventory-repair-receipt--compact{
    font-size:12px !important;
    line-height:1.28 !important;
  }

  .inventory-repair-receipt-kicker{
    font-size:9px !important;
  }

  .inventory-repair-receipt-title{
    font-size:14px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-badge{
    font-size:9px !important;
    padding:4px 8px !important;
  }

  .inventory-repair-receipt-summary-line{
    font-size:11px !important;
    line-height:1.28 !important;
  }

  .inventory-repair-receipt-section-title{
    font-size:9.5px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-label{
    font-size:8.5px !important;
    line-height:1.15 !important;
  }

  .inventory-repair-receipt-value{
    font-size:11px !important;
    line-height:1.22 !important;
  }

  .inventory-repair-receipt-note,
  .inventory-repair-receipt-note--compact{
    font-size:10.5px !important;
    line-height:1.25 !important;
  }

  .inventory-repair-receipt-table{
    font-size:9.6px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-table th{
    font-size:8.8px !important;
    line-height:1.12 !important;
  }

  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    padding:4px 3px !important;
  }
}
/* Phase 4.5D.4.R5 — Receipt print border contrast + stronger shaded areas */
@media print{
  .inventory-repair-receipt-hero,
  .inventory-repair-receipt-hero--compact{
    border:1px solid #000000 !important;
    border-left:5px solid #000000 !important;
    background:#dbeafe !important;
  }

  .inventory-repair-receipt-summary-line,
  .inventory-repair-receipt-section,
  .inventory-repair-receipt-section--compact,
  .inventory-repair-receipt-field,
  .inventory-repair-receipt-note,
  .inventory-repair-receipt-note--compact{
    border-color:#000000 !important;
  }

  .inventory-repair-receipt-summary-line{
    background:#e5e7eb !important;
  }

  .inventory-repair-receipt-field,
  .inventory-repair-receipt-note,
  .inventory-repair-receipt-note--compact{
    background:#f1f5f9 !important;
  }

  .inventory-repair-receipt-table,
  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    border-color:#000000 !important;
  }

  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    border:1px solid #000000 !important;
  }

  .inventory-repair-receipt-table th{
    background:#d1d5db !important;
    color:#000000 !important;
  }

  .inventory-repair-receipt-table tbody tr:nth-child(even) td{
    background:#f3f4f6 !important;
  }

  .inventory-repair-receipt-badge{
    border-color:#000000 !important;
    background:#dcfce7 !important;
    color:#000000 !important;
  }
}

/* Phase 4.5D.4.R6 — Receipt print font boost */
@media print{
  .inventory-repair-receipt,
  .inventory-repair-receipt--compact{
    font-size:13px !important;
    line-height:1.32 !important;
  }

  .inventory-repair-receipt-kicker{
    font-size:10px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-title{
    font-size:16px !important;
    line-height:1.2 !important;
  }

  .inventory-repair-receipt-badge{
    font-size:10.5px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-summary-line{
    font-size:12px !important;
    line-height:1.32 !important;
  }

  .inventory-repair-receipt-section-title{
    font-size:10.5px !important;
    line-height:1.2 !important;
  }

  .inventory-repair-receipt-label{
    font-size:9.6px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-value{
    font-size:12.5px !important;
    line-height:1.26 !important;
  }

  .inventory-repair-receipt-note,
  .inventory-repair-receipt-note--compact{
    font-size:12px !important;
    line-height:1.3 !important;
  }

  .inventory-repair-receipt-table{
    font-size:11.2px !important;
    line-height:1.25 !important;
  }

  .inventory-repair-receipt-table th{
    font-size:10.2px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    padding:4px 3px !important;
  }
}

/* Phase 4.5D.4.R7 — Receipt location-row print font fine-tune */
@media print{
  .inventory-repair-receipt-table{
    font-size:12.2px !important;
    line-height:1.28 !important;
  }

  .inventory-repair-receipt-table th{
    font-size:11.1px !important;
    line-height:1.2 !important;
  }

  .inventory-repair-receipt-table th,
  .inventory-repair-receipt-table td{
    padding:4px 3px !important;
  }
}
/* Phase 4.5D.4.R8 — Location-row body font only */
@media print{
  .inventory-repair-receipt-table tbody td{
    font-size:13.4px !important;
    line-height:1.32 !important;
  }
}

/* Phase 4.5D.4.R9 — Receipt print readability + location table column fit */
@media print{
  .inventory-repair-receipt,
  .inventory-repair-receipt--compact{
    font-size:15px !important;
    line-height:1.34 !important;
  }

  .inventory-repair-receipt-kicker{
    font-size:12px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-title{
    font-size:18px !important;
    line-height:1.2 !important;
  }

  .inventory-repair-receipt-badge{
    font-size:12.5px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-summary-line{
    font-size:14px !important;
    line-height:1.34 !important;
  }

  .inventory-repair-receipt-section-title{
    font-size:12.5px !important;
    line-height:1.22 !important;
  }

  .inventory-repair-receipt-label{
    font-size:11.6px !important;
    line-height:1.18 !important;
  }

  .inventory-repair-receipt-value{
    font-size:14.5px !important;
    line-height:1.28 !important;
  }

  .inventory-repair-receipt-note,
  .inventory-repair-receipt-note--compact{
    font-size:14px !important;
    line-height:1.32 !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table{
    font-size:14.4px !important;
    line-height:1.3 !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th{
    font-size:13px !important;
    line-height:1.18 !important;
    white-space:nowrap !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table tbody td{
    font-size:14.5px !important;
    line-height:1.3 !important;
    font-weight:850 !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th:nth-child(1),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table td:nth-child(1){
    width:28% !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th:nth-child(2),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table td:nth-child(2){
    width:15% !important;
    text-align:right !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th:nth-child(3),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table td:nth-child(3),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th:nth-child(4),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table td:nth-child(4){
    width:18% !important;
    text-align:right !important;
  }

  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table th:nth-child(5),
  .inventory-repair-receipt-before-after-grid--tables .inventory-repair-receipt-table td:nth-child(5){
    width:21% !important;
  }
}

/* Phase 4.5D.5.R3 — Smart Repair History Overlay + Mobile Filter Accordion */
.inventory-reconciliation-history-overlay{
  z-index:9769;
  align-items:center;
  justify-content:center;
  padding:clamp(6px, 1.2vw, 16px);
  overflow:hidden;
}

.inventory-reconciliation-history-card{
  width:min(1720px, calc(100vw - clamp(12px, 2.4vw, 32px)));
  max-width:none;
  height:min(94dvh, calc(100dvh - clamp(12px, 2.4vw, 32px)));
  max-height:min(94dvh, calc(100dvh - clamp(12px, 2.4vw, 32px)));
  display:flex;
  flex-direction:column;
  gap:9px;
  overflow:hidden;
  padding:clamp(10px, 1.1vw, 16px);
}

.inventory-reconciliation-history-head{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:104px minmax(0, 1fr) 104px;
  align-items:start;
  gap:10px;
  border-bottom:1px solid var(--border);
  padding-bottom:8px;
}

.inventory-reconciliation-history-head-spacer{
  width:104px;
  min-width:104px;
}

.inventory-reconciliation-history-titleblock{
  min-width:0;
  text-align:center;
}

.inventory-reconciliation-history-head h3{
  margin:0;
  line-height:1.14;
}

.inventory-reconciliation-history-close{
  flex:0 0 auto;
  width:104px;
  min-width:104px;
  max-width:104px;
  justify-content:center;
  white-space:nowrap;
  text-align:center;
  padding-left:12px;
  padding-right:12px;
}

.inventory-reconciliation-history-sub{
  margin-top:4px;
  color:var(--muted);
  font-size:.84rem;
  font-weight:700;
  line-height:1.32;
}

.inventory-reconciliation-history-filter-panel{
  flex:0 0 auto;
  min-width:0;
}

.inventory-reconciliation-history-filter-toggle{
  display:none;
  width:100%;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:var(--primary);
  min-height:38px;
  padding:8px 10px;
  font-size:.88rem;
  font-weight:900;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  cursor:pointer;
  text-align:left;
}

.inventory-reconciliation-history-filter-toggle:focus-visible{
  outline:2px solid rgba(15,76,129,.22);
  border-color:#0f4c81;
}

.inventory-reconciliation-history-filter-summary{
  flex:1 1 auto;
  color:var(--muted);
  font-size:.78rem;
  font-weight:850;
  text-align:right;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inventory-reconciliation-history-filter-caret{
  flex:0 0 auto;
  color:var(--muted);
  transition:transform .16s ease;
}

.inventory-reconciliation-history-filter-panel--open .inventory-reconciliation-history-filter-caret{
  transform:rotate(180deg);
}

.inventory-reconciliation-history-filter-body{
  display:block;
  min-width:0;
}

.inventory-reconciliation-history-filter-grid{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:110px 110px minmax(230px, 2fr) minmax(120px, 1fr) minmax(145px, 1.2fr) minmax(175px, 1.1fr) 88px;
  gap:7px;
  align-items:end;
  padding:9px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f8fafc;
}

.inventory-reconciliation-history-filter-grid label{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  margin:0;
}

.inventory-reconciliation-history-filter-grid span{
  font-size:.7rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
}

.inventory-reconciliation-history-filter-grid input,
.inventory-reconciliation-history-filter-grid select{
  width:100%;
  min-height:36px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:7px 8px;
  background:#fff;
  color:var(--primary);
  font-weight:750;
  font-size:.88rem;
}

.inventory-reconciliation-history-filter-grid input:focus,
.inventory-reconciliation-history-filter-grid select:focus,
.inventory-reconciliation-history-select-button:focus{
  outline:2px solid rgba(15,76,129,.22);
  border-color:#0f4c81;
}

.inventory-reconciliation-history-select{
  position:relative;
  min-width:0;
}

.inventory-reconciliation-history-select-button{
  width:100%;
  min-height:36px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:var(--primary);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 9px;
  font-size:.88rem;
  font-weight:800;
  line-height:1.15;
  cursor:pointer;
  text-align:left;
}

.inventory-reconciliation-history-select-button span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inventory-reconciliation-history-select-caret{
  flex:0 0 auto;
  color:var(--muted);
  font-size:.85rem;
}

.inventory-reconciliation-history-select-menu{
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  right:0;
  z-index:20;
  display:none;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  box-shadow:0 12px 30px rgba(15,23,42,.18);
  padding:5px;
  max-height:220px;
  overflow:auto;
}

.inventory-reconciliation-history-select--open .inventory-reconciliation-history-select-menu{
  display:block;
}

.inventory-reconciliation-history-select-option{
  width:100%;
  border:0;
  background:#fff;
  color:var(--primary);
  border-radius:8px;
  padding:8px 9px;
  font-size:.86rem;
  font-weight:800;
  text-align:left;
  cursor:pointer;
}

.inventory-reconciliation-history-select-option:hover,
.inventory-reconciliation-history-select-option:focus-visible,
.inventory-reconciliation-history-select-option--active{
  background:#eff6ff;
  color:#0f4c81;
  outline:none;
}

.inventory-reconciliation-history-actions{
  flex:0 0 auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.inventory-reconciliation-history-actions .btn{
  white-space:nowrap;
}

.inventory-reconciliation-history-meta{
  flex:0 0 auto;
  display:flex;
  gap:6px 12px;
  flex-wrap:wrap;
  align-items:center;
  color:var(--muted);
  font-size:.84rem;
  font-weight:800;
}

.inventory-reconciliation-history-warning{
  color:#92400e;
  background:#fef3c7;
  border:1px solid #f59e0b;
  border-radius:999px;
  padding:3px 8px;
}

.inventory-reconciliation-history-results{
  flex:1 1 auto;
  min-height:190px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-gutter:stable both-edges;
  position:relative;
}

.inventory-reconciliation-history-empty{
  padding:18px;
  text-align:center;
  color:var(--muted);
  font-weight:850;
}

.inventory-reconciliation-history-table{
  width:100%;
  min-width:700px;
  border-collapse:separate;
  border-spacing:0;
  font-size:.82rem;
  line-height:1.28;
}

.inventory-reconciliation-history-table th,
.inventory-reconciliation-history-table td{
  border-bottom:1px solid var(--border);
  padding:8px 9px;
  text-align:left;
  vertical-align:top;
  line-height:1.28;
  overflow-wrap:anywhere;
  background:#fff;
}

.inventory-reconciliation-history-table th{
  position:sticky;
  top:0;
  z-index:3;
  background:#f1f5f9;
  color:var(--primary);
  font-size:.73rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.035em;
  box-shadow:0 1px 0 var(--border);
}

.inventory-reconciliation-history-table tbody tr:nth-child(even) td{
  background:#f8fafc;
}

.inventory-reconciliation-history-table th:nth-child(1),
.inventory-reconciliation-history-table td:nth-child(1){
  width:96px;
  white-space:nowrap;
}

.inventory-reconciliation-history-table th:nth-child(2),
.inventory-reconciliation-history-table td:nth-child(2){
  width:155px;
  min-width:155px;
}

.inventory-reconciliation-history-table th:nth-child(3),
.inventory-reconciliation-history-table td:nth-child(3){
  min-width:220px;
}

.inventory-reconciliation-history-table th:nth-child(4),
.inventory-reconciliation-history-table td:nth-child(4){
  min-width:260px;
}

.inventory-reconciliation-history-barcode{
  margin-top:3px;
  color:#6b7280;
  font-size:.78rem;
  font-weight:850;
  line-height:1.2;
}

.inventory-reconciliation-history-item-link{
  border:0;
  background:transparent;
  color:#111827;
  padding:0;
  margin:0;
  font:inherit;
  font-weight:950;
  text-decoration:underline;
  cursor:pointer;
  text-align:left;
}

.inventory-reconciliation-history-item-link:hover,
.inventory-reconciliation-history-item-link:focus-visible{
  color:#0f4c81;
  outline:2px solid rgba(15,76,129,.18);
  outline-offset:2px;
  border-radius:4px;
}

@media (max-width:1180px){
  .inventory-reconciliation-history-card{
    width:calc(100vw - 16px);
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }

  .inventory-reconciliation-history-filter-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }

  .inventory-reconciliation-history-filter-search{
    grid-column:span 2;
  }
}

@media (min-width:700px) and (max-width:1180px) and (orientation:portrait){
  .inventory-reconciliation-history-filter-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .inventory-reconciliation-history-filter-date{
    display:grid !important;
    grid-template-columns:48px minmax(0, 1fr);
    align-items:center;
    gap:7px;
  }

  .inventory-reconciliation-history-filter-date span{
    text-align:right;
    line-height:1;
  }

  .inventory-reconciliation-history-filter-search{
    grid-column:span 2;
  }

  .inventory-reconciliation-history-filter-movement{
    grid-column:span 1;
  }

  .inventory-reconciliation-history-filter-limit{
    grid-column:span 1;
  }
}

@media (max-width:640px){
  .inventory-reconciliation-history-overlay{
    padding:6px;
    align-items:stretch;
  }

  .inventory-reconciliation-history-card{
    width:calc(100vw - 12px);
    height:calc(100dvh - 12px);
    max-height:calc(100dvh - 12px);
    padding:9px;
    gap:7px;
  }

  .inventory-reconciliation-history-head{
    grid-template-columns:1fr 96px;
    align-items:center;
    padding-bottom:6px;
  }

  .inventory-reconciliation-history-head-spacer{
    display:none;
  }

  .inventory-reconciliation-history-titleblock{
    text-align:left;
  }

  .inventory-reconciliation-history-sub{
    display:none;
  }

  .inventory-reconciliation-history-filter-toggle{
    display:flex;
  }

  .inventory-reconciliation-history-filter-body{
    display:grid;
    grid-template-rows:0fr;
    overflow:hidden;
    transition:grid-template-rows .18s ease;
  }

  .inventory-reconciliation-history-filter-body > .inventory-reconciliation-history-filter-grid{
    min-height:0;
  }

  .inventory-reconciliation-history-filter-panel--open .inventory-reconciliation-history-filter-body{
    grid-template-rows:1fr;
    margin-top:6px;
  }

  .inventory-reconciliation-history-filter-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
    padding:8px;
  }

  .inventory-reconciliation-history-filter-search,
  .inventory-reconciliation-history-filter-movement{
    grid-column:1 / -1;
  }

  .inventory-reconciliation-history-filter-date{
    display:grid !important;
    grid-template-columns:44px minmax(0, 1fr);
    align-items:center;
    gap:6px;
  }

  .inventory-reconciliation-history-filter-date span{
    text-align:right;
    line-height:1;
  }

  .inventory-reconciliation-history-filter-grid input,
  .inventory-reconciliation-history-filter-grid select,
  .inventory-reconciliation-history-select-button{
    min-height:34px;
    padding:6px 7px;
    font-size:.84rem;
  }

  .inventory-reconciliation-history-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
  }

  .inventory-reconciliation-history-actions .btn{
    width:100%;
    min-height:36px;
  }

  .inventory-reconciliation-history-meta{
    font-size:.78rem;
    gap:4px 10px;
  }

  .inventory-reconciliation-history-results{
    min-height:0;
    flex:1 1 260px;
  }

  .inventory-reconciliation-history-table{
    min-width:690px;
  }
}

/* ==========================================================
   POS Inventory Search Status UX
   Shows zero/out-of-stock inventory in search with clear sellability state.
   ========================================================== */
#itemResults .pos-item-result{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px 10px;
  align-items:center;
}

#itemResults .pos-item-result--blocked{
  background:#fff7ed;
}

#itemResults .pos-item-result--blocked:hover{
  background:#ffedd5;
}

#itemResults .pos-item-result-main{
  min-width:0;
}

#itemResults .pos-item-result-title{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  align-items:baseline;
  min-width:0;
}

#itemResults .pos-item-result-title span{
  overflow-wrap:anywhere;
  word-break:break-word;
}

#itemResults .pos-item-result-meta{
  margin-top:3px;
  font-size:.78rem;
  line-height:1.25;
  color:var(--muted);
}

#itemResults .pos-item-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  font-size:.70rem;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  border:1px solid transparent;
}

#itemResults .pos-item-status-badge--ready{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

#itemResults .pos-item-status-badge--blocked{
  background:#fef2f2;
  color:#b91c1c;
  border-color:#fecaca;
}

#itemResults .pos-item-result-hint{
  grid-column:1 / -1;
  font-size:.74rem;
  font-weight:800;
  color:#9a3412;
}

.pos-status-alert{
  display:grid;
  gap:12px;
}

.pos-status-alert-item{
  display:grid;
  gap:2px;
}

.pos-status-alert-item strong{
  font-size:1.05rem;
}

.pos-status-alert-item span{
  color:var(--muted);
  overflow-wrap:anywhere;
  word-break:break-word;
}

.pos-status-alert-badge{
  display:inline-flex;
  justify-self:start;
  align-items:center;
  min-height:28px;
  padding:6px 10px;
  border-radius:999px;
  background:#fef2f2;
  color:#b91c1c;
  border:1px solid #fecaca;
  font-weight:900;
  font-size:.78rem;
}

.pos-status-alert--ready .pos-status-alert-badge{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

.pos-status-alert p{
  margin:0;
  line-height:1.45;
}

.pos-status-alert-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
}

.pos-status-alert-grid > div{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 10px;
  display:grid;
  gap:3px;
}

.pos-status-alert-grid span{
  font-size:.74rem;
  color:var(--muted);
  font-weight:800;
}

.pos-status-alert-grid strong{
  font-size:1rem;
}

.pos-status-alert-note{
  padding:10px 12px;
  border-radius:10px;
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
}

@media (max-width: 600px){
  #itemResults .pos-item-result{
    grid-template-columns:1fr;
  }

  #itemResults .pos-item-status-badge{
    justify-self:start;
  }

  .pos-status-alert-grid{
    grid-template-columns:1fr;
  }
}

/* ==========================================================
   POS Mixed-Location Sellability Picker
   Shows sellable locations as selectable and blocked stock locations as reference-only.
   ========================================================== */
#posLocationPickModal .modal-content{
  max-height:92dvh;
  overflow:auto;
}

.pos-location-pick-context{
  margin:0 0 12px 0;
  padding:10px 12px;
  border-radius:10px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e3a8a;
  font-size:.86rem;
  font-weight:800;
  line-height:1.35;
  display:grid;
  gap:3px;
}

.pos-location-pick-list{
  display:grid;
  gap:8px;
}

.pos-location-pick-row{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--primary);
  padding:10px 12px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px 10px;
  align-items:center;
  text-align:left;
  box-shadow:0 3px 10px rgba(15,23,42,.06);
}

.pos-location-pick-row--selectable{
  cursor:pointer;
}

.pos-location-pick-row--selectable:hover,
.pos-location-pick-row--selectable.active{
  border-color:#0ea5e9;
  background:#f0f9ff;
  box-shadow:0 0 0 2px rgba(14,165,233,.16);
}

.pos-location-pick-row--blocked{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#7c2d12;
  cursor:not-allowed;
  opacity:1;
}

.pos-location-pick-row-main{
  min-width:0;
  display:grid;
  gap:3px;
}

.pos-location-pick-row-main strong{
  font-size:.95rem;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.pos-location-pick-row-main small{
  color:var(--muted);
  font-size:.78rem;
  line-height:1.25;
}

.pos-location-pick-row-main em{
  color:#9a3412;
  font-style:normal;
  font-size:.78rem;
  font-weight:900;
  line-height:1.25;
}

.pos-location-pick-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  font-size:.70rem;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  border:1px solid transparent;
}

.pos-location-pick-badge--ready{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

.pos-location-pick-badge--blocked{
  background:#fef2f2;
  color:#b91c1c;
  border-color:#fecaca;
}

.pos-location-pick-empty{
  padding:12px;
  border:1px dashed var(--border);
  border-radius:10px;
  color:var(--muted);
  text-align:center;
}

@media (max-width:600px){
  .pos-location-pick-row{
    grid-template-columns:1fr;
  }

  .pos-location-pick-badge{
    justify-self:start;
  }
}

/* ==========================================================
   Phase 4.7.S2 / 4.7.S2.R1.2 — Hybrid Workspace Shell Foundation
   Compact professional command bar, account/alerts panel, navigation polish,
   and non-destructive quick links. Module logic remains unchanged.
   ========================================================== */
.mv-shell{
  width:min(100%, 1180px);
  max-width:1180px;
  min-height:100vh;
  padding:10px;
  background:var(--mv-app-bg,#e4eaf0);
  position:relative;
}

.mv-shell-header{
  padding:8px 10px 9px;
  margin:0 auto 10px;
  overflow:visible;
  border-radius:4px;
  border-color:#8da2b8;
  box-shadow:0 2px 10px rgba(15,23,42,.12);
}

.mv-shell-brand-row{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
  padding:2px 6px 0;
}

.mv-shell-brand-title{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  color:#7c2d12;
  cursor:pointer;
  font-family:Georgia, "Times New Roman", Times, serif;
  font-size:1.85rem;
  font-weight:900;
  line-height:1.05;
  letter-spacing:.03em;
  text-align:left;
  text-shadow:none;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:geometricPrecision;
  -webkit-appearance:none;
  appearance:none;
  touch-action:manipulation;
}

.mv-shell-brand-title:hover,
.mv-shell-brand-title:focus-visible{
  color:#0f4c81;
  outline:none;
}

.mv-shell-commandbar{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:34px;
  min-width:0;
  margin-top:6px;
  padding:5px 8px;
  border:1px solid #8da2b8;
  border-radius:2px;
  background:#eef3f8;
}

.mv-shell-idline{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:6px;
  overflow:hidden;
  white-space:nowrap;
}

.mv-shell-divider{
  flex:0 0 auto;
  width:1px;
  height:18px;
  background:#8da2b8;
  opacity:.85;
}

.mv-shell-field{
  min-width:0;
  display:inline-flex;
  align-items:center;
  gap:3px;
  color:#243447;
  font-size:.79rem;
  font-weight:850;
  line-height:1.1;
}

.mv-shell-field-label{
  flex:0 0 auto;
  color:#45566a;
  font-weight:950;
}

.mv-shell-field-value{
  min-width:0;
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#101827;
  font-weight:900;
}

.mv-shell-company-name{
  max-width:230px;
}

.mv-shell-user-field .mv-shell-field-value{
  max-width:210px;
}

.mv-shell-date-field .mv-shell-field-value{
  max-width:150px;
}

.mv-shell-command-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  min-width:0;
  white-space:nowrap;
}

.mv-shell-alert-btn,
.mv-shell-signout-btn{
  flex:0 0 auto;
  min-height:30px;
  max-width:none;
  padding:5px 8px;
  border-radius:4px;
  font-size:.78rem;
  font-weight:950;
  line-height:1;
  white-space:nowrap;
  box-shadow:none;
}

.mv-shell-alert-btn{
  background:#0f4c81;
  color:#fff;
}

.mv-shell-alert-btn--active{
  background:#9a3412;
  color:#fff;
}

.mv-shell-alert-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  margin-left:5px;
  padding:0 5px;
  border-radius:999px;
  background:#fff;
  color:#0f4c81;
  font-weight:950;
  font-size:.70rem;
  line-height:1;
}

.mv-shell-signout-btn{
  background:#b91c1c;
  color:#fff;
}

.mv-shell-accent-wrap{
  position:relative;
  z-index:1;
  width:100%;
  padding:0 6px;
  margin:2px 0 0;
}

.mv-shell-title-accent{
  display:block;
  width:100%;
  max-width:none;
  min-width:0;
  height:3px;
  margin:4px auto 0;
  border-radius:2px;
  pointer-events:none;
  box-sizing:border-box;
}

.mv-shell-alert-overlay{
  position:absolute;
  top:54px;
  right:10px;
  z-index:9100;
  width:min(92vw, 360px);
}

.mv-shell-alert-card{
  background:#fff;
  border:1px solid #8da2b8;
  border-radius:6px;

  box-shadow:0 10px 24px rgba(15,23,42,.24);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  max-height:min(72vh, 520px);
}

.mv-shell-alert-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  background:#0f4c81;
  color:#fff;
}

.mv-shell-alert-title{
  font-weight:950;
  font-size:.9rem;
}

.mv-shell-alert-close{
  width:28px;
  height:28px;
  border:0;
  border-radius:4px;
  background:rgba(255,255,255,.16);
  color:#fff;
  font-size:1.1rem;
  font-weight:950;
  cursor:pointer;
}

.mv-shell-alert-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:9px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.mv-shell-alert-empty{
  padding:9px;
  color:var(--muted);
  font-weight:850;
  text-align:center;
}

.mv-shell-alert-item{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:5px;
  border:1px solid rgba(15,76,129,.25);
  border-left:4px solid #9a3412;
  border-radius:4px;
  background:#fff8eb;
  color:var(--primary);
  padding:9px;
  text-align:left;
}

.mv-shell-alert-item-title{
  font-weight:950;
  font-size:.88rem;
}

.mv-shell-alert-item-meta{
  font-size:.76rem;
  font-weight:850;
  color:var(--muted);
}

.mv-shell-alert-item-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-top:3px;
}

.mv-shell-alert-item-actions--single{
  grid-template-columns:1fr;
}

.mv-shell-alert-action-btn{
  min-height:32px;
  max-width:none;
  padding:6px 8px;
  border-radius:4px;
  box-shadow:none;
  font-size:.76rem;
  font-weight:950;
  line-height:1.1;
}

.mv-shell-alert-action-btn--primary{
  background:#0f4c81;
  color:#fff;
}

.mv-shell-alert-action-btn--dismiss{
  background:#6b7280;
  color:#fff;
}

/* ==========================================================
   Phase 4.7.S4.R1 - POS Hold Alert Review Surface
   Compact item-list first; full hold details only after item selection.
   ========================================================== */
.mv-pos-hold-review-overlay{
  position:fixed;
  inset:0;
  z-index:9300;
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:72px 10px 18px;
  background:rgba(15,23,42,.34);
}

.mv-pos-hold-review-card{
  width:min(94vw, 520px);
  max-height:calc(100dvh - 92px);
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid #8da2b8;
  border-radius:8px;
  box-shadow:0 16px 36px rgba(15,23,42,.30);
  overflow:hidden;
}

.mv-pos-hold-review-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 11px;
  background:#0f4c81;
  color:#fff;
}

.mv-pos-hold-review-title{
  font-size:.92rem;
  font-weight:950;
}

.mv-pos-hold-review-close{
  width:30px;
  height:30px;
  border:0;
  border-radius:4px;
  background:rgba(255,255,255,.16);
  color:#fff;
  font-size:1.15rem;
  font-weight:950;
  cursor:pointer;
}

.mv-pos-hold-review-list,
.mv-pos-hold-review-detail{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:10px;
}

.mv-pos-hold-review-list{
  display:grid;
  gap:7px;
}

.mv-pos-hold-review-empty{
  padding:12px;
  text-align:center;
  color:var(--muted);
  font-size:.86rem;
  font-weight:850;
}

.mv-pos-hold-review-item-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:42px;
  padding:9px 11px;
  border:1px solid rgba(15,76,129,.25);
  border-left:4px solid #9a3412;
  border-radius:6px;
  background:#fff8eb;
  color:var(--primary);
  font-size:.92rem;
  font-weight:950;
  text-align:left;
  cursor:pointer;
}

.mv-pos-hold-review-item-btn small{
  min-width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#9a3412;
  color:#fff;
  font-size:.72rem;
  font-weight:950;
}

.mv-pos-hold-review-detail .pos-status-alert{
  gap:10px;
}

.mv-pos-hold-review-detail-actions{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.mv-pos-hold-review-detail-actions .btn{
  max-width:none;
}

@media (max-width:600px){
  .mv-pos-hold-review-overlay{
    align-items:stretch;
    padding:62px 7px 10px;
  }

  .mv-pos-hold-review-card{
    width:100%;
    max-height:calc(100dvh - 74px);
  }

  .mv-pos-hold-review-detail-actions{
    grid-template-columns:1fr;
  }
}

.mv-shell-nav,
.mv-quick-links{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:5px;
  width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  border:1px solid #8da2b8;
  background:#dbecfd; /* original #cfd9e5 */
}

.mv-shell-nav{
  margin:8px 0 0;
  padding:5px;
  border-radius:2px;
}

.mv-quick-links{
  margin:6px 0 0;
  padding:5px;
  border-radius:3px;
}

.mv-shell-nav-btn,
.mv-quick-link{
  flex:0 0 auto;
  min-height:34px;
  border:1px solid #8da2b8;
  border-radius:3px;
  cursor:pointer;
  font-family:inherit;
  font-weight:950;
  line-height:1.1;
  white-space:nowrap;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(15,76,129,.20);
  box-shadow:none;
}

.mv-shell-nav-btn{
  padding:7px 11px;
  background:#e3ebf3;
  color:#0f172a;
  font-size:.84rem;
}

.mv-shell-nav-btn--active,
.mv-shell-nav-btn:hover,
.mv-shell-nav-btn:focus-visible{
  background:#0f4c81;
  color:#fff;
  border-color:#0f4c81;
}

.mv-quick-link{
  padding:6px 10px;
  background:#e3ebf3;
  color:#0f172a;
  font-size:.80rem;
}

.mv-quick-link:hover,
.mv-quick-link:focus-visible{
  background:#0f4c81;
  color:#fff;
  border-color:#0f4c81;
}

#mainHelpBtn.mv-shell-nav-btn{
  display:inline-flex !important;
}

/* ==========================================================
   Phase 4.7.WS5 - Reports / System / Help shell alignment
   Groups utility navigation on compact screens and provides one
   permission-filtered shell menu for existing report surfaces.
   ========================================================== */
.mv-shell-nav-group{
  display:flex;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
  min-width:0;
}

.mv-shell-reports-overlay{
  position:fixed;
  inset:0;
  z-index:9200;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.52);
  backdrop-filter:blur(3px);
  transition:opacity 180ms ease;
}

.mv-shell-reports-card{
  width:min(860px, 100%);
  max-height:min(86vh, 720px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #8da2b8;
  border-radius:6px;
  background:#fff;
  box-shadow:0 18px 48px rgba(15,23,42,.28);
}

.mv-shell-reports-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:13px 15px;
  border-bottom:1px solid #8da2b8;
  background:#0f4c81;
  color:#fff;
}

.mv-shell-reports-title{
  font-size:1.05rem;
  font-weight:950;
  line-height:1.15;
}

.mv-shell-reports-subtitle{
  margin-top:4px;
  font-size:.8rem;
  font-weight:750;
  line-height:1.35;
  color:rgba(255,255,255,.88);
}

.mv-shell-reports-close{
  flex:0 0 32px;
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.35);
  border-radius:4px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font:inherit;
  font-size:1.2rem;
  font-weight:950;
  line-height:1;
  cursor:pointer;
}

.mv-shell-reports-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:9px;
  padding:12px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  background:#f8fafc;
}

.mv-shell-report-entry{
  min-width:0;
  min-height:92px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:6px;
  padding:12px;
  border:1px solid #a9bacb;
  border-left:4px solid #0f4c81;
  border-radius:5px;
  background:#fff;
  color:#0f172a;
  font:inherit;
  text-align:left;
  cursor:pointer;
  box-shadow:0 1px 3px rgba(15,23,42,.08);
}

.mv-shell-report-entry:hover,
.mv-shell-report-entry:focus-visible{
  border-color:#0f4c81;
  outline:2px solid rgba(15,76,129,.2);
  outline-offset:1px;
}

.mv-shell-report-entry[hidden]{
  display:none !important;
}

.mv-shell-report-entry--future{
  border-left-color:#64748b;
  background:#f8fafc;
}

.mv-shell-report-entry-title{
  color:#0f4c81;
  font-size:.9rem;
  font-weight:950;
  line-height:1.2;
}

.mv-shell-report-entry-detail{
  color:#526171;
  font-size:.78rem;
  font-weight:750;
  line-height:1.38;
  overflow-wrap:anywhere;
}

.mv-shell-report-future-badge{
  display:inline-flex;
  margin-left:5px;
  padding:2px 5px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#475569;
  font-size:.64rem;
  font-weight:950;
  line-height:1;
  vertical-align:middle;
}

.mv-shell-reports-empty{
  margin:12px;
  padding:14px;
  border:1px dashed #94a3b8;
  border-radius:5px;
  color:var(--muted);
  font-size:.84rem;
  font-weight:850;
  text-align:center;
}

@media (max-width:600px){
  .mv-shell-nav{
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    overflow:visible;
  }

  .mv-shell-nav-group{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }

  .mv-shell-nav-group--utility{
    padding-top:4px;
    border-top:1px solid rgba(141,162,184,.75);
  }

  .mv-shell-reports-overlay{
    align-items:flex-start;
    padding:max(10px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom));
  }

  .mv-shell-reports-card{
    width:100%;
    max-height:calc(100dvh - 20px);
  }

  .mv-shell-reports-grid{
    grid-template-columns:1fr;
    padding:9px;
  }

  .mv-shell-report-entry{
    min-height:0;
    padding:11px;
  }
}

.mv-shell-main{
  min-width:0;
}

.mv-dashboard-workspace{
  min-width:0;
}

.mv-dashboard-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:0 0 8px;
  padding:9px 10px;
  border:1px solid rgba(17,24,39,.12);
  border-left:4px solid #0f4c81;
  border-radius:3px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

.mv-dashboard-title{
  font-size:.98rem;
  font-weight:950;
  color:var(--primary);
  line-height:1.1;
}

.mv-dashboard-subtitle,
.mv-dashboard-note{
  font-size:.76rem;
  font-weight:850;
  color:var(--muted);
  line-height:1.25;
}

.mv-dashboard-note{
  text-align:right;
  max-width:420px;
}

.mv-dashboard-actionbar{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap:6px;
  margin:0 0 8px;
  padding:7px;
  border:1px solid rgba(17,24,39,.14);
  border-radius:4px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

/* R8: allow labels to wrap inside their actual grid track, including controls
   otherwise marked short. The centered Pricing width cap remains unchanged. */
.mv-dashboard-actionbar .btn{
  width:100%;max-width:100%;min-width:0;
  white-space:normal !important;overflow-wrap:anywhere;
  min-height:44px;
  padding:7px 8px;
  border-radius:4px;
  font-size:.80rem;
  line-height:1.12;
}

.mv-dashboard-foundation{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  margin:0 0 8px;
}

.mv-dashboard-card{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px;
  border:1px solid rgba(17,24,39,.14);
  border-left:4px solid #0f4c81;
  border-radius:4px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}

.mv-dashboard-card--workspace{
  grid-column:span 2;
}

.mv-dashboard-card-kicker{
  color:#45566a;
  font-size:.72rem;
  font-weight:950;
  letter-spacing:.04em;
  line-height:1.1;
  text-transform:uppercase;
}

.mv-dashboard-card-title{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--primary);
  font-size:.98rem;
  font-weight:950;
  line-height:1.15;
}

.mv-dashboard-card-meta,
.mv-dashboard-price-values{
  color:var(--muted);
  font-size:.76rem;
  font-weight:800;
  line-height:1.28;
}

.mv-dashboard-price-values{
  color:#243447;
}

.mv-dashboard-mini-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  margin-top:auto;
}

.mv-dashboard-mini-pill{
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:4px 7px;
  border:1px solid rgba(15,76,129,.18);
  border-radius:999px;
  background:#eef3f8;
  color:#243447;
  font-size:.72rem;
  font-weight:900;
  line-height:1.1;
}

.mv-dashboard-card-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:6px;
  margin-top:auto;
}

.mv-dashboard-card-actions .btn{
  width:100%;
  max-width:none;
  min-height:32px;
  padding:6px 8px;
  border-radius:4px;
  box-shadow:none;
  font-size:.76rem;
  font-weight:950;
  line-height:1.1;
}

.mv-dashboard-primary-btn{
  background:#0f4c81;
  color:#fff;
}

.mv-dashboard-secondary-btn{
  background:#6b7280;
  color:#fff;
}

.mv-dashboard-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 6px;
  padding:8px 10px;
  border:1px solid rgba(17,24,39,.12);
  border-left:4px solid #92400e;
  border-radius:3px;
  background:#fff8eb;
}

.mv-dashboard-section-title-main{
  color:var(--primary);
  font-size:.88rem;
  font-weight:950;
  line-height:1.15;
}

.mv-dashboard-section-title-sub{
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  line-height:1.25;
}

.mv-shell-menu-overlay{
  position:fixed;
  inset:0;
  z-index:9000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.60);
  transition:opacity .2s ease;
}

.mv-shell-menu-card{
  width:min(100%, 380px);
  max-width:380px;
  padding:20px;
  border-radius:6px;
  background:var(--card);
  box-shadow:0 10px 25px rgba(0,0,0,.26);
  position:relative;
}

.mv-shell-menu-close{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  border:0;
  border-radius:4px;
  background:#e5e7eb;
  color:var(--muted);
  font-size:1.35rem;
  font-weight:950;
  cursor:pointer;
}

.mv-shell-menu-title{
  margin:0;
  text-align:center;
  color:var(--primary);
  font-size:1.25rem;
  font-weight:950;
}

.mv-shell-menu-subtitle{
  margin:6px 0 14px;
  color:var(--muted);
  font-size:.82rem;
  font-weight:750;
  line-height:1.35;
  text-align:center;
}

.mv-shell-menu-links{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.mv-shell-menu-link{
  max-width:none;
  min-height:44px;
  padding:10px;
  font-size:.96rem;
  font-weight:950;
  gap:10px;
  border-radius:4px;
}

.mv-shell-menu-link--pos{ background:var(--accent); color:#fff; }
.mv-shell-menu-link--inventory{ background:var(--success); color:#07251d; }
.mv-shell-menu-link--customers{ background:var(--custBtn-bg); color:#1f2937; }
.mv-shell-menu-link--buy{ background:#92400e; color:#fff; }

@media (max-width: 1024px){
  .mv-shell-commandbar{
    gap:6px;
    padding:5px 7px;
  }

  .mv-shell-title-btn{
    font-size:1.65rem;
  }

  .mv-shell-field{
    font-size:.74rem;
  }

  .mv-shell-field-value{
    max-width:130px;
  }

  .mv-shell-company-name{
    max-width:160px;
  }

  .mv-shell-user-field .mv-shell-field-value{
    max-width:150px;
  }

  .mv-shell-date-field .mv-shell-field-value{
    max-width:130px;
  }

  .mv-shell-alert-btn,
	.mv-shell-signout-btn{
    font-size:.72rem;
  }
}

@media (max-width: 760px){
  .mv-shell{
    padding:7px;
  }

  .mv-shell-header{
    padding:7px;
  }

  .mv-shell-commandbar{
    align-items:stretch;
    flex-direction:column;
  }

  .mv-shell-idline{
    width:100%;
  }

  .mv-shell-command-actions{
    width:100%;
    justify-content:flex-end;
  }

  .mv-shell-alert-overlay{
    top:72px;
    right:7px;
    left:7px;
    width:auto;
  }

  .mv-shell-alert-card{
    max-height:calc(100dvh - 96px);
  }

  .mv-dashboard-foundation{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .mv-dashboard-card--workspace{
    grid-column:span 2;
  }

}

@media (max-width: 600px){
  .mv-shell{
    padding:6px;
  }

  .mv-shell-commandbar{
    gap:6px;
  }

  .mv-shell-idline{
    flex-wrap:wrap;
    gap:5px;
    white-space:normal;
  }

  .mv-shell-title-btn{
    width:100%;
    font-size:1.42rem;
    text-align:left;
  }

  .mv-shell-divider{
    display:none;
  }

  .mv-shell-field{
    max-width:100%;
    font-size:.76rem;
  }

  .mv-shell-field-value,
  .mv-shell-company-name,
  .mv-shell-user-field .mv-shell-field-value,
  .mv-shell-date-field .mv-shell-field-value{
    max-width:42vw;
  }

  .mv-shell-command-actions{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    gap:5px;
    align-items:center;
  }

  .mv-shell-alert-btn,
  .mv-shell-signout-btn{
    width:100%;
    min-width:0;
    min-height:32px;
  }

  .mv-shell-title-accent{
    margin-top:4px;
  }

  .mv-shell-nav,
  .mv-quick-links{
    margin-top:6px;
    border-radius:2px;
  }

  .mv-shell-nav-btn{
    min-height:34px;
    padding:7px 10px;
    font-size:.80rem;
  }

  .mv-quick-link{
    min-height:32px;
    padding:6px 9px;
    font-size:.76rem;
  }

  .mv-dashboard-heading{
    flex-direction:column;
    align-items:stretch;
    padding:8px 10px;
    border-radius:4px;
  }

  .mv-dashboard-note{
    text-align:left;
    max-width:none;
  }

  .mv-dashboard-foundation{
    grid-template-columns:1fr;
    gap:6px;
  }

  .mv-dashboard-card,
  .mv-dashboard-card--workspace{
    grid-column:span 1;
  }

  .mv-dashboard-card{
    padding:9px;
  }

  .mv-dashboard-card-title{
    white-space:normal;
  }

  .mv-dashboard-card-actions{
    grid-template-columns:1fr;
  }

  .mv-dashboard-section-title{
    padding:8px 10px;
    border-radius:4px;
  }

  .mv-dashboard-actionbar{
    gap:5px;
    padding:6px;
    border-radius:4px;
  }

  .mv-dashboard-actionbar .btn{
    min-height:44px;
    padding:7px 8px;
    font-size:.76rem;
  }

  .mv-shell-alert-item-actions{
    grid-template-columns:1fr;
  }

  .mv-shell-menu-card{
    width:min(100%, 350px);
    padding:18px;
  }
}

@media print{
  .mv-shell-nav,
  .mv-quick-links,
  .mv-shell-command-actions,
  .mv-dashboard-heading,
  .mv-dashboard-foundation,
  .mv-dashboard-section-title,
  .mv-dashboard-actionbar,
  .mv-shell-alert-overlay,
  .mv-shell-menu-overlay{
    display:none !important;
  }

  .mv-shell{
    max-width:none !important;
    background:#fff !important;
    padding:0 !important;
  }
}
/* ==========================================================
   Phase 4.7.DR.4.R2.2.C1 - Platform Maintenance Lease and Persistent Password Retry
   C2.C3.C2: shared password dialog uses the approved compact light-blue/gray header.
   ========================================================== */
#platformAdminPasswordOverlay{
  box-sizing:border-box;
  width:100vw;
  height:100vh;
  height:100dvh;
  padding:12px;
  padding-top:max(12px, env(safe-area-inset-top));
  padding-right:max(12px, env(safe-area-inset-right));
  padding-bottom:max(12px, env(safe-area-inset-bottom));
  padding-left:max(12px, env(safe-area-inset-left));
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

#platformAdminPasswordOverlay .platform-admin-password-card{
  box-sizing:border-box;
  width:430px;
  max-width:100%;
  flex:0 1 430px;
  max-height:calc(100dvh - 24px);
  overflow:auto;
  text-align:left;
  padding:0;
  border:1px solid var(--mv-page-border,#a8bdd0);
}

.platform-admin-password-header{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:0 4px 0 12px;
  border-bottom:1px solid var(--mv-page-border,#a8bdd0);
}

.platform-admin-password-key{
  flex:0 0 18px;
  width:18px;
  height:18px;
}

.platform-admin-password-card h3{
  flex:1 1 auto;
  min-width:0;
  margin:0;
  text-align:left;
  font-size:1rem;
  font-weight:500;
  line-height:1.3;
  overflow-wrap:anywhere;
}

#platformAdminPasswordOverlay .platform-admin-password-close{
  position:static;
  flex:0 0 44px;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
  border-radius:2px;
  font-size:1.25rem;
  line-height:1;
  cursor:pointer;
}

.platform-admin-password-close:focus-visible{
  outline:2px solid #1b5687;
  outline-offset:1px;
}

.platform-admin-password-body{
  padding:14px;
}

.platform-admin-password-action-row{
  display:flex;
  align-items:flex-start;
  gap:6px;
  margin:0 0 8px;
  line-height:1.4;
  font-size:.875rem;
}

.platform-admin-password-action-row[hidden]{
  display:none;
}

.platform-admin-password-action-row span{
  flex:0 0 auto;
  color:var(--mv-page-muted,#526779);
}

.platform-admin-password-action-row strong{
  min-width:0;
  overflow-wrap:anywhere;
  color:var(--mv-page-ink,#19354d);
  font-weight:600;
}

.platform-admin-password-description{
  margin-bottom:13px;
  color:var(--mv-page-ink,#19354d);
  font-size:.875rem;
  line-height:1.45;
}

.platform-admin-password-field{
  margin-bottom:14px;
}

.platform-admin-password-field label{
  display:block;
  margin-bottom:6px;
  font-size:.875rem;
  font-weight:400;
}

#platformAdminPasswordOverlay .platform-admin-password-field input{
  box-sizing:border-box;
  width:100%;
  min-height:44px;
  padding:10px;
  border:1px solid var(--mv-page-border,#a8bdd0);
  border-radius:3px;
  background:var(--mv-page-soft-bg,#f7fafc);
  font-size:1rem;
}

#platformAdminPasswordOverlay .platform-admin-password-field input[aria-invalid="true"]{
  border-color:var(--danger) !important;
  box-shadow:0 0 0 3px rgba(239,68,68,.14);
}
#platformAdminPasswordOverlay .platform-admin-password-field input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.16);
  outline:none;
}

.platform-admin-password-status{
  margin:2px 0 12px;
  padding:9px 10px;
  border-radius:3px;
  background:var(--mv-page-soft-bg,#f7fafc);
  color:var(--mv-page-muted,#526779);
  font-size:.86rem;
  font-weight:600;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.platform-admin-password-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.platform-admin-password-actions .btn{
  flex:0 0 auto;
  width:auto;
  min-height:44px;
  padding:9px 12px;
}

body.mv-platform-admin-password-open{
  overflow:hidden;
}

/* An expired server grant may leave an accordion open for context, but the
   summary is visibly locked and every protected request is reauthorized. */
#platformMaintenanceAccordion.platform-maintenance-is-locked,
#platformTenantBillingAccordion.tenant-management-is-locked,
#platformAdminCompanyAccessAccordion.platform-admin-company-access-is-locked{
  border-left:6px solid var(--danger);
}

@media (max-width:600px){
  #platformAdminPasswordOverlay{
    align-items:flex-start;
  }

  #platformAdminPasswordOverlay .platform-admin-password-card{
    margin-top:0;
    max-height:calc(100dvh - 24px);
  }
}
/* ==========================================================
   Phase 4.7.DR.4.R2.3 - Secure Empty-Database Bootstrap

   Non-dismissible, pre-authenticated setup surface. Existing R2.2/C1
   password-overlay behavior and C1.R2 native button feedback remain intact.
   ========================================================== */
body.mv-initial-platform-setup-open{
  overflow:hidden;
}

/* ==========================================================
   Phase 4.7.DR.4.R2.5.C1.R4 — Three-step Production Database
   Change. All selectors are scoped to the protected surface.
   ========================================================== */
.mv-r25-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px;
  border: 2px solid #1d4ed8;
  border-radius: 12px;
  background: #eff6ff;
}

.mv-r25-launcher h4 {
  margin: 2px 0 5px;
  color: #172554;
  font-size: 1rem;
}

.mv-r25-launcher p {
  margin: 0;
  color: #334155;
  font-size: .82rem;
  line-height: 1.45;
}

.mv-r25-launcher__eyebrow,
.mv-r25__eyebrow {
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mv-r25-overlay {
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.mv-r25 {
  position: relative;
  width: min(1180px, 100%);
  max-width: 1180px;
  height: min(94vh, 980px);
  max-height: 94vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f8fafc;
  color: #172033;
}

.mv-r25__header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, .98);
}

.mv-r25__header h2 {
  margin: 3px 0 6px;
  color: #172554;
  font-size: clamp(1.22rem, 2vw, 1.7rem);
  line-height: 1.2;
}

.mv-r25__header p {
  max-width: 850px;
  margin: 0;
  color: #475569;
  font-size: .88rem;
  line-height: 1.45;
}

.mv-r25__close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}

.mv-r25__close[hidden] {
  display: none;
}

.mv-r25__message {
  margin: 14px 20px 0;
  padding: 11px 13px;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.4;
}

.mv-r25__message[data-kind="success"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.mv-r25__message[data-kind="error"] {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.mv-r25__message[data-kind="warning"] {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.mv-r25__alert,
.mv-r25__unknown,
.mv-r25__current-instruction {
  margin: 10px 20px 0;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: .82rem;
  line-height: 1.45;
}

.mv-r25__alert {
  border: 2px solid #dc2626;
  background: #fef2f2;
  color: #7f1d1d;
}

.mv-r25__alert strong,
.mv-r25__alert span {
  display: block;
}

.mv-r25__alert strong + span,
.mv-r25__alert span + span {
  margin-top: 4px;
}

.mv-r25__unknown {
  border: 2px solid #d97706;
  background: #fffbeb;
  color: #78350f;
}

.mv-r25__unknown strong,
.mv-r25__unknown span {
  display: block;
}

.mv-r25__unknown span {
  margin-top: 4px;
}

.mv-r25__unknown .btn {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  min-height: 42px;
  margin-top: 10px;
  overflow: visible;
  white-space: normal;
}

.mv-r25__current-instruction {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 750;
}

.mv-r25__alert[hidden],
.mv-r25__unknown[hidden],
.mv-r25__current-instruction[hidden],
.mv-r25__blocked[hidden],
.mv-r25__stage-body[hidden],
.mv-r25__receipt[hidden],
.mv-r25__validation-details[hidden],
.mv-r25__rollback[hidden] {
  display: none !important;
}

.mv-r25__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 20px;
}

.mv-r25__toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.mv-r25__identity {
  min-width: 0;
}

.mv-r25__identity span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mv-r25__identity strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: .92rem;
}

.mv-r25__progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 20px 14px;
  padding: 0;
  list-style: none;
}

.mv-r25__progress li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "number title" "number status";
  align-items: center;
  gap: 1px 8px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.mv-r25__progress li > span {
  grid-area: number;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 900;
}

.mv-r25__progress li > strong {
  grid-area: title;
  color: #1e293b;
  font-size: .78rem;
  line-height: 1.2;
}

.mv-r25__progress li > em {
  grid-area: status;
  color: #64748b;
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
}

.mv-r25__progress li[data-status="PASSED"] {
  border-color: #22c55e;
  background: #f0fdf4;
}

.mv-r25__progress li[data-status="PASSED"] > span {
  background: #166534;
  color: #fff;
}

.mv-r25__progress li[data-status="FAILED"],
.mv-r25__progress li[data-status^="FAILED"] {
  border-color: #ef4444;
  background: #fef2f2;
}

.mv-r25__progress li[data-status="FAILED"] > span,
.mv-r25__progress li[data-status^="FAILED"] > span {
  background: #991b1b;
  color: #fff;
}

.mv-r25__progress li[data-status="BLOCKED"],
.mv-r25__progress li[data-status^="BLOCKED"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.mv-r25__progress li[data-status="BLOCKED"] > span,
.mv-r25__progress li[data-status^="BLOCKED"] > span {
  background: #cbd5e1;
  color: #475569;
}

.mv-r25__progress li[data-status="CURRENT"],
.mv-r25__progress li[aria-current="step"] {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}

.mv-r25__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 20px 14px;
}

.mv-r25__fact {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #fff;
}

.mv-r25__fact span {
  display: block;
  color: #64748b;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.mv-r25__fact strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #172033;
  font-size: .8rem;
  line-height: 1.3;
}

.mv-r25__stages {
  display: grid;
  gap: 13px;
  padding: 0 20px 22px;
}

.mv-r25__stage {
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #94a3b8;
  border-radius: 10px;
  background: #fff;
}

.mv-r25__stage[data-status="PASSED"] {
  border-left-color: #16a34a;
}

.mv-r25__stage[data-status="FAILED"],
.mv-r25__stage[data-status^="FAILED"] {
  border-left-color: #dc2626;
}

.mv-r25__stage[data-status="BLOCKED"],
.mv-r25__stage[data-status^="BLOCKED"] {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.mv-r25__stage[aria-current="step"] {
  border-left-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .1);
}

.mv-r25__stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mv-r25__stage-head span {
  display: block;
  color: #2563eb;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mv-r25__stage-head h3 {
  margin: 2px 0 0;
  color: #172554;
  font-size: 1.03rem;
}

.mv-r25__stage-head > strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .7rem;
}

.mv-r25__stage[data-status="PASSED"] .mv-r25__stage-head > strong {
  background: #dcfce7;
  color: #166534;
}

.mv-r25__stage[data-status="FAILED"] .mv-r25__stage-head > strong,
.mv-r25__stage[data-status^="FAILED"] .mv-r25__stage-head > strong {
  background: #fee2e2;
  color: #991b1b;
}

.mv-r25__stage > p,
.mv-r25__help {
  margin: 6px 0 10px;
  color: #475569;
  font-size: .82rem;
  line-height: 1.45;
}

.mv-r25__receipt {
  margin: 9px 0;
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.4;
}

.mv-r25__receipt[data-status="FAILED"],
.mv-r25__receipt[data-status^="FAILED"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.mv-r25__receipt[data-status="NOT COMPLETED"] {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.mv-r25__stage-body {
  margin-top: 9px;
}

.mv-r25__stage-body > p {
  margin: 0 0 10px;
  color: #475569;
  font-size: .82rem;
  line-height: 1.48;
}

.mv-r25__blocked {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.4;
}

.mv-r25__acknowledgements {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mv-r25__acknowledgements label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.4;
}

.mv-r25__acknowledgements input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.mv-r25__actions,
.mv-r25__inline-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.mv-r25__actions .btn,
.mv-r25__toolbar-actions .btn,
.mv-r25-launcher .btn {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  word-break: normal;
  overflow: visible;
  overflow-wrap: normal;
  text-overflow: clip;
  line-height: 1.3;
}

.mv-r25__btn--primary,
.mv-r25__btn--confirm {
  border-color: #1d4ed8 !important;
  background: #1d4ed8 !important;
  color: #fff !important;
}

.mv-r25__btn--authorize {
  border-color: #6d28d9 !important;
  background: #6d28d9 !important;
  color: #fff !important;
}

.mv-r25__btn--utility {
  border-color: #475569 !important;
  background: #475569 !important;
  color: #fff !important;
}

.mv-r25__btn--confirm {
  background: #166534 !important;
  border-color: #166534 !important;
}

.mv-r25 .btn:disabled,
.mv-r25 .btn[aria-disabled="true"] {
  cursor: not-allowed !important;
  filter: grayscale(.45);
  opacity: .55;
}

.mv-r25__instructions {
  display: grid;
  gap: 9px;
  margin: 9px 0;
  padding-left: 25px;
}

.mv-r25__instructions li {
  padding-left: 3px;
  color: #334155;
  font-size: .82rem;
  line-height: 1.48;
}

.mv-r25__instructions li > strong {
  color: #172554;
}

.mv-r25 code {
  padding: 1px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: .78rem;
}

.mv-r25__stop {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: .79rem;
  line-height: 1.4;
}

.mv-r25__validation-details,
.mv-r25__rollback {
  margin-top: 12px;
}

.mv-r25__validation-details {
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.mv-r25__validation-details > summary {
  min-height: 44px;
  padding: 11px 12px;
  color: #172554;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.35;
}

.mv-r25__validation-details > .mv-r25__check-list {
  padding: 0 12px 12px;
}

.mv-r25__decision {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #f8fafc;
}

.mv-r25__decision h4 {
  margin: 0 0 7px;
  color: #172554;
  font-size: .92rem;
}

.mv-r25__check-list {
  display: grid;
  gap: 8px;
}

.mv-r25__check {
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
}

.mv-r25__check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mv-r25__check-head strong {
  color: #1e293b;
  font-size: .79rem;
  line-height: 1.3;
}

.mv-r25__check-status {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .64rem;
  font-weight: 900;
}

.mv-r25__check[data-status="PASSED"] {
  border-color: #86efac;
}

.mv-r25__check[data-status="PASSED"] .mv-r25__check-status {
  background: #dcfce7;
  color: #166534;
}

.mv-r25__check[data-status="FAILED"],
.mv-r25__check[data-status^="FAILED"] {
  border-color: #fca5a5;
}

.mv-r25__check[data-status="FAILED"] .mv-r25__check-status,
.mv-r25__check[data-status^="FAILED"] .mv-r25__check-status {
  background: #fee2e2;
  color: #991b1b;
}

.mv-r25__check[data-status="BLOCKED"],
.mv-r25__check[data-status="NOT COMPLETED"] {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.mv-r25__check[data-status="NOT REQUIRED"] {
  border-color: #94a3b8;
  background: #f8fafc;
}

.mv-r25__check[data-status="NOT REQUIRED"] .mv-r25__check-status {
  background: #e2e8f0;
  color: #334155;
}

.mv-r25__check p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: .73rem;
  line-height: 1.4;
}

.mv-r25__check-corrective {
  color: #7c2d12 !important;
  font-weight: 800;
}

.mv-r25__empty {
  margin: 0;
  color: #64748b;
  font-size: .78rem;
}

.mv-r25__decision--confirm {
  border-color: #86efac;
  background: #f0fdf4;
}

.mv-r25__decision--rollback {
  border-color: #fca5a5;
  background: #fef2f2;
}

.mv-r25__decision p,
.mv-r25__decision li {
  color: #475569;
  font-size: .78rem;
  line-height: 1.45;
}

.mv-r25__decision ol {
  margin: 7px 0;
  padding-left: 20px;
}

.mv-r25__rollback {
  padding: 12px;
  border: 2px solid #fca5a5;
  border-radius: 9px;
  background: #fef2f2;
}

.mv-r25__rollback h4 {
  margin: 0 0 7px;
  color: #7f1d1d;
  font-size: .92rem;
}

.mv-r25__rollback p,
.mv-r25__rollback li {
  color: #7f1d1d;
  font-size: .78rem;
  line-height: 1.45;
}

.mv-r25__rollback ol {
  margin: 7px 0;
  padding-left: 20px;
}

@media (max-width: 860px) {
  .mv-r25-launcher,
  .mv-r25__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mv-r25__toolbar-actions {
    width: 100%;
  }

  .mv-r25__progress,
  .mv-r25__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mv-r25-overlay {
    padding: 0;
  }

  .mv-r25 {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .mv-r25__header,
  .mv-r25__stages {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mv-r25__message,
  .mv-r25__alert,
  .mv-r25__unknown,
  .mv-r25__current-instruction,
  .mv-r25__toolbar,
  .mv-r25__progress,
  .mv-r25__facts {
    margin-right: 12px;
    margin-left: 12px;
  }

  .mv-r25__progress,
  .mv-r25__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .mv-r25__stage-head,
  .mv-r25__check-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mv-r25 .btn,
  .mv-r25-launcher .btn {
    width: 100%;
    min-height: 44px;
    max-width: none;
  }
}

.initial-platform-setup-overlay[hidden],
.initial-platform-setup-overlay [hidden]{
  display:none !important;
}

.initial-platform-setup-overlay{
  position:fixed;
  inset:0;
  z-index:9000;
  width:100vw;
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:clamp(12px, 3vw, 30px);
  padding-top:max(clamp(12px, 3vw, 30px), env(safe-area-inset-top));
  padding-right:max(clamp(12px, 3vw, 30px), env(safe-area-inset-right));
  padding-bottom:max(clamp(12px, 3vw, 30px), env(safe-area-inset-bottom));
  padding-left:max(clamp(12px, 3vw, 30px), env(safe-area-inset-left));
  background:
    radial-gradient(circle at top, rgba(234,179,8,.12), transparent 34rem),
    var(--bg, #f5f6f8);
}

.initial-platform-setup-card{
  width:min(100%, 780px);
  margin:auto;
  padding:clamp(18px, 4vw, 34px);
  border:1px solid var(--border);
  border-top:7px solid var(--gold-text);
  border-radius:14px;
  background:var(--card, #fff);
  box-shadow:0 22px 60px rgba(15,23,42,.20);
}

.initial-platform-setup-header{
  margin:0 0 18px;
  text-align:left;
}

.initial-platform-setup-kicker{
  margin-bottom:5px;
  color:var(--gold-text);
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.initial-platform-setup-header h1{
  margin:0;
  color:var(--primary);
  font-size:clamp(1.45rem, 4vw, 2rem);
  line-height:1.18;
}

.initial-platform-setup-header p{
  margin:9px 0 0;
  color:var(--muted);
  line-height:1.5;
}

.initial-platform-setup-system-status,
.initial-platform-setup-form-status{
  margin:0 0 16px;
  padding:11px 13px;
  border:1px solid #bfdbfe;
  border-radius:8px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:.9rem;
  font-weight:800;
  line-height:1.4;
  overflow-wrap:anywhere;
}

.initial-platform-setup-system-status[data-tone="error"],
.initial-platform-setup-form-status[data-tone="error"]{
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.initial-platform-setup-system-status[data-tone="success"],
.initial-platform-setup-form-status[data-tone="success"]{
  border-color:#a7f3d0;
  background:#ecfdf5;
  color:#065f46;
}

.initial-platform-setup-identity{
  margin:0 0 18px;
  padding:15px;
  border:1px solid rgba(180,83,9,.28);
  border-radius:10px;
  background:#fffaf0;
}

.initial-platform-setup-identity h2,
#initialPlatformSetupForm h2,
.initial-platform-setup-blocked h2{
  margin:0 0 11px;
  color:var(--primary);
  font-size:1.08rem;
  line-height:1.3;
}

.initial-platform-setup-identity dl{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin:0;
}

.initial-platform-setup-identity dl > div{
  min-width:0;
  padding:10px;
  border:1px solid rgba(180,83,9,.20);
  border-radius:7px;
  background:#fff;
}

.initial-platform-setup-identity dt,
.initial-platform-setup-auth-row span{
  display:block;
  margin-bottom:3px;
  color:var(--muted);
  font-size:.75rem;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
}

.initial-platform-setup-identity dd{
  margin:0;
  color:var(--primary);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.88rem;
  font-weight:850;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.initial-platform-setup-identity p{
  margin:10px 0 0;
  color:var(--muted);
  font-size:.84rem;
  line-height:1.4;
}

.initial-platform-setup-auth-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin:0 0 18px;
}

.initial-platform-setup-auth-row > div{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f9fafb;
}

.initial-platform-setup-auth-row strong{
  color:var(--primary);
  font-size:.9rem;
  overflow-wrap:anywhere;
}

.initial-platform-setup-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  column-gap:14px;
  row-gap:2px;
}

.initial-platform-setup-field--full{
  grid-column:1 / -1;
}

.initial-platform-setup-field label{
  display:block;
  margin-bottom:5px;
  color:var(--primary);
  font-size:.88rem;
  font-weight:850;
}

.initial-platform-setup-field input{
  width:100%;
  min-height:44px;
  padding:10px 11px;
  border:1px solid #cbd5e1;
  border-radius:7px;
  background:#fff;
  color:var(--primary);
  font-size:1rem;
}

.initial-platform-setup-field input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.16);
  outline:none;
}

.initial-platform-setup-field input[aria-invalid="true"]{
  border-color:var(--danger) !important;
  box-shadow:0 0 0 3px rgba(239,68,68,.14);
}

.initial-platform-setup-field input:disabled{
  background:#f3f4f6;
  color:#6b7280;
  cursor:not-allowed;
}

.initial-platform-setup-hint{
  margin-top:5px;
  color:var(--muted);
  font-size:.8rem;
  line-height:1.35;
}

.initial-platform-setup-policy{
  margin:8px 0 17px;
  padding:12px 14px;
  border:1px solid #dbeafe;
  border-radius:9px;
  background:#f8fbff;
  color:#334155;
  font-size:.85rem;
  line-height:1.42;
}

.initial-platform-setup-policy > strong{
  color:var(--primary);
}

.initial-platform-setup-policy ul{
  margin:7px 0;
  padding-left:20px;
}

.initial-platform-setup-policy p{
  margin:7px 0 0;
  color:var(--muted);
  font-weight:750;
}

.initial-platform-setup-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.initial-platform-setup-actions .btn{
  min-height:44px;
  min-width:190px;
}

.initial-platform-setup-actions .btn[aria-busy="true"],
.initial-platform-setup-blocked .btn[aria-busy="true"]{
  cursor:wait;
}

.initial-platform-setup-actions .btn[aria-busy="true"]::before,
.initial-platform-setup-blocked .btn[aria-busy="true"]::before{
  content:"";
  display:inline-block;
  width:.85em;
  height:.85em;
  margin-right:7px;
  border:2px solid currentColor;
  border-right-color:transparent;
  border-radius:50%;
  vertical-align:-.08em;
  animation:mv-initial-setup-spin .7s linear infinite;
}

@keyframes mv-initial-setup-spin{
  to{ transform:rotate(360deg); }
}

.initial-platform-setup-blocked{
  padding:16px;
  border:1px solid #fecaca;
  border-left:6px solid var(--danger);
  border-radius:9px;
  background:#fef2f2;
  color:#7f1d1d;
}

.initial-platform-setup-blocked p{
  margin:8px 0;
  line-height:1.45;
}

.initial-platform-setup-blocked .btn{
  min-height:44px;
  margin-top:6px;
}

.initial-platform-setup-safety-note{
  margin:18px 0 0;
  padding-top:14px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
  line-height:1.4;
  text-align:center;
}

@media (max-width:640px){
  .initial-platform-setup-overlay{
    padding:0;
    padding-top:env(safe-area-inset-top);
    padding-right:env(safe-area-inset-right);
    padding-bottom:env(safe-area-inset-bottom);
    padding-left:env(safe-area-inset-left);
    background:var(--card, #fff);
  }

  .initial-platform-setup-card{
    width:100%;
    min-height:100vh;
    min-height:100dvh;
    margin:0;
    padding:18px 14px 24px;
    border-right:0;
    border-bottom:0;
    border-left:0;
    border-radius:0;
    box-shadow:none;
  }

  .initial-platform-setup-identity dl,
  .initial-platform-setup-auth-row,
  .initial-platform-setup-grid{
    grid-template-columns:1fr;
  }

  .initial-platform-setup-field--full{
    grid-column:auto;
  }

  .initial-platform-setup-actions{
    flex-direction:column-reverse;
  }

  .initial-platform-setup-actions .btn,
  .initial-platform-setup-blocked .btn{
    width:100%;
    min-width:0;
  }
}

@media (prefers-reduced-motion:reduce){
  .initial-platform-setup-actions .btn[aria-busy="true"]::before,
  .initial-platform-setup-blocked .btn[aria-busy="true"]::before{
    animation:none;
  }
}

/* Phase 4.7.DR.4.R2.4.C2.R1.C2 — In-step navigation, receipts, and lock visibility */
.mv-r24{
  --mv-r24-ink:#172033;
  --mv-r24-muted:#5f6b7a;
  --mv-r24-line:#d8dee8;
  --mv-r24-soft:#f7f9fc;
  --mv-r24-pass:#087443;
  --mv-r24-pass-bg:#ecfdf3;
  --mv-r24-fail:#b42318;
  --mv-r24-fail-bg:#fff1f0;
  --mv-r24-blocked:#8a4b08;
  --mv-r24-blocked-bg:#fff8e8;
  --mv-r24-primary:#0f4c81;
  --mv-r24-focus:#2563eb;
  color:var(--mv-r24-ink);
}
.mv-r24__title{margin:0 0 10px;font-size:1.05rem;line-height:1.3;}
.mv-r24__protection{margin-bottom:14px;padding:11px 13px;border:1px solid #f4c56a;border-left:5px solid #e79a12;border-radius:9px;background:#fffbeb;color:#713b0b;font-size:.82rem;font-weight:750;line-height:1.45;}
.mv-r24__next{margin:12px 0;padding:13px 14px;border:2px solid #2563eb;border-left-width:6px;border-radius:10px;background:#eff6ff;box-shadow:0 5px 16px rgba(37,99,235,.12);}
.mv-r24__next h4{margin:3px 0 5px;color:#123d67;font-size:.98rem;line-height:1.3;}
.mv-r24__next p{margin:0;color:#344054;font-size:.82rem;line-height:1.45;}
.mv-r24__next-facts{display:flex;flex-wrap:wrap;gap:7px 16px;margin-top:9px;color:#475467;font-size:.76rem;}
.mv-r24__next-facts strong{color:#172033;}
.mv-r24__next-button{min-height:44px;margin-top:11px;}
.mv-r24__next-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px;}
.mv-r24__next-controls:empty{display:none;}
.mv-r24__inline-action{margin:12px 0 14px;}
.mv-r24__toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:12px;border:1px solid var(--mv-r24-line);border-radius:9px;background:var(--mv-r24-soft);}
.mv-r24__toolbar-actions,.mv-r24__actions{display:flex;flex-wrap:wrap;gap:8px;}
.mv-r24__toolbar-actions .btn,.mv-r24__actions .btn{min-height:44px;}
.mv-r24 .btn{border:2px solid var(--mv-r24-primary);background:var(--mv-r24-primary);color:#fff;-webkit-text-fill-color:#fff;}
.mv-r24 .mv-r24__btn--primary{border-color:#0f4c81;background:#0f4c81;color:#fff;}
.mv-r24 .mv-r24__btn--authorize{border-color:#b45309;background:#b45309;color:#fff;}
.mv-r24 .mv-r24__btn--execute{border-color:#5b21b6;background:#5b21b6;color:#fff;}
.mv-r24 .mv-r24__btn--utility{border-color:#64748b;background:#dbeafe;color:#172033;-webkit-text-fill-color:#172033;}
.mv-r24 .mv-r24__btn--download{border-color:#087443;background:#087443;color:#fff;}
.mv-r24 .mv-r24__btn--print{border-color:#64748b;background:#f8fafc;color:#334155;-webkit-text-fill-color:#334155;}
.mv-r24 .mv-r24__return-current{width:100%;margin-top:8px;border-color:#115e59;background:#0f766e;color:#fff;}
.mv-r24 .btn[hidden],.mv-r24__actions[hidden]{display:none!important;}
.mv-r24 .btn:focus-visible,.mv-r24 input:focus-visible,.mv-r24 select:focus-visible,.mv-r24 summary:focus-visible{outline:3px solid var(--mv-r24-focus);outline-offset:2px;}
.mv-r24 .is-required-control:not(:disabled):not([aria-disabled="true"]){box-shadow:0 0 0 3px rgba(37,99,235,.22);}
.mv-r24__eyebrow,.mv-r24__step-number{color:var(--mv-r24-muted);font-size:.7rem;font-weight:850;letter-spacing:.065em;line-height:1.2;text-transform:uppercase;}
.mv-r24__identity{margin-top:3px;overflow-wrap:anywhere;font-size:.82rem;font-weight:750;}
.mv-r24__facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:8px;}
.mv-r24__facts>div{display:flex;min-width:0;flex-direction:column;gap:3px;padding:10px 11px;border:1px solid var(--mv-r24-line);border-radius:8px;background:#fff;}
.mv-r24__facts span{color:var(--mv-r24-muted);font-size:.7rem;font-weight:800;letter-spacing:.035em;text-transform:uppercase;}
.mv-r24__facts strong{overflow-wrap:anywhere;font-size:.82rem;}
.mv-r24__lifecycle{margin:8px 0 14px;color:var(--mv-r24-muted);font-size:.78rem;line-height:1.4;}
.mv-r24__steps{display:grid;grid-template-columns:1fr;gap:10px;margin:0;padding:0;list-style:none;counter-reset:none;}
.mv-r24__step{position:relative;min-width:0;padding:12px;border:1px solid var(--mv-r24-line);border-left:5px solid #98a2b3;border-radius:9px;background:#fff;}
.mv-r24__step.is-current{border-color:#2563eb;border-left-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.15);}
.mv-r24__step.is-current::before{content:"NEXT ACTION";position:absolute;top:-9px;left:12px;padding:2px 7px;border-radius:999px;background:#2563eb;color:#fff;font-size:.65rem;font-weight:900;letter-spacing:.055em;}
.mv-r24__step[data-status="PASS"]{border-left-color:var(--mv-r24-pass);background:linear-gradient(90deg,var(--mv-r24-pass-bg),#fff 28%);}
.mv-r24__step[data-status="FAIL"]{border-left-color:var(--mv-r24-fail);background:linear-gradient(90deg,var(--mv-r24-fail-bg),#fff 28%);}
.mv-r24__step[data-status="BLOCKED"]{border-left-color:#d97706;background:linear-gradient(90deg,var(--mv-r24-blocked-bg),#fff 28%);}
.mv-r24__step.is-collapsed{padding-bottom:11px;}
.mv-r24__step-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.mv-r24__step-head h4{margin:2px 0 0;font-size:.93rem;line-height:1.3;}
.mv-r24__step-head h4:focus{outline:3px solid var(--mv-r24-focus);outline-offset:3px;border-radius:3px;}
.mv-r24__step-controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:7px;}
.mv-r24__step-body[hidden],
.mv-r24__step-receipt[hidden],
.mv-r24__step-blocked-reason[hidden],
.mv-r24__closeout-receipt[hidden]{display:none!important;}
.mv-r24__step-body>p{margin:8px 0 10px;color:var(--mv-r24-muted);font-size:.8rem;line-height:1.42;}
.mv-r24__step-toggle{
  min-height:36px;
  padding:6px 10px;
  border:2px solid #0f4c81;
  border-radius:7px;
  background:#fff;
  color:#123d67;
  font:inherit;
  font-size:.74rem;
  font-weight:850;
  line-height:1.2;
  cursor:pointer;
}
.mv-r24__step-toggle:hover{background:#eff6ff;}
.mv-r24__step-toggle:focus-visible{outline:3px solid var(--mv-r24-focus);outline-offset:2px;}
.mv-r24__step-receipt{
  display:grid;
  grid-template-columns:1fr;
  gap:5px;
  margin-top:9px;
  padding:9px 10px;
  border:1px solid #98a2b3;
  border-radius:7px;
  background:#f8fafc;
  color:#344054;
  font-size:.76rem;
  font-weight:750;
  line-height:1.4;
}
.mv-r24__step-receipt--pass{border-color:#75c9a1;background:var(--mv-r24-pass-bg);color:#065f3b;}
.mv-r24__step-receipt--fail{border-color:#f1a6a0;background:var(--mv-r24-fail-bg);color:#912018;}
.mv-r24__step-receipt--progress{border-color:#93b4df;background:#eff6ff;color:#24436f;}
.mv-r24__step-receipt>div{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.mv-r24__step-receipt>div span{font-weight:750;}
.mv-r24__step-receipt>div strong{text-align:right;overflow-wrap:anywhere;}
.mv-r24__step-receipt .is-pass{color:#065f3b;}
.mv-r24__step-receipt .is-pending{color:#92400e;}
.mv-r24__step-blocked-reason{
  margin-top:9px;
  padding:8px 10px;
  border:1px solid #f2c267;
  border-radius:7px;
  background:var(--mv-r24-blocked-bg);
  color:#713b0b;
  font-size:.76rem;
  font-weight:750;
  line-height:1.4;
}
.mv-r24__guidance{margin:8px 0 10px;padding:8px 10px;border:1px solid #d9e3f1;border-radius:8px;background:#f8fbff;color:#344054;}
.mv-r24__guidance summary{cursor:pointer;color:#223b63;font-size:.8rem;font-weight:850;}
.mv-r24__guidance[open] summary{margin-bottom:7px;}
.mv-r24__guidance p{margin:0;font-size:.82rem;line-height:1.45;}
.mv-r24__guidance p+p{margin-top:5px;}
.mv-r24__guidance strong{color:#223b63;}
.mv-r24__status{align-self:flex-start;flex:0 0 auto;padding:4px 8px;border:1px solid #c8ced8;border-radius:999px;background:#f2f4f7;color:#475467;font-size:.75rem;font-weight:900;letter-spacing:.04em;line-height:1.2;white-space:nowrap;}
.mv-r24__step[data-status="PASS"] .mv-r24__status{border-color:#75c9a1;background:var(--mv-r24-pass-bg);color:var(--mv-r24-pass);}
.mv-r24__step[data-status="FAIL"] .mv-r24__status{border-color:#f1a6a0;background:var(--mv-r24-fail-bg);color:var(--mv-r24-fail);}
.mv-r24__step[data-status="BLOCKED"] .mv-r24__status{border-color:#f2c267;background:var(--mv-r24-blocked-bg);color:var(--mv-r24-blocked);}
.mv-r24__success{margin:8px 0 10px;padding:8px 10px;border-radius:7px;background:var(--mv-r24-pass-bg);color:var(--mv-r24-pass);font-size:.76rem;font-weight:900;line-height:1.35;}
.mv-r24__file-field{margin:10px 0 0;}
.mv-r24__file-field input[type="file"]{min-height:44px;padding:7px;border:1px solid #667085;border-radius:7px;background:#fff;}
.mv-r24__file-field input[type="file"]::file-selector-button{min-height:36px;margin-right:9px;padding:7px 11px;border:1px solid #0f4c81;border-radius:6px;background:#0f4c81;color:#fff;font:inherit;font-weight:800;cursor:pointer;}
.mv-r24__file-field input[type="file"]:disabled::file-selector-button{border-color:#667085;background:#e4e7ec;color:#475467;cursor:not-allowed;}
.mv-r24__history-field{margin:10px 0;padding:10px;border:1px solid var(--mv-r24-line);border-radius:8px;background:var(--mv-r24-soft);}
.mv-r24__history-field label{display:block;margin-bottom:5px;font-size:.76rem;font-weight:800;}
.mv-r24__history-field select{width:100%;max-width:100%;min-width:0;min-height:44px;padding:7px;border:1px solid #667085;border-radius:7px;background:#fff;color:var(--mv-r24-ink);}
.mv-r24__dashboard-check{display:flex;align-items:flex-start;gap:9px;margin:10px 0;padding:10px;border:1px solid #bfd1ee;border-radius:8px;background:#f2f7ff;color:#24436f;font-size:.78rem;font-weight:700;line-height:1.4;}
.mv-r24__dashboard-check[hidden],.mv-r24__file-field[hidden]{display:none!important;}
.mv-r24__dashboard-check input{width:20px;height:20px;flex:0 0 auto;margin-top:1px;accent-color:#0f4c81;}
.mv-r24__candidate-disposition{margin:10px 0;padding:12px;border:2px solid #0f766e;border-radius:9px;background:#f0fdfa;color:#134e4a;}
.mv-r24__candidate-disposition[hidden]{display:none!important;}
.mv-r24__candidate-disposition h5{margin:0 0 7px;color:#115e59;font-size:.88rem;}
.mv-r24__candidate-disposition ol{margin:0 0 10px;padding-left:22px;font-size:.78rem;line-height:1.48;}
.mv-r24__candidate-disposition li+li{margin-top:6px;}
.mv-r24__candidate-sequence{margin:12px 0;padding:12px;border:1px solid #0f766e;border-left-width:5px;border-radius:9px;background:#f0fdfa;color:#134e4a;}
.mv-r24__candidate-sequence h4{margin:0 0 7px;color:#115e59;font-size:.9rem;}
.mv-r24__candidate-sequence ol{margin:0;padding-left:22px;font-size:.79rem;line-height:1.48;}
.mv-r24__candidate-sequence li+li{margin-top:5px;}
.mv-r24__candidate-sequence p{margin:8px 0 0;font-size:.76rem;font-weight:700;}
.mv-r24__file-summary,.mv-r24__stage{margin-top:6px;overflow-wrap:anywhere;color:var(--mv-r24-muted);font-size:.76rem;line-height:1.4;}
.mv-r24__stage:not(:empty){padding:8px 10px;border:1px solid #bfd1ee;border-radius:7px;background:#f2f7ff;color:#24436f;font-weight:750;}
.mv-r24 .btn:disabled,.mv-r24 .btn[aria-disabled="true"]{border:1px solid #667085!important;background:#e4e7ec!important;box-shadow:none!important;color:#475467!important;-webkit-text-fill-color:#475467!important;cursor:not-allowed;opacity:1;}
.mv-r24__danger{border-color:#7f1d1d!important;background:#991b1b!important;color:#fff!important;-webkit-text-fill-color:#fff!important;}
.mv-r24__target-evidence{margin-top:12px;padding:12px;border:1px solid #bfd1ee;border-radius:9px;background:#f5f9ff;}
.mv-r24__target-evidence[hidden]{display:none!important;}
.mv-r24__inspection{margin-top:12px;padding:12px;border:1px solid var(--mv-r24-line);border-radius:9px;background:var(--mv-r24-soft);}
.mv-r24__inspection[hidden]{display:none!important;}
.mv-r24__inspection-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:9px;border-bottom:1px solid var(--mv-r24-line);}
.mv-r24__inspection-head h5{margin:2px 0 0;font-size:.88rem;}
.mv-r24__inspection-head>strong{font-size:.78rem;}
.mv-r24__inspection-body{margin-top:10px;}
.mv-r24__member-section{margin-top:12px;}
.mv-r24__member-section h5,.mv-r24__inspection-findings h5{margin:0 0 7px;font-size:.8rem;}
.mv-r24__member-table-wrap{max-width:100%;overflow-x:auto;}
.mv-r24__member-table{width:100%;min-width:980px;border-collapse:collapse;background:#fff;}
.mv-r24__member-table th,.mv-r24__member-table td{padding:7px 8px;border:1px solid var(--mv-r24-line);text-align:left;vertical-align:top;overflow-wrap:anywhere;font-size:.72rem;line-height:1.35;}
.mv-r24__member-table th{background:#edf2f8;font-weight:850;}
.mv-r24__member-table code,.mv-r24__mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all;}
.mv-r24__member-table td>div{margin-top:3px;color:var(--mv-r24-muted);font-size:.68rem;}
.mv-r24__inspection-findings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;}
.mv-r24__inspection-findings>section{min-width:0;padding:10px;border:1px solid var(--mv-r24-line);border-radius:8px;background:#fff;}
.mv-r24__inspection-findings ul{margin:0;padding-left:20px;overflow-wrap:anywhere;font-size:.75rem;line-height:1.45;}
.mv-r24__finding{margin-bottom:8px;}
.mv-r24__finding-grid{display:grid;grid-template-columns:minmax(115px,.55fr) minmax(0,1.45fr);margin:4px 0 0;border-top:1px solid var(--mv-r24-line);border-left:1px solid var(--mv-r24-line);}
.mv-r24__finding-grid dt,.mv-r24__finding-grid dd{min-width:0;margin:0;padding:6px 7px;border-right:1px solid var(--mv-r24-line);border-bottom:1px solid var(--mv-r24-line);overflow-wrap:anywhere;font-size:.7rem;line-height:1.35;}
.mv-r24__finding-grid dt{background:#f3f5f8;font-weight:800;}
.mv-r24__report{margin-top:14px;padding:14px;border:2px solid #aeb9c8;border-radius:10px;background:#fff;}
.mv-r24__report[hidden],.mv-r24__message[hidden],.mv-r24__stage[hidden]{display:none!important;}
.mv-r24__report-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--mv-r24-line);}
.mv-r24__report-head h4{margin:2px 0 0;font-size:1rem;}
.mv-r24__report-head>strong{font-size:.82rem;}
.mv-r24__report-body>section{margin-top:12px;}
.mv-r24__report-body h5,.mv-r24__report-findings h5{margin:0 0 7px;font-size:.82rem;}
.mv-r24__report-grid{display:grid;grid-template-columns:minmax(145px,.8fr) minmax(0,1.5fr);margin:10px 0 0;border-top:1px solid var(--mv-r24-line);border-left:1px solid var(--mv-r24-line);}
.mv-r24__report-grid dt,.mv-r24__report-grid dd{min-width:0;margin:0;padding:7px 8px;border-right:1px solid var(--mv-r24-line);border-bottom:1px solid var(--mv-r24-line);overflow-wrap:anywhere;font-size:.74rem;line-height:1.35;}
.mv-r24__report-grid dt{background:var(--mv-r24-soft);font-weight:800;}
.mv-r24__report-findings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;}
.mv-r24__report-findings section{min-width:0;padding:10px;border:1px solid var(--mv-r24-line);border-radius:8px;}
.mv-r24__report-findings ul,.mv-r24__report-body ul{margin:0;padding-left:20px;overflow-wrap:anywhere;font-size:.75rem;line-height:1.45;}
.mv-r24__report-actions{margin-top:12px;}
.mv-r24__closeout-receipt{
  margin-top:12px;
  padding:12px;
  border:2px solid #93b4df;
  border-radius:9px;
  background:#eff6ff;
}
.mv-r24__closeout-receipt--pass{border-color:#75c9a1;background:#f0fdf4;}
.mv-r24__closeout-receipt--fail{border-color:#f1a6a0;background:var(--mv-r24-fail-bg);}
.mv-r24__closeout-receipt h5{margin:0 0 8px;color:#24436f;font-size:.84rem;}
.mv-r24__closeout-receipt--pass h5{color:#065f3b;}
.mv-r24__closeout-receipt--fail h5{color:#912018;}
.mv-r24__closeout-receipt>div{display:grid;grid-template-columns:1fr;gap:0;border-top:1px solid #b8c5d8;}
.mv-r24__closeout-receipt>div>div{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(120px,.7fr);
  gap:12px;
  padding:7px 8px;
  border-right:1px solid #b8c5d8;
  border-bottom:1px solid #b8c5d8;
  border-left:1px solid #b8c5d8;
  background:#fff;
  font-size:.75rem;
  line-height:1.35;
}
.mv-r24__closeout-receipt span{font-weight:750;}
.mv-r24__closeout-receipt strong{text-align:right;overflow-wrap:anywhere;}
.mv-r24__closeout-receipt .is-pass{color:#065f3b;}
.mv-r24__closeout-receipt .is-pending{color:#92400e;}
.mv-r24__message{margin-top:12px;padding:10px 12px;border:1px solid #b8c5d8;border-radius:8px;background:#f5f8fc;color:#42526a;font-size:.8rem;line-height:1.4;white-space:pre-line;}
.mv-r24__message--success{border-color:#75c9a1;background:var(--mv-r24-pass-bg);color:var(--mv-r24-pass);}
.mv-r24__message--error{border-color:#f1a6a0;background:var(--mv-r24-fail-bg);color:var(--mv-r24-fail);}

@media (max-width:760px){
  .mv-r24__toolbar,.mv-r24__step-head,.mv-r24__report-head,.mv-r24__inspection-head{align-items:stretch;flex-direction:column;}
  .mv-r24__facts,.mv-r24__report-findings,.mv-r24__inspection-findings{grid-template-columns:1fr;}
  .mv-r24__step-controls{justify-content:flex-start;}
  .mv-r24__toolbar-actions .btn,.mv-r24__actions .btn{flex:1 1 190px;}
}
@media (max-width:520px){
  .mv-r24__toolbar-actions,.mv-r24__actions{flex-direction:column;}
  .mv-r24__toolbar-actions .btn,.mv-r24__actions .btn{width:100%;min-width:0;flex:0 0 auto;}
  .mv-r24__report-grid{grid-template-columns:1fr;}
  .mv-r24__report-grid dt{border-bottom:0;}
  .mv-r24__finding-grid{grid-template-columns:1fr;}
  .mv-r24__finding-grid dt{border-bottom:0;}
  .mv-r24__step-receipt>div,
  .mv-r24__closeout-receipt>div>div{grid-template-columns:1fr;gap:3px;}
  .mv-r24__step-receipt>div strong,
  .mv-r24__closeout-receipt strong{text-align:left;}
}
@media print{
  .mv-r24{color:#000!important;background:#fff!important;}
  .mv-r24__toolbar,.mv-r24__message,.mv-r24__protection,.mv-r24__next,.mv-r24__facts,.mv-r24__lifecycle{display:none!important;}
  .mv-r24__steps>.mv-r24__step{display:none!important;}
  .mv-r24__steps>#platformDrRestoreStep7{display:block!important;padding:0;border:0;background:#fff;box-shadow:none;}
  #platformDrRestoreStep7::before{display:none!important;}
  #platformDrRestoreStep7>.mv-r24__step-head,
  #platformDrRestoreStep7>.mv-r24__step-receipt,
  #platformDrRestoreStep7>.mv-r24__step-blocked-reason{display:none!important;}
  #platformDrRestoreStep7Body{display:block!important;}
  #platformDrRestoreStep7Body>:not(.mv-r24__report){display:none!important;}
  .mv-r24__report{display:block!important;margin:0;padding:0;border:0;color:#000;break-inside:avoid;}
  .mv-r24__report-body>section,.mv-r24__report-findings section,.mv-r24__report-grid{break-inside:avoid;}
}

/* ==========================================================
   Phase 4.7.DR.4.R3 — responsive On-Demand Restore and
   independent restored-database selection console.
   ========================================================== */
.mv-r3-launchers{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:12px 0;
}

.mv-r3-launcher{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-width:0;
  padding:16px;
  border:1px solid color-mix(in srgb,var(--border) 78%,#64748b);
  border-radius:14px;
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(248,250,252,.95));
  box-shadow:0 8px 24px rgba(15,23,42,.07);
}

.mv-r3-launcher>div{min-width:0;}
.mv-r3-launcher h4{margin:3px 0 5px;font-size:1.02rem;line-height:1.25;color:var(--primary);}
.mv-r3-launcher p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.45;}
.mv-r3-launcher code,.mv-r3 code{overflow-wrap:anywhere;}

.mv-r3__eyebrow{
  color:#7c3aed;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.09em;
  line-height:1.25;
  text-transform:uppercase;
}

.mv-r3-overlay,
.mv-r3-target-overlay{
  align-items:center;
  justify-content:center;
  padding:max(12px,env(safe-area-inset-top))
          max(12px,env(safe-area-inset-right))
          max(12px,env(safe-area-inset-bottom))
          max(12px,env(safe-area-inset-left));
  overflow:hidden;
}

.mv-r3{
  --mv-r3-pass:#067647;
  --mv-r3-pass-bg:#ecfdf3;
  --mv-r3-fail:#b42318;
  --mv-r3-fail-bg:#fef3f2;
  --mv-r3-warn:#92400e;
  --mv-r3-warn-bg:#fffbeb;
  --mv-r3-current:#4338ca;
  width:min(1180px,100%);
  max-width:1180px;
  height:min(900px,calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom))));
  max-height:calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:0;
  overflow:auto;
  overscroll-behavior:contain;
  color:var(--text);
  background:#f8fafc;
  border:1px solid var(--border);
}

.mv-r3__header{
  position:sticky;
  top:0;
  z-index:4;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
}

.mv-r3__header>div{min-width:0;}
.mv-r3__header h2{margin:2px 0 6px;color:var(--primary);font-size:clamp(1.25rem,2vw,1.7rem);line-height:1.2;}
.mv-r3__header p{max-width:900px;margin:0;color:var(--muted);font-size:.88rem;line-height:1.5;}

.mv-r3__close{
  flex:0 0 44px;
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--primary);
  font-size:1.35rem;
  font-weight:900;
  line-height:1;
  cursor:pointer;
}

.mv-r3__close:focus-visible,
.mv-r3__btn:focus-visible,
.mv-r3 input:focus-visible,
.mv-r3-target input:focus-visible,
.mv-r3 summary:focus-visible,
.mv-r3-report__table-scroll:focus-visible{
  outline:3px solid rgba(67,56,202,.32);
  outline-offset:2px;
}

.mv-r3__message,
.mv-r3__alert,
.mv-r3__instruction{
  margin:0 20px;
  padding:11px 13px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:.84rem;
  font-weight:700;
  line-height:1.45;
  white-space:pre-line;
}

.mv-r3__message[data-kind="success"]{border-color:#86efac;background:var(--mv-r3-pass-bg);color:var(--mv-r3-pass);}
.mv-r3__message[data-kind="error"],
.mv-r3__alert{border-color:#fca5a5;background:var(--mv-r3-fail-bg);color:var(--mv-r3-fail);}
.mv-r3__message[data-kind="warning"]{border-color:#fcd34d;background:var(--mv-r3-warn-bg);color:var(--mv-r3-warn);}

.mv-r3__toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 20px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}

.mv-r3__identity{display:grid;gap:3px;min-width:0;}
.mv-r3__identity span{font-size:.72rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;}
.mv-r3__identity strong{overflow-wrap:anywhere;font-size:.88rem;}
.mv-r3__toolbar-actions,.mv-r3__actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}

.mv-r3__btn{
  min-height:44px;
  padding:10px 14px;
  border-radius:10px;
  font-weight:850;
  line-height:1.2;
  touch-action:manipulation;
}
.mv-r3__btn--primary{border-color:#4338ca;background:#4338ca;color:#fff;}
.mv-r3__btn--secondary{border-color:#0369a1;background:#0369a1;color:#fff;}
.mv-r3__btn--utility{border-color:#94a3b8;background:#fff;color:#334155;}
.mv-r3__btn--danger{border-color:#b42318;background:#b42318;color:#fff;}
.mv-r3__btn[disabled]{opacity:.52;cursor:not-allowed;}

.mv-r3__progress{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 20px;
  padding:0;
  list-style:none;
}
.mv-r3__progress--three{grid-template-columns:repeat(3,minmax(0,1fr));}
.mv-r3__progress li{
  min-width:0;
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  grid-template-areas:"number title" "number status";
  align-items:center;
  gap:2px 9px;
  min-height:68px;
  padding:10px;
  border:1px solid #cbd5e1;
  border-radius:12px;
  background:#fff;
}
.mv-r3__progress li>span{
  grid-area:number;
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#e2e8f0;
  color:#334155;
  font-weight:900;
}
.mv-r3__progress li>strong{grid-area:title;min-width:0;font-size:.79rem;line-height:1.3;}
.mv-r3__progress li>em{grid-area:status;color:var(--muted);font-size:.66rem;font-style:normal;font-weight:900;letter-spacing:.04em;}
.mv-r3__progress li[data-status="CURRENT"]{border-color:#818cf8;background:#eef2ff;}
.mv-r3__progress li[data-status="CURRENT"]>span{background:var(--mv-r3-current);color:#fff;}
.mv-r3__progress li[data-status="PASS"]{border-color:#86efac;background:var(--mv-r3-pass-bg);}
.mv-r3__progress li[data-status="PASS"]>span{background:var(--mv-r3-pass);color:#fff;}
.mv-r3__progress li[data-status="FAIL"]{border-color:#fca5a5;background:var(--mv-r3-fail-bg);}
.mv-r3__progress li[data-status="FAIL"]>span{background:var(--mv-r3-fail);color:#fff;}

.mv-r3__facts{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0 20px;
}
.mv-r3__facts>div{
  min-width:0;
  display:grid;
  gap:3px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}
.mv-r3__facts span{color:var(--muted);font-size:.69rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em;}
.mv-r3__facts strong{overflow-wrap:anywhere;font-size:.83rem;line-height:1.35;}

.mv-r3__stages{display:grid;gap:12px;margin:0 20px 20px;}
.mv-r3__stage{
  min-width:0;
  overflow:hidden;
  border:1px solid #cbd5e1;
  border-radius:13px;
  background:#fff;
}
.mv-r3__stage[data-status="CURRENT"]{border-color:#818cf8;box-shadow:0 0 0 2px rgba(99,102,241,.08);}
.mv-r3__stage[data-status="PASS"]{border-color:#86efac;}
.mv-r3__stage[data-status="FAIL"]{border-color:#fca5a5;}
.mv-r3__stage-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid #e2e8f0;
  background:#f8fafc;
}
.mv-r3__stage-head>div{min-width:0;}
.mv-r3__stage-head span{display:block;color:var(--muted);font-size:.68rem;font-weight:900;text-transform:uppercase;letter-spacing:.05em;}
.mv-r3__stage-head h3{margin:2px 0 0;font-size:1rem;line-height:1.3;color:#1e293b;}
.mv-r3__stage-head>strong{font-size:.72rem;color:#475569;}
.mv-r3__stage-body{padding:14px;}
.mv-r3__stage-body>p{margin:0 0 12px;color:#475569;font-size:.84rem;line-height:1.5;}
.mv-r3__blocked{padding:12px 14px;color:#64748b;font-size:.82rem;font-weight:700;}
.mv-r3__instructions{margin:0 0 12px;padding-left:1.25rem;color:#334155;font-size:.84rem;line-height:1.55;}
.mv-r3__instructions li+li{margin-top:7px;}
.mv-r3__stop{padding:10px 12px;border-left:4px solid #dc2626;background:#fff7ed;color:#7c2d12;}

.mv-r3__file{display:grid;gap:7px;padding:13px;border:1px dashed #94a3b8;border-radius:11px;background:#f8fafc;}
.mv-r3__file>span{font-size:.82rem;font-weight:900;color:#334155;}
.mv-r3__file input{width:100%;min-height:44px;}
.mv-r3__file small{overflow-wrap:anywhere;color:var(--muted);line-height:1.4;}
.mv-r3__meter{display:grid;gap:7px;margin:12px 0;}
.mv-r3__meter-track{height:12px;overflow:hidden;border-radius:999px;background:#e2e8f0;}
.mv-r3__meter-track span{display:block;width:0;height:100%;background:#4338ca;transition:width .18s ease;}
.mv-r3__meter>strong{font-size:.76rem;color:#475569;}

.mv-r3__execution{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 12px;padding:0;list-style:none;}
.mv-r3__execution li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px;border:1px solid #e2e8f0;border-radius:9px;background:#f8fafc;font-size:.75rem;}
.mv-r3__execution li span{color:#64748b;font-size:.66rem;font-weight:900;}
.mv-r3__execution li[data-status="CURRENT"]{border-color:#818cf8;background:#eef2ff;}
.mv-r3__execution li[data-status="PASS"]{border-color:#86efac;background:var(--mv-r3-pass-bg);}

.mv-r3__outcome{
  display:grid;
  gap:13px;
  margin:0 20px max(20px,env(safe-area-inset-bottom));
  padding:16px;
  border:1px solid #86efac;
  border-radius:13px;
  background:var(--mv-r3-pass-bg);
}
.mv-r3__outcome h3{margin:3px 0 4px;font-size:1.1rem;color:#14532d;}
.mv-r3__outcome p{margin:0;color:#365341;font-size:.84rem;line-height:1.5;}

.mv-r3-target{
  width:min(520px,100%);
  max-width:520px;
  max-height:calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  overflow:auto;
  padding:18px;
  text-align:left;
}
.mv-r3-target__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.mv-r3-target__header h2{margin:3px 0 8px;color:var(--primary);font-size:1.25rem;line-height:1.25;}
.mv-r3-target>p{margin:0 0 14px;color:var(--muted);font-size:.84rem;line-height:1.5;}
.mv-r3-target__fields{display:grid;gap:10px;}
.mv-r3-target__fields .form-group{margin:0;}
.mv-r3-target__fields label{display:block;margin-bottom:5px;font-size:.8rem;font-weight:850;}
.mv-r3-target__fields input{width:100%;min-height:46px;}
.mv-r3-target__actions{margin-top:14px;}

.mv-r3__check{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc;}
.mv-r3__check input{flex:0 0 auto;width:22px;height:22px;margin:0;}
.mv-r3__check span{font-size:.82rem;line-height:1.45;}
.mv-r3__validation-details{margin-top:12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;}
.mv-r3__validation-details>summary{min-height:44px;padding:11px;cursor:pointer;font-size:.82rem;font-weight:900;}
.mv-r3__check-list{display:grid;gap:7px;padding:0 11px 11px;}
.mv-r3__check-list>div,.mv-r3-report__checks>li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:10px;border:1px solid #e2e8f0;border-radius:9px;background:#f8fafc;}
.mv-r3__check-list span,.mv-r3-report__checks span{font-size:.72rem;font-weight:900;}
.mv-r3__check-list p,.mv-r3-report__checks p{grid-column:1/-1;margin:0;color:#64748b;font-size:.76rem;line-height:1.4;}
.mv-r3__check-list [data-status="PASS"],.mv-r3-report__checks [data-status="PASS"]{border-color:#86efac;background:var(--mv-r3-pass-bg);}
.mv-r3__check-list [data-status="FAIL"],.mv-r3-report__checks [data-status="FAIL"]{border-color:#fca5a5;background:var(--mv-r3-fail-bg);}

.mv-r3-regression{
  display:grid;
  gap:12px;
  margin-top:12px;
  padding:14px;
  border:1px solid #cbd5e1;
  border-radius:11px;
  background:#f8fafc;
}
.mv-r3-regression[hidden]{display:none;}
.mv-r3-regression h4{margin:0;color:#1e293b;font-size:.95rem;}
.mv-r3-regression>p{margin:0;color:#475569;font-size:.8rem;line-height:1.5;}
.mv-r3-regression__list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.mv-r3-regression__row{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px 10px;
  padding:12px;
  border:1px solid #dbe3ee;
  border-radius:10px;
  background:#fff;
}
.mv-r3-regression__row>div{
  grid-column:1/-1;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.mv-r3-regression__row>div strong{min-width:0;overflow-wrap:anywhere;font-size:.82rem;line-height:1.35;}
.mv-r3-regression__row>div span{
  flex:0 0 auto;
  color:#64748b;
  font-size:.65rem;
  font-weight:900;
  letter-spacing:.04em;
  line-height:1.35;
}
.mv-r3-regression__row>label{grid-column:1/-1;color:#475569;font-size:.72rem;font-weight:850;}
.mv-r3-regression__row>select,
.mv-r3-regression__row>input{
  grid-column:1/-1;
  width:100%;
  min-width:0;
  min-height:44px;
}
.mv-r3-regression__row>input{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  font-size:.76rem;
}
.mv-r3-regression__row>button{grid-column:1/-1;justify-self:start;min-height:44px;}
.mv-r3-regression__row{transition:border-color .15s ease,background .15s ease;}
.mv-r3-regression__row[data-status="PASS"]{border-color:#86efac;background:var(--mv-r3-pass-bg);}
.mv-r3-regression__row[data-status="FAIL"]{border-color:#fca5a5;background:var(--mv-r3-fail-bg);}

.mv-r3-report{padding:14px;border:1px solid #bbf7d0;border-radius:11px;background:#fff;}
.mv-r3-report h4,.mv-r3-report h5{margin:0 0 10px;color:#1e293b;}
.mv-r3-report__definitions{display:grid;grid-template-columns:minmax(150px,.45fr) minmax(0,1fr);margin:0 0 14px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;}
.mv-r3-report__definitions dt,.mv-r3-report__definitions dd{margin:0;padding:9px;border-bottom:1px solid #e2e8f0;font-size:.78rem;overflow-wrap:anywhere;}
.mv-r3-report__definitions dt{background:#f8fafc;font-weight:900;}
.mv-r3-report__definitions dt:last-of-type,.mv-r3-report__definitions dd:last-of-type{border-bottom:0;}
.mv-r3-report__checks{display:grid;gap:7px;margin:0;padding:0;list-style:none;}
.mv-r3-report__table-scroll{max-width:100%;overflow:auto;border:1px solid #cbd5e1;border-radius:9px;}
.mv-r3-report__table-scroll table{width:100%;min-width:640px;border-collapse:collapse;font-size:.76rem;}
.mv-r3-report__table-scroll th,.mv-r3-report__table-scroll td{padding:8px;border:1px solid #e2e8f0;text-align:left;vertical-align:top;}

@media (min-width:1024px) and (pointer:fine){
  .mv-r3__progress{grid-template-columns:repeat(4,minmax(0,1fr));}
  .mv-r3__progress--three{grid-template-columns:repeat(3,minmax(0,1fr));}
}

@media (min-width:641px) and (max-width:1023px), (pointer:coarse){
  .mv-r3{width:min(960px,100%);}
  .mv-r3-launchers{grid-template-columns:1fr;}
  .mv-r3__progress,.mv-r3__progress--three{grid-template-columns:repeat(2,minmax(0,1fr));}
  .mv-r3__facts{grid-template-columns:repeat(2,minmax(0,1fr));}
  .mv-r3-regression__list{grid-template-columns:1fr;}
  .mv-r3__btn,.mv-r3__close,.mv-r3 input,.mv-r3-target input{min-height:44px;}
}

@media (max-width:640px){
  html,body{max-width:100%;overflow-x:hidden;}
  .mv-r3-overlay,.mv-r3-target-overlay{align-items:stretch;padding:0;}
  .mv-r3{
    width:100%;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border:0;
    border-radius:0;
    gap:11px;
  }
  .mv-r3__header{
    padding:max(12px,env(safe-area-inset-top))
            max(12px,env(safe-area-inset-right))
            12px
            max(12px,env(safe-area-inset-left));
  }
  .mv-r3__header p{font-size:.8rem;}
  .mv-r3__toolbar{align-items:stretch;flex-direction:column;}
  .mv-r3__toolbar,
  .mv-r3__message,
  .mv-r3__alert,
  .mv-r3__instruction,
  .mv-r3__progress,
  .mv-r3__facts,
  .mv-r3__stages,
  .mv-r3__outcome{margin-left:12px;margin-right:12px;}
  .mv-r3__progress,.mv-r3__progress--three,.mv-r3__facts,.mv-r3__execution{grid-template-columns:1fr;}
  .mv-r3__stage-head{align-items:flex-start;}
  .mv-r3__actions,.mv-r3__toolbar-actions{align-items:stretch;flex-direction:column;width:100%;}
  .mv-r3__actions .btn,.mv-r3__toolbar-actions .btn{width:100%;}
  .mv-r3__stage-body>.mv-r3__actions,
  .mv-r3__outcome>.mv-r3__actions{
    position:sticky;
    bottom:0;
    z-index:2;
    margin:12px -14px -14px;
    padding:10px 14px max(10px,env(safe-area-inset-bottom));
    border-top:1px solid #e2e8f0;
    background:rgba(255,255,255,.97);
  }
  .mv-r3-target{
    width:100%;
    max-width:none;
    min-height:100dvh;
    max-height:100dvh;
    border:0;
    border-radius:0;
    padding:max(14px,env(safe-area-inset-top))
            max(14px,env(safe-area-inset-right))
            max(14px,env(safe-area-inset-bottom))
            max(14px,env(safe-area-inset-left));
  }
  .mv-r3-target__actions{position:sticky;bottom:0;padding-top:10px;background:#fff;}
  .mv-r3-report__definitions{grid-template-columns:1fr;}
  .mv-r3-report__definitions dt{border-bottom:0;}
  .mv-r3__check-list>div,.mv-r3-report__checks>li{grid-template-columns:1fr;}
  .mv-r3-regression{padding:11px;}
  .mv-r3-regression__list{grid-template-columns:1fr;}
  .mv-r3-regression__row>button{width:100%;}
  .mv-r3-launcher{align-items:stretch;flex-direction:column;}
  .mv-r3-launcher .btn{width:100%;min-height:44px;}
}

@media print{
  .mv-r3-overlay,.mv-r3-target-overlay,.mv-r3-launchers{display:none!important;}
}

/* Database-neutral recovery operations */
.recovery-controls[hidden],
.recovery-controls [hidden],
.recovery-overlay[hidden],
.recovery-overlay [hidden]{display:none!important}
body.modal-open{overflow:hidden;overscroll-behavior:none}
.recovery-controls{border:1px solid var(--border);border-radius:12px;padding:14px;margin:0 0 14px;background:var(--card,#fff);min-width:0}
.recovery-controls__row{display:flex;gap:10px;align-items:stretch;flex-wrap:wrap;margin:10px 0;min-width:0}
.recovery-controls__row>label{display:flex;align-items:center;margin:0;font-weight:800;flex:0 1 auto}
.recovery-controls select,.recovery-card input{box-sizing:border-box;min-height:44px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:9px 11px;background:var(--input-bg,#fff);color:var(--primary,#111827);font:inherit}
.recovery-controls select{flex:1 1 12rem;max-width:100%}
.recovery-badge{display:inline-flex;align-items:center;justify-content:center;min-height:34px;max-width:100%;border-radius:999px;padding:5px 10px;font-size:.78rem;font-weight:900;background:#e5e7eb;color:#374151;overflow-wrap:anywhere}
.recovery-badge[data-kind="success"]{background:#dcfce7;color:#166534}.recovery-badge[data-kind="warning"]{background:#fef3c7;color:#92400e}.recovery-badge[data-kind="error"]{background:#fee2e2;color:#991b1b}
.recovery-status{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;border-radius:8px;padding:10px;margin:8px 0;background:#f3f4f6;color:#374151;font:600 .82rem/1.45 system-ui}
.recovery-status[data-kind="success"]{background:#ecfdf5;color:#065f46}.recovery-status[data-kind="warning"]{background:#fffbeb;color:#92400e}.recovery-status[data-kind="error"]{background:#fef2f2;color:#991b1b}
.recovery-overlay{z-index:9890;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100vh;height:100dvh;padding:10px;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));overflow:auto}
.recovery-card{box-sizing:border-box;width:min(980px,96vw);max-width:980px;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);overflow:auto;text-align:left;padding:clamp(1rem,3vw,2rem)}
.recovery-card--small{width:min(600px,96vw);max-width:600px}.recovery-card--restricted{width:min(760px,94vw);max-width:760px}
.recovery-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.recovery-card__header>div{min-width:0}.recovery-card__header .recovery-card__close{flex:0 0 auto;max-width:10rem}
.recovery-card h2{margin:.2rem 0 1rem;overflow-wrap:anywhere}.recovery-card label{display:grid;gap:5px;font-weight:800;margin:10px 0}.recovery-notice{padding:10px;border-radius:8px;background:#fffbeb;color:#92400e;font-weight:800;overflow-wrap:anywhere}
.recovery-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px;margin:10px 0}.recovery-facts>div{min-width:0;padding:8px;border:1px solid var(--border);border-radius:8px;overflow-wrap:anywhere}.recovery-facts span{display:block;font-size:.72rem;color:var(--muted)}
.recovery-stages{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;padding:0;list-style:none}.recovery-stages li{min-width:0;border:1px solid var(--border);border-radius:8px;padding:10px;overflow-wrap:anywhere}.recovery-stages li[data-kind="current"]{border-color:#1d4ed8;background:#eff6ff}.recovery-stages li[data-kind="success"]{border-color:#15803d;background:#f0fdf4}.recovery-stages li[data-kind="error"]{border-color:#b91c1c;background:#fef2f2}.recovery-stages em{display:block;font-size:.7rem;margin-top:5px}.recovery-file{border:1px dashed var(--border);border-radius:8px;padding:12px;overflow-wrap:anywhere}.recovery-file input{width:100%;max-width:100%}
.recovery-meter{min-height:40px;height:auto;border-radius:12px;background:#e5e7eb;overflow:hidden;position:relative}.recovery-meter span{position:absolute;inset:0 auto 0 0;display:block;width:0;background:#0f766e}.recovery-meter em{position:relative;z-index:1;display:block;padding:10px;text-align:center;font-size:.72rem;line-height:1.35;overflow-wrap:anywhere}
.recovery-report{max-width:100%;max-height:min(55dvh,520px);overflow:auto;margin:10px 0;border-radius:8px;-webkit-overflow-scrolling:touch}.recovery-report table{width:100%;border-collapse:collapse}.recovery-report th,.recovery-report td{border:1px solid var(--border);padding:7px;text-align:left;vertical-align:top;overflow-wrap:anywhere;word-break:break-word}
.recovery-report__heading{margin:14px 0 8px;color:var(--primary);font-size:1.1rem}.recovery-report__heading:focus-visible{outline:3px solid #f59e0b;outline-offset:3px}.recovery-report[data-kind="success"]{border:2px solid #15803d}.recovery-report[data-kind="warning"]{border:2px solid #b45309}.recovery-report[data-kind="error"]{border:2px solid #b91c1c}.recovery-report__administrator{padding:14px;background:#fff}.recovery-report__title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.recovery-report__title-row>div{min-width:0}.recovery-report__title-row small{display:block;color:var(--muted);font-weight:800}.recovery-report__title-row h4{margin:4px 0 12px;overflow-wrap:anywhere}.recovery-report__administrator h5{margin:14px 0 6px}.recovery-report__definitions{display:grid;grid-template-columns:minmax(145px,220px) minmax(0,1fr);margin:0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.recovery-report__definitions dt,.recovery-report__definitions dd{margin:0;padding:8px 10px;border-bottom:1px solid var(--border);overflow-wrap:anywhere;word-break:break-word}.recovery-report__definitions dt{font-weight:900;background:#f8fafc}.recovery-report__definitions dd{background:#fff}.recovery-report__definitions dt:last-of-type,.recovery-report__definitions dd:last-of-type{border-bottom:0}.recovery-report__definitions code{font:700 .78rem/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:normal;overflow-wrap:anywhere}.recovery-report__definitions pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:600 .76rem/1.45 ui-monospace,SFMono-Regular,Menlo,monospace}.recovery-report__next-steps{margin:0;padding-left:1.4rem}.recovery-report__next-steps li{margin:5px 0;line-height:1.45}.recovery-report__technical,.recovery-report__findings,.recovery-report__identity,.recovery-report__raw{margin:10px;padding:0;border:1px solid var(--border);border-radius:8px;background:#fff;overflow:hidden}.recovery-report__technical>summary,.recovery-report__findings>summary,.recovery-report__identity>summary,.recovery-report__raw>summary{padding:10px 12px;cursor:pointer;font-weight:900;background:#f8fafc}.recovery-report__technical>.recovery-report__definitions,.recovery-report__identity>.recovery-report__definitions{border:0;border-top:1px solid var(--border);border-radius:0}.recovery-report__findings ul{display:grid;gap:8px;list-style:none;margin:0;padding:10px}.recovery-report__findings li{display:grid;gap:3px;padding:9px;border-left:5px solid #64748b;background:#f8fafc}.recovery-report__findings li[data-kind="error"]{border-left-color:#b91c1c;background:#fef2f2}.recovery-report__findings li[data-kind="warning"]{border-left-color:#b45309;background:#fffbeb}.recovery-report__findings li[data-kind="success"]{border-left-color:#15803d;background:#f0fdf4}.recovery-report__findings li span{line-height:1.4}.recovery-report__truncation{margin:10px;padding:9px;border:1px solid #b45309;border-radius:6px;background:#fffbeb;color:#78350f;font-weight:800}.recovery-report__raw .recovery-report__table{margin:10px;max-width:calc(100% - 20px);overflow:auto}

/* C12.C1.C1: compact, actionable readiness observations; no new operational controls. */
.database-readiness.recovery-status{white-space:normal;background:#fff;color:var(--primary,#111827);border:1px solid var(--border);padding:8px;font-weight:500}
.database-readiness[data-kind="error"]{border-left:4px solid #b91c1c}.database-readiness[data-kind="warning"]{border-left:4px solid #b45309}.database-readiness[data-kind="success"]{border-left:4px solid #15803d}
.database-readiness h4{font-size:.95rem;margin:0 0 5px}.database-readiness h5{font-size:.83rem;margin:8px 0 3px}.database-readiness p{margin:4px 0;line-height:1.45}.database-readiness__next{font-weight:650}
.database-readiness__facts{display:grid;grid-template-columns:minmax(125px,190px) minmax(0,1fr);margin:6px 0;border:1px solid var(--border);border-radius:6px;overflow:hidden}.database-readiness__facts dt,.database-readiness__facts dd{margin:0;padding:4px 7px;border-bottom:1px solid var(--border);overflow-wrap:anywhere}.database-readiness__facts dt{font-weight:750;background:#f8fafc}.database-readiness__facts dd{background:#fff}.database-readiness__facts dt:last-of-type,.database-readiness__facts dd:last-of-type{border-bottom:0}
.database-readiness__finding,.database-readiness__technical{margin:6px 0 0;border:1px solid var(--border);border-radius:6px;background:#fff;overflow:hidden}.database-readiness__finding>summary,.database-readiness__technical>summary{display:flex;align-items:center;gap:7px;box-sizing:border-box;min-height:44px;padding:5px 8px;cursor:pointer;list-style:none;font-weight:750;touch-action:manipulation}.database-readiness summary::-webkit-details-marker{display:none}.database-readiness summary:focus-visible{outline:3px solid #f59e0b;outline-offset:-3px}.database-readiness__caret{display:inline-flex;justify-content:center;align-items:center;flex:0 0 14px;font-size:1.3rem;line-height:1;transform:rotate(0deg)}.database-readiness details[open]>summary>.database-readiness__caret{transform:rotate(90deg)}
.database-readiness__finding[data-kind="error"]>summary{color:#991b1b;background:#fef2f2;font-weight:800}.database-readiness__finding[data-kind="warning"]>summary{color:#92400e;background:#fffbeb}.database-readiness__finding[data-kind="success"]>summary{color:#166534;background:#f0fdf4}.database-readiness__finding-title{display:block;flex:1 1 auto;min-width:0}.database-readiness__finding-title strong{display:block;font-weight:800}.database-readiness__finding-title small{display:block;font-size:.76rem;line-height:1.35;font-weight:700;margin-top:2px}.database-readiness__finding-state{flex:0 0 auto;font-size:.72rem;font-weight:850}.database-readiness__finding-body{padding:5px 8px 8px;border-top:1px solid var(--border)}
.database-readiness__instructions ul,.database-readiness__instructions ol{margin:3px 0;padding-left:1.4rem}.database-readiness__instructions li{margin:3px 0;line-height:1.45}.database-readiness__technical>summary{color:var(--primary,#111827);background:#f8fafc}.database-readiness__technical>.database-readiness__facts{margin:0;border:0;border-top:1px solid var(--border);border-radius:0}.database-readiness__information{font-size:.78rem;margin-top:6px}.database-readiness__export-error{padding:6px;border:1px solid #b45309;border-radius:6px;background:#fffbeb;color:#92400e;font-weight:750}
@media(max-width:520px){.database-readiness__facts{grid-template-columns:minmax(98px,36%) minmax(0,1fr)}.database-readiness__finding>summary{flex-wrap:wrap}.database-readiness__finding-title{flex-basis:calc(100% - 25px)}.database-readiness__finding-state{margin-left:21px}}
@media(forced-colors:active){.database-readiness summary:focus-visible{outline:3px solid Highlight}.database-readiness__finding-state{border:1px solid CanvasText;padding:1px 3px}}

/* Every current Recovery Operations button: stable colors, 44px touch target, and wrapping text. */
.recovery-controls .btn,.recovery-card .btn,#databaseRestrictedAccessOverlay .btn,#appConfirmModal .btn{box-sizing:border-box;flex:1 1 10rem;min-width:44px;max-width:100%;min-height:44px;height:auto;padding:10px 14px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;word-break:normal;text-overflow:clip;text-align:center;-webkit-appearance:none;appearance:none;touch-action:manipulation}
.recovery-card .recovery-card__header .recovery-card__close{flex:0 0 auto;width:auto;max-width:10rem}
#appConfirmModal .modal-card>div:last-child{flex-wrap:wrap}#appConfirmModal .btn{max-width:100%!important}#appConfirmCancelBtn:not(:disabled){background:#fff;color:#1f2937;-webkit-text-fill-color:#1f2937;border:1px solid #94a3b8}#appConfirmOkBtn[data-confirm-variant="apply"]:not(:disabled){background:#1d4ed8;color:#fff;-webkit-text-fill-color:#fff}#appConfirmOkBtn[data-confirm-variant="backup"]:not(:disabled){background:#166534;color:#fff;-webkit-text-fill-color:#fff}#appConfirmOkBtn[data-confirm-variant="danger"]:not(:disabled){background:#b91c1c;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--apply{background:#1d4ed8;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--backup{background:#166534;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--restore{background:#6d28d9;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--validate{background:#0f766e;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--abort{background:#b91c1c;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--print{background:#374151;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--download{background:#0f766e;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--report{background:#1e3a8a;color:#fff;-webkit-text-fill-color:#fff}
.recovery-btn--refresh,.recovery-btn--readiness,.recovery-btn--close{background:#fff;color:#1f2937;-webkit-text-fill-color:#1f2937;border:1px solid #94a3b8}
.recovery-controls .btn:focus-visible,.recovery-card .btn:focus-visible,#databaseRestrictedAccessOverlay .btn:focus-visible,#appConfirmModal .btn:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.recovery-controls .btn:disabled,.recovery-card .btn:disabled,#databaseRestrictedAccessOverlay .btn:disabled,#appConfirmModal .btn:disabled{background:#cbd5e1;color:#475569;-webkit-text-fill-color:#475569;border-color:#94a3b8;opacity:1;cursor:not-allowed}
#appConfirmCancelBtn:disabled,#appConfirmOkBtn:disabled{background:#cbd5e1;color:#475569;-webkit-text-fill-color:#475569;border-color:#94a3b8;opacity:1;cursor:not-allowed}
@media(hover:hover) and (pointer:fine){.recovery-controls .btn:not(:disabled):hover,.recovery-card .btn:not(:disabled):hover,#databaseRestrictedAccessOverlay .btn:not(:disabled):hover,#appConfirmModal .btn:not(:disabled):hover{filter:brightness(1.08)}}
@media(max-width:520px){.recovery-overlay{align-items:flex-start;padding:6px;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}.recovery-card,.recovery-card--small,.recovery-card--restricted{width:100%;max-width:100%;max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);padding:1rem}.recovery-controls{padding:10px}.recovery-controls__row>.btn,.recovery-controls__row>select,.recovery-card .recovery-controls__row>.btn,#appConfirmModal .btn{flex:1 1 100%;width:100%;max-width:none!important}.recovery-card__header{align-items:flex-start}.recovery-card__header .recovery-card__close{flex:0 0 auto;width:auto;min-width:64px}.recovery-stages{grid-template-columns:1fr}.recovery-report{max-height:48vh;max-height:48dvh}.recovery-report__title-row{flex-direction:column}.recovery-report__definitions{grid-template-columns:1fr}.recovery-report__definitions dt{border-bottom:0}.recovery-report__definitions dd{border-bottom:1px solid var(--border)}}
@media(forced-colors:active){.recovery-controls .btn,.recovery-card .btn,#databaseRestrictedAccessOverlay .btn,#appConfirmModal .btn{forced-color-adjust:auto;border:2px solid ButtonText}.recovery-controls .btn:focus-visible,.recovery-card .btn:focus-visible,#appConfirmModal .btn:focus-visible{outline:3px solid Highlight}}
/* Adopt Database button — permanent cross-browser/device styling */
#databaseAdoptionOpenBtn,
#databaseAdoptionConfirmBtn {
    background: #14532d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid #166534 !important;
}

#databaseAdoptionOpenBtn:not(:disabled):hover,
#databaseAdoptionOpenBtn:focus-visible,
#databaseAdoptionConfirmBtn:not(:disabled):hover,
#databaseAdoptionConfirmBtn:focus-visible {
    background: #166534 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

#databaseAdoptionOpenBtn:not(:disabled):active,
#databaseAdoptionConfirmBtn:not(:disabled):active {
    background: #15803d !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

#databaseAdoptionOpenBtn:disabled,
#databaseAdoptionConfirmBtn:disabled {
    background: #cbd5e1 !important;
    color: #475569 !important;
    -webkit-text-fill-color: #475569 !important;
    border-color: #94a3b8 !important;
    cursor: not-allowed !important;
}

/* ==========================================================
   Phase 4.7B.2.R5.C1 — POS Search Controls and Item Detail
   Type-ahead remains primary. Results are explicit-action cards, paged in
   deliberate ten-row batches, and detail is an isolated read-only dialog.
   ========================================================== */
.pos-inventory-search{
  display:grid;
  gap:8px;
  margin:0 0 16px;
}

.pos-inventory-search-label{
  color:var(--primary);
  font-weight:900;
  line-height:1.3;
}

.pos-inventory-search-controls{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
  align-items:stretch;
}

.pos-inventory-search-controls input{
  flex:1 1 240px;
  box-sizing:border-box;
  min-width:0;
  min-height:44px;
  border:1px solid #94a3b8;
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  color:var(--primary);
  background:#fff;
  -webkit-appearance:none;
  appearance:none;
}

.pos-inventory-search-controls input:focus-visible,
.pos-inventory-search-button:focus-visible,
.pos-item-action:focus-visible,
.pos-item-detail-close-button:focus-visible,
.pos-item-detail-retry-button:focus-visible,
#posItemDetailTitle:focus-visible{
  outline:3px solid #f59e0b;
  outline-offset:2px;
}

.pos-inventory-search-button,
.pos-item-action,
.pos-item-detail-close-button,
.pos-item-detail-retry-button{
  box-sizing:border-box;
  min-width:44px;
  min-height:44px;
  height:auto;
  padding:10px 14px;
  border:1px solid transparent;
  border-radius:9px;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
  text-overflow:clip;
  touch-action:manipulation;
  -webkit-appearance:none;
  appearance:none;
}

.pos-inventory-search-button--primary,
.pos-inventory-search-button--more,
.pos-item-action--detail,
.pos-item-detail-close-button,
.pos-item-detail-retry-button{
  background:#1d4ed8;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#1e40af;
}

.pos-inventory-search-button--clear,
.pos-item-action--status{
  background:#b45309;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#92400e;
}

.pos-item-action--add{
  background:#15803d;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#166534;
}

.pos-inventory-search-button:disabled,
.pos-item-action:disabled,
.pos-item-detail-close-button:disabled,
.pos-item-detail-retry-button:disabled{
  filter:saturate(.7);
  opacity:.68;
  cursor:not-allowed;
}

.pos-inventory-search-help,
.pos-inventory-search-status{
  font-size:.82rem;
  line-height:1.4;
}

.pos-inventory-search-help{color:var(--muted);}

.pos-inventory-search-status{
  min-height:1.2em;
  color:#1e3a8a;
  font-weight:800;
}

.pos-inventory-search-status[data-state="error"]{color:#b91c1c;}
.pos-inventory-search-status[data-state="limit"]{color:#92400e;}
.pos-inventory-search-status[data-state="results"]{color:#166534;}

.pos-inventory-results{
  position:static;
  display:grid;
  gap:10px;
  max-height:min(52dvh,560px);
  overflow:auto;
  padding:10px;
  border:1px solid #cbd5e1;
  border-radius:12px;
  background:#f8fafc;
  box-shadow:0 8px 22px rgba(15,23,42,.08);
  -webkit-overflow-scrolling:touch;
}

.pos-inventory-results[hidden],
.pos-inventory-search-button[hidden]{display:none!important;}

.pos-inventory-results-list{
  display:grid;
  gap:10px;
}

#itemResults.pos-inventory-results .pos-item-result{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px 14px;
  align-items:center;
  padding:12px;
  border:1px solid #cbd5e1;
  border-left:5px solid #1d4ed8;
  border-radius:12px;
  background:#fff;
  color:var(--primary);
  cursor:default;
  box-shadow:0 2px 8px rgba(15,23,42,.06);
}

#itemResults.pos-inventory-results .pos-item-result--ready{
  border-left-color:#15803d;
}

#itemResults.pos-inventory-results .pos-item-result--blocked,
#itemResults.pos-inventory-results .pos-item-result--blocked:hover{
  border-left-color:#b45309;
  background:#fffaf0;
}

.pos-item-result-summary{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px 10px;
  align-items:center;
  min-width:0;
}

.pos-item-result-actions{
  display:flex;
  justify-content:flex-end;
  align-items:stretch;
  flex-wrap:wrap;
  gap:8px;
  max-width:310px;
}

.pos-item-result-actions .pos-item-action{
  flex:1 1 130px;
}

.pos-inventory-results-footer{
  display:flex;
  justify-content:center;
  padding:2px 0 0;
}

.pos-inventory-search-button--more{
  width:min(100%,320px);
}

.pos-inventory-search-message{
  padding:14px;
  border:1px dashed #94a3b8;
  border-radius:10px;
  background:#fff;
  color:#334155;
  text-align:center;
  line-height:1.4;
}

.pos-inventory-search-message--error{
  border-style:solid;
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
  font-weight:800;
}

html.pos-item-detail-open,
body.pos-item-detail-open{
  overflow:hidden;
  overscroll-behavior:none;
}

#posItemDetailModal{
  z-index:1250;
  padding:max(12px,env(safe-area-inset-top))
          max(12px,env(safe-area-inset-right))
          max(12px,env(safe-area-inset-bottom))
          max(12px,env(safe-area-inset-left));
}

.pos-item-detail-modal-content{
  box-sizing:border-box;
  width:min(960px,96vw);
  max-width:960px;
  max-height:92vh;
  max-height:92dvh;
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  border:1px solid #cbd5e1;
  border-radius:16px;
  box-shadow:0 24px 60px rgba(15,23,42,.28);
}

.pos-item-detail-header,
.pos-item-detail-footer{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  background:#fff;
}

.pos-item-detail-header{
  border-bottom:1px solid var(--border);
}

.pos-item-detail-header>div{min-width:0;}

.pos-item-detail-header h3{
  margin:0;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.pos-item-detail-subtitle{
  margin-top:4px;
  color:var(--muted);
  overflow-wrap:anywhere;
}

.pos-item-detail-footer{
  justify-content:flex-end;
  align-items:center;
  border-top:1px solid var(--border);
  padding-bottom:max(16px,env(safe-area-inset-bottom));
}

.pos-item-detail-body{
  flex:1 1 auto;
  min-height:180px;
  overflow:auto;
  padding:18px;
  background:#f8fafc;
  -webkit-overflow-scrolling:touch;
}

.pos-item-detail-state{
  min-height:120px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:18px;
  border:1px dashed #94a3b8;
  border-radius:12px;
  background:#fff;
  color:#475569;
  text-align:center;
  line-height:1.45;
}

.pos-item-detail-state--loading{
  color:#1e3a8a;
  font-weight:900;
}

.pos-item-detail-state--error{
  border-style:solid;
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.pos-item-detail-identity{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:start;
  padding:16px;
  border:1px solid #bfdbfe;
  border-left:6px solid #1d4ed8;
  border-radius:14px;
  background:#eff6ff;
}

.pos-item-detail-identity>div:first-child{
  min-width:0;
  display:grid;
  gap:4px;
}

.pos-item-detail-eyebrow{
  color:#1e40af;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.pos-item-detail-identity strong{
  font-size:1.08rem;
  overflow-wrap:anywhere;
}

.pos-item-detail-identity p{
  margin:0;
  color:#334155;
  overflow-wrap:anywhere;
}

.pos-item-detail-identity-side{
  display:grid;
  justify-items:end;
  gap:10px;
  text-align:right;
}

.pos-item-detail-identity-side .pos-item-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:6px 10px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:.76rem;
  font-weight:900;
}

.pos-item-detail-identity-side .pos-item-status-badge--ready{
  border-color:#86efac;
  background:#dcfce7;
  color:#166534;
}

.pos-item-detail-identity-side .pos-item-status-badge--blocked{
  border-color:#fed7aa;
  background:#ffedd5;
  color:#9a3412;
}

.pos-item-detail-section{
  margin-top:14px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

.pos-item-detail-section h4{
  margin:0 0 10px;
  color:var(--primary);
}

.pos-item-detail-section-heading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}

.pos-item-detail-section-heading span{
  color:var(--muted);
  font-size:.8rem;
  font-weight:800;
}

.pos-item-detail-summary-grid,
.pos-item-detail-fields{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}

.pos-item-detail-field{
  min-width:0;
  padding:10px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}

.pos-item-detail-field span{
  display:block;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  margin-bottom:3px;
}

.pos-item-detail-field strong{
  display:block;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.pos-item-detail-hold-summary,
.pos-item-detail-limit-note{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #fed7aa;
  border-radius:10px;
  background:#fff7ed;
  color:#9a3412;
  font-size:.84rem;
  font-weight:800;
  line-height:1.4;
}

.pos-item-detail-locations{
  display:grid;
  gap:8px;
}

.pos-item-detail-location{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid #cbd5e1;
  border-left:5px solid #15803d;
  border-radius:11px;
  background:#fff;
}

.pos-item-detail-location--blocked{
  border-left-color:#b45309;
  background:#fffaf0;
}

.pos-item-detail-location>div{
  min-width:0;
  display:grid;
  gap:3px;
}

.pos-item-detail-location strong,
.pos-item-detail-location small,
.pos-item-detail-location em{
  overflow-wrap:anywhere;
}

.pos-item-detail-location small{
  color:var(--muted);
  line-height:1.35;
}

.pos-item-detail-location em{
  color:#9a3412;
  font-size:.78rem;
  font-style:normal;
  font-weight:800;
}

.pos-item-detail-location>span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:5px 8px;
  border:1px solid #bfdbfe;
  border-radius:999px;
  background:#eff6ff;
  color:#1e40af;
  font-size:.72rem;
  font-weight:900;
  white-space:nowrap;
}

.pos-item-detail-public-note{
  padding:12px;
  border:1px solid #bfdbfe;
  border-radius:10px;
  background:#eff6ff;
  color:#1e3a8a;
  line-height:1.5;
  overflow-wrap:anywhere;
}

@media(hover:hover) and (pointer:fine){
  .pos-inventory-search-button:not(:disabled):hover,
  .pos-item-action:not(:disabled):hover,
  .pos-item-detail-close-button:not(:disabled):hover,
  .pos-item-detail-retry-button:not(:disabled):hover{
    filter:brightness(1.08);
  }
}

@media(max-width:900px){
  .pos-item-detail-summary-grid,
  .pos-item-detail-fields{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .pos-item-detail-modal-content{
    width:min(98vw,900px);
    max-height:calc(100dvh - 24px);
  }
}

@media(max-width:700px){
  .pos-inventory-search-controls input{flex-basis:100%;}

  #itemResults.pos-inventory-results .pos-item-result,
  .pos-item-result-summary,
  .pos-item-detail-identity,
  .pos-item-detail-location{
    grid-template-columns:1fr;
  }

  .pos-item-result-actions{
    justify-content:stretch;
    max-width:none;
  }

  .pos-item-detail-identity-side{
    justify-items:start;
    text-align:left;
  }
}

@media(max-width:520px){
  #posItemDetailModal{
    align-items:stretch;
    padding:0;
  }

  .pos-item-detail-modal-content{
    width:100vw;
    max-width:100vw;
    height:100vh;
    height:100dvh;
    max-height:100vh;
    max-height:100dvh;
    border:0;
    border-radius:0;
  }

  .pos-item-detail-header{
    padding:max(12px,env(safe-area-inset-top))
            max(12px,env(safe-area-inset-right))
            12px
            max(12px,env(safe-area-inset-left));
  }

  .pos-item-detail-body{
    padding:12px max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));
  }

  .pos-item-detail-footer{
    padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  }

  .pos-item-detail-footer .pos-item-detail-close-button{
    width:100%;
  }

  .pos-item-detail-summary-grid,
  .pos-item-detail-fields{
    grid-template-columns:1fr;
  }

  .pos-inventory-results{
    max-height:58dvh;
    padding:8px;
  }

  .pos-item-result-actions{
    flex-direction:column;
  }

  .pos-item-result-actions .pos-item-action{
    width:100%;
    flex-basis:auto;
  }
}

@media(forced-colors:active){
  .pos-inventory-search-controls input,
  .pos-inventory-search-button,
  .pos-item-action,
  .pos-item-result,
  .pos-item-detail-modal-content,
  .pos-item-detail-close-button,
  .pos-item-detail-retry-button{
    forced-color-adjust:auto;
    border:2px solid ButtonText;
  }

  .pos-inventory-search-controls input:focus-visible,
  .pos-inventory-search-button:focus-visible,
  .pos-item-action:focus-visible,
  .pos-item-detail-close-button:focus-visible,
  .pos-item-detail-retry-button:focus-visible,
  #posItemDetailTitle:focus-visible{
    outline:3px solid Highlight;
  }
}

@media print{
  #posItemDetailModal,
  .pos-inventory-results{
    display:none!important;
  }
}

/* ==========================================================
   Phase 4.7B.2.R5.C2.R4 — POS item-detail Add-to-Cart and
   persistent post-sale workflow continuity.
   ========================================================== */
html.pos-location-pick-open,
body.pos-location-pick-open,
html.pos-sale-complete-open,
body.pos-sale-complete-open{
  overflow:hidden;
  overscroll-behavior:none;
}

.pos-item-detail-header-actions{
  flex:0 1 auto;
  display:flex;
  align-items:stretch;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
}

.pos-item-detail-add-button,
.pos-item-detail-close-button,
#posLocationPickCloseButton,
#posLocationPickCancelButton,
#posLocationPickConfirmButton,
.pos-sale-complete-action{
  box-sizing:border-box;
  min-height:44px;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.2;
}

.pos-item-detail-add-button{
  min-width:128px;
  background:#15803d;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#166534;
}

.pos-item-detail-close-button{
  min-width:96px;
}

.pos-item-detail-add-button[hidden]{display:none!important;}

.pos-item-detail-add-button:disabled,
.pos-sale-complete-action:disabled,
#posLocationPickCloseButton:disabled,
#posLocationPickCancelButton:disabled,
#posLocationPickConfirmButton:disabled{
  filter:saturate(.7);
  opacity:.68;
  cursor:not-allowed;
}

.pos-cart-line:focus-visible{
  outline:3px solid #2563eb;
  outline-offset:3px;
  border-radius:8px;
}

#posLocationPickModal{
  z-index:1350;
  padding:max(12px,env(safe-area-inset-top))
          max(12px,env(safe-area-inset-right))
          max(12px,env(safe-area-inset-bottom))
          max(12px,env(safe-area-inset-left));
}

#posLocationPickModal .pos-location-pick-modal-content{
  box-sizing:border-box;
  width:min(560px,96vw);
  max-width:560px;
  max-height:calc(100dvh - 24px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.pos-sale-complete-modal{
  z-index:1500;
  padding:max(12px,env(safe-area-inset-top))
          max(12px,env(safe-area-inset-right))
          max(12px,env(safe-area-inset-bottom))
          max(12px,env(safe-area-inset-left));
}

.pos-sale-complete-content{
  box-sizing:border-box;
  width:min(620px,94vw);
  max-width:620px;
  max-height:calc(100dvh - 24px);
  overflow:auto;
  padding:20px;
  border:1px solid #cbd5e1;
  border-radius:14px;
  box-shadow:0 24px 60px rgba(15,23,42,.3);
  -webkit-overflow-scrolling:touch;
}

.pos-sale-complete-content h3{
  margin:0 0 8px;
  color:var(--primary);
  overflow-wrap:anywhere;
}

.pos-sale-complete-content p{
  margin:0;
  color:var(--primary);
  line-height:1.45;
  overflow-wrap:anywhere;
}

.pos-sale-complete-reference{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid #bfdbfe;
  border-radius:9px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:.84rem;
  font-weight:800;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.pos-sale-complete-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:16px;
}

.pos-sale-complete-action{
  width:100%;
  min-width:0;
  padding:10px 12px;
  font-weight:900;
}

.pos-sale-complete-action--new{
  background:#15803d;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#166534;
}

.pos-sale-complete-action--print{
  background:#b45309;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#92400e;
}

.pos-sale-complete-action--close{
  background:#b91c1c;
  color:#fff;
  -webkit-text-fill-color:#fff;
  border-color:#991b1b;
}

@media(hover:hover) and (pointer:fine){
  .pos-item-detail-add-button:not(:disabled):hover,
  .pos-sale-complete-action:not(:disabled):hover,
  #posLocationPickCloseButton:not(:disabled):hover,
  #posLocationPickCancelButton:not(:disabled):hover,
  #posLocationPickConfirmButton:not(:disabled):hover{
    filter:brightness(1.08);
  }
}

@media(max-width:760px){
  .pos-item-detail-header{
    flex-wrap:wrap;
  }

  .pos-item-detail-header>div:first-child{
    flex:1 1 100%;
  }

  .pos-item-detail-header-actions{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .pos-item-detail-add-button,
  .pos-item-detail-close-button{
    width:100%;
    min-width:0;
  }

  .pos-sale-complete-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .pos-sale-complete-action--close{
    grid-column:1 / -1;
  }
}

@media(max-width:380px){
  .pos-item-detail-header-actions,
  .pos-sale-complete-actions{
    grid-template-columns:1fr;
  }

  .pos-sale-complete-action--close{
    grid-column:auto;
  }

  .pos-sale-complete-content{
    width:100%;
    max-width:100%;
    padding:16px;
  }
}

@media(forced-colors:active){
  .pos-item-detail-add-button,
  .pos-sale-complete-content,
  .pos-sale-complete-action,
  #posLocationPickModal .pos-location-pick-modal-content,
  #posLocationPickCloseButton,
  #posLocationPickCancelButton,
  #posLocationPickConfirmButton{
    forced-color-adjust:auto;
    border:2px solid ButtonText;
  }

  .pos-item-detail-add-button:focus-visible,
  .pos-sale-complete-action:focus-visible,
  #posSaleCompleteTitle:focus-visible,
  #posLocationPickTitle:focus-visible,
  #posLocationPickCloseButton:focus-visible,
  #posLocationPickCancelButton:focus-visible,
  #posLocationPickConfirmButton:focus-visible,
  .pos-cart-line:focus-visible{
    outline:3px solid Highlight;
  }
}

@media print{
  #posLocationPickModal,
  #posSaleCompleteModal{
    display:none!important;
  }
}

/* 4.7.WS8.R5.C6 — shared workspace theme and directory presentation.
   Feature pages adopt .mv-directory-frame (square outer border), inner blocks
   adopt .mv-ui-surface, and records frames use --mv-surface-bg. Keep semantic
   action colors and module/editor styles independent of these surface tokens. */
:root{
  --mv-app-bg:#e4eaf0;
  --mv-feature-bg:#edf2f6;
  --mv-surface-bg:#fff;
  --mv-border-color:#aab9c8;
  --mv-surface-radius:2px;
  --mv-directory-frame-radius:0px;
  --mv-directory-frame-border:var(--mv-border-color);
  --mv-directory-search-width:560px;
}
.mv-ui-surface{border-radius:var(--mv-surface-radius);}
#appShell :is(
  .mv-shell-header,.mv-shell-commandbar,.mv-shell-nav,.mv-quick-links,
  .mv-shell-nav-btn,.mv-quick-link,.mv-shell-menu-card,.mv-shell-menu-link,
  .mv-ws8-category-nav,.mv-ws8-category-trigger,.mv-ws8-mobile-dashboard,
  .mv-ws8-functions-button,.mv-ws8-shortcut-shelf,.mv-ws8-shortcut-button,
  .mv-ws8-shortcut-toggle,.mv-ws8-menu,.mv-ws8-menu-item,.mv-ws8-switcher,
  .mv-ws8-tab-item,.mv-ws8-tab,.mv-ws8-picker,
  .mv-dashboard-heading,.mv-dashboard-card,.mv-dashboard-section-title,.mv-dashboard-actionbar
){border-radius:var(--mv-surface-radius);}
:root .mv-workspace :is([data-mv-workspace-tablist],[data-mv-workspace-tab],.mv-workspace-empty){
  border-radius:var(--mv-surface-radius);
}
:root :is(.mv-customer-root,[data-mv-inventory-root],body.inventory-db-page) :is(
  .data-table,.inventory-list-frame,.inventory-table,.inventory-workspace-card,.inventory-responsive-sort,
  .inventory-reports-shell,.inventory-reports-scope-card,.inventory-report-filters-card,
  .inventory-reports-status,.inventory-reports-no-access
){border-radius:var(--mv-surface-radius);}
:root .mv-directory-frame{
  box-sizing:border-box;
  border:1px solid var(--mv-directory-frame-border);
  border-radius:var(--mv-directory-frame-radius);
  background:var(--mv-section-bg,#f3f6f9);
}
.mv-directory-frame .mv-directory-toolbar{
  display:block;margin:0;padding:0;border:0;border-radius:0;
  background:transparent;box-shadow:none;
}
.mv-directory-frame .mv-directory-search{
  display:grid;grid-template-columns:minmax(0,1fr);gap:6px;
  min-width:0;max-width:100%;margin:0 0 10px;padding:0;
}
.mv-directory-frame .mv-directory-search .mv-directory-search-label{
  /* Keep the explicit input label available to assistive technology without
     repeating the placeholder visually or reserving another line of space. */
  display:block;position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);
  white-space:nowrap;border:0;
}
.mv-directory-frame .mv-directory-search .mv-directory-search-control{
  position:relative;width:min(100%,var(--mv-directory-search-width));
  max-width:var(--mv-directory-search-width);min-width:0;
}
.mv-directory-frame .mv-directory-search .mv-directory-search-input{
  box-sizing:border-box;width:100%;min-height:42px;
  border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius);
  padding:10px 42px 10px 12px;background:var(--mv-surface-bg);color:var(--primary);
  font-family:inherit;font-size:.95rem;font-weight:700;line-height:1.2;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
  -webkit-appearance:none;appearance:none;
}
.mv-directory-frame .mv-directory-search .mv-directory-search-input:focus{
  outline:2px solid rgba(15,76,129,.22);border-color:#0f4c81;
}
.mv-directory-search .mv-directory-search-input::-webkit-search-cancel-button,
.mv-directory-search .mv-directory-search-input::-webkit-search-decoration{
  -webkit-appearance:none;appearance:none;display:none;
}
.mv-directory-frame .mv-directory-search .mv-directory-search-clear{
  position:absolute;top:50%;right:9px;transform:translateY(-50%);
  width:28px;height:28px;padding:0;align-items:center;justify-content:center;
  border:1px solid var(--border);border-radius:999px;
  background:#fff;color:var(--muted);font-size:18px;font-weight:900;line-height:1;
  cursor:pointer;touch-action:manipulation;
}
.mv-directory-search .mv-directory-search-clear[hidden]{display:none!important;}
.mv-directory-frame .mv-directory-search .mv-directory-search-help{
  display:block;width:100%;margin:0;padding:0;color:var(--muted);
  font-size:.76rem;font-weight:500;line-height:1.35;text-align:left;
}
.mv-ws8-opening-notice{
  display:inline-flex;align-items:center;margin:12px;padding:7px 10px;
  border:1px solid #c9dbea;border-left:3px solid #0f4c81;
  border-radius:var(--mv-surface-radius);background:#eff6ff;color:#164b70;
  font-size:.85rem;font-weight:600;line-height:1.35;
}
.mv-ws8-opening-notice[hidden]{display:none!important;}
@media(pointer:coarse){
  .mv-directory-frame .mv-directory-search .mv-directory-search-input{min-height:44px;padding-right:50px;}
  .mv-directory-frame .mv-directory-search .mv-directory-search-clear{width:44px;height:44px;right:0;}
}


/* 4.7.WS8.R5.C6.R3 — reusable feature UI theme contract.
   Opt-in scope only; no viewport, navigation, request or print behavior changes.
   New feature surfaces use mv-theme-scope and explicit mv-action-* / data-mv-tone
   variants. Record/name links, sort handles and resize controls keep their roles. */
@media screen{
  .mv-theme-scope{--border:var(--mv-border-color,#aab9c8);min-width:0;}
  :root .mv-theme-scope :is(.modal-content,.modal-card,.mv-ui-dialog,
    .mv-contact-dialog,.mv-address-dialog){
    border:1px solid var(--mv-border-color);
    border-radius:var(--mv-surface-radius,2px);
    background:var(--mv-section-bg,#f3f6f9);
    color:var(--primary,#1f2937);
  }
  :root .mv-theme-scope :is(.modal-header,.modal-footer,.modal-body,
    .mv-ui-dialog-header,.mv-ui-dialog-body,.mv-ui-dialog-footer){
    background:var(--mv-section-bg,#f3f6f9);
    border-color:var(--mv-border-color);
    min-width:0;
  }
  :root .mv-theme-scope :is(button,[role="button"],a,input,select,textarea):focus-visible{
    outline:2px solid var(--mv-focus-color);outline-offset:2px;
  }
  :root .mv-theme-scope :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),select,textarea){
    box-sizing:border-box;min-width:0;max-width:100%;min-height:var(--mv-control-height);
    border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius,2px);
    background:var(--mv-field-bg);color:var(--primary,#1f2937);
  }
  :root .mv-theme-scope :is(input,select,textarea):disabled,
  :root .mv-theme-scope :is(input,textarea)[readonly]{
    background:var(--mv-field-readonly-bg);color:#405367;
  }
  :root .mv-theme-scope input:is([type="checkbox"],[type="radio"]){
    accent-color:var(--mv-action-primary-bg);flex-shrink:0;
  }
  :root .mv-theme-scope input[type="checkbox"]{width:16px;height:16px;margin:0 6px 0 0;}
  :root .mv-theme-scope .mv-write-processing__status{
    border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius,2px);
    background:var(--mv-action-primary-bg);box-shadow:var(--mv-ui-shadow);
  }
}
@media screen and (any-pointer:coarse),screen and (max-width:600px){
  :root .mv-theme-scope :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),select,textarea){
    min-height:var(--mv-touch-target);font-size:16px;
  }
}
@media screen and (forced-colors:active){
  :root .mv-theme-scope :is(.btn,[data-mv-tone]){forced-color-adjust:auto;}
}

/* Inventory setup/reconciliation handoffs use the same opt-in surface rules. */
@media screen{
  :root .mv-theme-scope :is(
    .inventory-setup-sub-accordion,.inventory-setup-location-card,
    .inventory-location-filter-row,.inventory-location-card,.inventory-location-type-manager-card-row,
    .inventory-freeze-child-accordion,.inventory-freeze-panel,.inventory-freeze-card,
    .inventory-freeze-report-grid,.inventory-freeze-lookup-card,
    .inventory-reconciliation-admin-lock-card,.inventory-reconciliation-admin-panel,
    .inventory-reconciliation-issue-card,.inventory-reconciliation-history-filter-grid,
    .inventory-reconciliation-history-results,.inventory-repair-preview-section,
    .inventory-repair-preview-field,.inventory-repair-preview-option,
    .inventory-repair-receipt,.inventory-repair-receipt-hero,.inventory-repair-receipt-section,
    .inventory-repair-receipt-field,.inventory-repair-receipt-note){
    min-width:0;border:1px solid var(--mv-border-color);
    border-radius:var(--mv-surface-radius,2px);background:var(--mv-section-bg,#f3f6f9);
  }
  :root .mv-theme-scope :is(
    .inventory-setup-sub-summary,.inventory-setup-sub-body,
    .inventory-location-modal-head,.inventory-location-modal-actions,
    .inventory-freeze-child-summary,.inventory-freeze-child-body,
    .inventory-freeze-lookup-head,.inventory-freeze-lookup-row,
    .inventory-reconciliation-issue-summary,.inventory-reconciliation-issue-accordion-body,
    .inventory-repair-preview-head,.inventory-repair-preview-body){
    min-width:0;border-color:var(--mv-border-color);
    border-radius:var(--mv-surface-radius,2px);background:var(--mv-section-bg,#f3f6f9);
  }
  :root .mv-theme-scope .inventory-repair-preview-before-after>div{
    border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius,2px);
    background:var(--mv-section-bg,#f3f6f9);min-width:0;
  }
  :root .mv-theme-scope :is(.freeze-select-trigger,.freeze-select-menu,.freeze-select-option,
    .freeze-check-card,.freeze-check-box,.inventory-reconciliation-history-select-button,
    .inventory-reconciliation-history-select-menu,.inventory-reconciliation-history-select-option){
    border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius,2px);
  }
  :root .mv-theme-scope :is(.freeze-select-trigger,.freeze-select-menu,
    .inventory-reconciliation-history-select-button,.inventory-reconciliation-history-select-menu){
    background:var(--mv-field-bg);color:var(--primary);
  }
  :root .mv-theme-scope :is(.inventory-location-field-clear-btn,
    .inventory-freeze-lookup-close,.inventory-freeze-lookup-clear){
    min-width:32px;min-height:32px;padding:4px;
  }
}
@media screen and (any-pointer:coarse),screen and (max-width:600px){
  :root .mv-theme-scope :is(.inventory-location-field-clear-btn,
    .inventory-freeze-lookup-close,.inventory-freeze-lookup-clear,
    .freeze-select-trigger,.inventory-reconciliation-history-select-button){
    min-width:var(--mv-touch-target);min-height:var(--mv-touch-target);
  }
}

/* Explicit scoped geometry wins legacy id-based 4px fields and confirm cards. */
@media screen{
  :root .mv-theme-scope :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),select,textarea){
    border-radius:var(--mv-surface-radius,2px)!important;
  }
  #appConfirmModal.mv-theme-scope .modal-card,
  #mvPosCloseChoiceModal.mv-theme-scope .modal-card,
  #messageModal.mv-theme-scope .modal-card{
    border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius,2px)!important;
    background:var(--mv-section-bg,#f3f6f9);box-shadow:0 8px 28px rgba(15,35,55,.22);
  }
  :is(#companyInventoryLocationOverlay,#inventoryFreezeReportOverlay,
    #inventoryReconciliationUnlockOverlay,#inventoryReconciliationReportOverlay,
    #inventoryReconciliationRepairPreviewOverlay,#inventoryReconciliationApplyOverlay).mv-theme-scope .modal-card{
    border:1px solid var(--mv-border-color);border-radius:var(--mv-surface-radius,2px)!important;
    background:var(--mv-section-bg,#f3f6f9);
  }
}

/* Long references in shared messages remain readable within the dialog. */
@media screen{
  .mv-theme-scope :is(#appConfirmText,#appConfirmTitle,#msgText,#msgTitle){
    min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:normal;
  }
}

/* C6.R4: shared Setup/admin/POS/alerts surfaces. Existing visibility, locking,
   positioning, overflow and operation-state selectors above retain ownership. */
@media screen{
  :is(.modal-card,.modal-content,.overlay-card,.recovery-card,.initial-platform-setup-card){
    border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius);
    background:var(--mv-section-bg);color:var(--primary);
  }
  :is(.acc-card,.acc-card--nested,.inventory-setup-sub-accordion,.inventory-freeze-child-accordion){
    border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius);
    background:var(--mv-section-bg);box-shadow:none;
  }
  :is(.acc-summary,.acc-card--nested>.acc-summary,.inventory-setup-sub-summary,
    .inventory-freeze-child-summary,.inventory-reconciliation-issue-summary){
    background:var(--mv-section-heading-bg);color:var(--mv-heading-text);
    border-color:var(--mv-border-color);box-shadow:none;
  }
  :is(.acc-summary,.inventory-setup-sub-summary) :is(.acc-sub,.acc-caret){color:#405a77;}
  :is(.acc-body,.acc-card--nested>.acc-body,.inventory-setup-body,.inventory-setup-sub-body,
    .inventory-freeze-child-body,.inventory-reconciliation-issue-accordion-body){background:var(--mv-section-bg);}
  :is(.access-policy-toolbar,.access-policy-catalog-toolbar,.staff-role-catalog-body,
    .staff-role-catalog-intro,.tenant-management-unlocked-toolbar,.inventory-location-filter-row,
    .inventory-reconciliation-history-filter-grid,.recovery-controls,.recovery-report,
    .mv-r24__toolbar,.mv-r24__history-field,.mv-r24__inspection,.mv-r3__toolbar,
    .pos-location-pick-context,.pos-status-alert-grid,.mv-pos-hold-review-filters){
    background:var(--mv-section-bg);border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius);box-shadow:none;
  }
  :is(.staff-role-card,.access-policy-group-card,.access-policy-role-card,.tenant-billing-list-card,
    .inventory-setup-location-card,.inventory-location-card,.inventory-location-type-manager-card-row,
    .inventory-freeze-card,.inventory-freeze-lookup-card,.inventory-reconciliation-issue-card,
    .inventory-repair-preview-field,.inventory-repair-receipt-field,.inventory-repair-receipt-note,
    .pos-status-alert-grid>div,.mv-pos-hold-review-card,.mv-pos-hold-review-detail-card,
    .mv-r24__facts>div,.mv-r24__step,.mv-r24__inspection-findings>section){
    background:var(--mv-surface-bg);border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius);box-shadow:none;
  }
  :is(.recovery-card__header,.initial-platform-setup-header,.mv-pos-hold-review-head){
    background:var(--mv-title-bg);color:var(--mv-title-text);border-color:var(--mv-border-color);
  }
  :is(.recovery-card__header,.initial-platform-setup-header,.mv-pos-hold-review-head) :is(h2,h3,h4,p,small){color:inherit;}
  .mv-shell-alert-card{background:var(--mv-section-bg);border-color:var(--mv-border-color);border-radius:var(--mv-surface-radius);}
  .mv-shell-alert-card .mv-shell-alert-head{background:var(--mv-section-heading-bg);color:var(--mv-heading-text);}
  :is(.mv-shell-alert-item,.mv-pos-hold-review-warning){border-radius:var(--mv-surface-radius);}
  :is(.recovery-controls .btn,.recovery-card .btn,#databaseRestrictedAccessOverlay .btn,#appConfirmModal .btn){
    flex:0 1 auto;min-height:var(--mv-control-height);padding:7px 12px;overflow-wrap:normal;word-break:normal;
  }
  :is(.pos-cart-line__description-icon-button,.pos-cart-line__description-restore-button){
    border-radius:var(--mv-surface-radius);box-shadow:none;
  }
}
@media screen and (any-pointer:coarse),screen and (max-width:600px){
  :is(.recovery-controls .btn,.recovery-card .btn,#databaseRestrictedAccessOverlay .btn,#appConfirmModal .btn,
    .pos-cart-line__description-icon-button,.pos-cart-line__description-restore-button){min-height:44px;min-width:44px;}
}

@media screen{
  :root .mv-theme-scope :is(.inventory-setup-location-card,.inventory-location-card,.inventory-location-type-manager-card-row,
    .inventory-freeze-card,.inventory-freeze-lookup-card,.inventory-reconciliation-issue-card,
    .inventory-repair-preview-field,.inventory-repair-preview-option,.inventory-repair-receipt-field,
    .inventory-repair-receipt-note,.inventory-repair-preview-before-after>div){background:var(--mv-surface-bg);}
  :root .mv-theme-scope :is(.inventory-setup-sub-summary,.inventory-freeze-child-summary,
    .inventory-reconciliation-issue-summary){background:var(--mv-section-heading-bg);color:var(--mv-heading-text);}
  :root .mv-theme-scope :is(.inventory-location-modal-head,.inventory-freeze-lookup-head,.inventory-repair-preview-head){
    background:var(--mv-title-bg);color:var(--mv-title-text);
  }
  :root .mv-theme-scope :is(.inventory-location-modal-head,.inventory-freeze-lookup-head,.inventory-repair-preview-head) :is(h3,h4,p,small){color:inherit;}
  :root .mv-theme-scope :is(.mv-ui-dialog-header,.modal-header){background:var(--mv-title-bg);color:var(--mv-title-text);}
  :root .mv-theme-scope :is(.mv-ui-dialog-header,.modal-header) :is(h2,h3,h4,p,small){color:inherit;}
  .mv-shell-alert-item-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;}
  .mv-shell-alert-item-actions>.mv-control{flex:0 1 auto;width:auto;}
}

/* 4.7B.7.C5.C7.C3: compact recovery activity, never an input-blocking veil. */
.recovery-feedback{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:2px;padding:7px 9px;margin:8px 0;background:var(--card,#fff);color:var(--primary,#153d60)}
.recovery-feedback[hidden],.recovery-feedback progress[hidden]{display:none!important}
.recovery-feedback>div{flex:1;min-width:0}.recovery-feedback strong,.recovery-feedback [data-feedback-details]{display:block;overflow-wrap:anywhere;font-size:.82rem;line-height:1.35}
.recovery-feedback [data-feedback-details],.recovery-feedback small{font-size:.75rem;color:var(--muted,#475569)}
.recovery-feedback small{white-space:nowrap}.recovery-feedback progress{display:block;width:100%;height:5px;margin-top:5px;accent-color:var(--mv-action-primary-bg,#0f4c81)}
.recovery-feedback__spinner{display:none;flex:none;width:14px;height:14px;border:2px solid #c4d1dd;border-top-color:var(--mv-action-primary-bg,#0f4c81);border-radius:50%;animation:mv-recovery-turn .9s linear infinite}
.recovery-feedback[data-active="true"] .recovery-feedback__spinner{display:block}
.recovery-feedback[data-kind="error"]{border-color:var(--danger,#b42318)}
.recovery-feedback[data-kind="success"]{border-color:var(--success,#087f5b)}
.recovery-controls .mv-control--icon,.recovery-card .mv-control--icon{flex:0 0 44px;width:44px;min-width:44px;max-width:44px!important;min-height:44px;height:44px;padding:8px}
#staffBulkResetBtn.mv-control--icon,button[aria-label="Add Staff"].mv-control--icon{min-width:44px;min-height:44px}
button[aria-label="Add Staff"]>svg{width:20px;height:20px;flex:none;pointer-events:none}
@keyframes mv-recovery-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.recovery-feedback__spinner{animation:none}}

/* 4.7B.9.C1 Reports subtitle on the light themed header. */
#workspaceReportsOverlay .mv-shell-reports-subtitle{color:#000;}
/* 4.7B.9.C2 protected company presentation editor. */
#setupModal .company-ui-options{border-radius:2px;}
#setupModal .company-ui-options .acc-body{padding:14px;}
#setupModal .company-ui-options fieldset{min-width:0;margin:0;padding:0;border:0;}
#setupModal .company-ui-options legend{padding:0;margin-bottom:8px;font-size:15px;font-weight:700;color:#173d59;}
#setupModal .company-ui-company{margin:0 0 10px;font-size:13px;color:#425466;}
#setupModal .company-ui-options-grid{display:grid;grid-template-columns:minmax(240px,1fr) minmax(180px,1fr);gap:18px;max-width:800px;align-items:center;}
#setupModal .company-ui-choices{display:grid;gap:6px;}
#setupModal .company-ui-choices label{display:flex;align-items:center;gap:10px;min-height:54px;margin:0;padding:6px 10px;border:1px solid #c1cdd8;border-radius:2px;background:#f6f9fc;font-size:14px;cursor:pointer;}
#setupModal .company-ui-choices label:has(input:checked){background:#edf5fb;border-color:#2172a5;}
#setupModal .company-ui-choices input{appearance:auto;width:20px;height:20px;min-width:20px;margin:0;accent-color:#176895;}
#setupModal .company-ui-choices input:focus-visible{outline:2px solid #176895;outline-offset:3px;}
#setupModal .company-ui-choices small{display:block;margin-top:3px;font-size:12px;line-height:1.4;color:#425466;}
#setupModal .company-ui-preview{display:grid;grid-template-columns:32% 1fr;gap:8px;padding:10px;min-height:124px;background:#f4f7fa;border:1px solid #b4c2cf;border-radius:2px;box-sizing:border-box;}
#setupModal .company-ui-preview[data-layout="top"]{grid-template-columns:1fr;grid-template-rows:38px 1fr;}
#setupModal .company-ui-preview>div{display:grid;place-items:center;text-align:center;padding:6px;border:1px solid #bccbd6;border-radius:2px;color:#28465d;font-size:12px;}
#setupModal .company-ui-mini-filters{background:#e5eef5;}
#setupModal .company-ui-mini-statement{background:white;}
#setupModal .company-ui-help{font-size:13px;line-height:1.4;margin:12px 0 6px;color:#425466;}
#setupModal .company-ui-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
#setupModal #companyUiOptionsStatus{flex:1 1 220px;font-size:13px;line-height:1.5;margin:0;color:#365369;}
#setupModal #companyUiOptionsStatus[data-error="true"]{color:#a6251b;}
#setupModal .company-ui-actions button{min-width:44px;min-height:44px;border-radius:2px;}
@media(max-width:600px){#setupModal .company-ui-options-grid{grid-template-columns:minmax(0,1fr);gap:12px;}#setupModal .company-ui-choices label{font-size:14px;}#setupModal #companyUiOptionsStatus{flex-basis:100%;}}
@media(forced-colors:active){#setupModal .company-ui-choices label:has(input:checked){border-color:Highlight;}#setupModal .company-ui-preview>div{color:CanvasText;border-color:CanvasText;}}

/* B10.C2: existing Restore owner at the end of the readiness/report row. */
#databaseRecoveryControls .recovery-controls__restore-action{display:flex;align-items:center;flex:0 0 auto;margin-inline-start:auto;max-width:100%}
#databaseRecoveryControls .recovery-controls__restore-action[hidden]{display:none!important}
#databaseRecoveryControls .recovery-controls__restore-action>button{flex:0 0 auto;max-width:100%}

/* C6.P2.C3.C1 — shared compact draft-close review, inside the workspace portal. */
#mvDraftCloseReviewModal{padding:12px;box-sizing:border-box;}
#mvDraftCloseReviewModal .mv-draft-close-card{width:min(100%,760px);max-width:760px;max-height:calc(100dvh - 40px);margin:0;padding:12px;display:flex;flex-direction:column;gap:10px;text-align:left;box-sizing:border-box;overflow:auto;}
#mvDraftCloseReviewModal .mv-dialog-heading{margin:0;padding:10px 12px;font-size:1.05rem;}
#mvDraftCloseReviewModal .mv-draft-close-message{margin:0;font-size:.92rem;line-height:1.45;overflow-wrap:anywhere;}
#mvDraftCloseReviewModal .mv-draft-close-list{border:1px solid var(--mv-border-color,#aab9c8);min-height:0;overflow:auto;}
#mvDraftCloseReviewModal .mv-draft-close-row{padding:8px 10px;background:#fff;border-bottom:1px solid var(--mv-border-color,#aab9c8);min-width:0;}
#mvDraftCloseReviewModal .mv-draft-close-row:nth-child(even){background:#edf4fb;}
#mvDraftCloseReviewModal .mv-draft-close-row:last-child{border-bottom:0;}
#mvDraftCloseReviewModal .mv-draft-close-row strong{display:block;overflow-wrap:anywhere;}
#mvDraftCloseReviewModal .mv-draft-close-meta,#mvDraftCloseReviewModal .mv-draft-close-reason{display:block;line-height:1.4;font-size:.84rem;overflow-wrap:anywhere;color:#244158;}
#mvDraftCloseReviewModal .mv-draft-close-reason{color:#934310;margin-top:3px;}
#mvDraftCloseReviewModal .mv-draft-close-controls,#mvDraftCloseReviewModal .mv-draft-close-options,#mvDraftCloseReviewModal .mv-draft-close-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;}
#mvDraftCloseReviewModal .mv-draft-close-controls{justify-content:space-between;margin-top:6px;}
#mvDraftCloseReviewModal .mv-draft-close-option{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:4px 9px;box-sizing:border-box;border:1px solid #89a8c6;border-radius:var(--mv-surface-radius,2px);background:#f3f8fd;color:#164e7a;cursor:pointer;font-size:.85rem;}
#mvDraftCloseReviewModal .mv-draft-close-option:has(input:checked){border-color:#175f9a;background:#dceeff;box-shadow:inset 0 -3px #d6ac2b;}
#mvDraftCloseReviewModal .mv-draft-close-option--delete{color:#a32121;border-color:#d68d8d;background:#fff6f5;}
#mvDraftCloseReviewModal .mv-draft-close-option--delete:has(input:checked){border-color:#b72323;background:#ffe4df;box-shadow:inset 0 -3px #b72323;}
#mvDraftCloseReviewModal .mv-draft-close-option input{margin:0;min-width:16px;min-height:16px;}
#mvDraftCloseReviewModal .btn{min-height:44px;max-width:100%;height:auto;white-space:normal;line-height:1.3;}
#mvDraftCloseReviewModal .mv-draft-close-actions{justify-content:flex-end;border-top:1px solid var(--mv-border-color,#aab9c8);padding-top:10px;}
#mvDraftCloseReviewModal .mv-draft-close-warning{border:1px solid #cb7770;background:#fff2ef;color:#82251c;padding:10px;line-height:1.45;overflow-wrap:anywhere;}
#mvDraftCloseReviewModal .mv-draft-close-warning ul{margin:0 0 8px;padding-left:24px;}
#mvDraftCloseReviewModal .mv-draft-close-warning p{margin:0;}
#mvDraftCloseReviewModal [hidden]{display:none!important;}
@media(max-width:600px){#mvDraftCloseReviewModal{padding:8px;}#mvDraftCloseReviewModal .mv-draft-close-card{padding:9px;max-height:calc(100dvh - 24px);}#mvDraftCloseReviewModal .mv-draft-close-controls{align-items:stretch;gap:8px;}#mvDraftCloseReviewModal .mv-draft-close-options{flex:1 1 100%;}#mvDraftCloseReviewModal .mv-draft-close-actions{justify-content:stretch;}#mvDraftCloseReviewModal .mv-draft-close-actions .btn{flex:1 1 auto;}}

/* 4.7B.12.C6.P2.C3.C2.C1: existing compact recovery theme and touch targets. */
.mv-release-info{margin:4px 0 8px;font-size:.72rem;line-height:1.4;color:var(--muted,#475569);overflow-wrap:anywhere;font-weight:400}
.mv-release-info>span{display:block;font-size:.68rem}
#loginOverlay .mv-release-info{text-align:center}
#loginOverlay .mv-release-info--compact{display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;overflow-wrap:normal}
#loginOverlay .mv-release-info--compact>span{display:inline;font-size:inherit}
#loginOverlay .mv-release-info--compact .mv-release-divider{flex:0 0 6px;width:6px;height:10px}
.recovery-card .recovery-automatic-choice{display:flex;align-items:center;gap:8px;min-height:44px;margin:8px 0;padding:4px 6px;border:1px solid var(--mv-border-color,var(--border));border-radius:var(--mv-surface-radius,2px);background:var(--mv-section-bg,var(--card,#fff));font-size:.8rem;font-weight:400;cursor:pointer}
.recovery-card .recovery-automatic-choice input{flex:0 0 20px;width:20px;min-height:20px;height:20px;margin:0;padding:0;accent-color:var(--mv-action-primary-bg,#0f4c81)}
.recovery-card .recovery-automatic-choice[hidden]{display:none!important}
.recovery-credential-notice{margin:6px 0;font-size:.78rem;line-height:1.4;color:var(--primary,#153d60)}

/* C3 restore timing and authoritative outcome notification. */
.recovery-timer{display:flex;align-items:center;gap:7px;flex-wrap:wrap;width:fit-content;max-width:100%;padding:5px 8px;margin:6px 0;border:1px solid #b9cfdf;border-radius:4px;background:#eff6ff;color:#153d60;font:600 .78rem/1.4 system-ui}
.recovery-timer[hidden]{display:none!important}.recovery-timer strong{font-variant-numeric:tabular-nums;letter-spacing:.03em}.recovery-timer__icon{font-size:1.1rem;line-height:1}.recovery-timer [data-restore-time-state]{padding-left:7px;border-left:1px solid currentColor;font-size:.73rem}
.recovery-timer[data-kind="success"]{background:#ecfdf5;border-color:#86c4a4;color:#065f46}.recovery-timer[data-kind="warning"]{background:#fffbeb;border-color:#e4c474;color:#92400e}.recovery-timer[data-kind="error"]{background:#fef2f2;border-color:#e3aaaa;color:#991b1b}
.recovery-result .recovery-card{padding:14px;border:1px solid #b9cfdf;border-radius:6px}.recovery-result__header{padding:8px 10px;background:#153d60;color:#fff;border-radius:3px}.recovery-result__header h2{margin:0;font-size:1rem;color:inherit}.recovery-result p{font-size:.85rem;line-height:1.45;margin:10px 0}.recovery-result__detail{white-space:pre-wrap;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.recovery-result .recovery-controls__row{gap:6px;margin:10px 0 0}.recovery-result button{min-height:44px}.recovery-result[data-kind="success"] .recovery-card{border-left:4px solid #15803d}.recovery-result[data-kind="warning"] .recovery-card{border-left:4px solid #b45309}.recovery-result[data-kind="error"] .recovery-card{border-left:4px solid #b91c1c}

.recovery-time-details{max-width:100%;font-size:.75rem;color:var(--primary,#153d60);margin:0 0 6px}.recovery-time-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;width:fit-content;text-decoration:underline;text-underline-offset:3px}.recovery-time-details p{white-space:pre-wrap;line-height:1.45;margin:0;padding:8px;border-left:2px solid #b9cfdf;background:#eff6ff}.recovery-time-details[hidden]{display:none!important}

.recovery-timer #databaseRestoreServerTime{padding-left:7px;border-left:1px solid currentColor;font-size:.72rem;font-weight:500}

/* C13: visibly separate retained readiness and completed adoption reports. */
.recovery-controls__row--reports{align-items:center;gap:6px}
.recovery-report-actions{display:inline-flex;align-items:center;gap:4px;flex:0 1 auto;min-width:0;max-width:100%;padding:0 4px;border-left:1px solid var(--border);border-right:1px solid var(--border);border-radius:2px;background:#eff6ff}
.recovery-report-actions__label{flex:1 1 auto;min-width:0;margin-right:2px;color:#153d60;font-size:.76rem;font-weight:750;line-height:1.25;overflow-wrap:anywhere}
.recovery-report-actions[hidden]{display:none!important}
.recovery-report__guidance{padding:0 8px 8px}.recovery-report__guidance h5{font-size:.86rem;margin:6px 0}.recovery-report__observation{margin:6px 0;font-size:.8rem;line-height:1.4}
.recovery-report__technical>summary,.recovery-report__findings>summary,.recovery-report__identity>summary,.recovery-report__raw>summary{box-sizing:border-box;min-height:44px;padding:7px 10px;line-height:1.4;align-content:center}
@media(max-width:520px){.recovery-controls__row--reports>.recovery-report-actions{flex:1 1 100%}.recovery-controls__row--reports>.recovery-badge{flex:0 1 auto}.recovery-report-actions__label{font-size:.8rem}.recovery-report__definitions{grid-template-columns:minmax(100px,36%) minmax(0,1fr)}}
.database-readiness__finding[data-kind="info"]>summary{color:#153d60;background:#eff6ff}.recovery-report__guidance .database-readiness__finding[data-kind="warning"]>summary{color:#991b1b;font-weight:800}

/* C13.C2: scoped recovery navigation and readable protected-access subtitle. */
#recoveryRestrictedAccessOverlay .recovery-access-subtitle,
#databaseRestrictedAccessOverlay .recovery-access-subtitle,
#recoveryOperationsOverlay .recovery-access-subtitle {
  color:var(--mv-page-heading-ink,#123f64);
  -webkit-text-fill-color:var(--mv-page-heading-ink,#123f64);
  font-weight:700;
}
#recoveryOperationsOverlay[aria-hidden="true"]{display:none!important}
.recovery-operations-card{padding:12px}
.recovery-operations-header{align-items:center;gap:8px;padding:8px;background:var(--mv-page-header-bg,#d6e5f1)!important;color:var(--mv-page-heading-ink,#123f64)}
.recovery-operations-header h2{margin:3px 0 0;font-family:var(--mv-page-font-family,"Segoe UI",Arial,sans-serif);font-size:16px;font-weight:500;line-height:1.3;color:var(--mv-page-heading-ink,#123f64)}
.recovery-operations-header__actions{display:flex;gap:4px;align-items:center;flex:0 0 auto}
#recoveryOperationsOverlay .recovery-operations-header__actions .btn{flex:0 0 44px;min-width:44px;min-height:44px;width:44px;padding:0}
.recovery-operations-intro{margin:8px 0;line-height:1.4;font-size:.85rem}
#recoveryOperationsHost>.recovery-controls{margin:0;padding:8px}
#recoveryOperationsHost .recovery-controls__row{gap:6px;margin:6px 0}
#recoveryRestrictedOperationsBtn{min-height:44px}
@media(max-width:520px){
  .recovery-operations-card{padding:8px}
  .recovery-operations-header{padding:6px;align-items:flex-start}
  .recovery-operations-header h2{font-size:1.1rem}
  .recovery-operations-header .recovery-access-subtitle{font-size:.72rem}
}
