﻿.erp-app-shell { min-height: 100vh; display: flex; background: var(--erp-black); color: var(--erp-text-secondary); }
.erp-main-shell { min-width: 0; flex: 1 1 auto; margin-left: var(--erp-sidebar-width); transition: margin var(--erp-motion-base) var(--erp-ease); }
.erp-sidebar-collapsed .erp-main-shell { margin-left: var(--erp-sidebar-collapsed-width); }
.erp-main-content, .page-shell { width: min(100%, var(--erp-content-max)); margin: 0 auto; padding: var(--erp-space-6); }
.erp-main-content main { min-width: 0; }
.erp-topbar { min-height: var(--erp-topbar-height); position: sticky; top: 0; z-index: var(--erp-z-topbar); display: flex; align-items: center; justify-content: space-between; gap: var(--erp-space-4); padding: var(--erp-space-3) var(--erp-space-6); background: rgba(var(--erp-rgb-card), 0.9); border-bottom: 1px solid var(--erp-border-gold-hairline); backdrop-filter: blur(14px); }
.erp-topbar-left, .erp-topbar-tools, .erp-topbar-utility, .erp-topbar-accountzone { display: flex; align-items: center; gap: var(--erp-space-3); min-width: 0; }
.erp-topbar-left { flex: 1 1 auto; }
.erp-topbar-tools { flex-wrap: wrap; justify-content: flex-end; }
.erp-topbar-copy { min-width: 0; display: grid; gap: 2px; }
.erp-topbar-caption { color: var(--erp-gold-primary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.erp-topbar-title { color: var(--erp-text-primary); font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-public-header { min-height: var(--erp-topbar-height); display: flex; align-items: center; justify-content: space-between; padding: var(--erp-space-4) var(--erp-space-6); background: rgba(var(--erp-rgb-card), 0.9); border-bottom: 1px solid var(--erp-border); }
.erp-public-actions { display: flex; align-items: center; gap: var(--erp-space-2); }
.erp-sidebar { position: fixed; inset: 0 auto 0 0; z-index: var(--erp-z-topbar); width: var(--erp-sidebar-width); display: flex; flex-direction: column; gap: var(--erp-space-4); padding: var(--erp-space-4); background: var(--erp-card); border-right: 1px solid var(--erp-border); transition: width var(--erp-motion-base) var(--erp-ease); }
.erp-sidebar-collapsed .erp-sidebar { width: var(--erp-sidebar-collapsed-width); }
.erp-sidebar-head, .erp-sidebar-brand, .erp-sidebar-context, .erp-nav-link-main { display: flex; align-items: center; gap: var(--erp-space-3); min-width: 0; }
.erp-sidebar-head { justify-content: space-between; }
.erp-sidebar-brand { color: var(--erp-text-primary); font-weight: 800; }
.erp-sidebar-brand-mark, .auth-brand-mark { width: 32px; height: 32px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--erp-radius-sm); background: linear-gradient(135deg, var(--erp-gold-primary), var(--erp-gold-dark)); color: var(--erp-black); font-size: 12px; font-weight: 900; }
.erp-sidebar-brand-copy, .auth-brand-text { min-width: 0; display: grid; gap: 1px; }
.erp-sidebar-brand-title, .auth-brand-title { color: var(--erp-text-primary); font-size: 14px; font-weight: 900; }
.erp-sidebar-brand-subtitle, .auth-brand-subtitle { color: var(--erp-text-muted); font-size: 11px; }
.erp-sidebar-toggle, .erp-mobile-menu { width: 36px; height: 36px; border: 1px solid var(--erp-border); border-radius: var(--erp-radius-sm); background: transparent; color: var(--erp-gold-light); display: inline-grid; place-items: center; cursor: pointer; }
.erp-sidebar-toggle-bar, .erp-mobile-menu-line { width: 16px; height: 2px; display: block; background: currentColor; border-radius: var(--erp-radius-pill); margin: 2px 0; }
.erp-sidebar-context { display: grid; align-items: stretch; padding: var(--erp-space-3); border: 1px solid var(--erp-border); border-radius: var(--erp-radius-md); background: var(--color-erp-context); }
.erp-sidebar-context-label { color: var(--erp-gold-label); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.erp-sidebar-context-value { color: var(--erp-gold-light); font-size: 14px; font-weight: 800; }
.erp-sidebar-context-meta { color: var(--erp-text-muted); font-size: 11px; }
.erp-sidebar-scroll { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--erp-space-4); }
.erp-footer { margin-top: var(--erp-space-8); padding-top: var(--erp-space-4); border-top: 1px solid var(--erp-border); color: var(--erp-text-muted); font-size: 12px; }
/* impersonate banner — Phase 4.A.4 升級為頂部全寬紅 bar
   依據：ERP 操作大師硬條件「sticky toast 在右上易被忽略；SAP-style 慣例是頂部全寬紅 bar」
   sticky 跟著 topbar 一起釘在頂部，danger 色強烈視覺提醒 admin 正處於 impersonate 模式 */
/* support-mode banner — compact horizontal strip per UIUX RPT 2026-05-14
   原規格 padding-3 + gradient + 2px borders 過厚，疊加 sticky top + tenant-switch
   dropdown 開啟時會擋住 banner 右側 action button。改 compact 1-row 設計：
   - padding 收緊（top/bottom = space-2）
   - 只保留底邊 danger border + 左側 danger 直條
   - 內容 single-row truncate；溢出 dropdown 才換行
   - position: relative + z-index: 70 確保 action button 一定在 dropdown 之上
*/
/* Wave 8 (A8) 2026-05-15 — Support banner 低調化
   原因：用戶反饋紅 banner 占頂部全寬太搶眼、每頁都吃空間
   修法：保留功能但降低視覺權重 — 去掉 2px 紅底線、padding 縮小、紅色僅在左邊 4px
   仍保留 aria-live + 退出支援模式 CTA（a11y / 操作完整）

   P1.9 refresh 2026-05-16 — 紅 → 橘對齊 UI_SUPPORT_MODE_BANNER §2.2：
   spec 強制 banner 橘色（#fa8c16）區隔 tenant accent + danger row highlight。
   role="banner" + aria-label 升級（取代 role="status"），icon → fa-exclamation-triangle。
   保留 compact 風格（低調化版型）— 純 visual refresh，未改觸發邏輯 / cookie / claim。 */
.erp-support-mode-banner {
  position: relative;
  z-index: var(--erp-z-sticky-banner);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--erp-space-3);
  padding: 6px var(--erp-space-4);
  background: var(--erp-color-support-mode-banner-bg-soft);
  border-left: 3px solid var(--erp-color-support-mode-banner);
  color: var(--erp-text-secondary);
}
.erp-support-mode-copy {
  display: flex;
  align-items: center;
  gap: var(--erp-space-3);
  flex-wrap: wrap;
  min-width: 0;
}
.erp-support-mode-kicker {
  color: var(--erp-color-support-mode-banner-text);
  background: var(--erp-color-support-mode-banner);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 10px 2px 8px;
  border: 1px solid var(--erp-color-support-mode-banner-strong);
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.erp-support-mode-kicker__icon {
  font-size: 13px;
  line-height: 1;
}
.erp-support-mode-title {
  color: var(--erp-text-primary);
  display: flex;
  gap: var(--erp-space-2);
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.erp-support-mode-title strong { color: var(--erp-color-support-mode-banner-strong); }
.erp-support-mode-detail {
  color: var(--erp-text-secondary);
  font-size: 12px;
  margin: 0;
  /* 永遠顯示（修 P2-2 hover-only — 觸控桌面/鍵盤使用者也要看到 detail）。
     大畫面 inline 接在 title 後；窄畫面 stack column 自動換行 */
  display: inline;
}
.erp-support-mode-actions {
  display: flex;
  align-items: center;
  gap: var(--erp-space-2);
  flex-shrink: 0;
}
/* U-19: leave-support is a POST form (state change). display:contents keeps the
   submit button as a direct flex item of .erp-support-mode-actions — aligned with
   the sibling workspace <a>, no extra wrapper box. */
.erp-support-mode-leave-form { display: contents; }
@media (max-width: 767px) {
  .erp-support-mode-banner { flex-direction: column; align-items: stretch; padding: var(--erp-space-2) var(--erp-space-3); }
  .erp-support-mode-actions { justify-content: flex-end; }
  .erp-support-mode-detail { display: block; }
  .erp-support-mode-copy { flex-direction: column; align-items: flex-start; gap: 4px; }
}
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--erp-space-6); background: var(--erp-black); }
.auth-shell-stack { width: min(100%, 480px); display: grid; gap: var(--erp-space-6); }
.auth-brand { display: inline-flex; align-items: center; justify-content: center; gap: var(--erp-space-3); color: var(--erp-text-primary); }
.auth-shell-form { background: var(--erp-card); border: 1px solid var(--erp-border); border-radius: var(--erp-radius-lg); padding: var(--erp-space-6); box-shadow: var(--erp-shadow-card); }
/* 波 1.1 mobile sidebar drawer (PM 2026-05-30 ratified, UIMP §Navigation And Shell Rules).
   `display:none` removed; sidebar collapses to off-canvas drawer.
   All literal values delegated to 00-tokens.css — if any of the tokens below
   are not yet declared there, declare them BEFORE relying on this rule
   (drift-check Rule 1 forbids literal fallbacks via `var(--x, fallback)`).
   Required tokens: --erp-drawer-max-width / --erp-ds-motion-base /
   --erp-ds-motion-exit / --erp-ds-ease-emphasis / --erp-z-drawer /
   --erp-ds-bg-overlay / --erp-drawer-backdrop-blur /
   --erp-drawer-backdrop-saturate / --erp-space-4. */
@media (max-width: 1023px) {
  .erp-main-shell,
  .erp-sidebar-collapsed .erp-main-shell { margin-left: 0; }
  .erp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, var(--erp-drawer-max-width));
    transform: translateX(-100%);
    transition: transform var(--erp-ds-motion-base) var(--erp-ds-ease-emphasis);
    z-index: var(--erp-z-drawer);
  }
  .erp-sidebar[data-sidebar-drawer][data-open] { transform: translateX(0); }
  .erp-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: var(--erp-ds-bg-overlay);
    backdrop-filter: blur(var(--erp-drawer-backdrop-blur)) saturate(var(--erp-drawer-backdrop-saturate));
    z-index: calc(var(--erp-z-drawer) - 10);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--erp-ds-motion-exit) var(--erp-ds-ease-emphasis);
  }
  .erp-sidebar-backdrop[data-open] { opacity: 1; pointer-events: auto; }
  .erp-main-content,
  .page-shell { padding: var(--erp-space-4); }
  .erp-topbar { padding-inline: var(--erp-space-4); }
}
.erp-page-container { width: min(100%, var(--erp-content-max)); margin: 0 auto; padding: var(--erp-space-6); }
.erp-page-container--full { width: 100%; max-width: none; padding-inline: var(--erp-space-6); }
.erp-page-container--wide { width: min(100%, 1840px); padding: var(--erp-space-6); }
.erp-page-container--narrow { width: min(100%, 960px); padding: var(--erp-space-6); }
.api-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1000; background: transparent; pointer-events: none; }
.api-progress.is-active::after { content: ''; display: block; height: 100%; background: linear-gradient(90deg, var(--erp-gold-dark), var(--erp-gold-primary), var(--erp-gold-light)); animation: erp-progress-slide 1.2s linear infinite; }
@keyframes erp-progress-slide { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.erp-breadcrumb-bar { display: flex; align-items: center; min-height: 36px; padding: var(--erp-space-2) var(--erp-space-6); border-bottom: 1px solid var(--erp-border); background: rgba(var(--erp-rgb-card), 0.6); color: var(--erp-text-muted); }
.erp-breadcrumb-bar-public { background: transparent; border-bottom: 0; }
.erp-main-content-public { padding-top: var(--erp-space-4); }
.erp-footer-copy { color: var(--erp-text-muted); font-size: 12px; }

/* ───────────────────────────────────────────────────────────────────────
 * Slice 1c-γ Layout Fix (2026-05-13) — erp-app-shell GRID mode
 * Override 02-shell.css L1-3 flex+margin-left baseline; site.css originally
 * used grid mode (sidebar 286px + main 1fr) which is the actual production layout.
 * Required because elaborate sidebar (sticky) below needs grid container.
 * ─────────────────────────────────────────────────────────────────────── */
.erp-app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}
body.erp-sidebar-collapsed .erp-app-shell {
  grid-template-columns: var(--erp-sidebar-collapsed-width) minmax(0, 1fr);
}
body.erp-sidebar-collapsed .erp-main-shell {
  margin-left: 0;
}
/* TASK-20260621 S2 — narrow-viewport main-content fix. Below the sidebar drawer
   breakpoint (L137) the sidebar is position:fixed (out of grid flow), so the 286px
   track would strand erp-main-shell in a narrow column and blank the rest (user-
   reported). Collapse to a single column. MUST sit after the unconditional grid
   rule above to win the source-order cascade. */
@media (max-width: 1023px) {
  .erp-app-shell { grid-template-columns: minmax(0, 1fr); }
}
.erp-main-shell {
  margin-left: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ───────────────────────────────────────────────────────────────────────
 * Slice 1c-γ Batch 2 (2026-05-13) — erp-sidebar-* elaborate (cascade winner)
 * Migrated from site.css L5079-5266 (18 selectors).
 * Note: 02-shell.css 上方已有 erp-sidebar-* basic 定義；本段 append 後
 * 透過「同檔後者勝」cascade，elaborate 版本成為實際生效規則。
 * Source: SLICE1_ERP_PREFIX_ALLOCATION §A3
 * ─────────────────────────────────────────────────────────────────────── */
/* .erp-sidebar / .erp-sidebar--admin / .erp-sidebar--tenant sub-token
   declarations moved to 00-tokens.css (2026-05-27 audit Phase B-3
   closure). 02-shell.css retains only the layout properties; palette
   lives in the canonical token sheet. */
.erp-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1rem 1rem;
  border-right: 1px solid rgba(var(--erp-sidebar-accent-rgb), 0.2);
  background:
    linear-gradient(180deg, var(--erp-sidebar-bg-start), var(--erp-sidebar-bg-end)),
    radial-gradient(circle at top left, rgba(var(--erp-sidebar-accent-rgb), 0.1), transparent 45%);
  box-shadow: inset -1px 0 0 rgba(var(--erp-rgb-white), 0.03);
  z-index: 30;
}
.erp-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: var(--erp-space-3);
  border-bottom: var(--erp-border-width-hairline) solid var(--erp-border-gold-hairline);
}
.erp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  color: var(--dark-ink);
  text-decoration: none;
}
.erp-sidebar-brand:hover { color: var(--dark-ink); }
/* Phase B-3 (2026-05-27 audit): brand-mark gradient restored to blackgold
   baseline. The elaborate cascade was overriding the basic version's
   gold gradient (line 20) with an Art-Deco red→maroon palette (#cb4e3e
   → #7f241d) — a leftover from the prior Art-Deco design language that
   contradicts memory feedback_blackgold_brand_default.md (blackgold is
   the only baseline). The .erp-sidebar-brand-mark renders the same "ERP"
   text in admin and tenant variants alike (per Sidebar/Default.cshtml),
   so there is no semantic reason for a red accent. Matched to the basic
   version: gold-primary → gold-dark with a gold-dark shadow. */
.erp-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--erp-gold-primary), var(--erp-gold-dark) 68%);
  color: var(--erp-black);
  font-family: var(--font-display);
  font-size: 1.05rem;
  box-shadow: 0 14px 28px rgba(var(--erp-rgb-gold-dark), 0.42);
  flex: 0 0 auto;
}
.erp-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.erp-sidebar-brand-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f6dfb4;
}
.erp-sidebar-brand-subtitle {
  font-size: 0.78rem;
  color: var(--erp-sidebar-text-muted);
}
.erp-sidebar-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(var(--erp-sidebar-accent-rgb), 0.32);
  border-radius: 12px;
  background: rgba(var(--erp-sidebar-panel-rgb), 0.86);
  color: var(--erp-sidebar-text);
  transition: border-color var(--erp-motion-fast), background-color var(--erp-motion-fast), color var(--erp-motion-fast), box-shadow var(--erp-motion-fast);
}
.erp-sidebar-toggle:hover {
  border-color: rgba(var(--erp-sidebar-accent-rgb), 0.58);
  background: rgba(var(--erp-sidebar-panel-hover-rgb), 0.96);
}
.erp-sidebar-toggle-bar {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.erp-sidebar-context {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(var(--erp-sidebar-accent-rgb), 0.18);
  background: rgba(var(--erp-sidebar-panel-rgb), 0.86);
  box-shadow: inset 0 0 0 1px rgba(var(--erp-rgb-white), 0.02);
}
.erp-sidebar-context-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--erp-sidebar-text-dim);
}
.erp-sidebar-context-value {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--erp-sidebar-text);
}
.erp-sidebar-context-meta {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--erp-sidebar-text-muted);
}
.erp-sidebar-scroll {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.15rem;
}

/* ───────────────────────────────────────────────────────────────────────
 * Slice 1c-γ Batch 3 (2026-05-13) — erp-topbar-* elaborate (cascade winner)
 * Migrated from site.css L5219-5291 (10 selectors + tenant-switch-dropdown).
 * Note: 02-shell.css 上方已有 erp-topbar-* basic 定義；本段 append 後 wins。
 * Source: SLICE1_ERP_PREFIX_ALLOCATION §A4
 * ─────────────────────────────────────────────────────────────────────── */
.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(var(--erp-rgb-nav-accent), 0.14);
  background: rgba(var(--erp-rgb-shell-bg-start), 0.88);
  backdrop-filter: blur(14px);
}
.erp-topbar-left,
.erp-topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.erp-topbar-tools {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.erp-topbar-utility,
.erp-topbar-accountzone {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}
.erp-topbar-utility {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.erp-topbar-accountzone {
  flex: 0 0 auto;
}
.erp-topbar-copy {
  min-width: 0;
}
.erp-topbar-caption {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9d927d;
}
.erp-topbar-title {
  color: #f6dfb4;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}
.erp-topbar-select {
  min-width: clamp(220px, 22vw, 300px);
  max-width: 320px;
  border-radius: 999px;
}
.tenant-switch-dropdown {
  min-width: clamp(220px, 22vw, 320px);
}

/* ───────────────────────────────────────────────────────────────────────
 * Slice 1c-γ Batch 5 (2026-05-13) — erp-footer + mobile + public + help-dock + layout-split
 * Migrated from site.css L5220-5290 + L5755-5768 + L8513-8524 (~13 selectors).
 * Source: SLICE1_ERP_PREFIX_ALLOCATION §A9 + §A2
 * ─────────────────────────────────────────────────────────────────────── */
.erp-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--erp-rgb-nav-accent), 0.14);
}
.erp-footer-copy,
.erp-footer-copy a {
  color: #aa9f88;
  text-decoration: none;
}
.erp-footer-copy a:hover {
  color: #f4ddb2;
}
.erp-public-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(var(--erp-rgb-nav-accent), 0.14);
  background: rgba(var(--erp-rgb-shell-bg-start), 0.88);
  backdrop-filter: blur(14px);
}
.erp-public-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.erp-main-content-public.page-shell {
  max-width: none;
}
.erp-mobile-menu {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(var(--erp-rgb-nav-accent), 0.28);
  border-radius: 12px;
  background: rgba(var(--erp-rgb-shell-mobile-menu), 0.84);
  color: #f4e1ba;
}
.erp-mobile-menu-line {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.erp-mobile-drawer {
  --bs-offcanvas-width: min(360px, 88vw);
  background: linear-gradient(180deg, rgba(var(--erp-rgb-shell-bg-start), 0.99), rgba(var(--erp-rgb-shell-bg-end), 0.99));
  color: #f6dfb4;
  border-right: 1px solid rgba(var(--erp-rgb-nav-accent), 0.18);
}
.erp-mobile-drawer .offcanvas-header {
  min-height: var(--erp-topbar-height);
  padding: var(--erp-space-4) var(--erp-space-5);
  align-items: center;
  border-bottom: 1px solid rgba(var(--erp-rgb-nav-accent), 0.14);
}
.erp-mobile-drawer .offcanvas-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 0;
}
.erp-mobile-drawer .erp-sidebar-scroll {
  flex: 1 1 auto;
  gap: var(--erp-space-3);
  padding: var(--erp-space-3) var(--erp-space-4) var(--erp-space-5);
}
.erp-mobile-drawer .btn-close {
  flex: 0 0 auto;
  margin: 0;
  padding: var(--erp-space-2);
  border-radius: var(--erp-radius-sm);
  opacity: 0.9;
}
.erp-mobile-drawer .btn-close:focus-visible {
  outline: var(--erp-focus-ring);
  outline-offset: var(--erp-space-1);
}
.erp-help-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--erp-z-floating-dock);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none; /* let dock children own their own click area; collapsed body shouldn't intercept */
}
.erp-help-dock-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  pointer-events: auto;
}
.erp-help-dock.is-collapsed .erp-help-dock-panel {
  display: none;
}
.erp-help-dock .btn,
.erp-help-dock .erp-button {
  min-width: 96px;
  box-shadow: 0 14px 30px rgba(var(--erp-rgb-black), 0.28);
}
/* Floating action button — single small "?" pill always visible at bottom-right.
   Click expands the dock panel (教學/說明). Default = collapsed so dock never
   covers tenant page row action buttons / 儲存 buttons. */
.erp-help-dock-fab {
  appearance: none;
  border: 1px solid var(--erp-gold-dark);
  background: rgba(var(--erp-rgb-nav-panel), 0.92);
  color: var(--erp-gold-light);
  /* 44px = Apple HIG / Material 觸控標準最小值（ui-ux-pro-max §2 touch-target-size）*/
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(var(--erp-rgb-black), 0.35);
  transition: transform var(--erp-motion-fast), border-color var(--erp-motion-fast);
}
.erp-help-dock-fab:hover,
.erp-help-dock-fab:focus-visible {
  border-color: var(--erp-gold-primary);
  color: var(--erp-text-primary);
  transform: translateY(-1px);
}
.erp-help-dock:not(.is-collapsed) .erp-help-dock-fab {
  /* When expanded, give a "close-like" affordance */
  background: rgba(var(--erp-rgb-gold-primary), 0.12);
  border-color: var(--erp-gold-primary);
}
/* Body bottom padding compensation only when dock is expanded (mounted). */
body.erp-help-dock-mounted {
  padding-bottom: var(--erp-help-dock-clearance, 84px);
}
@media (max-width: 767.98px) {
  .erp-help-dock {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .erp-help-dock .btn,
  .erp-help-dock .erp-button {
    min-width: 84px;
  }
  .erp-help-dock-fab {
    /* mobile 仍維持 44px 觸控標準（ui-ux-pro-max §2 touch-target-size）*/
    width: 2.75rem;
    height: 2.75rem;
  }
}
.erp-layout-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 1rem;
  align-items: start;
}

/* ───────────────────────────────────────────────────────────────────────
 * Slice 1c-γ Batch 6 (2026-05-13) — erp-page / erp-main-content / page-actions
 * Migrated from site.css L267 (=L3137 dup) + L5197 + L6480 + L5648 + L297 (=L3141 dup)
 * Note: .erp-page descendant selectors (form-control / text-* / etc.) 保留在 site.css
 *       屬 cyber-mandarin 全域 form/text override，等 Slice 1c-β / 主題整治處理。
 * Source: SLICE1_ERP_PREFIX_ALLOCATION §A1 + §A2
 * ─────────────────────────────────────────────────────────────────────── */
.erp-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.erp-main-content {
  width: 100%;
  max-width: none;
}
.erp-main-content.page-shell {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.35rem 1.4rem 2rem;
  animation: rise 320ms ease-out;
}
.erp-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}
.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1199.98px) {
  .erp-layout-split {
    grid-template-columns: 1fr;
  }
  .erp-layout-split > .erp-card:last-child {
    position: static;
  }
}

/* =============================================================
   Support Mode banner — Slice 4 of SLICE-SUPPORT-MODE-WAVE4-F6
   Spec: docs/SUPPORT_MODE_CONTRACT.md §3.2 (sticky, non-dismissible,
   contrast-checked, outside iframes).
   Markup: Views/Shared/_SupportModeBanner.cshtml.
   Cross-page chrome rendered by _AdminLayout + _TenantLayout.
   All literals reference --erp-* tokens per wwwroot/css/CLAUDE.md §1.
   ============================================================= */
.erp-support-banner {
  position: sticky;
  top: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: var(--erp-space-4);
  padding: var(--erp-space-3) var(--erp-space-4);
  background: var(--erp-black);
  color: var(--erp-gold-light);
  border-bottom: var(--erp-space-1) solid var(--erp-gold-primary);
  font-weight: 600;
  flex-wrap: wrap;
}

.erp-support-banner__label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: var(--erp-text-button-emphasis);
}

.erp-support-banner__tenant-pill {
  padding: var(--erp-space-1) var(--erp-space-2);
  background: rgba(var(--erp-rgb-gold-primary), 0.12);
  border-radius: var(--erp-radius-pill);
  font-weight: 500;
}

.erp-support-banner__tenant-name {
  font-weight: 400;
  opacity: 0.8;
}

.erp-support-banner__countdown {
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
  font-size: var(--erp-text-button-emphasis);
}

.erp-support-banner__leave-form {
  margin: 0;
}

.erp-support-banner__leave-btn {
  padding: var(--erp-space-1) var(--erp-space-3);
  border-radius: var(--erp-radius-sm);
  background: var(--erp-gold-primary);
  color: var(--erp-black);
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.erp-support-banner__leave-btn:hover,
.erp-support-banner__leave-btn:focus {
  background: var(--erp-gold-light);
  outline: var(--erp-space-1) solid var(--erp-gold-primary);
  outline-offset: var(--erp-space-1);
}

.erp-support-banner--warning-3min .erp-support-banner__countdown {
  color: var(--erp-warning);
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  .erp-support-banner--warning-3min .erp-support-banner__countdown {
    animation: erp-support-banner-pulse 1.6s ease-in-out infinite;
  }

  @keyframes erp-support-banner-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
  }
}

.erp-support-banner--expired {
  background: var(--erp-danger);
  color: var(--erp-text-primary);
  border-bottom-color: var(--erp-text-primary);
}

.erp-support-banner--expired .erp-support-banner__tenant-pill {
  background: rgba(var(--erp-rgb-white), 0.15);
}

.erp-support-banner--expired .erp-support-banner__leave-btn {
  background: var(--erp-text-primary);
  color: var(--erp-danger);
}

@media (max-width: 575.98px) {
  /* TASK-20260610 F-8 mobile chrome (Gate 1 LOCKED 2026-06-09) — collapse chrome
     from ~32% viewport (214px/667px) to ≤14% (≤96px) on phone breakpoint per
     §4 selector contract. PM-proxy裁定 Q1=A drawer footer, Q2=A hide dropdown,
     Q3=C sticky-collapse banner, Q4=A pure CSS @media (no markup change),
     Q5=A pure CSS truncate. */

  /* §3.1 topbar — condense to hamburger + title + avatar-only */
  .erp-topbar {
    min-height: var(--erp-topbar-mobile-height);
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: var(--erp-space-2) var(--erp-space-3);
  }
  .erp-topbar .erp-topbar-tools {
    width: auto;
    flex: 0 0 auto;
  }
  .erp-topbar .erp-account-toggle {
    width: auto;
  }
  .erp-topbar-caption {
    display: none;
  }
  .erp-topbar-title {
    font-size: var(--erp-text-body);
    max-width: calc(100vw - var(--erp-mobile-title-reserve));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }
  .erp-topbar [data-ui-mode-toggle],
  .erp-topbar [data-theme-toggle] {
    display: none;
  }
  .erp-topbar .tenant-switch-dropdown {
    display: none;
  }
  .erp-topbar .erp-account-copy {
    display: none;
  }
  .erp-account-avatar {
    width: var(--erp-space-8);
    height: var(--erp-space-8);
    position: relative;
  }
  .erp-account-avatar::before {
    content: "";
    position: absolute;
    inset: -6px;
    min-width: 44px;
    min-height: 44px;
  }

  /* §3.3 breadcrumb hidden on phone */
  .erp-breadcrumb-bar {
    display: none;
  }

  /* §3.2 support banner Q3=C: sticky collapsed thin bar, tap to expand.
     Collapsed state hides children; [data-erp-expanded] attribute (JS to wire) restores. */
  .erp-support-banner {
    padding: 0;
    height: var(--erp-space-1);
    overflow: hidden;
    flex-wrap: nowrap;
    font-size: var(--erp-text-caption);
    cursor: pointer;
  }
  .erp-support-banner:not([data-erp-expanded])::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: rgba(var(--erp-rgb-white), 0.6);
    border-radius: 1px;
  }
  .erp-support-banner:focus-visible {
    outline: 2px solid var(--erp-gold-primary);
    outline-offset: 1px;
  }
  .erp-support-banner[data-erp-expanded] {
    height: auto;
    padding: var(--erp-space-1) var(--erp-space-3);
  }
  .erp-support-banner:not([data-erp-expanded]) > * {
    display: none;
  }
  .erp-support-banner[data-erp-expanded] .erp-support-banner__label {
    display: none;
  }
  .erp-support-banner[data-erp-expanded] .erp-support-banner__tenant-pill {
    padding: 0;
    background: transparent;
    border-radius: 0;
  }
  .erp-support-banner__countdown {
    margin-inline-start: 0;
    flex-basis: auto;
  }
  .erp-support-banner[data-erp-expanded] .erp-support-banner__leave-btn {
    width: var(--erp-space-8);
    padding-inline: 0;
  }

  /* R-3 drawer footer utility row — visible on phone only */
  .erp-mobile-drawer-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--erp-space-2);
    padding: var(--erp-space-3) var(--erp-space-4) var(--erp-space-4);
    border-top: 1px solid var(--erp-border);
    background: rgba(var(--erp-rgb-shell-bg-start), 0.72);
  }
  .erp-mobile-drawer-footer .erp-button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .erp-mobile-drawer-footer form {
    min-width: 0;
  }
  .erp-mobile-drawer-footer form .erp-button {
    width: 100%;
  }
}

/* Drawer footer hidden on tablet+ (defensive — offcanvas itself is lg-hidden) */
@media (min-width: 576px) {
  .erp-mobile-drawer-footer { display: none; }
}

/* Tablet (576-1023px) — narrow tenant-switch-dropdown for portrait */
@media (min-width: 576px) and (max-width: 1023.98px) {
  .tenant-switch-dropdown { min-width: clamp(160px, 20vw, 240px); }
}
