/* Portal layout only. Navigation markup remains controlled by app.js. */
.workspace { width:100%; }
.portal-navigation { display:block; }
.portal-home,.module-card { display:flex; align-items:center; gap:8px; width:100%; min-height:28px; margin:0 0 2px; padding:4px 8px; border:0; border-radius:9px; color:var(--dq-ink); background:transparent; text-decoration:none; text-align:left; font-size:14px; font-weight:500; }
.portal-home { background:var(--dq-active); }
.portal-nav-label { margin:16px 8px 8px; color:var(--dq-muted); font-size:12px; }
.module-card:hover { background:var(--dq-hover); }
.module-card.unavailable { color:var(--dq-faint); }
.module-card h3 { flex:1; margin:0; font-size:14px; line-height:20px; font-weight:500; }
.portal-navigation :is(.portal-home,.module-card,.module-card h3) { font:500 14px/20px var(--dq-font); letter-spacing:normal; white-space:nowrap; }
.module-card p,.card-foot { display:none; }
.module-card.unavailable p { display:block; margin:0; font-size:11px; white-space:nowrap; }
.icon-box { display:grid; place-items:center; flex:0 0 auto; width:16px; height:16px; color:var(--dq-sub); }
.icon-box svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:var(--dq-icon-stroke,1.5); stroke-linecap:round; stroke-linejoin:round; }
.empty { padding:12px 8px; color:var(--dq-muted); font-size:13px; line-height:22px; }
.password-dialog .logout { border:0; border-radius:6px; background:transparent; color:var(--dq-ink); padding:6px 8px; font-size:13px; }
.password-dialog .logout:hover { background:var(--dq-hover); }
.portal-heading { display:flex; align-items:center; gap:8px; font-weight:500; }
.portal-heading .dq-icon { color:var(--dq-sub); }
.portal-content { max-width:1000px; margin:0 auto; padding:44px 32px; }
/* Module loading must not expose the retained home content underneath. */
#portalShell[content-header] .portal-content { visibility:hidden; }
.portal-intro { display:flex; align-items:center; gap:24px; margin-bottom:40px; }
.portal-intro>div:first-child { min-width:0; }
.portal-intro h1 { margin:0; font-size:22px; line-height:30px; font-weight:600; letter-spacing:-.02em; }
.portal-intro p { margin:6px 0 0; color:var(--dq-muted); }
.portal-datetime { margin-left:auto; flex:none; display:grid; gap:2px; text-align:right; }
#portalDate { color:var(--dq-faint); font:12px/20px var(--dq-font); white-space:nowrap; }
.portal-clock { min-width:8ch; color:var(--dq-sub); font:500 20px/28px var(--dq-mono); font-variant-numeric:tabular-nums; white-space:nowrap; }
.portal-summary h2,.portal-entries h2 { display:flex; align-items:center; gap:8px; margin:0 0 12px; font-size:14px; font-weight:600; }
.portal-approval-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:64px; padding:12px 14px; border:1px solid var(--dq-accent-a20); border-radius:12px; color:var(--dq-accent-dark); background:var(--dq-accent-soft); text-decoration:none; }
.portal-approval-row strong { font-size:14px; font-weight:500; }
#portalApprovalCount { display:block; margin-top:4px; color:var(--dq-accent-dark); opacity:.8; font-size:12px; }
.portal-entries { margin-top:36px; }
.portal-entry-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:32px; }
.portal-entry-empty { grid-column:1/-1; margin:0; padding:16px; color:var(--dq-sub); background:var(--dq-g50); border:1px solid var(--dq-line); border-radius:10px; font-size:13px; }
.portal-entry { display:grid; grid-template-columns:26px minmax(0,1fr); align-content:center; column-gap:10px; row-gap:2px; min-height:76px; margin:0; padding:12px 8px; border:0; border-bottom:1px solid var(--dq-line-soft); border-radius:0; background:#fff; }
.portal-entry:hover { background:var(--dq-g50); }
.portal-entry .icon-box { grid-row:1/3; align-self:center; width:26px; height:26px; border-radius:7px; color:var(--dq-accent); background:var(--dq-accent-soft); }
.portal-entry.violet .icon-box { color:var(--dq-purple-tx); background:var(--dq-purple-bg); }
.portal-entry.green .icon-box { color:var(--dq-ok-tx); background:var(--dq-ok-bg); }
.portal-entry.amber .icon-box { color:var(--dq-warn-tx); background:var(--dq-warn-bg); }
.portal-entry.slate .icon-box { color:var(--dq-sub); background:var(--dq-g150); }
.portal-entry h3 { align-self:center; font-size:14px; }
.portal-entry p { display:block; grid-column:2; margin:0; color:var(--dq-sub); font-size:12px; line-height:20px; font-weight:400; }
.portal-entry .card-foot { display:none; }
.portal-entry .card-foot svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:var(--dq-icon-stroke,1.5); }
.password-dialog { width:440px; max-height:calc(100dvh - 28px); overflow-y:auto; padding:24px; border:1px solid var(--dq-line); border-radius:12px; color:var(--dq-ink); background:#fff; box-shadow:var(--dq-pop); }
.password-dialog::backdrop { background:rgba(16,17,18,.32); }
.password-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.password-dialog h2 { margin:0; font-size:20px; line-height:28px; font-weight:600; }
.password-dialog p { color:var(--dq-muted); font-size:13px; line-height:22px; }
.password-field { display:block; margin:16px 0; }
.password-field span { display:block; margin-bottom:6px; font-size:13px; font-weight:500; }
.password-field input { width:100%; height:36px; padding:0 12px; border:1px solid var(--dq-line); border-radius:8px; color:var(--dq-ink); }
.password-dialog .password-error { color:var(--dq-danger-tx); background:var(--dq-danger-bg); padding:9px 12px; border-radius:8px; }
.password-submit { width:100%; min-height:36px; border:0; border-radius:8px; color:#fff; background:var(--dq-accent); font-weight:500; box-shadow:var(--dq-raised-pri); }
.password-submit:hover { background:var(--dq-accent-dark); }
.password-dialog button:disabled { opacity:.6; cursor:wait; }
.finance-workspace { position:fixed; inset:0; left:276px; z-index:20; background:#fff; transition:left .18s ease; }
.finance-workspace[data-ready] { left:0; }
.finance-workspace[hidden] { display:none; }
.finance-frame-host,.finance-frame-host iframe { width:100%; height:100%; }
.finance-frame-host iframe { display:block; border:0; opacity:0; transition:opacity .18s ease; }
.finance-workspace[data-ready] iframe { opacity:1; }
.finance-entry-status { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--dq-sub); background:#fff; }
.finance-entry-status[hidden] { display:none; }
.finance-entry-status p { margin:0; }
.finance-entry-status button { margin:0 4px; padding:6px 12px; border:1px solid var(--dq-line); border-radius:8px; background:#fff; color:var(--dq-ink); }
.finance-entry-status .finance-entry-primary { background:var(--dq-accent); color:#fff; border-color:var(--dq-accent); }
.project-entry-fallback { display:inline-block; margin:0 4px; padding:6px 12px; border-radius:8px; background:var(--dq-accent); color:#fff; text-decoration:none; }
.project-entry-fallback[hidden] { display:none; }
/* Keep the business viewport stable while the portal sidebar slides away. */
.project-workspace { left:0; background:transparent; transition:none; }
.project-workspace iframe { opacity:1; visibility:hidden; transition:none; }
.project-workspace[data-ready] iframe { visibility:visible; }
.project-workspace:not([data-ready]) .finance-entry-status { left:276px; }
/* The portal keeps the same navigation nodes and vertical grid in both widths. */
#portalShell[navigation-grid] .portal-nav-label { display:none; }
#portalShell[navigation-grid] .portal-home,#portalShell[navigation-grid] .portal-navigation .module-card { height:36px; min-height:36px; margin:0; border-radius:8px; }
#portalShell[navigation-grid] .portal-home { margin-bottom:8px; }
#portalShell[navigation-grid] .module-grid { display:flex; flex-direction:column; gap:8px; }
#portalShell[navigation-mode="rail"] .portal-home>span:not(.icon-box),#portalShell[navigation-mode="rail"] .portal-navigation .module-card :is(h3,p,.card-foot) { display:none; }
#portalShell[navigation-mode="rail"] .portal-navigation :is(.portal-home,.module-card) { justify-content:center; width:36px; padding:0; margin-left:2px; }
#portalShell .portal-home:not([aria-current="page"]) { background:transparent; }
#portalShell .portal-navigation .module-card[aria-current="page"] { background:var(--dq-active); }
.portal-rail-note { position:fixed; z-index:1200; width:270px; max-width:calc(100vw - 16px); padding:10px 12px; border:1px solid #292a2b; border-radius:10px; color:#fff; background:var(--dq-ink); box-shadow:0 8px 24px rgba(0,0,0,.2); font:13px/20px var(--dq-font); user-select:text; }
.portal-rail-note[hidden] { display:none; }
.portal-rail-note::before { content:""; position:absolute; top:-1px; bottom:-1px; left:-12px; width:12px; }
.portal-rail-note-heading { display:flex; align-items:center; gap:8px; }
.portal-rail-note-heading strong { font-size:14px; font-weight:500; }
.portal-rail-note-heading svg { flex:0 0 auto; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:var(--dq-icon-stroke,1.5); stroke-linecap:round; stroke-linejoin:round; color:rgba(255,255,255,.8); }
.portal-rail-note p { margin:6px 0 0; color:rgba(255,255,255,.72); overflow-wrap:anywhere; }
.project-workspace,.project-workspace[data-ready] { left:56px; }
.project-workspace:not([data-ready]) .finance-entry-status { left:0; }
.project-workspace:not([data-ready]):not([data-loading]) { visibility:hidden; }
.personnel-workspace,.personnel-workspace[data-ready] { left:56px; background:transparent; transition:none; }
.personnel-workspace iframe { opacity:1; visibility:hidden; transition:none; }
.personnel-workspace[data-ready] iframe { visibility:visible; }
.personnel-workspace:not([data-ready]) .finance-entry-status { left:0; }
.personnel-workspace:not([data-ready]):not([data-loading]) { visibility:hidden; }
#financeWorkspace,#financeWorkspace[data-ready] { left:56px; transition:none; }
#financeWorkspace iframe { opacity:1; visibility:hidden; transition:none; }
#financeWorkspace[data-ready] iframe { visibility:visible; }
@media(prefers-reduced-motion:reduce) { .finance-workspace,.finance-frame-host iframe { transition:none; } }
/* Keep retained module documents out of layout until their navigation entry is active. */
.finance-frame-host iframe[hidden] { display:none !important; }
/* Modules without a business sidebar retain the full portal navigation. */
#moduleWorkspace[data-navigation="global"],#moduleWorkspace[data-navigation="global"][data-ready] { left:276px; }
#portalShell[navigation-mode="rail"]~#moduleWorkspace[data-navigation="global"] { left:56px; }
