/*
 * app-shell-2026-06-17.css
 *
 * New HRH portal app shell - topbar, sidebar, off-platform banner.
 * Consumed by /v2-preview during Phase 1a so we can validate before
 * swapping layout.php in Phase 1b.
 *
 * Depends on design-tokens-2026-06-17.css being loaded first.
 */

.appshell { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 56px 1fr; min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Poppins','Segoe UI',Roboto,sans-serif; font-size: 14px; line-height: 1.5; }
.appshell * { box-sizing: border-box; }
.appshell a { color: var(--hra-purple); }
.appshell :focus-visible { outline: 2px solid var(--hra-purple); outline-offset: 2px; border-radius: 4px; }

/* ===== Topbar ===== */
.appshell .topbar { grid-column: 1 / -1; background: linear-gradient(180deg, var(--hra-purple) 0%, var(--hra-purple-dark) 100%); color: #fff; display: flex; align-items: center; padding: 0 20px; gap: 16px; border-bottom: 1px solid rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 50; height: 56px; }
.appshell .topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; text-decoration: none; color: #fff; }
.appshell .topbar .brand-mark { width: 30px; height: 30px; border-radius: 7px; background: url("/assets/img/logo/hrh-color-mark-128.png") center/cover no-repeat; flex-shrink: 0; }
.appshell .topbar .brand small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; margin-top: -2px; }
.appshell .topbar-spacer { flex: 1; }
.appshell .topbar-search { position: relative; width: 320px; max-width: 36vw; }
.appshell .topbar-search input { width: 100%; height: 34px; border: none; background: rgba(255,255,255,0.14); color: #fff; padding: 0 12px 0 36px; border-radius: var(--r-md); font-size: 13px; font-family: inherit; }
.appshell .topbar-search input::placeholder { color: rgba(255,255,255,0.7); }
.appshell .topbar-search input:focus { background: rgba(255,255,255,0.22); outline: 2px solid rgba(255,255,255,0.6); outline-offset: 0; }
.appshell .topbar-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; opacity: 0.7; }
.appshell .topbar-actions { display: flex; align-items: center; gap: 6px; }
.appshell .iconbtn { width: 34px; height: 34px; border-radius: var(--r-md); border: none; background: transparent; color: rgba(255,255,255,0.9); display: grid; place-items: center; cursor: pointer; position: relative; }
.appshell .iconbtn:hover { background: rgba(255,255,255,0.14); }
.appshell .iconbtn svg { width: 18px; height: 18px; }
.appshell .iconbtn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--hra-tile-coral); border-radius: 50%; border: 2px solid var(--hra-purple-dark); }
.appshell .usermenu { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,0.10); color: #fff; border: none; cursor: pointer; font: inherit; }
.appshell .usermenu:hover { background: rgba(255,255,255,0.18); }
.appshell .usermenu .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--hra-tile-blue); color: var(--hra-navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.appshell .usermenu .who { font-size: 12px; line-height: 1.2; text-align: left; }
.appshell .usermenu .who b { font-weight: 600; font-size: 13px; display: block; }
.appshell .usermenu .who span { opacity: 0.75; }

/* Disaster picker chip */
.appshell .tb-disaster { position: relative; display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 5px 10px 5px 9px; border-radius: 8px; font: 600 12px/1 inherit; cursor: pointer; white-space: nowrap; }
.appshell .tb-disaster:hover { background: rgba(255,255,255,0.18); }
.appshell .tb-disaster .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hra-tile-coral); box-shadow: 0 0 0 0 rgba(249,99,124,0.6); animation: tbpulse 2s infinite; }
@keyframes tbpulse { 0% { box-shadow: 0 0 0 0 rgba(249,99,124,0.55); } 70% { box-shadow: 0 0 0 6px rgba(249,99,124,0); } 100% { box-shadow: 0 0 0 0 rgba(249,99,124,0); } }
.appshell .tb-disaster .chev { width: 11px; height: 11px; opacity: 0.8; }
.appshell .tb-disaster b { font-weight: 700; }
.appshell .tb-disaster small { opacity: 0.75; font-weight: 500; font-size: 10.5px; margin-left: 4px; letter-spacing: 0.02em; }
@media (max-width: 900px) { .appshell .tb-disaster small { display: none; } }

/* ===== Sidebar ===== */
.appshell .sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; position: sticky; top: 56px; height: calc(100vh - 56px); }
.appshell .sidebar .group { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); padding: 14px 12px 6px; }
.appshell .sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500; position: relative; }
.appshell .sidebar a:hover { background: var(--hra-lavender-bg); color: var(--hra-purple); }
.appshell .sidebar a.active { background: var(--hra-lavender-bg); color: var(--hra-purple); font-weight: 600; }
.appshell .sidebar a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--hra-purple); border-radius: 0 3px 3px 0; }
.appshell .sidebar a svg { width: 16px; height: 16px; flex-shrink: 0; }
.appshell .sidebar a .pill { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--critical); color: #fff; }
.appshell .sidebar a .pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.appshell .sidebar a .pill.info { background: var(--info); color: #fff; }

/* Org card in sidebar */
.appshell .org-card { margin: 16px 4px 0; padding: 12px; border-radius: var(--r-md); background: linear-gradient(180deg, var(--hra-lavender-bg) 0%, var(--surface) 100%); border: 1px solid var(--border); }
.appshell .org-card .row1 { display: flex; align-items: center; gap: 10px; }
.appshell .org-card .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--hra-purple); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: -0.02em; flex-shrink: 0; }
.appshell .org-card .name { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.appshell .org-card .role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.appshell .org-card .verified { display: inline-flex; align-items: center; gap: 3px; margin-top: 10px; font-size: 10.5px; font-weight: 600; color: var(--success); }
.appshell .org-card .verified svg { width: 11px; height: 11px; }

/* ===== Main ===== */
.appshell .main { padding: 24px 32px 96px; min-width: 0; }

/* ===== Off-platform banner ===== */
.appshell .offplat { position: fixed; left: 268px; right: 20px; bottom: 16px; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; z-index: 50; transition: padding .18s ease, gap .18s ease; }
@media (max-width: 900px) { .appshell .offplat { left: 16px; } }
.appshell .offplat .mark { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; background: url("/assets/img/logo/hrh-color-mark-128.png") center/cover no-repeat; }
.appshell .offplat .body { min-width: 0; line-height: 1.4; }
.appshell .offplat .body strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; margin-bottom: 1px; }
.appshell .offplat .body p { margin: 0; font-size: 12px; color: var(--muted); }
.appshell .offplat .body p a { color: var(--hra-purple); font-weight: 600; text-decoration: none; }
.appshell .offplat .body p a:hover { text-decoration: underline; }
.appshell .offplat .send-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--hra-purple); color: #fff; text-decoration: none; font-weight: 600; font-size: 12.5px; padding: 8px 14px; border-radius: 8px; white-space: nowrap; transition: background .12s; }
.appshell .offplat .send-btn:hover { background: var(--hra-purple-dark); }
.appshell .offplat .send-btn svg { width: 13px; height: 13px; }
.appshell .offplat .min-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.appshell .offplat .min-btn:hover { background: var(--surface-2); color: var(--ink); }
.appshell .offplat .min-btn svg { width: 14px; height: 14px; }
.appshell .offplat .min-btn[data-state="max"] .icon-max { display: none; }
.appshell .offplat .min-btn[data-state="min"] .icon-min { display: none; }
.appshell .offplat.is-min { grid-template-columns: auto auto auto; width: fit-content; margin-left: auto; padding: 8px 10px; gap: 10px; }
.appshell .offplat.is-min .mark { width: 28px; height: 28px; border-radius: 7px; }
.appshell .offplat.is-min .body p, .appshell .offplat.is-min .body strong { display: none; }
.appshell .offplat.is-min .body::before { content: "Coordinate off-platform"; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.appshell .offplat.is-min .send-btn { display: none; }
@media (max-width: 768px) { .appshell .offplat { grid-template-columns: auto 1fr auto; gap: 10px; padding: 10px 12px; } .appshell .offplat .send-btn { display: none; } }

/* ===== Page header logo tile (72x72) ===== */
.appshell .page-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.appshell .page-header .ph-logo { width: 72px; height: 72px; border-radius: 16px; flex-shrink: 0; background: url("/assets/img/logo/hrh-color-mark-128.png") center/cover no-repeat; box-shadow: 0 6px 16px rgba(75,46,131,0.22), 0 1px 3px rgba(0,0,0,0.06); }
.appshell .page-header .ph-text { min-width: 0; }
.appshell .page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--ink); }
.appshell .page-header p { margin: 0; font-size: 13px; color: var(--muted); }

/* ===== Preview-only callout ===== */
.appshell .preview-banner { background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%); border: 1px solid #FCD34D; border-left: 4px solid var(--warning); border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #78350F; }
.appshell .preview-banner strong { color: #57240A; }
